[streaming] transcoding h.264 to MJPEG under Linux

Yves A. yves030 at gmx.de
Fri May 31 23:10:30 CEST 2013


Hi,

I am trying to transcode a H.264 Stream (via RTSP) from my IP Cam to a 
MJPEG Stream (via HTTP), so that I can easily
view the stream in many Browsers / Devices without the need of PlugIns, 
Apps and so on...

Now I have several problems...

When I run (under windows):
*
**vlc rtsp://192.168.10.254:8554/proxyStream-1 
:sout=#transcode{vcodec=MJPG,vb=800,scale=1}:duplicate{dst=std{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8080/mjpeg}}**/
/*

I can view the MJPEG stream in my browser like expected

Issuing the same command under linux (ubuntu 13, Kernel 
3.8.0-19-generic) throws the following errors and outputs therefor no 
stream...:

custodia at vigilia:~$ *cvlc -vvv rtsp://192.168.10.254:8554/proxyStream-1 
:sout=#transcode{vcodec=MJPG,vb=800,scale=1}:duplicate{dst=std{access=http{mime**
**=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8080/mjpeg}}

*VLC media player 2.0.6 Twoflower (revision 2.0.6-0-gbe9623c)
[0x95958f0] main libvlc debug: VLC media player - 2.0.6 Twoflower
[0x95958f0] main libvlc debug: Copyright © 1996-2013 VLC authors and 
VideoLAN
[0x95958f0] main libvlc debug: revision 2.0.6-0-gbe9623c
[0x95958f0] main libvlc debug: configured with ./configure 
'--enable-static' '--build=i686-linux-gnu' 'CFLAGS=-g -O2 
-fstack-protector --param=ssp-bu
ffer-size=4 -Wformat -Werror=format-security' 
'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector 
--param=ssp-buffer-size=4 -Wformat -We
rror=format-security' 'LDFLAGS=-Wl,-Bsymbolic-functions -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=1' '--enable-a52'
'--enable-aa' '--enable-bluray' '--enable-bonjour' '--enable-caca' 
'--enable-dbus' '--enable-dca' '--enable-dirac' '--enable-directfb' 
'--enable-dvbps
i' '--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-opus' 
'--enable-os
s' '--enable-pulse' '--enable-qt4' '--enable-realrtsp' 
'--enable-samplerate' '--enable-schroedinger' '--enable-sdl' 
'--enable-sftp' '--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-dc
1394' '--enable-dv' '--enable-fbosd' '--enable-libva' '--enable-linsys' 
'--enable-omxil' '--enable-pvr' '--enable-udev' '--enable-v4l2' 
'--enable-crys
talhd' '--enable-mmx' '--enable-sse' '--disable-neon' 
'--disable-altivec' 'build_alias=i686-linux-gnu'
[0x95958f0] main libvlc debug: searching plug-in modules
[0x95958f0] main libvlc debug: loading plugins cache file 
/usr/lib/vlc/plugins/plugins.dat
[0x95958f0] main libvlc debug: recursively browsing `/usr/lib/vlc/plugins'
[0x95958f0] main libvlc debug: saving plugins cache 
/usr/lib/vlc/plugins/plugins.dat
[0x95958f0] main libvlc debug: plug-ins loaded: 422 modules
[0x95958f0] main libvlc debug: opening config file 
(/home/custodia/.config/vlc/vlcrc)
[0x95958f0] main libvlc debug: translation test: code is "de"
[0x95958f0] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 
SSE3 SSSE3 FPU
[0x95958f0] main libvlc debug: looking for memcpy module: 4 candidates
[0x95958f0] main libvlc debug: using memcpy module "memcpymmxext"
[0x9727668] main input debug: Creating an input for 'Medienbibliothek'
[0x9727668] main input debug: Input is a meta file: disabling unneeded 
options
[0x9727668] main input debug: using timeshift granularity of 50 MiB, in 
path '/tmp'
[0x9727668] main input debug: 
`file/xspf-open:///home/custodia/.local/share/vlc/ml.xspf' gives access 
`file' demux `xspf-open' path `/home/custodia/.l
ocal/share/vlc/ml.xspf'
[0x9727668] main input debug: creating demux: access='file' 
demux='xspf-open' location='/home/custodia/.local/share/vlc/ml.xspf' 
file='/home/custodia/
.local/share/vlc/ml.xspf'
[0x95b6018] main demux debug: looking for access_demux module: 3 candidates
[0x95b6018] main demux debug: no access_demux module matching "file" 
could be loaded
[0x95b6018] main demux debug: TIMER module_need() : 1.988 ms - Total 
1.988 ms / 1 intvls (Avg 1.988 ms)
[0x9727668] main input debug: creating access 'file' 
location='/home/custodia/.local/share/vlc/ml.xspf', 
path='/home/custodia/.local/share/vlc/ml.xspf
'
[0x962eca0] main access debug: looking for access module: 2 candidates
[0x962eca0] filesystem access debug: opening file 
`/home/custodia/.local/share/vlc/ml.xspf'
[0x962eca0] main access debug: using access module "filesystem"
[0x962eca0] main access debug: TIMER module_need() : 1.058 ms - Total 
1.058 ms / 1 intvls (Avg 1.058 ms)
[0x962fc10] main stream debug: Using stream method for AStream*
[0x962fc10] main stream debug: starting pre-buffering
[0x962fc10] main stream debug: received first data after 0 ms
[0x962fc10] main stream debug: pre-buffering done 299 bytes in 0s - 2147 
KiB/s
[0x962f470] main stream debug: looking for stream_filter module: 7 
candidates
[0x962f470] main stream debug: no stream_filter module matching "any" 
could be loaded
[0x962f470] main stream debug: TIMER module_need() : 1.954 ms - Total 
1.954 ms / 1 intvls (Avg 1.954 ms)
[0x962f470] main stream debug: looking for stream_filter module: 1 candidate
[0x962f470] main stream debug: using stream_filter module 
"stream_filter_record"
[0x962f470] main stream debug: TIMER module_need() : 0.666 ms - Total 
0.666 ms / 1 intvls (Avg 0.666 ms)
[0x9727668] main input debug: creating demux: access='file' 
demux='xspf-open' location='/home/custodia/.local/share/vlc/ml.xspf' 
file='/home/custodia/
.local/share/vlc/ml.xspf'
[0x962fcd0] main demux debug: looking for demux module: 1 candidate
[0x962fcd0] playlist demux debug: using XSPF playlist reader
[0x962fcd0] main demux debug: using demux module "playlist"
[0x962fcd0] main demux debug: TIMER module_need() : 0.871 ms - Total 
0.871 ms / 1 intvls (Avg 0.871 ms)
[0x96321f8] main demux meta debug: looking for meta reader module: 2 
candidates
[0x96321f8] lua demux meta debug: Trying Lua scripts in 
/home/custodia/.local/share/vlc/lua/meta/reader
[0x96321f8] lua demux meta debug: Trying Lua scripts in 
/usr/lib/vlc/lua/meta/reader
[0x96321f8] lua demux meta debug: Trying Lua playlist script 
/usr/lib/vlc/lua/meta/reader/filename.luac
[0x96321f8] lua demux meta debug: Trying Lua scripts in 
/usr/share/vlc/lua/meta/reader
[0x96321f8] main demux meta debug: no meta reader module matching "any" 
could be loaded
[0x96321f8] main demux meta debug: TIMER module_need() : 4.667 ms - 
Total 4.667 ms / 1 intvls (Avg 4.667 ms)
[0x9727668] main input debug: 
`file/xspf-open:///home/custodia/.local/share/vlc/ml.xspf' successfully 
opened
[0x9624be8] main xml reader debug: looking for xml reader module: 1 
candidate
[0x9624be8] main xml reader debug: using xml reader module "xml"
[0x9624be8] main xml reader debug: TIMER module_need() : 1.740 ms - 
Total 1.740 ms / 1 intvls (Avg 1.740 ms)
[0x962fcd0] playlist demux debug: parsed 0 tracks successfully
[0x9727668] main input debug: EOF reached
[0x962fcd0] main demux debug: removing module "playlist"
[0x962f470] main stream debug: removing module "stream_filter_record"
[0x962eca0] main access debug: removing module "filesystem"
[0x9727668] main input debug: TIMER input launching for 
'Medienbibliothek' : 13.841 ms - Total 13.841 ms / 1 intvls (Avg 13.841 ms)
[0x9623e88] main interface debug: looking for interface module: 1 candidate
[0x9623e88] main interface debug: using interface module "hotkeys"
[0x9623e88] main interface debug: TIMER module_need() : 0.759 ms - Total 
0.759 ms / 1 intvls (Avg 0.759 ms)
[0x95a96d8] main interface debug: looking for interface module: 1 candidate
[0x95a96d8] inhibit interface error: Failed to connect to the D-Bus 
session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY 
for X11
[0x95a96d8] main interface debug: no interface module matching 
"inhibit,none" could be loaded
[0x95a96d8] main interface debug: TIMER module_need() : 0.919 ms - Total 
0.919 ms / 1 intvls (Avg 0.919 ms)
[0x95a96d8] main interface error: no suitable interface module
[0x9729150] main playlist debug: playlist threads correctly activated
[0x9729150] main playlist debug: rebuilding array of current - root 
Wiedergabeliste
[0x9729150] main playlist debug: rebuild done - 0 items, index -1
[0x9729150] main playlist debug: adding item 
`rtsp://192.168.10.254:8554/proxyStream-1' ( 
rtsp://192.168.10.254:8554/proxyStream-1 )
[0x9729150] main playlist debug: no fetch required for (null) (art 
currently (null))
[0x9728510] main interface debug: looking for interface module: 1 candidate
[0x9728510] main interface debug: no interface module matching 
"globalhotkeys,none" could be loaded
[0x9728510] main interface debug: TIMER module_need() : 1.202 ms - Total 
1.202 ms / 1 intvls (Avg 1.202 ms)
[0x9728510] main interface error: no suitable interface module
[0x95958f0] main libvlc error: interface "globalhotkeys,none" 
initialization failed
[0x9728510] main interface debug: looking for interface module: 1 candidate
[0x9728510] dummy interface: using the dummy interface module...
[0x9728510] main interface debug: using interface module "dummy"
[0x9728510] main interface debug: TIMER module_need() : 0.999 ms - Total 
0.999 ms / 1 intvls (Avg 0.999 ms)
[0x9729150] main playlist debug: processing request item: null, node: 
Wiedergabeliste, skip: 0
[0x9729150] main playlist debug: rebuilding array of current - root 
Wiedergabeliste
[0x9729150] main playlist debug: rebuild done - 1 items, index -1
[0x9729150] main playlist debug: starting playback of the new playlist item
[0x9729150] main playlist debug: resyncing on 
rtsp://192.168.10.254:8554/proxyStream-1
[0x9729150] main playlist debug: 
rtsp://192.168.10.254:8554/proxyStream-1 is at 0
[0x9729150] main playlist debug: creating new input thread
[0xb53005f0] main input debug: Creating an input for 
'rtsp://192.168.10.254:8554/proxyStream-1'
[0xb5100880] main stream output debug: using sout 
chain=`transcodescale=1:duplicate{dst=std{access=http{mime=multipart/x-mixed-replace'
[0xb5100880] main stream output debug: stream=`duplicate'
[0xb5100b10] main stream out debug: looking for sout stream module: 1 
candidate
[0xb5100b10] stream_out_duplicate stream out debug: creating 'duplicate'
[0xb5100b10] stream_out_duplicate stream out debug:  * adding 
`std{access=http{mime=multipart/x-mixed-replace'
[0xb5100880] main stream output debug: stream=`std'
[0xb5101128] main stream out debug: looking for sout stream module: 1 
candidate
[0xb5101128] main stream out debug: set config option: 
sout-standard-access to http{mime=multipart/x-mixed-replace
[0xb5101128] stream_out_standard stream out error: no mux specified or 
found by extension
[0xb5101128] main stream out debug: no sout stream module matching "std" 
could be loaded
[0xb5101128] main stream out debug: TIMER module_need() : 1.270 ms - 
Total 1.270 ms / 1 intvls (Avg 1.270 ms)
[0xb5101128] main stream out debug: destroying chain... (name=(null))
[0xb5101128] main stream out debug: destroying chain done
[0xb5100b10] stream_out_duplicate stream out error: no destination given
[0xb5100b10] main stream out debug: no sout stream module matching 
"duplicate" could be loaded
[0xb5100b10] main stream out debug: TIMER module_need() : 3.054 ms - 
Total 3.054 ms / 1 intvls (Avg 3.054 ms)
[0xb5100b10] main stream out debug: destroying chain... (name=(null))
[0xb5100b10] main stream out debug: destroying chain done
[0xb5100880] main stream output error: stream chain failed for 
`transcodescale=1:duplicate{dst=std{access=http{mime=multipart/x-mixed-replace'
[0xb53005f0] main input error: cannot start stream output instance, aborting
[0x9729150] main playlist debug: finished input
[0x9729150] main playlist debug: dead input
[0xb53005f0] main input debug: TIMER input launching for 
'rtsp://192.168.10.254:8554/proxyStream-1' : 4.873 ms - Total 4.873 ms / 
1 intvls (Avg 4.873
ms)
[0x9729150] main playlist debug: changing item without a request 
(current 0/1)
[0x9729150] main playlist debug: nothing to play

What am I missing?

Next Question....:
the rtsp URL from my IP Cam contains ampersands and question mark to 
supply parameters... unfortunately vlc seems to have problems, when the 
url contains
such characters... the only way to get this working (under linux... 
windows gui has no problems) was to use live555 as a proxy... I tried 
wrapping in double quote, single quotes etc....
nothing helped... the "original url" for the h.264 stream of the camera is:

rtsp://user:password@ip-addr:554/cam/realtimemonitor?channel=1&subtype=0

thank you for reading and maybe giving the solution(s).

regards,
yves


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/streaming/attachments/20130531/64230857/attachment-0001.html>


More information about the streaming mailing list