sbaratheon
Posts: 81
Joined: Sun Sep 30, 2012 10:33 am

streaming pi camera works only sometimes

Thu Dec 26, 2013 12:43 am

I'm trying to stream video over LAN using my pi camera board with:

Code: Select all

raspivid -o - -t 99999 -hf -w 640 -h 360 -fps 25|cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264
which seems to work the first time (client using VLC) but then fails a second time:

Code: Select all

raspivid -o - -t 99999 -hf -w 640 -h 360 -fps 25|cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264
VLC media player 2.0.3 Twoflower (revision 2.0.2-93-g77aa89e)
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

[0xdfe8f0] main libvlc debug: VLC media player - 2.0.3 Twoflower
[0xdfe8f0] main libvlc debug: Copyright © 1996-2012 VLC authors and VideoLAN
[0xdfe8f0] main libvlc debug: revision 2.0.2-93-g77aa89e
[0xdfe8f0] 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'
[0xdfe8f0] main libvlc debug: searching plug-in modules
[0xdfe8f0] main libvlc debug: loading plugins cache file /usr/lib/vlc/plugins/plugins.dat
[0xdfe8f0] main libvlc debug: recursively browsing `/usr/lib/vlc/plugins'
[0xdfe8f0] main libvlc warning: cannot load module `/usr/lib/vlc/plugins/notify/libnotify_plugin.so' (libEGL.so.1: cannot open shared object file: No such file or directory)
[0xdfe8f0] main libvlc debug: saving plugins cache /usr/lib/vlc/plugins/plugins.dat
[0xdfe8f0] main libvlc debug: plug-ins loaded: 409 modules
[0xdfe8f0] main libvlc debug: opening config file (/home/pi/.config/vlc/vlcrc)
[0xdfe8f0] main libvlc debug: translation test: code is "en_GB"
[0xdfe8f0] main libvlc debug: CPU has capabilities FPU
[0xdfe8f0] main libvlc debug: looking for memcpy module: 1 candidate
[0xdfe8f0] main libvlc debug: using memcpy module "memcpy"
[0xf5c910] main input debug: Creating an input for 'Media Library'
[0xf5c910] main input debug: Input is a meta file: disabling unneeded options
[0xf5c910] main input debug: using timeshift granularity of 50 MiB, in path '/tmp'
[0xf5c910] 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'
[0xf5c910] 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'
[0xe11da0] main demux debug: looking for access_demux module: 3 candidates
[0xe11da0] main demux debug: no access_demux module matching "file" could be loaded
[0xe11da0] main demux debug: TIMER module_need() : 15.051 ms - Total 15.051 ms / 1 intvls (Avg 15.051 ms)
[0xf5c910] main input debug: creating access 'file' location='/home/pi/.local/share/vlc/ml.xspf', path='/home/pi/.local/share/vlc/ml.xspf'
[0xe948f0] main access debug: looking for access module: 2 candidates
[0xe948f0] filesystem access debug: opening file `/home/pi/.local/share/vlc/ml.xspf'
[0xe948f0] main access debug: using access module "filesystem"
[0xe948f0] main access debug: TIMER module_need() : 10.114 ms - Total 10.114 ms / 1 intvls (Avg 10.114 ms)
[0xe94f08] main stream debug: Using stream method for AStream*
[0xe94f08] main stream debug: starting pre-buffering
[0xe94f08] main stream debug: received first data after 0 ms
[0xe94f08] main stream debug: pre-buffering done 296 bytes in 0s - 340 KiB/s
[0xe950c8] main stream debug: looking for stream_filter module: 7 candidates
[0xe950c8] main stream debug: no stream_filter module matching "any" could be loaded
[0xe950c8] main stream debug: TIMER module_need() : 11.464 ms - Total 11.464 ms / 1 intvls (Avg 11.464 ms)
[0xe950c8] main stream debug: looking for stream_filter module: 1 candidate
[0xe950c8] main stream debug: using stream_filter module "stream_filter_record"
[0xe950c8] main stream debug: TIMER module_need() : 7.982 ms - Total 7.982 ms / 1 intvls (Avg 7.982 ms)
[0xf5c910] 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'
[0xe96120] main demux debug: looking for demux module: 1 candidate
[0xe96120] playlist demux debug: using XSPF playlist reader
[0xe96120] main demux debug: using demux module "playlist"
[0xe96120] main demux debug: TIMER module_need() : 8.179 ms - Total 8.179 ms / 1 intvls (Avg 8.179 ms)
[0xe99030] main demux meta debug: looking for meta reader module: 2 candidates
[0xe99030] lua demux meta debug: Trying Lua scripts in /home/pi/.local/share/vlc/lua/meta/reader
[0xe99030] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/reader
[0xe99030] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/reader/filename.luac
[0xe99030] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
[0xe99030] main demux meta debug: no meta reader module matching "any" could be loaded
[0xe99030] main demux meta debug: TIMER module_need() : 49.133 ms - Total 49.133 ms / 1 intvls (Avg 49.133 ms)
[0xf5c910] main input debug: `file/xspf-open:///home/pi/.local/share/vlc/ml.xspf' successfully opened
[0xe8ae28] main xml reader debug: looking for xml reader module: 1 candidate
[0xe8ae28] main xml reader debug: using xml reader module "xml"
[0xe8ae28] main xml reader debug: TIMER module_need() : 13.499 ms - Total 13.499 ms / 1 intvls (Avg 13.499 ms)
[0xe96120] playlist demux debug: parsed 0 tracks successfully
[0xf5c910] main input debug: EOF reached
[0xe96120] main demux debug: removing module "playlist"
[0xe950c8] main stream debug: removing module "stream_filter_record"
[0xe948f0] main access debug: removing module "filesystem"
[0xf5c910] main input debug: TIMER input launching for 'Media Library' : 132.604 ms - Total 132.604 ms / 1 intvls (Avg 132.604 ms)
[0xe89d90] main interface debug: looking for interface module: 1 candidate
[0xe89d90] main interface debug: using interface module "hotkeys"
[0xe89d90] main interface debug: TIMER module_need() : 7.676 ms - Total 7.676 ms / 1 intvls (Avg 7.676 ms)
[0xf5c910] main interface debug: looking for interface module: 1 candidate
[0xf5c910] inhibit interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[0xf5c910] main interface debug: no interface module matching "inhibit,none" could be loaded
[0xf5c910] main interface debug: TIMER module_need() : 7.087 ms - Total 7.087 ms / 1 intvls (Avg 7.087 ms)
[0xf5c910] main interface error: no suitable interface module
[0xe0dc68] main playlist debug: playlist threads correctly activated
[0xe0dc68] main playlist debug: adding item `stdin' ( stream:///dev/stdin )
[0xe948f0] main interface debug: looking for interface module: 1 candidate
[0xe0dc68] main playlist debug: rebuilding array of current - root Playlist
[0xe0dc68] main playlist debug: rebuild done - 1 items, index -1
[0xe1e630] main input debug: Creating an input for 'stdin'
[0xe0dc68] main playlist debug: no fetch required for (null) (art currently (null))
[0xe948f0] main interface debug: no interface module matching "globalhotkeys,none" could be loaded
[0xe948f0] main interface debug: TIMER module_need() : 21.441 ms - Total 21.441 ms / 1 intvls (Avg 21.441 ms)
[0xe948f0] main interface error: no suitable interface module
[0xdfe8f0] main libvlc error: interface "globalhotkeys,none" initialization failed
[0xe948f0] main interface debug: looking for interface module: 1 candidate
[0xe948f0] dummy interface: using the dummy interface module...
[0xe948f0] main interface debug: using interface module "dummy"
[0xe948f0] main interface debug: TIMER module_need() : 6.971 ms - Total 6.971 ms / 1 intvls (Avg 6.971 ms)
[0xe0dc68] main playlist debug: processing request item: null, node: Playlist, skip: 0
[0xe0dc68] main playlist debug: starting playback of the new playlist item
[0xe0dc68] main playlist debug: resyncing on stdin
[0xe0dc68] main playlist debug: stdin is at 0
[0xe0dc68] main playlist debug: creating new input thread
[0xe1e750] main input debug: Creating an input for 'stdin'
[0xe8aa50] main stream output debug: using sout chain=`standard{access=http,mux=ts,dst=:8090}'
[0xe8aa50] main stream output debug: stream=`standard'
[0xe8ac98] main stream out debug: looking for sout stream module: 1 candidate
[0xe8ac98] main stream out debug: set config option: sout-standard-access to http
[0xe8ac98] main stream out debug: set config option: sout-standard-mux to ts
[0xe8ac98] main stream out debug: set config option: sout-standard-dst to :8090
[0xe8c3b8] main access out debug: looking for sout access module: 1 candidate
[0xe8c3b8] main access out debug: net: listening to * port 8090
[0xe8c3b8] main access out error: socket bind error (Permission denied)
[0xe8c3b8] main access out debug: socket error: Address family not supported by protocol
[0xe8c3b8] main access out error: cannot create socket(s) for HTTP host
[0xe8c3b8] access_output_http access out error: cannot start HTTP server
[0xe8c3b8] main access out debug: no sout access module matching "http" could be loaded
[0xe8c3b8] main access out debug: TIMER module_need() : 36.068 ms - Total 36.068 ms / 1 intvls (Avg 36.068 ms)
[0xe8ac98] stream_out_standard stream out error: no suitable sout access module for `http/ts://:8090'
[0xe8ac98] main stream out debug: no sout stream module matching "standard" could be loaded
[0xe8ac98] main stream out debug: TIMER module_need() : 45.718 ms - Total 45.718 ms / 1 intvls (Avg 45.718 ms)
[0xe8ac98] main stream out debug: destroying chain... (name=(null))
[0xe8ac98] main stream out debug: destroying chain done
[0xe8aa50] main stream output error: stream chain failed for `standard{access=http,mux=ts,dst=:8090}'
[0xe0dc68] main playlist debug: finished input
[0xe1e750] main input error: cannot start stream output instance, aborting
[0xe0dc68] main playlist debug: dead input
[0xe1e750] main input debug: TIMER input launching for 'stdin' : 59.018 ms - Total 59.018 ms / 1 intvls (Avg 59.018 ms)
[0xe0dc68] main playlist debug: changing item without a request (current 0/1)
[0xe0dc68] main playlist debug: nothing to play
^Z
[6]+  Stopped                 raspivid -o - -t 99999 -hf -w 640 -h 360 -fps 25 | cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264

Any ideas?

Thanks

kaos
Posts: 108
Joined: Mon Mar 26, 2012 8:14 pm

Re: streaming pi camera works only sometimes

Thu Dec 26, 2013 10:49 am

Are you sure the first raspivid command had terminated properly before you executed the second? The MMAL errors suggest that you are trying to run two raspivid commands concurrently, which cannot be done. Either that, or the first command crashed in such a way that resources were not properly released, and therefore the second instance fails. Either way, a reboot should get you going again.

--
Regards, Kári.

Return to “Camera board”