Skip to content

Instantly share code, notes, and snippets.

@anselmobattisti
Created September 7, 2019 16:02
Show Gist options
  • Save anselmobattisti/ddab81f9485c5479d6c784d2813bc28e to your computer and use it in GitHub Desktop.
Save anselmobattisti/ddab81f9485c5479d6c784d2813bc28e to your computer and use it in GitHub Desktop.
Capture webcam video and stream it using gstreamer
Capture and send video
gst-launch-1.0 v4l2src device=/dev/video0 \
! decodebin \
! x264enc \
! rtph264pay \
! udpsink port=5000
Show the video
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 \
! videoconvert \
! autovideosink
If you are ussing virtualbox use camerama program to test the webcam, chesse program sometimes not work!
In VirtuablBox set yout USB to 2.0 or 3.0 if your camera not working using 1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment