Skip to content

Instantly share code, notes, and snippets.

@meee1
Forked from anselmobattisti/gstreamer pipeline
Created January 10, 2023 07:39
Show Gist options
  • Select an option

  • Save meee1/728e1d928444803780a856d33445afee to your computer and use it in GitHub Desktop.

Select an option

Save meee1/728e1d928444803780a856d33445afee to your computer and use it in GitHub Desktop.
Grab video from webcam and stream it using udpsink via x264
Pipeline to send video (simulating SRC) get the data from video0
gst-launch-1.0 v4l2src device=/dev/video0 \
! decodebin \
! x264enc \
! rtph264pay \
! udpsink host=localhost port=5000
// if you are running it inside a docker container be aware of the host ip in udpsink
gst-launch-1.0 v4l2src device=/dev/video0 \
! decodebin \
! x264enc \
! rtph264pay \
! udpsink host=172.17.0.1 port=5000
Pipeline to crop a video and send data to UDP dest (simulating de VMS)
gst-launch-1.0 \
udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" \
! rtph264depay \
! decodebin \
! videocrop top=200 left=100 right=4 bottom=0 \
! x264enc \
! rtph264pay \
! udpsink host=localhost port=5001
Pipeline to show video (simulating the application)
gst-launch-1.0 \
udpsrc port=5001 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" \
! rtph264depay \
! decodebin \
! videoconvert \
! autovideosink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment