tiger79
Posts: 15
Joined: Mon Sep 09, 2013 8:49 am

Re: Using VLC to stream from the camera - Help needed

Tue Sep 10, 2013 11:20 am

I am curious why in this topic people are mentioning rtsp as the better option qualitywise compared to http-streaming ?
I have been playing with both now and I have to say that when using rtsp there are a lot more artifacts, grey screens and simply 5 to 10 seconds freezes...

simonetm
Posts: 1
Joined: Thu Sep 12, 2013 4:56 am

Re: Using VLC to stream from the camera - Help needed

Thu Sep 12, 2013 5:01 am

Hey,

I'd appreciate a little help it seems like everyone else has been able to get this thing to work and for whatever reason I can't. I'm not sure if everyone here is using the camera add on for the pi. But I am using a USB camera at /dev/video0. What am I doing wrong?

Thanks
Matt



Code: Select all

pi@raspberrypi /dev $ raspivid -o - -t 99999 |cvlc -vvv stream:///dev/video0 --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264
VLC media player 2.0.3 Twoflower (revision 2.0.2-93-g77aa89e)
[0x3188f0] main libvlc debug: VLC media player - 2.0.3 Twoflower
[0x3188f0] main libvlc debug: Copyright © 1996-2012 VLC authors and VideoLAN
[0x3188f0] main libvlc debug: revision 2.0.2-93-g77aa89e
[0x3188f0] main libvlc debug: configured with ./configure  '--enable-static' '--build=arm-linux-gnueabihf' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security' 'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security' 'LDFLAGS=-Wl,-z,relro' '--config-cache' '--disable-maintainer-mode' '--disable-silent-rules' '--disable-update-check' '--enable-fast-install' '--prefix=/usr' '--docdir=/usr/share/doc/vlc-nox' '--sysconfdir=/etc' '--with-binary-version=5' '--enable-a52' '--enable-aa' '--enable-bluray' '--enable-bonjour' '--enable-caca' '--enable-dbus' '--enable-dca' '--enable-dirac' '--enable-directfb' '--enable-dvbpsi' '--enable-dvdnav' '--enable-faad' '--enable-flac' '--enable-fluidsynth' '--enable-freetype' '--enable-fribidi' '--enable-gnutls' '--enable-jack' '--enable-kate' '--enable-libass' '--enable-libmpeg2' '--enable-libproxy' '--enable-libxml2' '--enable-lirc' '--enable-live555' '--enable-mad' '--enable-mkv' '--enable-mod' '--enable-mpc' '--enable-mtp' '--enable-mux_ogg' '--enable-ncurses' '--enable-notify' '--enable-ogg' '--enable-oss' '--enable-pulse' '--enable-qt4' '--enable-realrtsp' '--enable-samplerate' '--enable-schroedinger' '--enable-sdl' '--enable-shout' '--enable-skins2' '--enable-smb' '--enable-speex' '--enable-svg' '--enable-taglib' '--enable-theora' '--enable-twolame' '--enable-upnp' '--enable-vcd' '--enable-vcdx' '--enable-vorbis' '--enable-x264' '--enable-zvbi' '--with-kde-solid=/usr/share/kde4/apps/solid/actions/' '--disable-dxva2' '--disable-gnomevfs' '--disable-goom' '--disable-portaudio' '--disable-projectm' '--disable-sqlite' '--disable-telx' '--enable-alsa' '--enable-atmo' '--enable-dc1394' '--enable-dv' '--enable-fbosd' '--enable-libva' '--enable-linsys' '--enable-omxil' '--enable-pvr' '--enable-udev' '--enable-v4l2' '--disable-crystalhd' '--disable-mmx' '--disable-sse' '--disable-neon' '--disable-altivec' 'build_alias=arm-linux-gnueabihf'
[0x3188f0] main libvlc debug: searching plug-in modules
[0x3188f0] main libvlc debug: loading plugins cache file /usr/lib/vlc/plugins/plugins.dat
[0x3188f0] main libvlc debug: recursively browsing `/usr/lib/vlc/plugins'
[0x3188f0] main libvlc debug: saving plugins cache /usr/lib/vlc/plugins/plugins.dat
[0x3188f0] main libvlc debug: plug-ins loaded: 410 modules
[0x3188f0] main libvlc debug: opening config file (/home/pi/.config/vlc/vlcrc)
[0x3188f0] main libvlc debug: translation test: code is "en_GB"
[0x3188f0] main libvlc debug: CPU has capabilities FPU 
[0x3188f0] main libvlc debug: looking for memcpy module: 1 candidate
[0x3188f0] main libvlc debug: using memcpy module "memcpy"
[0x48c098] main input debug: Creating an input for 'Media Library'
[0x48c098] main input debug: Input is a meta file: disabling unneeded options
[0x48c098] main input debug: using timeshift granularity of 50 MiB, in path '/tmp'
[0x48c098] main input debug: `file/xspf-open:///home/pi/.local/share/vlc/ml.xspf' gives access `file' demux `xspf-open' path `/home/pi/.local/share/vlc/ml.xspf'
[0x48c098] main input debug: creating demux: access='file' demux='xspf-open' location='/home/pi/.local/share/vlc/ml.xspf' file='/home/pi/.local/share/vlc/ml.xspf'
[0x487820] main demux debug: looking for access_demux module: 3 candidates
[0x487820] main demux debug: no access_demux module matching "file" could be loaded
[0x487820] main demux debug: TIMER module_need() : 17.101 ms - Total 17.101 ms / 1 intvls (Avg 17.101 ms)
[0x48c098] main input debug: creating access 'file' location='/home/pi/.local/share/vlc/ml.xspf', path='/home/pi/.local/share/vlc/ml.xspf'
[0x329968] main access debug: looking for access module: 2 candidates
[0x329968] filesystem access debug: opening file `/home/pi/.local/share/vlc/ml.xspf'
[0x329968] main access debug: using access module "filesystem"
[0x329968] main access debug: TIMER module_need() : 12.318 ms - Total 12.318 ms / 1 intvls (Avg 12.318 ms)
[0x32a800] main stream debug: Using stream method for AStream*
[0x32a800] main stream debug: starting pre-buffering
[0x32a800] main stream debug: received first data after 0 ms
[0x32a800] main stream debug: pre-buffering done 296 bytes in 0s - 268 KiB/s
[0x32a080] main stream debug: looking for stream_filter module: 7 candidates
[0x32a080] main stream debug: no stream_filter module matching "any" could be loaded
[0x32a080] main stream debug: TIMER module_need() : 15.656 ms - Total 15.656 ms / 1 intvls (Avg 15.656 ms)
[0x32a080] main stream debug: looking for stream_filter module: 1 candidate
[0x32a080] main stream debug: using stream_filter module "stream_filter_record"
[0x32a080] main stream debug: TIMER module_need() : 7.208 ms - Total 7.208 ms / 1 intvls (Avg 7.208 ms)
[0x48c098] main input debug: creating demux: access='file' demux='xspf-open' location='/home/pi/.local/share/vlc/ml.xspf' file='/home/pi/.local/share/vlc/ml.xspf'
[0x32ab70] main demux debug: looking for demux module: 1 candidate
[0x32ab70] playlist demux debug: using XSPF playlist reader
[0x32ab70] main demux debug: using demux module "playlist"
[0x32ab70] main demux debug: TIMER module_need() : 10.827 ms - Total 10.827 ms / 1 intvls (Avg 10.827 ms)
[0x47b828] main demux meta debug: looking for meta reader module: 2 candidates
[0x47b828] lua demux meta debug: Trying Lua scripts in /home/pi/.local/share/vlc/lua/meta/reader
[0x47b828] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/reader
[0x47b828] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/reader/filename.luac
[0x47b828] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
[0x47b828] main demux meta debug: no meta reader module matching "any" could be loaded
[0x47b828] main demux meta debug: TIMER module_need() : 50.513 ms - Total 50.513 ms / 1 intvls (Avg 50.513 ms)
[0x48c098] main input debug: `file/xspf-open:///home/pi/.local/share/vlc/ml.xspf' successfully opened
[0x47fae0] main xml reader debug: looking for xml reader module: 1 candidate
[0x47fae0] main xml reader debug: using xml reader module "xml"
[0x47fae0] main xml reader debug: TIMER module_need() : 14.550 ms - Total 14.550 ms / 1 intvls (Avg 14.550 ms)
[0x32ab70] playlist demux debug: parsed 0 tracks successfully
[0x48c098] main input debug: EOF reached
[0x32ab70] main demux debug: removing module "playlist"
[0x32a080] main stream debug: removing module "stream_filter_record"
[0x329968] main access debug: removing module "filesystem"
[0x48c098] main input debug: TIMER input launching for 'Media Library' : 145.589 ms - Total 145.589 ms / 1 intvls (Avg 145.589 ms)
[0x32a800] main interface debug: looking for interface module: 1 candidate
[0x32a800] main interface debug: using interface module "hotkeys"
[0x32a800] main interface debug: TIMER module_need() : 8.888 ms - Total 8.888 ms / 1 intvls (Avg 8.888 ms)
[0x48c098] main interface debug: looking for interface module: 1 candidate
[0x48c098] inhibit interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[0x48c098] main interface debug: no interface module matching "inhibit,none" could be loaded
[0x48c098] main interface debug: TIMER module_need() : 11.243 ms - Total 11.243 ms / 1 intvls (Avg 11.243 ms)
[0x48c098] main interface error: no suitable interface module
[0x3a0a68] main playlist debug: playlist threads correctly activated
[0x3a0a68] main playlist debug: adding item `video0' ( stream:///dev/video0 )
[0x329968] main interface debug: looking for interface module: 1 candidate
[0x3a0a68] main playlist debug: rebuilding array of current - root Playlist
[0x3a0a68] main playlist debug: rebuild done - 1 items, index -1
[0x48b548] main input debug: Creating an input for 'video0'
[0x3a0a68] main playlist debug: meta ok for (null), need to fetch art
[0x329968] main interface debug: no interface module matching "globalhotkeys,none" could be loaded
[0x329968] main interface debug: TIMER module_need() : 19.607 ms - Total 19.607 ms / 1 intvls (Avg 19.607 ms)
[0x329968] main interface error: no suitable interface module
[0x3188f0] main libvlc error: interface "globalhotkeys,none" initialization failed
[0x329968] main interface debug: looking for interface module: 1 candidate
[0x48b410] main demux meta debug: looking for meta fetcher module: 1 candidate
[0x48b410] lua demux meta debug: Trying Lua scripts in /home/pi/.local/share/vlc/lua/meta/fetcher
[0x48b410] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/fetcher
[0x48b410] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/fetcher/tvrage.luac
[0x329968] dummy interface: using the dummy interface module...
[0x329968] main interface debug: using interface module "dummy"
[0x329968] main interface debug: TIMER module_need() : 23.070 ms - Total 23.070 ms / 1 intvls (Avg 23.070 ms)
[0x3a0a68] main playlist debug: processing request item: null, node: Playlist, skip: 0
[0x3a0a68] main playlist debug: starting playback of the new playlist item
[0x3a0a68] main playlist debug: resyncing on video0
[0x3a0a68] main playlist debug: video0 is at 0
[0x3a0a68] main playlist debug: creating new input thread
[0x3397b8] main input debug: Creating an input for 'video0'
[0x48b410] main demux meta debug: using meta fetcher module "lua"
[0x48b410] main demux meta debug: TIMER module_need() : 41.062 ms - Total 41.062 ms / 1 intvls (Avg 41.062 ms)
[0x48b410] main demux meta debug: removing module "lua"
[0x3a0a68] main playlist debug: searching art for video0
[0x47f4c8] main stream output debug: using sout chain=`standard{access=http,mux=ts,dst=:8090}'
[0x47f4c8] main stream output debug: stream=`standard'
[0x47f580] main stream out debug: looking for sout stream module: 1 candidate
[0x47f580] main stream out debug: set config option: sout-standard-access to http
[0x47fae0] main art finder debug: looking for art finder module: 2 candidates
[0x47fae0] lua art finder debug: Trying Lua scripts in /home/pi/.local/share/vlc/lua/meta/art
[0x47f580] main stream out debug: set config option: sout-standard-mux to ts
[0x47f580] main stream out debug: set config option: sout-standard-dst to :8090
[0x481328] main access out debug: looking for sout access module: 1 candidate
[0x47fae0] lua art finder debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/art
[0x47fae0] lua art finder debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/00_musicbrainz.luac
[0x47fae0] lua art finder debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/01_googleimage.luac
[0x481328] main access out debug: net: listening to * port 8090
[0x47fae0] lua art finder debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/02_frenchtv.luac
[0x47fae0] lua art finder debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/art/03_lastfm.luac
[0x47fae0] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
[0x47fae0] main art finder debug: no art finder module matching "any" could be loaded
[0x47fae0] main art finder debug: TIMER module_need() : 78.348 ms - Total 78.348 ms / 1 intvls (Avg 78.348 ms)
[0x3a0a68] main playlist debug: art not found for video0
[0x481328] main access out debug: socket error: Address family not supported by protocol
[0x481328] main access out debug: using sout access module "access_output_http"
[0x481328] main access out debug: TIMER module_need() : 79.295 ms - Total 79.295 ms / 1 intvls (Avg 79.295 ms)
[0x4840e0] main mux debug: looking for sout mux module: 1 candidate
[0x4840e0] mux_ts mux debug: shaping=200000 pcr=70000 dts_delay=400000
[0x4840e0] main mux debug: using sout mux module "mux_ts"
[0x4840e0] main mux debug: TIMER module_need() : 6.027 ms - Total 6.027 ms / 1 intvls (Avg 6.027 ms)
[0x47f4c8] main stream output debug: muxer support adding stream at any time
[0x47f4c8] main stream output debug: muxer prefers to wait for all ES before starting to mux
[0x47f580] stream_out_standard stream out debug: using `http/ts://:8090'
[0x47f580] main stream out debug: using sout stream module "stream_out_standard"
[0x47f580] main stream out debug: TIMER module_need() : 104.434 ms - Total 104.434 ms / 1 intvls (Avg 104.434 ms)
[0x3397b8] main input debug: using timeshift granularity of 50 MiB, in path '/tmp'
[0x3397b8] main input debug: `stream:///dev/video0' gives access `stream' demux `' path `/dev/video0'
[0x3397b8] main input debug: enforced demux ` h264'
[0x3397b8] main input debug: creating demux: access='stream' demux='h264' location='/dev/video0' file='/dev/video0'
[0x4830a8] main demux debug: looking for access_demux module: 0 candidates
[0x4830a8] main demux debug: no access_demux module matched "stream"
[0x4830a8] main demux debug: TIMER module_need() : 2.434 ms - Total 2.434 ms / 1 intvls (Avg 2.434 ms)
[0x3397b8] main input debug: creating access 'stream' location='/dev/video0', path='/dev/video0'
[0x4830a8] main access debug: looking for access module: 1 candidate
[0x4830a8] filesystem access debug: opening file `/dev/video0'
[0x4830a8] main access debug: using access module "filesystem"
[0x4830a8] main access debug: TIMER module_need() : 3.183 ms - Total 3.183 ms / 1 intvls (Avg 3.183 ms)
[0x483190] main stream debug: Using stream method for AStream*
[0x483190] main stream debug: starting pre-buffering
[0x4830a8] main access error: Read error: Invalid argument
[0x4830a8] filesystem access error: failed to read (Invalid argument)
[0x4830a8] main access error: File reading failed
[0x4830a8] main access error: VLC could not read the file (Invalid argument).
[0x483190] main stream error: cannot pre fill buffer
[0x3397b8] main input warning: cannot create a stream_t from access
[0x4830a8] main access debug: removing module "filesystem"
[0x3a0a68] main playlist debug: finished input
[0x3a0a68] main playlist debug: dead input
[0x47f4c8] main stream output debug: destroying useless sout
[0x47f580] main stream out debug: destroying chain... (name=standard)
[0x47f580] main stream out debug: removing module "stream_out_standard"
[0x4840e0] main mux debug: removing module "mux_ts"
[0x481328] main access out debug: removing module "access_output_http"
[0x483bd0] main http host debug: waitpipe: object killed
[0x483bd0] main http host debug: HTTP host removed
[0x481328] access_output_http access out debug: Close
[0x47f580] main stream out debug: destroying chain done
[0x3397b8] main input debug: TIMER input launching for 'video0' : 157.745 ms - Total 157.745 ms / 1 intvls (Avg 157.745 ms)
[0x3a0a68] main playlist debug: changing item without a request (current 0/1)
[0x3a0a68] main playlist debug: nothing to play


RpiName
Posts: 712
Joined: Sat Jul 06, 2013 3:14 am

Re: Using VLC to stream from the camera - Help needed

Thu Sep 12, 2013 9:59 am

simonetm wrote: I'd appreciate a little help it seems like everyone else has been able to get this thing to work and for whatever reason I can't. I'm not sure if everyone here is using the camera add on for the pi. But I am using a USB camera at /dev/video0. What am I doing wrong?
I don't know if this can help, but a way to use VLC together with a /dev/video node for streaming is here:

Example 6: Set up a RealTime Streaming Server (RTSP)
at
http://www.linux-projects.org/modules/s ... e&artid=16

for other informations:
http://www.linux-projects.org/modules/s ... e&artid=14

raspberrypi2000
Posts: 1
Joined: Thu Sep 26, 2013 7:44 pm

Re: Using VLC to stream from the camera - Help needed

Thu Sep 26, 2013 7:59 pm

I tried this but my raspberrypi said can not prebuffer. Then cancelling stream_t does anyone know why and how I can fix it :?

dave1029
Posts: 5
Joined: Fri Dec 20, 2013 3:49 pm

Re: Using VLC to stream from the camera - Help needed

Mon Dec 30, 2013 2:42 pm

This is really a neat use of the rPi and VLC. I am using rPlay to mirror my iPad screen on an rPi. I would like to have a classroom full of iPads attached to corresponding rPi's (one to one ratio), and then use vlc to screen the rPlay mirrored outputs (from all of the rPi's) to a mosaic running on a more powerful PC (like a security camera setup that this thread so aptly explains how to do).

My problem is that I can't figure out how to "grab" the rPlay output. What would I use in place of "stream:///dev/stdin"?

Thanks

myy
Posts: 3
Joined: Tue Feb 25, 2014 4:03 pm

Re: Using VLC to stream from the camera - Help needed

Wed Feb 26, 2014 6:26 am

LeoWhite wrote:Hiya,

After much searching I managed to get this working using

raspivid -o - -t 99999 |cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264


its the ':demux=h264' that seemed to get things sorted.

This now lets me stream directly from the camera, over the network and to my PC running VLC!

Hope it works for you!

Now I just need to reduce the buffering to make it a bit more real time..

Leo
I've just tried that but get the error:

Code: Select all

[0x6c7d50] main stream out debug: looking for sout stream module: 0 candidates
[0x6c7d50] main stream out debug: no sout stream module matched "demux=h264"
How can I solve the problem?

User avatar
theoB610
Posts: 233
Joined: Sat Jan 05, 2013 12:40 pm
Location: Devon

Re: Using VLC to stream from the camera - Help needed

Wed Feb 26, 2014 1:42 pm

Has anyone tried doing this with the pure python interface?

And could you do it so that the pi is a wifi access point so that to view the stream you just connect to its wifi and open up the webpage?

caporeira
Posts: 73
Joined: Sun Aug 25, 2013 5:58 pm

Re: Using VLC to stream from the camera - Help needed

Sat Mar 15, 2014 8:56 am

Hi, after this comammand:

Code: Select all

raspivid -o - -t 9999999 -w 800 -h 600 --hflip | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8080/}' :demux=h264
I have this anser:

Code: Select all

[0x1250038] main input debug: creating access 'file' location='/home/pi/.local/s                                                                                                 hare/vlc/ml.xspf', path='/home/pi/.local/share/vlc/ml.xspf'
[0x123d8b0] main access debug: looking for access module: 2 candidates
[0x123d8b0] filesystem access debug: opening file `/home/pi/.local/share/vlc/ml.                                                                                                 xspf'
[0x123d8b0] main access debug: using access module "filesystem"
[0x123d8b0] main access debug: TIMER module_need() : 12.187 ms - Total 12.187 ms                                                                                                  / 1 intvls (Avg 12.187 ms)
[0x123df40] main stream debug: Using stream method for AStream*
[0x123df40] main stream debug: starting pre-buffering
[0x123df40] main stream debug: received first data after 0 ms
[0x123df40] main stream debug: pre-buffering done 296 bytes in 0s - 426 KiB/s
[0x123e110] main stream debug: looking for stream_filter module: 7 candidates
[0x123e110] main stream debug: no stream_filter module matching "any" could be l                                                                                                 oaded
[0x123e110] main stream debug: TIMER module_need() : 13.617 ms - Total 13.617 ms                                                                                                  / 1 intvls (Avg 13.617 ms)
[0x123e110] main stream debug: looking for stream_filter module: 1 candidate
[0x123e110] main stream debug: using stream_filter module "stream_filter_record"
[0x123e110] main stream debug: TIMER module_need() : 5.140 ms - Total 5.140 ms /                                                                                                  1 intvls (Avg 5.140 ms)
[0x1250038] main input debug: creating demux: access='file' demux='xspf-open' lo                                                                                                 cation='/home/pi/.local/share/vlc/ml.xspf' file='/home/pi/.local/share/vlc/ml.xs                                                                                                 pf'
[0x10df3f8] main demux debug: looking for demux module: 1 candidate
[0x10df3f8] playlist demux debug: using XSPF playlist reader
[0x10df3f8] main demux debug: using demux module "playlist"
[0x10df3f8] main demux debug: TIMER module_need() : 12.386 ms - Total 12.386 ms                                                                                                  / 1 intvls (Avg 12.386 ms)
[0x10e18d8] main demux meta debug: looking for meta reader module: 2 candidates
[0x10e18d8] lua demux meta debug: Trying Lua scripts in /home/pi/.local/share/vl                                                                                                 c/lua/meta/reader
[0x10e18d8] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/re                                                                                                 ader
[0x10e18d8] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/me                                                                                                 ta/reader/filename.luac
[0x10e18d8] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/                                                                                                 reader
[0x10e18d8] main demux meta debug: no meta reader module matching "any" could be                                                                                                  loaded
[0x10e18d8] main demux meta debug: TIMER module_need() : 75.914 ms - Total 75.91                                                                                                 4 ms / 1 intvls (Avg 75.914 ms)
[0x1250038] main input debug: `file/xspf-open:///home/pi/.local/share/vlc/ml.xsp                                                                                                 f' successfully opened
[0x1238df0] main xml reader debug: looking for xml reader module: 1 candidate
[0x1238df0] main xml reader debug: using xml reader module "xml"
[0x1238df0] main xml reader debug: TIMER module_need() : 21.818 ms - Total 21.81                                                                                                 8 ms / 1 intvls (Avg 21.818 ms)
[0x10df3f8] playlist demux debug: parsed 0 tracks successfully
[0x1250038] main input debug: EOF reached
[0x10df3f8] main demux debug: removing module "playlist"
[0x123e110] main stream debug: removing module "stream_filter_record"
[0x123d8b0] main access debug: removing module "filesystem"
[0x1250038] main input debug: TIMER input launching for 'Media Library' : 174.08                                                                                                 9 ms - Total 174.089 ms / 1 intvls (Avg 174.089 ms)
[0x123df40] main interface debug: looking for interface module: 1 candidate
[0x123df40] main interface debug: using interface module "hotkeys"
[0x123df40] main interface debug: TIMER module_need() : 7.836 ms - Total 7.836 m                                                                                                 s / 1 intvls (Avg 7.836 ms)
[0x1250038] main interface debug: looking for interface module: 1 candidate
[0x1250038] inhibit interface error: Failed to connect to the D-Bus session daem                                                                                                 on: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[0x1250038] main interface debug: no interface module matching "inhibit,none" co                                                                                                 uld be loaded
[0x1250038] main interface debug: TIMER module_need() : 10.369 ms - Total 10.369                                                                                                  ms / 1 intvls (Avg 10.369 ms)
[0x1250038] main interface error: no suitable interface module
[0x10ee950] main playlist debug: playlist threads correctly activated
[0x10ee950] main playlist debug: adding item `stdin' ( stream:///dev/stdin )
[0x10ee950] main playlist debug: rebuilding array of current - root Playlist
[0x10ee950] main playlist debug: rebuild done - 0 items, index -1
[0x1250d38] main interface debug: looking for interface module: 1 candidate
[0x10df3d8] main input debug: Creating an input for 'stdin'
[0x10ee950] main playlist debug: no fetch required for (null) (art currently (nu                                                                                                 ll))
[0x1250d38] main interface debug: no interface module matching "globalhotkeys,no                                                                                                 ne" could be loaded
[0x1250d38] main interface debug: TIMER module_need() : 14.182 ms - Total 14.182                                                                                                  ms / 1 intvls (Avg 14.182 ms)
[0x1250d38] main interface error: no suitable interface module
[0x10cdb30] main libvlc error: interface "globalhotkeys,none" initialization fai                                                                                                 led
[0x12409f8] main interface debug: looking for interface module: 1 candidate
[0x12409f8] dummy interface: using the dummy interface module...
[0x12409f8] main interface debug: using interface module "dummy"
[0x12409f8] main interface debug: TIMER module_need() : 6.148 ms - Total 6.148 m                                                                                                 s / 1 intvls (Avg 6.148 ms)
[0x10ee950] main playlist debug: processing request item: null, node: Playlist,                                                                                                  skip: 0
[0x10ee950] main playlist debug: rebuilding array of current - root Playlist
[0x10ee950] main playlist debug: rebuild done - 1 items, index -1
[0x10ee950] main playlist debug: starting playback of the new playlist item
[0x10ee950] main playlist debug: resyncing on stdin
[0x10ee950] main playlist debug: stdin is at 0
[0x10ee950] main playlist debug: creating new input thread
[0x1251500] main input debug: Creating an input for 'stdin'
[0x1238b28] main stream output debug: using sout chain=`rtp{sdp=rtsp://:8080/}'
[0x1238b28] main stream output debug: stream=`rtp'
[0x1238cd0] main stream out debug: looking for sout stream module: 1 candidate
[0x1238cd0] main stream out debug: set config option: sout-rtp-sdp to rtsp://:80                                                                                                 80/
[0x1238cd0] stream_out_rtp stream out debug: RTSP stream at /
[0x1238cd0] main stream out debug: net: listening to * port 8080
[0x1238cd0] main stream out debug: socket error: Address family not supported by                                                                                                  protocol
[0x1238cd0] main stream out debug: using sout stream module "stream_out_rtp"
[0x1238cd0] main stream out debug: TIMER module_need() : 40.579 ms - Total 40.57                                                                                                 9 ms / 1 intvls (Avg 40.579 ms)
[0x1251500] main input debug: using timeshift granularity of 50 MiB, in path '/t                                                                                                 mp'
[0x1251500] main input debug: `stream:///dev/stdin' gives access `stream' demux                                                                                                  `' path `/dev/stdin'
[0x1251500] main input debug: enforced demux ` h264'
[0x1251500] main input debug: creating demux: access='stream' demux='h264' locat                                                                                                 ion='/dev/stdin' file='/dev/stdin'
[0x123b9d0] main demux debug: looking for access_demux module: 0 candidates
[0x123b9d0] main demux debug: no access_demux module matched "stream"
[0x123b9d0] main demux debug: TIMER module_need() : 3.061 ms - Total 3.061 ms /                                                                                                  1 intvls (Avg 3.061 ms)
[0x1251500] main input debug: creating access 'stream' location='/dev/stdin', pa                                                                                                 th='/dev/stdin'
[0x123b9d0] main access debug: looking for access module: 1 candidate
[0x123b9d0] filesystem access debug: opening file `/dev/stdin'
[0x123b9d0] main access debug: using access module "filesystem"
[0x123b9d0] main access debug: TIMER module_need() : 8.490 ms - Total 8.490 ms /                                                                                                  1 intvls (Avg 8.490 ms)
[0x1239488] main stream debug: Using stream method for AStream*
[0x1239488] main stream debug: starting pre-buffering
[0x1239488] main stream debug: received first data after 0 ms
[0x1239488] main stream debug: pre-buffering done 1024 bytes in 0s - 653 KiB/s
[0x1239668] main stream debug: looking for stream_filter module: 7 candidates
[0x1239668] main stream debug: no stream_filter module matching "any" could be l                                                                                                 oaded
[0x1239668] main stream debug: TIMER module_need() : 3.456 ms - Total 3.456 ms /                                                                                                  1 intvls (Avg 3.456 ms)
[0x1239668] main stream debug: looking for stream_filter module: 1 candidate
[0x1239668] main stream debug: using stream_filter module "stream_filter_record"
[0x1239668] main stream debug: TIMER module_need() : 7.177 ms - Total 7.177 ms /                                                                                                  1 intvls (Avg 7.177 ms)
[0x1251500] main input debug: creating demux: access='stream' demux='h264' locat                                                                                                 ion='/dev/stdin' file='/dev/stdin'
[0x12397a0] main demux debug: looking for demux module: 1 candidate
[0x12397a0] h264 demux debug: using 25.00 fps
[0x1239b10] main demux packetizer debug: looking for packetizer module: 21 candi                                                                                                 dates
[0x1239b10] main demux packetizer debug: using packetizer module "packetizer_h26                                                                                                 4"
[0x1239b10] main demux packetizer debug: TIMER module_need() : 25.331 ms - Total                                                                                                  25.331 ms / 1 intvls (Avg 25.331 ms)
[0x12397a0] main demux debug: using demux module "h264"
[0x12397a0] main demux debug: TIMER module_need() : 34.526 ms - Total 34.526 ms                                                                                                  / 1 intvls (Avg 34.526 ms)
[0x1251500] main input debug: starting in async mode
[0x123bcf0] main demux meta debug: looking for meta reader module: 2 candidates
[0x123bcf0] lua demux meta debug: Trying Lua scripts in /home/pi/.local/share/vl                                                                                                 c/lua/meta/reader
[0x123bcf0] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/re                                                                                                 ader
[0x123bcf0] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/me                                                                                                 ta/reader/filename.luac
[0x123bcf0] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/                                                                                                 reader
[0x123bcf0] main demux meta debug: no meta reader module matching "any" could be                                                                                                  loaded
[0x123bcf0] main demux meta debug: TIMER module_need() : 17.120 ms - Total 17.12                                                                                                 0 ms / 1 intvls (Avg 17.120 ms)
[0x1251500] main input debug: `stream:///dev/stdin' successfully opened
[0x1239b10] packetizer_h264 demux packetizer debug: found NAL_SPS (sps_id=0)
[0x1239b10] packetizer_h264 demux packetizer debug: found NAL_PPS (pps_id=0 sps_                                                                                                 id=0)
[0x1251500] main input debug: selecting program id=0
[0x123bc68] main decoder debug: looking for packetizer module: 21 candidates
[0x123bc68] main decoder debug: using packetizer module "packetizer_h264"
[0x123bc68] main decoder debug: TIMER module_need() : 5.708 ms - Total 5.708 ms                                                                                                  / 1 intvls (Avg 5.708 ms)
[0x1251500] main input error: Invalid PCR value in ES_OUT_SET_(GROUP_)PCR !
[0x1251500] main input debug: switching to sync mode
[0x123bc68] packetizer_h264 decoder debug: found NAL_SPS (sps_id=0)
[0x123bc68] packetizer_h264 decoder debug: found NAL_PPS (pps_id=0 sps_id=0)
[0x1251500] main input debug: Buffering 0%
[0x1251500] main input debug: Buffering 13%
[0x1238b28] main stream output debug: adding a new sout input (sout_input:0x1241                                                                                                 c28)
[0x1238cd0] stream_out_rtp stream out debug: maximum RTP packet size: 1400 bytes
[0x1238cd0] stream_out_rtp stream out debug: RTSP: adding /trackID=0
[0x1238cd0] stream_out_rtp stream out debug: sdp=
v=0
o=- 15478470735953756438 15478470735953756438 IN IP4 raspberrypi
s=Unnamed
i=N/A
c=IN IP4 0.0.0.0
t=0 0
a=tool:vlc 2.0.3
a=recvonly
a=type:broadcast
a=charset:UTF-8
m=video 0 RTP/AVP 96
b=RR:0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1

[0x1251500] main input debug: Buffering 26%
[0x1251500] main input debug: Buffering 40%
[0x1251500] main input debug: Buffering 53%
[0x1251500] main input debug: Buffering 66%
[0x1251500] main input debug: Buffering 80%
[0x1251500] main input debug: Buffering 93%
[0x1251500] main input debug: Stream buffering done (320 ms in 72 ms)
[0x1251500] main input debug: Decoder buffering done in 0 ms
^C[0x10cdb30] main libvlc debug: deactivating the playlist
[0x10ee950] main playlist debug: deactivating the playlist
[0x10ee950] main playlist debug: incoming request - stopping current input
[0x123b9d0] main access debug: waitpipe: object killed
[0x10ee950] main playlist debug: dying input
[0x123b9d0] main access debug: socket 5 polling interrupted
[0x1251500] main input debug: control: stopping input
[0x10ee950] main playlist debug: dying input
[0x123bc68] main decoder debug: removing module "packetizer_h264"
[0x123bc68] main decoder debug: killing decoder fourcc `h264', 0 PES in FIFO
[0x1238b28] main stream output debug: removing a sout input (sout_input:0x1241c28)
[0x12397a0] main demux debug: removing module "h264"
[0x1239b10] main demux packetizer debug: removing module "packetizer_h264"
[0x1239668] main stream debug: removing module "stream_filter_record"
[0x123b9d0] main access debug: removing module "filesystem"
[0x1251500] main input debug: Program doesn't contain anymore ES
[0x10ee950] main playlist debug: dead input
[0x1238b28] main stream output debug: destroying useless sout
[0x1238cd0] main stream out debug: destroying chain... (name=rtp)
[0x1238cd0] main stream out debug: removing module "stream_out_rtp"
[0x123b650] main http host debug: waitpipe: object killed
[0x123b650] main http host debug: HTTP host removed
[0x1238cd0] main stream out debug: destroying chain done
[0x1251500] main input debug: TIMER input launching for 'stdin' : 143.605 ms - Total 143.605 ms / 1 intvls (Avg 143.605 ms)
[0x12415a0] main playlist export debug: saving Media Library to file /home/pi/.local/share/vlc/ml.xspf
[0x12415a0] main playlist export debug: looking for playlist export module: 1 candidate
[0x12415a0] main playlist export debug: using playlist export module "export"
[0x12415a0] main playlist export debug: TIMER module_need() : 9.778 ms - Total 9.778 ms / 1 intvls (Avg 9.778 ms)
[0x12415a0] main playlist export debug: removing module "export"
[0x10ee950] main playlist debug: playlist correctly deactivated
[0x10cdb30] main libvlc debug: removing all services discovery tasks
[0x10cdb30] main libvlc debug: removing all interfaces
[0x10cdb30] main libvlc debug: exiting
[0x12409f8] main interface debug: removing module "dummy"
[0x123df40] main interface debug: removing module "hotkeys"
[0x10ee950] main playlist debug: destroying
[0x10cdb30] main libvlc debug: TIMER ML Load : Total 212.926 ms / 1 intvls (Avg 212.926 ms)
[0x10cdb30] main libvlc debug: TIMER Items array build : Total 2.885 ms / 2 intvls (Avg 1.442 ms)
[0x10cdb30] main libvlc debug: TIMER Preparse run : Total 8.284 ms / 1 intvls (Avg 8.284 ms)
[0x10cdb30] main libvlc debug: TIMER ML Dump : Total 1572.561 ms / 1 intvls (Avg 1572.561 ms)
[0x10cdb30] main libvlc debug: removing stats
[0x10cdb30] main libvlc debug: removing module "memcpy"
pi@raspberrypi ~ $
What I'm doing wrong ?

paulbh
Posts: 1
Joined: Thu Jul 31, 2014 12:27 pm

Re: Using VLC to stream from the camera - Help needed

Thu Jul 31, 2014 12:31 pm

The original post was a while ago so things may have changed in raspivid, but changing the capture time to 0, leaves it running indefinitely, so:

Code: Select all

raspivid -t 0 -o - | cvlc etc
should sort you out if your streaming keeps stopping.

Thiago Moreira
Posts: 2
Joined: Tue Sep 16, 2014 7:28 pm

Re: Using VLC to stream from the camera - Help needed

Tue Sep 16, 2014 8:04 pm

Hi There!

I'm streaming from my RPi to my PC using VLC and it works great! However, there´s too much lag. How can fix this?
on my RPi I use the comand:

Code: Select all

 raspivid -o - -t 0 |cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264
On my Windows 8 side I run the VLC.

amadeus
Posts: 1
Joined: Mon Dec 29, 2014 11:00 pm

Re: Using VLC to stream from the camera - Help needed

Mon Dec 29, 2014 11:16 pm

Hello all,

I wanted to stream directly to a web browser, and had some success so thought I'd post here for the record. The goal is to have a web browser natively render the Pi camera stream using something along the lines of:

Code: Select all

<video width="800" height="600" controls>
  <source src="http://picam:8080/webcam.ogg" type="video/ogg">
</video>
I found two methods of successfully streaming from a Pi to a web browser - the best had about a 5-10 second delay.

The main challenge is that web browsers don't natively support h264 as described very well at http://diveintohtml5.info/video.html. You have to transcode it to .ogg or .webm and the Pi doesn't have enough power to do this. So you have to pipe it to another machine to do the transcoding before you can view in a browser.

Second challenge was using a Mac as a transcoding machine which has non-standard CLI tools versus the Pi due to OS X being a bit different to Linux.

Method 1: v4l2 driver

On the Pi:

Code: Select all

cvlc v4l2:///dev/video0 --v4l2-width 800 --v4l2-height 600 --v4l2-chroma h264 --sout '#standard{access=http,mux=ts,dst=0.0.0.0:12345}' -vvv
This will generate an h264 stream, which the host machine will read in, transcode and create another http stream the web browser can read.

On the host Mac:

Code: Select all

vlc -vvv -I "dummy" http://picam:12345 --sout '#transcode{vcodec=theo,vb=1024}:http{dst=:8080/webcam.ogg}'
That will run the stream at http://localhost:8080/webcam.ogg.

Method 2: raspvid and nc

On the Pi:

Code: Select all

raspivid -n -t 0 -o - | nc host.ip.address 5001
This will pipe the video to netcat, which requires a listening host to then pipe to vlc for transcoding as above.

On the host Mac:

Code: Select all

nc -l 5001 | vlc -I "dummy" stream:///dev/stdin --sout '#transcode{vcodec=theo,vb=1024}:http{dst=:8080/webcam.ogg}' :demux=h264
That will run the stream at http://localhost:8080/webcam.ogg.

Notes

[*] Method 1 was much faster than Method 2 (less lag).
[*] They both used comparable CPU on the Pi and Macbook Air.
[*] 800x600 was the highest they could reasonably handle. I will try on a heavy duty Mac Pro to bump up the resolution.
[*] Simply playing the nc stream in Method 2 worked well with less lag directly to mplayer:

Code: Select all

nc -l 5001 | mplayer -fps 31 -cache 1024 -
I didn't spend much time working with mencoder trying to generate an http stream as I'm not sure it's capable.
[*] The lag seems to increase over time. E.g. initially Method A has 5 seconds lag, but after a few minutes this get's higher to e.g. 30 seconds

To summarise: still lots of improvement to be needed before replacing any Dropcams...

User avatar
JeremPi
Posts: 24
Joined: Tue May 05, 2015 1:33 pm

Re: Using VLC to stream from the camera - Help needed

Tue May 19, 2015 12:20 pm

It's work. But with 6 or 7 seconds delay.
What about real time ?

Could you help me ? (French)

marwen1
Posts: 1
Joined: Wed Mar 16, 2016 10:13 am

Re: Using VLC to stream from the camera - Help needed

Wed Mar 16, 2016 10:18 am

salut mes amis
je cherche une solution a diffuser flux vidéo dans le web a l'aide mon camera pi par VLC , est ce que c'est possible ??
comment ??
de telles façons je peut le regarder a travers d'un réseau extérieur .
et merci d'avance

Riddeek
Posts: 31
Joined: Thu Apr 21, 2016 2:12 pm

Re: Using VLC to stream from the camera - Help needed

Tue Aug 16, 2016 7:11 am

theoB610 wrote:Has anyone tried doing this with the pure python interface?

And could you do it so that the pi is a wifi access point so that to view the stream you just connect to its wifi and open up the webpage?
Anyone tried this????
It works normally in the putty interface but it does not work in a python file
It gives error "SyntaxError: invalid syntax"

markolino
Posts: 18
Joined: Sun Nov 26, 2017 8:24 am

Re: Using VLC to stream from the camera - Help needed

Sun Dec 09, 2018 11:18 am

Please, how i can do it at runtime ? i've trying to make streaming from camera.
If i write in a shell

raspivid -o - --mode 7 -a 12 -t 50000 |cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264

it works fine in my LAN, i can see the streaming from vlc on my iphone.


But i have a bot, and if i send a command, i want to make the camera in this mode at runtime, by executing python code.
It is possible?
I try to write for example

Code: Select all

if condition:
 	converter = 'raspivid -o - --mode 7 -a 12 -t 50000 |cvlc -vvv stream:///dev/stdin --sout'
        converter2 = ' ' #standard{access=http,mux=ts,dst=:8090}  ' '
        converter3= ':demux=h264'
        converter4 = converter+converter2+converter3
        Call = subprocess.Popen(converter4, shell = True)                
No errors, but nothing happens.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Using VLC to stream from the camera - Help needed

Mon Dec 10, 2018 12:45 pm

markolino wrote:
Sun Dec 09, 2018 11:18 am
No errors, but nothing happens.
Try printing out each of your converter variables. Note: # is a comment character in python, so you are losing some options.
Try just doing:

Code: Select all

converter4 = "raspivid -o - --mode 7 -a 12 -t 50000 |cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264"


Return to “Camera board”