0

I am trying to stream webcam video to tcp or rtp, or whatever. The destination part is not what is bothering me, I know that might be erronous, but I have a mind to try some tcp/http and rtsp/rtp stuff to figure out what works best.

I am on a raspberry Pi 4, 4 Gb model

My Webcam supports YUVY or MJPG output. I have tried to construct a pipeline, like this:

gst-launch-1.0 v4l2src device=/dev/video0 \
  ! 'video/x-raw format=mjpg,framerate=(fraction)30/1' \
  ! omxmjpegdec ! omxh264enc \
  ! rtph264pay config-interval=1 name=pay0 pt=96 \
  ! tcpserversink host=127.0.0.1 port=5000

and it throws the following back at me:

WARNING: erroneous pipeline: could not parse caps "video/x-raw\ format=mjpg,framerate=(fraction)30/1"

I am at a loss as to what to do, and would really appreciate some help at this point, as I seem to simply be unable to make a pipeline that will take the contents of the webcam and use the hardware h264 encoder.

1 Answer 1

0

mjpg is not a valid video/x-raw format. Try "image/jpeg, framerate=30/1" instead of 'video/x-raw format=mjpg,framerate=(fraction)30/1':

gst-launch-1.0 v4l2src device=/dev/video0 \
  ! "image/jpeg, framerate=30/1" \
  ! omxmjpegdec ! omxh264enc \
  ! rtph264pay config-interval=1 name=pay0 pt=96 \
  ! tcpserversink host=127.0.0.1 port=5000

You can probably simplify the pipeline. Perhaps you don't really need the h264 encoding and could use rtpjpegpay instead of rtph264pay.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.