Skip to content

Instantly share code, notes, and snippets.

@siddharthdeore
Last active November 7, 2022 23:00
Show Gist options
  • Select an option

  • Save siddharthdeore/147f17cb66513ddc9974ff8b65a37b60 to your computer and use it in GitHub Desktop.

Select an option

Save siddharthdeore/147f17cb66513ddc9974ff8b65a37b60 to your computer and use it in GitHub Desktop.
GStreamer pipelines

Install Gstreamer-1.0

sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo apt-get update
sudo apt-get install gstreamer1.0-tools gstreamer1.0-alsa \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
gstreamer1.0-libav
sudo apt-get install libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-good1.0-dev \
libgstreamer-plugins-bad1.0-dev

Check installed Show usb camera with FPS overlay

gst-launch-1.0 v4l2src device=/dev/video0 \
 ! queue                                  \
 ! autovideoconvert                       \
 ! fpsdisplaysink

raw video with framerate

gst-launch-1.0 v4l2src device=/dev/video0 \
 ! 'video/x-raw, width=640,height=480, framerate=(fraction)30/1' \
 ! queue ! autovideoconvert ! fpsdisplaysink

UDP Sender

Stream usb camera over UDP

gst-launch-1.0 v4l2src device=/dev/video0                                       \
! videoconvert                                                                  \
! queue  max-size-time=0 max-size-bytes=0 max-size-buffers=0                    \
! x264enc byte-stream=true tune=zerolatency speed-preset=ultrafast bitrate=3000 \
! h264parse                                                                     \
! rtph264pay config-interval=-1 pt=96                                           \
! queue  max-size-time=0 max-size-bytes=0 max-size-buffers=0                    \
! udpsink clients=127.0.0.1:5000 max-bitrate=3000000 sync=false async=false

UDP Receiver

gst-launch-1.0 udpsrc port=5000                  \
 ! application/x-rtp,clock-rate=90000,payload=96 \
 ! queue                                         \
 ! rtph264depay                                  \
 ! h264parse                                     \
 ! avdec_h264                                    \
 ! queue                                         \
 ! autovideoconvert                              \
 ! fpsdisplaysink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment