Page 1 of 1

trouble using libvlc_media_add_option

Posted: 31 Dec 2009 09:29
by mohit839
Hello.

I am trying to play and save a .avi file simultanesouly using libvlc. My code looks as follows:

Code: Select all

/* Create a new item */ m = libvlc_media_new (inst, movie_name, ex); raise (ex); libvlc_media_add_option(m,":sout=#duplicate{dst=display,dst=std{access=file,mux=avi,dst=CWrecTest.avi}}",ex); raise (ex); mp = libvlc_media_player_new_from_media (m, ex); raise (ex); libvlc_media_release (m); raise (ex); libvlc_media_player_set_drawable(mp, (libvlc_drawable_t) (*hWindow), ex); raise (ex); /* play the media_player */ libvlc_media_player_play (mp, ex); raise (ex);
The file is displayed correctly. The recording is also done to file on hard disk. However I am not able to playback the recorded file. I notice that the new file that is created (CWrecTest.avi) is smaller than the original file. Original file was 4009KB while the new file is 3992KB.

What could be the reason for this?

Re: trouble using libvlc_media_add_option

Posted: 31 Dec 2009 10:39
by RĂ©mi Denis-Courmont
The file is remultiplexed. Hence it is very likely to exhibit slight size difference.

Re: trouble using libvlc_media_add_option

Posted: 31 Dec 2009 12:23
by mohit839
Thanks for the response Remi. Then why am I not able to open the recorded .avi file in VLC player? When I try opening the recorded file in VLC, then it does not play at all. It does not even give any error - but it looks like a zero length file to VLC.

Re: trouble using libvlc_media_add_option

Posted: 20 Jan 2010 07:08
by mohit839
When I use libvlc_media_add_option, I am unable to play the recorded file. Code looks as follows:

Code: Select all

libvlc_media_add_option(m,":sout=#duplicate{dst=display,dst=std{access=file,mux=avi,dst=CWrecTest.avi}}",ex); raise (ex);
CWrecTest.avi file is made. However VLC or windows media player is not able to play it. How can I play this recorded file? Is there some problem in my usage of libvlc_media_add_option?