Skip to content

Instantly share code, notes, and snippets.

@lamoboos223
Last active June 28, 2023 12:31
Show Gist options
  • Save lamoboos223/7a3385c73685be1ce39cbb9a72cdaeba to your computer and use it in GitHub Desktop.
Save lamoboos223/7a3385c73685be1ce39cbb9a72cdaeba to your computer and use it in GitHub Desktop.
taking pictures and videos using pi camera module
# take one picture and save it into file
raspistill -o test.jpg
# record a video for 10 seconds in the h264 codec
raspivid -o test.h264 -t 10000
# GStreamer
gst-launch-1.0 -e -v v4l2src device=/dev/video0 ! video/x-raw,format=YUY2,width=640,height=480,framerate=10/1 ! videoconvert ! x264enc tune=zerolatency ! rtph264pay config-interval=1 pt=96 ! udpsink host=192.168.3.6 port=5006 sync=false
gst-launch-1.0 -v v4l2src device=/dev/video0 ! 'video/x-raw,width=640,height=480' ! x264enc tune=zerolatency ! 'video/x-h264,stream-format=byte-stream' ! h264parse ! rtph264pay ! udpsink host=192.168.3.6 port=5006
# the below is the one that worked
gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw, width=620, height=480, framerate=30/1 ! videoconvert ! video/x-raw, format=I420 ! vp8enc ! rtpvp8pay ! udpsink host=192.168.3.6 port=5006
gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw, width=620, height=480, framerate=30/1 ! videoconvert ! video/x-raw, format=I420 ! x264enc ! h264parse ! rtph264pay ! udpsink host=192.168.3.6 port=5006
# this is the pipeline that worked so well
gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw, width=620, height=480, framerate=30/1 ! videoconvert ! video/x-raw, format=I420 ! x264enc bitrate=1000 speed-preset=ultrafast tune=zerolatency ! h264parse ! rtph264pay ! udpsink host=192.168.3.6 port=5006
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment