Asvin Goel
Asvin Goel

Reputation: 48

WebRTC video freezes for virtual camera provided through gstreamer and v4l2sink

I am trying to use video captured with my IP cam (Vstarcam C7837WIP) in my webpage using WebRTC.

The IP cam is connected directly to my computer with an ethernet cable and I managed to access the video with the cheese app on linux 14.04 using gstreamer and v4l2sink with this command

gst-launch-1.0 -vet  souphttpsrc location='http://10.10.10.10:81/videostream.cgi?user=XXX&pwd=XXX' timeout=5 ! jpegdec ! tee ! v4l2sink device=/dev/video1

Unfortunately, I have problems using the virtual webcam with WebRTC (e.g. at https://webrtc.github.io/samples/src/content/getusermedia/gum/). After selecting the camera in Firefox, the video shows the camera picture and freezes immediately.

Similarly, if I use

gst-launch-1.0 videotestsrc ! tee ! v4l2sink device=/dev/video1

I only see a picture but no video stream in the browser - though in cheese it works.

Any clue how I can get the video stream usable with WebRTC?

Edit:

I downloaded v0.10.0 from https://github.com/umlaeute/v4l2loopback and created the dummy video device with modprobe v4l2loopback exclusive_caps=0

Edit2:

The same happens if I use

gst-launch-1.0 -vet  rtspsrc user-id='XXX' user-pw='XXX' location='rtsp://10.10.10.10:10554/udp/av0_0' latency=0 ! decodebin ! tee ! v4l2sink device=/dev/video1

Upvotes: 1

Views: 1122

Answers (1)

Asvin Goel
Asvin Goel

Reputation: 48

I have managed to get a solution for my problem using

gst-launch -vet  rtspsrc user-id='XXX' user-pw='XXX' location='rtsp://10.10.10.10:10554/udp/av0_0' latency=0 ! decodebin2 ! v4l2sink device=/dev/video1

The remaining question is, how to get a solution using gst-launch-1.0 (I assume that eventually gst-launch-1.0 will become the default and version 0.10 will at some time be deprecated)?

Upvotes: 0

Related Questions