How can I use gstreamer with a V4L2 UVC webcam that serves JPEG images for video streaming over the network?

April 4th, 2008 by matthias

You can use “gst-inspect | less” to get a list of the current capabilities of gstreamer and it’s plugins.

To start, you should be able to see live video using this:

gst-launch v4l2src device=/dev/video1 ! jpegdec ! autovideosink

The manpage of gst-launch has an example for “network streaming”, but it doesn’t work here.

But you would have to do something similar like this:

gst-launch v4l2src \
  ! jpegdec \
  ! videoscale \
  ! video/x-raw-yuv, width=320, height=240 \
  ! ffmpegcolorspace \
  ! ffenc_h263 \
  ! video/x-h263 \
  ! rtph263ppay pt=96 \
  ! udpsink host=127.0.0.1 port=8800 sync=false

This does not to work yet:

  WARNUNG: Fehlerhafte Leitung: Konnte ffenc_h2630 nicht mit rtph263ppay0 verbinden

The reason seems to be that jpegdec does not serve the format declared as “video/x-raw-yuv”, and this is detected when trying to connect to RTP payloader. We need an additional encoder here.

The following commands show that the camera servers jpgeg:

$ gst-launch v4l2src ! filesink location=Desktop/test.file
$ gst-typefind ~/Desktop/test.file
/home/matthias/Desktop/test.file - image/jpeg

Additional useful things that can be used in the pipelines: r263depayloader, gconfv4l2src

The best solution will than be to combine this with the VLC multimedia player and server, to stream it. See:

  vlc --longhelp --advanced

Posted in Sprache: Englisch, Videobearbeitung, alle Artikel |

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.