2

I have an IP-CAM that streams video over RTSP and I want to detect bar codes from it with zbarcam (from Ubuntu's zbar-tools package).

According zbarcam's manual, it expects to be given a video4linux character device (default /dev/video0). How can I let it receive that RTSP stream instead?


I tried to use mplayer, but I can't figure out how I could use that to pipe the stream to zbarcam.

coding Bott
  • 123
  • 1
  • 5

1 Answers1

2

Try something on these lines:

sudo apt-get install v4l2loopback-utils gstreamer1.0-tools
sudo modprobe v4l2loopback # might not be needed
gst-launch-1.0 -v rtspsrc location=rtsp://your_stream_url ! v4l2sink device=/dev/video1

Then you should be able to use zbarcam against /dev/video1 as usual.

  • 1
    I think this could work, but not on my rasp pi. there is a problem with that v4l2loopback, can't get it to work. – coding Bott Sep 03 '14 at 20:06
  • What exactly fails? I guess v4l2loopback should be cross-platform... – Cristian Măgherușan-Stanciu Sep 09 '14 at 18:23
  • Is not part of my dist. so i have to compile it. won't compile because i didn't setup the infrastructure correct. I only need time, it's not a technical problem anymore. thx – coding Bott Sep 10 '14 at 15:12
  • It's not working on my RaspPi either. The error is given below, ../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc0: streaming stopped, reason not-linked (-1) – M.Hossein Rahimi Dec 08 '22 at 05:43