3

I have bought the NoIr cam for the Raspberry Pi. I stream the video of that camera to my other Ubuntu server using VLC:

cvlc v4l2:///dev/video0 --v4l2-width 1920 --v4l2-height 1080 --v4l2-chroma h264 --sout '#standard{access=http,mux=ts,dst=0.0.0.0:12345}'

The problem with this is that when I cancel the stream using ^C, the stream can not be restarted.

First stream (working):

raspberrypi :: ~/scripts % sudo modprobe bcm2835-v4l2
raspberrypi :: ~/scripts % cvlc v4l2:///dev/video0 --v4l2-width 1920 --   v4l2-height 1080 --v4l2-chroma h264 --sout   '#standard{access=http,mux=ts,dst=0.0.0.0:12345}'
VLC media player 2.2.1 Terry Pratchett (Weatherwax) (revision 2.2.1-0-ga425c42)
[0062b780] pulse audio output error: PulseAudio server connection failure: Connection refused
[00627258] core interface error: no suitable interface module
[0058df10] core libvlc error: interface "globalhotkeys,none" initialization failed
[00627258] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[00627258] core interface error: no suitable interface module
[0058df10] core libvlc error: interface "dbus,none" initialization failed
[00627258] dummy interface: using the dummy interface module...
[b3d04fc0] access_output_http access out: Consider passing --http-host=IP on the command line instead.

When I cancel after the above command and try again, I get the following output:

Failing attempt

^C%      
raspberrypi :: ~/scripts cvlc v4l2:///dev/video0 --v4l2-width 1920 --v4l2-height 1080 --v4l2-chroma h264 --sout '#standard{access=http,mux=ts,dst=0.0.0.0:12345}'                                                                                                         1 ↵
VLC media player 2.2.1 Terry Pratchett (Weatherwax) (revision 2.2.1-0-ga425c42)
[016f0780] pulse audio output error: PulseAudio server connection failure: Connection refused
[016ec258] core interface error: no suitable interface module
[01652f10] core libvlc error: interface "globalhotkeys,none" initialization failed
[016ec258] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[016ec258] core interface error: no suitable interface module
[01652f10] core libvlc error: interface "dbus,none" initialization failed
[016ec258] dummy interface: using the dummy interface module...
[b3d04fc0] access_output_http access out: Consider passing --http-host=IP on the command line instead.
libv4l2: error turning on stream: Operation not permitted
[b3d09b78] v4l2 demux error: cannot start streaming: Operation not permitted
[b3d09b78] v4l2 demux error: not a radio tuner device

So far I have checked, using htop, that no VLC process remains and I can't seem to find one. To me it seems like the resource (the video) is not being released by canceling the previous stream.

Any tips?

1 Answers1

12
rmmod bcm2835-v4l2
modprobe bcm2835-v4l2

Destroys and re-creates /dev/video0

Just ran into the same problem and that fixed it for me.

Michael
  • 326
  • 3
  • 5