Skip to content

Instantly share code, notes, and snippets.

@amfern
Last active July 5, 2021 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amfern/6635f78da324c723771842299b827c3d to your computer and use it in GitHub Desktop.
Save amfern/6635f78da324c723771842299b827c3d to your computer and use it in GitHub Desktop.
rpi4 camera module 2.1 stream ubuntu 20.04
cat /boot/firmware/config.txt
```
[pi4]
max_framebuffers=2
[all]
kernel=vmlinuz
cmdline=cmdline.txt
initramfs initrd.img followkernel
# Enable the audio output, I2C and SPI interfaces on the GPIO header
dtparam=audio=on
dtparam=i2c_arm=on
dtparam=spi=on
# Enable the serial pins
enable_uart=1
# Comment out the following line if the edges of the desktop appear outside
# the edges of your display
disable_overscan=1
# If you have issues with audio, you may try uncommenting the following line
# which forces the HDMI output into HDMI mode instead of DVI (which doesn't
# support audio output)
#hdmi_drive=2
# If you have a CM4, uncomment the following line to enable the USB2 outputs
# on the IO board (assuming your CM4 is plugged into such a board)
#dtoverlay=dwc2,dr_mode=host
# Config settings specific to arm64
arm_64bit=1
dtoverlay=dwc2
dtoverlay=vc4-fkms-v3d, cma-512
max_framebuffers=1
gpu_mem=256
hdmi_enable_4kp60=1
# must configure hdmi_force_hotplug when v3d is enabled, otherwise pi won't boot when hdmi disconnected
# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1
dtoverlay=rpivid-v4l2
start_x=1
```
sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly
Sender:
gst-launch-1.0 -e v4l2src ! video/x-h264,width=1280,height=720,framerate=60/1 ! h264parse ! rtph264pay pt=96 ! udpsink host=10.100.102.5 port=5001
Receiver:
gst-launch-1.0 -v udpsrc port=5001 ! application/x-rtp,clock-rate=90000,payload=96 ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink sync=false
note:
v4l2-ctl --set-ctrl=auto_exposure=1 --set-ctrl=scene_mode=11 --set-ctrl=exposure_dynamic_framerate=1 --set-ctrl=auto_exposure_bias=16 --set-ctrl=exposure_metering_mode=0 --set-ctrl=exposure_time_absolute=10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment