trouble using libvlc_media_add_option

This forum is about all development around libVLC.
mohit839
New Cone
New Cone
Posts: 7
Joined: 27 Apr 2009 13:12

trouble using libvlc_media_add_option

Postby mohit839 » 31 Dec 2009 09:29

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?

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: trouble using libvlc_media_add_option

Postby Rémi Denis-Courmont » 31 Dec 2009 10:39

The file is remultiplexed. Hence it is very likely to exhibit slight size difference.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

mohit839
New Cone
New Cone
Posts: 7
Joined: 27 Apr 2009 13:12

Re: trouble using libvlc_media_add_option

Postby mohit839 » 31 Dec 2009 12:23

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.

mohit839
New Cone
New Cone
Posts: 7
Joined: 27 Apr 2009 13:12

Re: trouble using libvlc_media_add_option

Postby mohit839 » 20 Jan 2010 07:08

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?


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 4 guests