Skip to content

Instantly share code, notes, and snippets.

@GraffJosh
GraffJosh / Raspi Camera to Network
Created November 19, 2024 19:57
Stream raspi cam over rtsp to network
https://github.com/bluenviron/mediamtx?tab=readme-ov-file#raspberry-pi-cameras
https://github.com/bluenviron/mediamtx?tab=readme-ov-file#linux
homeassistant generic camera
rtsp://cameraName.local:8554/cam
@GraffJosh
GraffJosh / RaspiCamera to Chrome.md
Last active November 19, 2024 19:39
RaspiCamera to Chrome

quoted from: https://forums.raspberrypi.com/viewtopic.php?t=359204

I'm using the camera 2 module, but my workaround (for chromium, it does not work with firefox) should work for the module 3 too. Might need to change resolution and pixelformat if module 3 can't output YUY2, but I cannot confirm this until I get the latest camera myself. Basically I use gstreamer to pipe raw camera output to virtual camera device on v4l2loopback, it introduces a small overhead of course and chromium doesn't have access to camera controls which you need to manipulate via the pipeline, but otherwise this works really well for me. I have tested this method with fresh install on Raspberry Pi 4, with camera module 2 and Raspberry Pi OS 64-bit 10 Oct. release:

Steps for my workaround:

install gstreamer and necessary plugins:

sudo apt-get install -y gstreamer1.0-tools gstreamer1.0-plugins gstreamer1.0-libcamera

@GraffJosh
GraffJosh / gist:6c9a3306b1ac12e7fd7e574fe47eb319
Last active September 1, 2025 13:10
Set up PC for github CLI
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
git config --global user.email "github@joshuagraff.com"
git config --global user.name "GraffJosh"
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
@GraffJosh
GraffJosh / Raspi Zero Kiosk.md
Last active March 30, 2025 18:58 — forked from fjctp/README.md
RPi Zero W kiosk

Summary

Setup RPi Zero W as a kiosk

Step

  1. write Raspbian Lite image to a SD card
  2. enable ssh (manage through imaging tool)
    touch /boot/ssh
    
  3. setup WiFi (manage through imaging tool)