1

I'm trying to use a rtsp stream from a beaglebone as a virtual webcam with v4l2loopback.

On the beaglebone(server) I start the stream with:

cvlc --sout=#rtp{sdp=rtsp://:8554/test} 'v4l2:///dev/video0:chroma=H264:width=640:height=480'

On my client I can view the stream using vlc without any problems. Now I am trying to use the stream as a virtual webcam, with:

gst-launch-1.0 -v rtspsrc location=rtsp://192.168.7.2:8554/test ! v4l2sink device=/dev/video0

The command results in:

/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstRtpBin:manager.GstGhostPad:recv_rtp_sink_0: caps = "application/x-rtp\,\ media\=\(string\)video\,\ payload\=\(int\)96\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ a-tool\=\(string\)\"vlc\\\ 2.0.3\"\,\ a-recvonly\=\(string\)\"\"\,\ a-type\=\(string\)broadcast\,\ a-charset\=\(string\)UTF-8\,\ ssrc\=\(uint\)2741328849\,\ clock-base\=\(uint\)712921660\,\ seqnum-base\=\(uint\)2089\,\ npt-start\=\(guint64\)9615207000\,\ play-speed\=\(double\)1\,\ play-scale\=\(double\)1"
FEHLER: Von Element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0: Interner Fehler im Datenfluss.
Zusätzliche Fehlerdiagnoseinformation:
gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0:
streaming task paused, reason not-linked (-1)
Execution ended after 0:00:00.049701641
Leitung wird auf PAUSIERT gesetzt ...
Leitung wird auf BEREIT gesetzt ...
Leitung wird auf NULL gesetzt ...
Leitung wird geleert ...

Does anybody know what's wrong here? Am I missing something, or is there another way to achieve this? Thanks!

Herrmann336
  • 21
  • 1
  • 2

3 Answers3

0

I dont think that you can directly link rtspsrc and v4l2sink, you have to add a middle step.

How to find for yourself:

gst-inspect-1.0 rtspsrc

and search for "Capabilities:" - you will find out that it outputs application/x-rtp or x-rdt which is not directly linkable to v4l2sink ..

Then check capabilities for your v4l2sink in a same way(for sink)

Solution:

You will need at least rtph264depay between rtspsrc and v4l2sink. Or you can use decodebin, or uridecodebin

Community
  • 1
  • 1
nayana
  • 3,787
  • 3
  • 20
  • 51
0

You need to decode the video stream in your pipeline. Just insert decodebin in your pipeline:

gst-launch-1.0 -v rtspsrc location=rtsp://192.168.7.2:8554/test ! decodebin ! v4l2sink device=/dev/video0
Dominic Cerisano
  • 3,522
  • 1
  • 31
  • 44
0

Here is a working pipeline. In my case I needed to add "tee", otherwise I would get only the first few frames on my video device.

gst-launch-1.0 rtspsrc location=rtsp://admin:password@192.168.1.250:554/Streaming/Channels/101 ! decodebin ! videoconvert ! video/x-raw,format=YUY2 ! tee ! v4l2sink device=/dev/video0
Arkadiy Bolotov
  • 314
  • 2
  • 8