Page 1 of 1

Programming with libvlc_vlm

Posted: 15 Jul 2008 11:22
by darkweaver87
Hi everyone,

I would like to change some parameters of a video while it's playing such as bitrate, width ...

I try this a the telnet control :

Code: Select all

new channel1 broadcast enabled setup channel1 input file:///home/partage/Videos/pepsi_baeren.mpg setup channel1 output #transcode{vcodec=h264,vb=1024,width=256}:duplicate{dst=std{access=rtp,mux=ts,dst=192.168.1.34:6789}} control channel1 play control channel1 pause show channel1 del channel1 new channel1 broadcast enabled setup channel1 input file:///home/partage/Videos/pepsi_baeren.mpg setup channel1 output #transcode{vcodec=h264,vb=1024,width=32}:duplicate{dst=std{access=rtp,mux=ts,dst=192.168.1.34:6789}} control channel1 seek control channel1 play
So, first question: Is there a simpler mean to do this ?

But now I have to implement a software (on the streaming server) which can adapt the width, etc of a video when the client send a message to the streaming server. I tried to do the same thing like I have done with the telnet interface but functions I use may not be in the API :

Code: Select all

CC server_vlc.o server_vlc.c: In function ‘streamerVLC’: server_vlc.c:78: warning: implicit declaration of function ‘libvlc_vlm_get_media_instance_position’ server_vlc.c:78: warning: nested extern declaration of ‘libvlc_vlm_get_media_instance_position’ server_vlc.c:107: warning: implicit declaration of function ‘libvlc_vlm_seek_media’ server_vlc.c:107: warning: nested extern declaration of ‘libvlc_vlm_seek_media’ LIB libserver.so INSTALL libserver.so CC prog.o BIN prog ../build/libserver.so: undefined reference to `libvlc_vlm_seek_media' ../build/libserver.so: undefined reference to `libvlc_vlm_get_media_instance_position' collect2: ld returned 1 exit status make[1]: *** [prog] Error 1 make: *** [build] Error 2
It seems normal because :

Code: Select all

cat /usr/include/vlc/*.h | grep libvlc_vlm * defgroup libvlc_vlm VLM void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* , void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * ); void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int, void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*, void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*, void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int, void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* , void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * ); void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * ); void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
Here is my sample code :

Code: Select all

... #include <vlc/libvlc.h> ... libvlc_exception_t vlcExcep; libvlc_instance_t *vlcInstance; float position; libvlc_exception_init (&vlcExcep); char *vlcOptions[] = {""}; if((vlcInstance = libvlc_new(1, vlcOptions, &vlcExcep)) == NULL || libvlc_exception_raised(&vlcExcep)) { perror("libvlc_new"); return NULL; } libvlc_vlm_add_broadcast(vlcInstance, "test", "file:///home/partage/Videos/superman_originale.avi", "#transcode{vcodec=h264,vb=1024,scale=1}:duplicate{dst=std{access=rtp,mux=ts,dst=192.168.1.2:1234}}", 0, vlcOptions, 1, 0, &vlcExcep); if(libvlc_exception_raised(&vlcExcep)) { perror("libvlc_vlm_add_broadcast"); return NULL; } libvlc_vlm_play_media(vlcInstance, "test", &vlcExcep); if(libvlc_exception_raised(&vlcExcep)) { perror("libvlc_vlm_play_media"); return NULL; } sleep(5); libvlc_vlm_pause_media(vlcInstance, "test", &vlcExcep); if(libvlc_exception_raised(&vlcExcep)) { perror("libvlc_vlm_pause_media"); return NULL; } position = libvlc_vlm_get_media_instance_position(vlcInstance, "test", 0, &vlcExcep); if(libvlc_exception_raised(&vlcExcep)) { perror("libvlc_vlm_get_media_instance_position"); return NULL; } //position = 0.5; libvlc_vlm_del_media(vlcInstance, "test", &vlcExcep); if(libvlc_exception_raised(&vlcExcep)) { perror("libvlc_vlm_del_media"); return NULL; } libvlc_vlm_add_broadcast(vlcInstance, "test", "file:///home/partage/Videos/superman_originale.avi", "#transcode{vcodec=h264,vb=1024,scale=2}:duplicate{dst=std{access=rtp,mux=ts,dst=192.168.1.2:1234}}", 0, vlcOptions, 1, 0, &vlcExcep); libvlc_vlm_seek_media(vlcInstance, "test", position, &vlcExcep); if(libvlc_exception_raised(&vlcExcep)) { perror("libvlc_vlm_seek_media"); return NULL; } libvlc_vlm_play_media(vlcInstance, "test", &vlcExcep); if(libvlc_exception_raised(&vlcExcep)) { perror("libvlc_vlm_play_media"); return NULL; } ...
Any ideas ?

Thanks.

PS: I'm using libvlc0-dev

Re: Programming with libvlc_vlm

Posted: 15 Jul 2008 13:52
by contremaitre
cat /usr/include/vlc/*.h | grep libvlc_vlm
This is because you must work with latest version of vlc (yet unstable) to access all of API's functions referenced here http://www.videolan.org/developers/vlc/ ... ibvlc.html

latest vlc is here http://nightlies.videolan.org/

Re: Programming with libvlc_vlm

Posted: 15 Jul 2008 14:26
by darkweaver87
Ok thank you I'll test this afternoon :D

Edit: It seems to work but I still have some troubles :

Code: Select all

[00000001] main libvlc debug: translation test: code is "C" [00000406] [Media: test] main access out error: no sout access module matched "rtp" [00000404] [Media: test] stream_out_standard stream out error: no suitable sout access module for `rtp/ts://192.168.1.2:1234' [00000402] [Media: test] stream_out_duplicate stream out error: no destination given [00000399] [Media: test] stream_out_transcode stream out error: cannot create chain [00000398] [Media: test] main stream output error: stream chain failed for `transcode{vcodec=h264,vb=1024,scale=1}:duplicate{dst=std{access=rtp,mux=ts,dst=192.168.1.2:1234}}' [00000397] [Media: test] main input error: cannot start stream output instance, aborting libvlc_vlm_pause_media: Resource temporarily unavailable
Are all modules implemented on vlc 0.86 available on this version ?
Even with the Qt interface I tried : Media -> Streaming -> Stream -> RTP (:sout=#duplicate{dst=rtp{,dst=192.168.1.2:1234}}) -> Stream but I didn't success in streaming my video (I get an other window with some error messages).

What can I do ?

Re: Programming with libvlc_vlm

Posted: 15 Jul 2008 15:35
by contremaitre
works for me :
./vlc -vvvv rtsp://192.xxxx --sout '#transcode{vcodec=h264,vb=1024,scale=1}:rtp{mux=ts,dst=192.xxxx}'
[00000336] main stream output debug: stream=`rtp'
[00000340] main stream out debug: looking for sout stream module: 1 candidate
[00000340] main stream out debug: set config option: sout-rtp-mux to ts
[00000340] main stream out debug: set config option: sout-rtp-dst to 192.xxxx
[00000343] main mux debug: looking for sout mux module: 1 candidate
[00000343] mux_ts mux debug: shaping=200000 pcr=70000 dts_delay=400000
[00000343] main mux debug: using sout mux module "mux_ts"
[00000343] main mux debug: TIMER module_Need() : 2.487 ms - Total 2.487 ms / 1 intvls (Avg 2.487 ms)
[00000336] main stream output debug: muxer support adding stream at any time
[00000336] main stream output debug: muxer prefers to wait for all ES before starting to mux
[00000340] stream_out_rtp stream out debug: maximum RTP packet size: 1400 bytes
Maybe your command line is wrong (but you didn't post it so I just tried to guess what you want to do)
Or you don't have rtp module ?

try this :
./vlc --list | grep rtp
VLC media player 0.9.0-test3 Grishenko
stream_out_rtp RTP stream output
rtp (Experimental) Real-Time Protocol demuxer

Re: Programming with libvlc_vlm

Posted: 15 Jul 2008 15:58
by darkweaver87
I've the RTP module I think :

Code: Select all

vlc --list | grep rtp VLC media player 0.9.0-test3 Grishenko [00000001] main libvlc debug: VLC media player - version 0.9.0-test3 Grishenko - (c) 1996-2008 the VideoLAN team [00000001] main libvlc debug: libvlc was configured with ./configure '--mandir=/share/man' '--build=i486-linux-gnu' '--enable-maintaner-mode' '--enable-release' '--prefix=/usr' '--enable-libtool' '--enable-fast-install' '--disable-update-check' '--disable-gnome' '--disable-gtk' '--disable-familiar' '--disable-fb' '--enable-ggi' '--enable-sdl' '--enable-esd' '--enable-mad' '--enable-arts' '--enable-jack' '--enable-pulse' '--enable-lirc' '--enable-a52' '--enable-aa' '--enable-dvbpsi' '--enable-mozilla' '--disable-kde' '--enable-mp4' '--enable-dvb' '--disable-satellite' '--enable-ogg' '--enable-vorbis' '--enable-shout' '--enable-wxwidgets' '--with-wx-config=wx-config' '--enable-qt4' '--disable-slp' '--enable-flac' '--disable-skins' '--disable-basic-skins' '--enable-skins2' '--enable-freetype' '--enable-mkv' '--enable-speex' '--enable-caca' '--enable-live555' '--enable-libmpeg2' '--enable-fribidi' '--enable-cdio' '--enable-mod' '--enable-theora' '--enable-modplug' '--enable-dvdnav' '--enable-gnutls' '--enable-ffmpeg' '--enable-ncurses' '--enable-smb' '--disable-gnomevfs' '--enable-bonjour' '--enable-mpc' '--enable-vcd' '--enable-vcdx' '--enable-notify' '--enable-debug' '--enable-twolame' '--enable-x264' '--enable-faad' '--disable-zvbi' '--enable-telx' '--enable-mediacontrol-bindings' '--disable-x264' '--disable-atmo' '--enable-alsa' '--enable-dv' '--enable-v4l' '--enable-v4l2' '--enable-pvr' '--enable-svgalib' '--enable-dvd' '--without-dvdcss' 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS=' 'CXXFLAGS=-g -O2' [00000001] main libvlc debug: translation test: code is "C" rtp (Experimental) Real-Time Protocol demuxer stream_out_rtp RTP stream output
In fact what I want to do is this :
- the server (the application I had to develop) is listening
- the client send it a sip message with its features (such as its resolution)
- the server starts the streaming of the video (in RTP) with the destination the IP address of the client
- during the video is playing the client realize that the there is a lot of traffic and the fluidity is decreasing. So it send an other SIP message containing the command "decrease the bitrate" (for instance).

So the server must be able to adapt these parameters on the video. And, I chose VLC because it is for me the project the most successfully completed.

I am writting my application in C and I use libvlc.

Code: Select all

vlc -vvvv /home/partage/Videos/superman_originale.avi --sout '#transcode{vcodec=h264,vb=1024,scale=1}:rtp{mux=ts,dst=192.168.1.2}' VLC media player 0.9.0-test3 Grishenko [00000001] main libvlc debug: VLC media player - version 0.9.0-test3 Grishenko - (c) 1996-2008 the VideoLAN team [00000001] main libvlc debug: libvlc was configured with ./configure '--mandir=/share/man' '--build=i486-linux-gnu' '--enable-maintaner-mode' '--enable-release' '--prefix=/usr' '--enable-libtool' '--enable-fast-install' '--disable-update-check' '--disable-gnome' '--disable-gtk' '--disable-familiar' '--disable-fb' '--enable-ggi' '--enable-sdl' '--enable-esd' '--enable-mad' '--enable-arts' '--enable-jack' '--enable-pulse' '--enable-lirc' '--enable-a52' '--enable-aa' '--enable-dvbpsi' '--enable-mozilla' '--disable-kde' '--enable-mp4' '--enable-dvb' '--disable-satellite' '--enable-ogg' '--enable-vorbis' '--enable-shout' '--enable-wxwidgets' '--with-wx-config=wx-config' '--enable-qt4' '--disable-slp' '--enable-flac' '--disable-skins' '--disable-basic-skins' '--enable-skins2' '--enable-freetype' '--enable-mkv' '--enable-speex' '--enable-caca' '--enable-live555' '--enable-libmpeg2' '--enable-fribidi' '--enable-cdio' '--enable-mod' '--enable-theora' '--enable-modplug' '--enable-dvdnav' '--enable-gnutls' '--enable-ffmpeg' '--enable-ncurses' '--enable-smb' '--disable-gnomevfs' '--enable-bonjour' '--enable-mpc' '--enable-vcd' '--enable-vcdx' '--enable-notify' '--enable-debug' '--enable-twolame' '--enable-x264' '--enable-faad' '--disable-zvbi' '--enable-telx' '--enable-mediacontrol-bindings' '--disable-x264' '--disable-atmo' '--enable-alsa' '--enable-dv' '--enable-v4l' '--enable-v4l2' '--enable-pvr' '--enable-svgalib' '--enable-dvd' '--without-dvdcss' 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS=' 'CXXFLAGS=-g -O2' [00000001] main libvlc debug: translation test: code is "C" [00000001] main libvlc debug: checking builtin modules [00000001] main libvlc debug: checking plugin modules [00000001] main libvlc debug: loading plugins cache file /home/user/.cache/vlc/plugins-04041e.dat [00000001] main libvlc debug: recursively browsing `/usr/lib/vlc' [00000001] main libvlc debug: module bank initialized, found 267 modules [00000001] main libvlc debug: opening config file (/home/user/.config/vlc/vlcrc) [00000001] main libvlc debug: CPU has capabilities 486 586 MMX MMXEXT FPU [00000001] main libvlc debug: looking for memcpy module: 3 candidates [00000001] main libvlc debug: using memcpy module "memcpymmxext" [00000363] main interaction debug: thread started [00000363] main interaction debug: thread 3081030544 (Interaction control) created at priority 0 (interface/interaction.c:379) [00000365] main input debug: Creating an input for 'Media Library' [00000365] main input debug: Input is a meta file: disabling unneeded options [00000365] main input debug: `file/xspf-open:///home/user/.local/share/vlc/ml.xspf' gives access `file' demux `xspf-open' path `/home/user/.local/share/vlc/ml.xspf' [00000365] main input debug: creating access 'file' path='/home/user/.local/share/vlc/ml.xspf' [00000366] main access debug: looking for access module: 3 candidates [00000366] access_mmap access debug: opening file /home/user/.local/share/vlc/ml.xspf [00000366] main access debug: using access module "access_mmap" [00000366] main access debug: TIMER module_Need() : 0.481 ms - Total 0.481 ms / 1 intvls (Avg 0.481 ms) [00000370] main stream debug: Using AStream*Block [00000370] main stream debug: pre buffering [00000370] main stream debug: received first data for our buffer [00000366] access_mmap access debug: at end of memory mapped file [00000365] main input debug: creating demux: access='file' demux='xspf-open' path='/home/user/.local/share/vlc/ml.xspf' [00000371] main demux debug: looking for demux module: 1 candidate [00000371] playlist demux debug: using XSPF playlist reader [00000371] main demux debug: using demux module "playlist" [00000371] main demux debug: TIMER module_Need() : 0.318 ms - Total 0.318 ms / 1 intvls (Avg 0.318 ms) [00000365] main input debug: `file/xspf-open:///home/user/.local/share/vlc/ml.xspf' successfully opened [00000386] main xml debug: looking for xml module: 2 candidates [00000386] main xml debug: using xml module "xml" [00000386] main xml debug: TIMER module_Need() : 0.491 ms - Total 0.491 ms / 1 intvls (Avg 0.491 ms) [00000366] access_mmap access debug: at end of memory mapped file [00000371] playlist demux debug: parsed 0 tracks successfully [00000386] main xml debug: removing module "xml" [00000365] main input debug: EOF reached [00000365] main input debug: control type=1 [00000371] main demux debug: removing module "playlist" [00000366] main access debug: removing module "access_mmap" [00000365] main input debug: Destroying the input for 'Media Library' [00000365] main input debug: TIMER input launching for 'Media Library' : 3.530 ms - Total 3.530 ms / 1 intvls (Avg 3.530 ms) [00000388] main preparser debug: thread started [00000388] main preparser debug: waiting for thread completion [00000388] main preparser debug: thread 3071220624 (preparser) created at priority 0 (playlist/thread.c:80) [00000389] main fetcher debug: thread started [00000389] main fetcher debug: waiting for thread completion [00000389] main fetcher debug: thread 3062827920 (fetcher) created at priority 0 (playlist/thread.c:110) [00000364] main playlist debug: thread started [00000364] main playlist debug: waiting for thread completion [00000364] main playlist debug: rebuilding array of current - root Playlist [00000364] main playlist debug: rebuild done - 0 items, index -1 [00000364] main playlist debug: thread 3054435216 (playlist) created at priority 0 (playlist/thread.c:119) [00000390] main interface debug: looking for interface module: 1 candidate [00000390] main interface debug: using interface module "hotkeys" [00000390] main interface debug: TIMER module_Need() : 0.270 ms - Total 0.270 ms / 1 intvls (Avg 0.270 ms) [00000390] main interface debug: thread started [00000390] main interface debug: thread 3046042512 (interface) created at priority 0 (interface/interface.c:164) [00000392] main interface debug: looking for interface module: 1 candidate [00000392] main interface debug: using interface module "inhibit" [00000392] main interface debug: TIMER module_Need() : 2.873 ms - Total 2.873 ms / 1 intvls (Avg 2.873 ms) [00000392] main interface debug: thread started [00000392] main interface debug: thread 3037649808 (interface) created at priority 0 (interface/interface.c:164) [00000394] main interface debug: looking for interface module: 1 candidate [00000394] main interface debug: using interface module "screensaver" [00000394] main interface debug: TIMER module_Need() : 0.244 ms - Total 0.244 ms / 1 intvls (Avg 0.244 ms) [00000394] main interface debug: thread started [00000394] main interface debug: thread 3029257104 (interface) created at priority 0 (interface/interface.c:164) [00000364] main playlist debug: adding item `superman_originale.avi' ( /home/partage/Videos/superman_originale.avi ) [00000396] main interface debug: looking for interface module: 23 candidates [00000396] main interface debug: using interface module "signals" [00000396] main interface debug: TIMER module_Need() : 0.197 ms - Total 0.197 ms / 1 intvls (Avg 0.197 ms) [00000396] main interface debug: thread started [00000396] main interface debug: thread 3012471696 (interface) created at priority 0 (interface/interface.c:164) [00000001] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface. [00000398] main interface debug: looking for interface module: 4 candidates [00000398] main interface debug: using interface module "qt4" [00000398] main interface debug: TIMER module_Need() : 20.736 ms - Total 20.736 ms / 1 intvls (Avg 20.736 ms) [00000398] main interface debug: thread started [00000398] main interface debug: thread 2988665744 (interface) created at priority 0 (interface/interface.c:164) [00000364] main playlist debug: rebuilding array of current - root Playlist [00000364] main playlist debug: rebuild done - 1 items, index -1 [00000364] main playlist debug: starting new item [00000364] main playlist debug: processing request item null node Playlist skip 0 [00000364] main playlist debug: creating new input thread [00000402] main input debug: Creating an input for 'superman_originale.avi' [00000402] main input debug: thread started [00000402] main input debug: waiting for thread completion [00000403] main stream output debug: stream=`transcode' [00000404] main stream out debug: looking for sout stream module: 1 candidate [00000403] main stream output debug: stream=`rtp' [00000407] main stream out debug: looking for sout stream module: 1 candidate [00000407] main stream out debug: set config option: sout-rtp-mux to ts [00000407] main stream out debug: set config option: sout-rtp-dst to 192.168.1.2 [00000410] main mux debug: looking for sout mux module: 1 candidate [00000410] mux_ts mux debug: shaping=200000 pcr=70000 dts_delay=400000 [00000410] main mux debug: using sout mux module "mux_ts" [00000410] main mux debug: TIMER module_Need() : 3.294 ms - Total 3.294 ms / 1 intvls (Avg 3.294 ms) [00000403] main stream output debug: muxer support adding stream at any time [00000403] main stream output debug: muxer prefers to wait for all ES before starting to mux [00000407] stream_out_rtp stream out debug: maximum RTP packet size: 1400 bytes [00000407] main stream out debug: net: connecting to [192.168.1.2]:50004 [00000407] main stream out debug: net: connecting to [192.168.1.2]:50005 from [192.168.1.2]:55773 [00000412] main generic debug: thread started [00000402] main input debug: thread 2980273040 (input) created at priority 10 (input/input.c:367) [00000412] main generic debug: thread 2971208592 (RTP send thread) created at priority 20 (rtp.c:1236) [00000407] stream_out_rtp stream out debug: sdp= v=0 o=- 14710774414277866340 14710774414277866340 IN IP4 MERCURE s=Unnamed i=N/A c=IN IP4 192.168.1.2 t=0 0 a=tool:vlc 0.9.0-test3 a=recvonly a=type:broadcast a=charset:UTF-8 m=video 50004 RTP/AVP 33 b=RR:0 a=rtpmap:33 MP2T/90000 [00000407] main stream out debug: using sout stream module "stream_out_rtp" [00000407] main stream out debug: TIMER module_Need() : 7.889 ms - Total 7.889 ms / 1 intvls (Avg 7.889 ms) [00000404] main stream out debug: set config option: sout-transcode-vcodec to h264 [00000404] main stream out debug: set config option: sout-transcode-vb to 1024 [00000404] main stream out debug: set config option: sout-transcode-scale to 1 [00000404] stream_out_transcode stream out debug: codec video=h264 0x0 scaling: 1.000000 1024kb/s [00000404] main stream out debug: using sout stream module "stream_out_transcode" [00000404] main stream out debug: TIMER module_Need() : 13.000 ms - Total 13.000 ms / 1 intvls (Avg 13.000 ms) [00000402] main input debug: `/home/partage/Videos/superman_originale.avi' gives access `' demux `' path `/home/partage/Videos/superman_originale.avi' [00000402] main input debug: creating demux: access='' demux='' path='/home/partage/Videos/superman_originale.avi' [00000413] main demux debug: looking for access_demux module: 4 candidates [00000413] main demux debug: TIMER module_Need() : 1.259 ms - Total 1.259 ms / 1 intvls (Avg 1.259 ms) [00000402] main input debug: creating access '' path='/home/partage/Videos/superman_originale.avi' [00000419] main access debug: looking for access module: 7 candidates [00000419] vcd access debug: trying .cue file: /home/partage/Videos/superman_originale.cue [00000419] vcd access debug: could not find .cue file [00000419] access_mmap access debug: opening file /home/partage/Videos/superman_originale.avi [00000419] main access debug: using access module "access_mmap" [00000419] main access debug: TIMER module_Need() : 1.765 ms - Total 1.765 ms / 1 intvls (Avg 1.765 ms) [00000422] main stream debug: Using AStream*Block [00000422] main stream debug: pre buffering [00000422] main stream debug: received first data for our buffer [00000422] main stream debug: prebuffering done 1048576 bytes in 0s - 48761904 kbytes/s [00000402] main input debug: creating demux: access='' demux='' path='/home/partage/Videos/superman_originale.avi' [00000423] main demux debug: looking for demux module: 60 candidates [00000422] avi stream debug: found Chunk fourcc:46464952 (RIFF) size:6695974 pos:0 [00000422] avi stream debug: found LIST chunk: 'AVI ' [00000422] avi stream debug: <list 'AVI '> [00000422] avi stream debug: found Chunk fourcc:5453494c (LIST) size:8516 pos:12 [00000422] avi stream debug: found LIST chunk: 'hdrl' [00000422] avi stream debug: <list 'hdrl'> [00000422] avi stream debug: found Chunk fourcc:68697661 (avih) size:56 pos:24 [00000422] avi stream debug: avih: streams:2 flags: HAS_INDEX IS_INTERLEAVED 720x304 [00000422] avi stream debug: found Chunk fourcc:5453494c (LIST) size:4220 pos:88 [00000422] avi stream debug: found LIST chunk: 'strl' [00000422] avi stream debug: <list 'strl'> [00000422] avi stream debug: found Chunk fourcc:68727473 (strh) size:56 pos:100 [00000422] avi stream debug: strh: type:vids handler:0x30355844 samplesize:0 25.00fps [00000422] avi stream debug: found Chunk fourcc:66727473 (strf) size:40 pos:164 [00000422] avi stream debug: strf: video:DX50 720x304 planes:1 24bpp [00000422] avi stream debug: found Chunk fourcc:4b4e554a (JUNK) size:4096 pos:212 [00000422] avi stream debug: </list 'strl'> [00000422] avi stream debug: found Chunk fourcc:5453494c (LIST) size:4212 pos:4316 [00000422] avi stream debug: found LIST chunk: 'strl' [00000422] avi stream debug: <list 'strl'> [00000422] avi stream debug: found Chunk fourcc:68727473 (strh) size:56 pos:4328 [00000422] avi stream debug: strh: type:auds handler:0x00000000 samplesize:1 24000.00fps [00000422] avi stream debug: found Chunk fourcc:66727473 (strf) size:32 pos:4392 [00000422] avi stream debug: strf: audio:0x0055 channels:2 48000Hz 0bits/sample 187kb/s [00000422] avi stream debug: found Chunk fourcc:4b4e554a (JUNK) size:4096 pos:4432 [00000422] avi stream debug: </list 'strl'> [00000422] avi stream debug: </list 'hdrl'> [00000422] avi stream debug: found Chunk fourcc:5453494c (LIST) size:6635814 pos:8536 [00000422] avi stream debug: skipping movi chunk [00000422] main stream debug: b_seek=1 th*avg=1048576 skip=5595782 [00000422] avi stream debug: found Chunk fourcc:31786469 (idx1) size:51616 pos:6644358 [00000419] access_mmap access debug: at end of memory mapped file [00000422] avi stream debug: idx1: index entry:3226 [00000422] avi stream debug: </list 'AVI '> [00000422] avi stream debug: * LIST-root size:6695982 pos:0 [00000422] avi stream debug: + RIFF-AVI size:6695974 pos:0 [00000422] avi stream debug: | + LIST-hdrl size:8516 pos:12 [00000422] avi stream debug: | | + avih size:56 pos:24 [00000422] avi stream debug: | | + LIST-strl size:4220 pos:88 [00000422] avi stream debug: | | | + strh size:56 pos:100 [00000422] avi stream debug: | | | + strf size:40 pos:164 [00000422] avi stream debug: | | | + JUNK size:4096 pos:212 [00000422] avi stream debug: | | + LIST-strl size:4212 pos:4316 [00000422] avi stream debug: | | | + strh size:56 pos:4328 [00000422] avi stream debug: | | | + strf size:32 pos:4392 [00000422] avi stream debug: | | | + JUNK size:4096 pos:4432 [00000422] avi stream debug: | + LIST-movi size:6635814 pos:8536 [00000422] avi stream debug: | + idx1 size:51616 pos:6644358 [00000423] avi demux debug: AVIH: 2 stream, flags HAS_INDEX IS_INTERLEAVED [00000423] avi demux debug: stream[0] rate:25000 scale:1000 samplesize:0 [00000423] avi demux debug: stream[0] video(DX50) 720x304 24bpp 25.000000fps [00000402] main input debug: selecting program id=0 [00000423] avi demux debug: stream[1] rate:24000 scale:1 samplesize:1 [00000423] avi demux debug: stream[1] audio(0x55) 2 channels 48000Hz 0bits [00000423] avi demux debug: no key frame set for track 1 [00000423] avi demux debug: stream[0] created 1613 index entries [00000423] avi demux debug: stream[1] created 1613 index entries [00000423] avi demux debug: stream[0] length:64 (based on index) [00000423] avi demux debug: stream[1] length:64 (based on index) [00000423] main demux debug: using demux module "avi" [00000423] main demux debug: TIMER module_Need() : 23.449 ms - Total 23.449 ms / 1 intvls (Avg 23.449 ms) [00000402] main input debug: looking for a subtitle file in /home/partage/Videos/ [00000425] main packetizer debug: looking for packetizer module: 18 candidates [00000425] main packetizer debug: using packetizer module "packetizer_mpeg4video" [00000425] main packetizer debug: TIMER module_Need() : 1.987 ms - Total 1.987 ms / 1 intvls (Avg 1.987 ms) [00000402] main input debug: stream out mode -> no decoder thread [00000443] main packetizer debug: looking for packetizer module: 18 candidates [00000443] main packetizer debug: using packetizer module "mpeg_audio" [00000443] main packetizer debug: TIMER module_Need() : 1.170 ms - Total 1.170 ms / 1 intvls (Avg 1.170 ms) [00000402] main input debug: stream out mode -> no decoder thread [00000402] main input debug: starting in async mode [00000402] main input debug: `/home/partage/Videos/superman_originale.avi' successfully opened [00000423] avi demux debug: old:0 < new 0 [00000425] packetizer_mpeg4video packetizer warning: waiting for VOL [00000443] mpeg_audio packetizer debug: MPGA channels:2 samplerate:48000 bitrate:192 [00000403] main stream output debug: adding a new sout input (sout_input:0x81c5270) [00000404] stream_out_transcode stream out debug: not transcoding a stream (fcc=`mpga') [00000410] main mux debug: adding a new input [00000410] mux_ts mux debug: adding input codec=mpga pid=68 [00000410] mux_ts mux debug: new PCR PID is 68 [00000443] main packetizer debug: switching to sync mode [00000402] main input debug: control type=1 [00000403] main stream output debug: adding a new sout input (sout_input:0x81c5710) [00000404] stream_out_transcode stream out debug: creating video transcoding from fcc=`mp4v' to fcc=`h264' [00000462] main decoder debug: looking for decoder module: 28 candidates [00000462] avcodec decoder debug: libavcodec initialized (interface 3352064 ) [00000462] avcodec decoder debug: using direct rendering [00000462] avcodec decoder debug: ffmpeg codec (MPEG-4 Video) started [00000462] main decoder debug: using decoder module "avcodec" [00000462] main decoder debug: TIMER module_Need() : 8.614 ms - Total 8.614 ms / 1 intvls (Avg 8.614 ms) [00000463] main encoder debug: looking for encoder module: 9 candidates [00000463] avcodec encoder debug: libavcodec already initialized [00000463] avcodec encoder error: cannot find encoder H264 - MPEG-4 AVC (part 10) [00000463] main encoder debug: TIMER module_Need() : 1.496 ms - Total 1.496 ms / 1 intvls (Avg 1.496 ms) [00000404] stream_out_transcode stream out error: cannot find video encoder (module:any fourcc:h264) [00000462] avcodec decoder debug: ffmpeg codec (MPEG-4 Video) stopped [00000462] main decoder debug: removing module "avcodec" [00000404] stream_out_transcode stream out error: cannot create video chain [00000425] main packetizer error: cannot create packetizer output (mp4v) [00000398] main interface debug: uses deprecated vlc_object_get(398) [00000398] main interface debug: uses deprecated vlc_object_get(402) [00000398] main interface debug: uses deprecated vlc_object_get(402) [00000398] main interface debug: uses deprecated vlc_object_get(402) [00000398] main interface debug: uses deprecated vlc_object_get(402) [00000398] main interface debug: uses deprecated vlc_object_get(402) [00000398] main interface debug: uses deprecated vlc_object_get(402) [00000398] main interface debug: uses deprecated vlc_object_get(402) [00000398] main interface debug: uses deprecated vlc_object_get(402) [00000398] main interface debug: uses deprecated vlc_object_get(402) [00000398] main interface debug: uses deprecated vlc_object_get(402) [00000398] qt4 interface debug: Error while initializing qt-specific localization [00000398] qt4 interface debug: I was here, updating your status [00000422] main stream debug: b_seek=0 th*avg=865294 skip=0 [00000419] access_mmap access debug: at end of memory mapped file [00000423] avi demux warning: cannot skip packet, track disabled [00000425] main packetizer debug: removing module "packetizer_mpeg4video" [00000425] main packetizer debug: killing decoder fourcc `DX50', 0 PES in FIFO [00000443] main packetizer debug: removing module "mpeg_audio" [00000443] main packetizer debug: killing decoder fourcc `mpga', 0 PES in FIFO [00000403] main stream output debug: removing a sout input (sout_input:0x81c5270) [00000410] mux_ts mux debug: removing input pid=68 [00000410] mux_ts mux debug: new PCR PID is 8191 [00000410] main mux warning: no more input streams for this mux [00000402] main input debug: EOF reached [00000398] qt4 interface debug: New Event: type 1103 [00000398] qt4 interface debug: I was here, updating your status [00000398] qt4 interface debug: New Event: type 1103 [00000364] main playlist debug: finished input [00000364] main playlist debug: dying input [00000364] message playlist warning: message queue overflowed [00000364] main playlist debug: dying input [00000422] avi stream debug: free chunk avih [00000422] avi stream debug: free chunk strh [00000422] avi stream debug: free chunk strf [00000422] avi stream debug: free chunk JUNK [00000422] avi stream debug: free chunk LIST [00000422] avi stream debug: free chunk strh [00000422] avi stream debug: free chunk strf [00000422] avi stream debug: free chunk JUNK [00000422] avi stream debug: free chunk LIST [00000422] avi stream debug: free chunk LIST [00000422] avi stream debug: free chunk LIST [00000422] avi stream debug: free chunk idx1 [00000422] avi stream debug: free chunk RIFF [00000422] avi stream debug: free chunk LIST [00000423] main demux debug: removing module "avi" [00000419] main access debug: removing module "access_mmap" [00000402] main input debug: thread ended [00000398] qt4 interface debug: I was here, updating your status [00000364] main playlist debug: dead input [00000403] main stream output error: object is not attached [00000001] main libvlc warning: input 402 destroyed while thread alive (VLC might crash) [00000402] main input debug: thread 2980273040 joined (misc/objects.c:308) [00000402] main input debug: Destroying the input for 'superman_originale.avi' [00000402] main input debug: TIMER input launching for 'superman_originale.avi' : 52.524 ms - Total 52.524 ms / 1 intvls (Avg 52.524 ms) [00000364] main playlist debug: starting new item [00000364] main playlist debug: changing item without a request (current 0/1) [00000364] main playlist debug: nothing to play [00000398] qt4 interface debug: Destroying the main interface [00000398] qt4 interface debug: Destroying the Dialog Provider [00000001] main libvlc debug: removing all interfaces [00000398] main interface debug: thread ended [00000398] main interface debug: thread 2988665744 joined (interface/interface.c:184) [00000398] main interface debug: removing module "qt4" [00000396] main interface debug: thread ended [00000396] main interface debug: thread 3012471696 joined (interface/interface.c:184) [00000396] main interface debug: removing module "signals" [00000394] main interface debug: thread ended [00000394] main interface debug: thread 3029257104 joined (interface/interface.c:184) [00000394] main interface debug: removing module "screensaver" [00000392] main interface debug: thread ended [00000392] main interface debug: thread 3037649808 joined (interface/interface.c:184) [00000392] main interface debug: removing module "inhibit" [00000390] main interface debug: thread ended [00000390] main interface debug: thread 3046042512 joined (interface/interface.c:184) [00000390] main interface debug: removing module "hotkeys" [00000001] main libvlc debug: removing all services discovery tasks [00000001] main libvlc debug: removing playlist [00000404] main stream out debug: destroying chain... (name=transcode) [00000407] main stream out debug: destroying chain... (name=rtp) [00000412] main generic debug: thread ended [00000412] main generic debug: thread 2971208592 joined (rtp.c:1272) [00000410] main mux debug: removing module "mux_ts" [00000407] main stream out debug: removing module "stream_out_rtp" [00000407] main stream out debug: destroying chain done [00000404] main stream out debug: removing module "stream_out_transcode" [00000404] main stream out debug: destroying chain done [00000364] main playlist: saving Media Library to file /home/user/.local/share/vlc/ml.xspf [00000364] main playlist debug: looking for playlist export module: 1 candidate [00000364] main playlist debug: using playlist export module "export" [00000364] main playlist debug: TIMER module_Need() : 0.360 ms - Total 0.360 ms / 1 intvls (Avg 0.360 ms) [00000364] main playlist debug: removing module "export" [00000388] main preparser debug: thread ended [00000388] main preparser debug: thread 3071220624 joined (playlist/engine.c:508) [00000389] main fetcher debug: thread ended [00000389] main fetcher debug: thread 3062827920 joined (playlist/engine.c:510) [00000364] main playlist debug: thread ended [00000364] main playlist debug: thread 3054435216 joined (libvlc.c:1010) [00000388] main preparser debug: Destroyed [00000389] main fetcher debug: Destroyed [00000364] main playlist debug: Destroyed [00000001] main libvlc debug: removing interaction [00000363] main interaction debug: thread ended [00000363] main interaction debug: thread 3081030544 joined (interface/interaction.c:397) [00000001] main libvlc debug: removing all video outputs [00000001] main libvlc debug: TIMER ML Load : Total 4.397 ms / 1 intvls (Avg 4.397 ms) [00000001] main libvlc debug: TIMER Items array build : Total 0.046 ms / 2 intvls (Avg 0.023 ms) [00000001] main libvlc debug: TIMER ML Dump : Total 0.504 ms / 1 intvls (Avg 0.504 ms) [00000001] main libvlc debug: removing stats [00000001] main libvlc debug: removing module "memcpymmxext" [00000001] main libvlc debug: opening config file (/home/user/.config/vlc/vlcrc) [00000001] main libvlc debug: opening config file (/home/user/.config/vlc/vlcrc) [00000001] main libvlc debug: writing plugins cache /home/user/.cache/vlc/plugins-04041e.dat
My commande line was (the one I used in vlc 0.86) :

Code: Select all

vlc Videos/pepsi_baeren.mpg --sout "#transcode{vcodec=h264,vb=1024,scale=1}:duplicate{dst=std{access=rtp,mux=ts,dst=192.168.1.33:1234}}"
but I try to do the same as the command line in C to have a control on the instance from my apllication (for instance decrease the bitrate).

Re: Programming with libvlc_vlm

Posted: 16 Jul 2008 08:42
by contremaitre
Your second command line is wrong so you need to look out vlc documentation and rewrite it with something like :
'#transcode{vcodec=h264,vb=1024,scale=1}:duplicate{dst=rtp{mux=ts,dst=192.168.1.33:1234}}'
which seems to works.

You should read
http://www.videolan.org/doc/streaming-h ... /ch03.html
" rtp: streams over RTP This can only be used to stream MPEG-TS over plain RTP. Support for this option has been removed in VLC 0.9.0 and latter. You should use the rtp stream output module instead. Options are the same as for the udp setting. "

Re: Programming with libvlc_vlm

Posted: 16 Jul 2008 09:27
by darkweaver87
Hi,

OK. Works fine now with this sample command :
vlc /home/partage/Videos/pepsi_baeren.mpg --sout "#transcode{vcodec=mp4v,vb=1024,scale=2}:duplicate{dst=rtp{mux=ts,dst=192.168.1.34,port=1234}}"
However I didn't success in transcoding the stream in h264 (the current version 0.86 of VLC support) this.with :
vlc /home/partage/Videos/pepsi_baeren.mpg --sout "#transcode{vcodec=h264,vb=1024,scale=2}:duplicate{dst=rtp{mux=ts,dst=192.168.1.34,port=1234}}"

[00000001] main libvlc debug: translation test: code is "C"
[00000001] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00000493] avcodec encoder error: cannot find encoder H264 - MPEG-4 AVC (part 10)
[00000403] stream_out_transcode stream out error: cannot find video encoder (module:any fourcc:x264)
[00000403] stream_out_transcode stream out error: cannot create video chain
[00000491] main packetizer error: cannot create packetizer output (mpgv)
Thanks again.

Edit:

With a good string my application works but when I call :

Code: Select all

printf("show : %s\n", libvlc_vlm_show_media(vlcInstance, "test", &vlcExcep)); if(libvlc_exception_raised(&vlcExcep)) { perror("l libvlc_vlm_show_media"); return NULL; }
I got this message in my console :
show : (null)
l libvlc_vlm_show_media: Resource temporarily unavailable

Re: Programming with libvlc_vlm

Posted: 16 Jul 2008 10:05
by contremaitre
sorry I don't know about that, and this is another issue you should post in another forum section.

Re: Programming with libvlc_vlm

Posted: 16 Jul 2008 10:11
by darkweaver87
OK I will post it in an other section.

Thanks a lot.

Re: Programming with libvlc_vlm

Posted: 24 Oct 2008 12:55
by silvara
are you aware your configuration has both '--disable-x264' and '--enable-x264' .. last one is disable this might be causing the x264 encoder module to be not loaded.

Re: Programming with libvlc_vlm

Posted: 16 Feb 2009 15:02
by vinu.viking
hello darkweaver,
i don't know if it is the right way to ask,but i wanted to ask as how far you could get the project woking.we're doing a similar project for the college purpose,and wanted all the help i can.
please do let me know about how i can contact you otherwise,by mail.all help will be appreciated.

regards.
vinu.
[vinu.viking@gmail.com]

Re: Programming with libvlc_vlm

Posted: 16 Feb 2009 15:22
by darkweaver87
Hi,

I don't think I can help you because my team and me, because of the bug I posted for, have given up vlc to do what we wanted. After that, we chose to use GStreamer which is more complex but works for our subject.

I can't help you anymore on vlc.

++