I have a fresh installed Buster(Release Date: 2020-08-20) on my Pi4B
I am able to stream with pi Camera by doing
gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720,framerate=30/1 ! clockoverlay time-format="%H:%M:%S %d.%m.%Y" outline-color=-16777216 color=-1 draw-shadow=false font-desc="myriad pro bold expanded 16" ! omxh264enc target-bitrate=1000000 control-rate=variable ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=x.x.my.ip port=8004
But when I use the same command with my webcam, which is at "/dev/video0", I got the below error:
Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error. Additional debug info: gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: streaming stopped, reason not-negotiated (-4) Execution ended after 0:00:00.001112783 Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ...
The webcam(brand name is rapoo) I am using is compatible with my pi. I can see live video from it by running:
gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! ximagesink
Also tested it with
fswebcam 123.jpg -d /dev/video0. It also works for my Pi camera in /dev/video1
May I know how can I do a rtp UDP stream with my webcam?