libvlc mp4 to wav - can I do it this way

This forum is about all development around libVLC.
jhinkle
New Cone
New Cone
Posts: 8
Joined: 17 Oct 2012 14:03

libvlc mp4 to wav - can I do it this way

Postby jhinkle » 18 Oct 2012 13:51

Since I completely dead in the water getting smem working - I'm looking for alternatives.

I need to extract audio from mp4 and produce a WAV or PCM file - hence my interest in smem in another post

I found this on the WiKi

vlc -I dummy -vvv "input.mp3" --sout=#transcode{acodec=s16l,channels=2,ab=128,samplerate=44100}:standard{access=file,mux=wav,dst="output.wav"} vlc://quit

This works and does exactly what I want ... except I want to do it NOT by running vlc.exe - but from my program using libvlc.

I revised my creation arg list to that below and it works beautifully

const char * const vlc_args[] = {
"-I", "dummy", // No special interface
"--ignore-config", // Don't use VLC's config
"--plugin-path=./plugins",
"--extraintf=logger", // Log anything
"--verbose=2", // Be much more verbose then normal for debugging purpose
"--sout", "#transcode{acodec=s16l,channels=2,ab=128,samplerate=44100}:standard{access=file,mux=wav,dst=\"output.wav\"}"

It works in my libvlc program but I don't know how to detect when the conversion is completed and how to close the output file except by closing the program.

Question - can you point me in the direction to documentation that would help me identify when the conversion was complete and how to close the output file (what libvlc call returns this status and performs output file close)

That way --- I can monitor the status, then rename the out file to the name I want ... and can process multiple files without having to restart after each one.

Thanks.

Joe

jhinkle
New Cone
New Cone
Posts: 8
Joined: 17 Oct 2012 14:03

Re: libvlc mp4 to wav - can I do it this way

Postby jhinkle » 18 Oct 2012 14:07

I am starting to figure out how to find documentation.

I found libvlc_media_player_is_playing(pMediaPlayer_) and it does what I need to determine when the player is done.

I found that I had to put a Sleep delay after calling PLAY - if not the player returned 0 - race condition.

Is there a better way to decide when to start monitoring the libvlc_media_player_is_playing(pMediaPlayer_) call instead using the brute force Sleep?

Output file close is still stumping me .... any insight would be appreciated.

Thanks.

Joe

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: libvlc mp4 to wav - can I do it this way

Postby Jean-Baptiste Kempf » 18 Oct 2012 14:43

YOu could use the events, maybe?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

jhinkle
New Cone
New Cone
Posts: 8
Joined: 17 Oct 2012 14:03

Re: libvlc mp4 to wav - can I do it this way

Postby jhinkle » 18 Oct 2012 16:01

Thanks.

I have a solution in place.

I would still like to figure out why smem fails.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 32 guests