How to extract audio from FLV files using VLC 2007-07-11

It took my some time to get it working but in the end VLC did exactly what I wanted: produce a seekable no-video MP3 file from the audio of a Flash Video File. Here is how it’s done:

vlc.exe “source with spaces.flv” ––sout
    #transcode{acodec=mp3}
    :duplicate{dst=std{access=file,mux=raw,
    dst=\”"dest with spaces.mp3″\”},select=\”novideo\”}

This is one single line, remove the linefeeds and indentation.
However I haven’t found a way to auto-close the VLC window after that!?

Creative Commons License
This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-No Derivative Works 3.0 Germany License.
32 Comments
Anon August 21st, 2007

Is there any way to do this with regular video files, say, avi or mpeg?

sping August 21st, 2007

Sure, just give VLC an AVI/MPEG file for the input filename :-)

Lean September 5th, 2007

The way I do this is to use the VLC wizard to transcode the FLV video to MPEG-1, and then use Avidemux to extract only the audio to get a real MP3.

May be there is a way to automate this by command line.

Erick September 7th, 2007

I’m trying your command line method but I can’t seem to get it to work. Can you take a look at the below line and see how it might differ from yours? As far as I can tell, it’s exactly the same.
Or, even better, can you tell me what selections I can use in the VLC GUI where you go to the Stream/Save and then Settings. I’ve tried just about every setting but still not getting a good mp3 file.

Thanks much.

vlc.exe “Head East – Love Me Tonite.flv” ––sout#transcode{acodec=mp3}:duplicate{dst=std{access=file,mux=raw,dst=\”Head East – Love Me ToniteCMD.mp3”},select=\”novideo\”}

Reynaldo September 23rd, 2007

Another way to achieve it is by using -dumpaudio and -dumpfile options from mplayer.

mplayer -dumpaudio “source with spaces.flv” -dumpfile “dest with spaces.mp3″

xurizaemon October 10th, 2007

I found easy one-step success with

mplayer -dumpaudio "source with spaces.flv" -dumpfile "dest with spaces.mp3"

But note that this won’t necessarily convert your audio format – so if your audio is MP2 to begin with, you’ll end up with an mp2 file with extension .mp3.

Make sure to give the output file the correct extension.

BJC October 17th, 2007

Set the bitrate (ab=192) or else a default of 64 will be used

vlc.exe “source with spaces.flv” ––sout #transcode{acodec=mp3,ab=192}:duplicate{dst=std{access=file,mux=raw,dst=\””dest with spaces.mp3″\”},select=\”novideo\”}

zlapper November 4th, 2007

just add

vlc:quit

at the end of the line to make to auto-close the VLC window

Daniel November 16th, 2007

Quick question, if I wanted the audio of only a portion of the video file could I specify the time constraints for the transcoding?

Also wondering, as so very unversed in these things as I am, if there is a way to change the sound intensity. What I mean by this, is that for some files the sound seems to be much louder than other files. Is there a way I could adjust it so that I don’t have to change the volume of my speakers when some songs change… maybe VLC is not appropriate for this, if not please advise! thanks.

Thanks

Daniel November 16th, 2007

I simply went and found an alternative, using an audio editing program like Audacity and it did the job.

Thanks again for the above tip!

Carlos December 21st, 2007

I tried the above and got various failures, but here’s what worked for me:

vlc.exe “target” :sout=#transcode{acodec=mp3,ab=192,channels=2}:duplicate{dst=std{access=file,mux=wav,dst=”destination”}}

note that the destination must be a .mp3 file or you wont be able to play it

[...] Andava eu à procura de um software que me permitisse fazer isto, e encontro o FLVExtract. Muito simples, e eficaz. 5 estrelas.UPDATE: Acabo de encontrar uma forma que deve funcionar para a maioria, usando o VLC: http://blog.hartwork.org/?p=58. [...]

Loubie April 14th, 2008

This method allows you to extract the audio using VLC grafical user interface. The mp3 file generated will also play in other media players like Winamp, Windows MP and Real:

1. Open the flv file with VLC and stop it as soon as it starts playing.
2. Open the VLC Wizard by clicking on File> Wizard…
3. Select Transcode/Save to File. Next
4. Select your file from the Playlist. Next
5. Check only the Transcode Audio checkmark, Leave Video unchecked). Select 192 KB BRate, and MP3 as the Audio codec. Next
6. Select MPEG-1 for encapsulation method. Save the file with any name, but with the extension MPG.(Don’t use MP3 at this time). Press Finish.

Once the bar runs it course, repeat exactly from 1 through 6, except for: a) Choose the MPG file you just created as your input file, b) Change the encapsulation method as RAW and b) Save the new file with the extension MP3.

Mike June 14th, 2008

You and VLC are my new heroes.

Alex August 8th, 2008

@ Loubie,

followed the steps, but when I get to saving the file as mp3, it says that I have to use the extension RAW. Am I missing something?

Thanks,

Mac September 26th, 2008

I tried it like Loubie said.
But under Vista and vlc 0.9.2. appeared some difficulties:
MPEG-1 could not be produced (Vista sayz: rundll32 error – fooooo)
So I tried the MOV for encapsulation method and then following the steps again like Loubie made them.
And: I have my mp3 :-) ))
Thanks for the tut!

Leo October 15th, 2008

I doubt there was a moment I was happier when the info that Loubie gave worked. The video had the perfect recording of a song that was so rare that the internet forgot it’s existence.

And it worked.

Cookies for Loubie.

Chris October 24th, 2008

Mac, your method worked no problem. Thanks.

Arand November 20th, 2008

After a bit of struggle I’ve made a somewhat interactive script performing this task, the batch file code goes as follows:

@ECHO OFF
ECHO "Select input file (flash video file). (You may also drag & drop the file into this window and then press enter.)"
SET /P variable1=
ECHO "Select output file (mp3 audio file). (You may drag & drop a destination file which is to be overwritten here.)"
SET /P variable2=
ECHO Converting %variable1% to %variable2%
"c:\program files\videolan\vlc\vlc.exe" "%variable1%" vlc:quit --sout #transcode{acodec=mp3}:duplicate{dst=std{access=file,mux=raw,dst=\"%variable2%"},select=\"novideo\"}
ECHO Done
PAUSE

:)
- Arand

RandomDude March 12th, 2009

Ok I’ve made a simple modification to the script which where all you have to do is drag the file you want to convert into it and it will auto create the mp3 file in the same place as the orginal file. It will also close vlc down once its done.

1) Open notepad and paste everthing within the “”. should come upto ONE line only. I’m going to create a Youtube video once I get a chance and post the link here.


“%ProgramFiles%”\VideoLAN\VLC\vlc.exe %1 :sout=#transcode{acodec=mp3,ab=192,channels=2}:duplicate{dst=std{access=file,mux=wav,dst=%1.mp3}} vlc://quit

2) save file as whatever.bat. the “.bat” is VERY important.

3) drag your flv file into the newly created file and just wait for it to be done. Works superfast. Like 5-6 seconds for a 4 minute flv into a high quality mp3.

YungChiZ March 14th, 2009

this is exactly what worked for me on Vista x64, VLC 0.9.8a:

:sout=#transcode{acodec=mp3}:duplicate{dst=display,dst=std{access=file,mux=raw,dst=C:\Users\UserName\Music\VideoName.mp3},select=novideo}

Klipz July 25th, 2009

Here is a bash script using VLC on command line only (ie without gui), to convert several FLC to MP3 :

#!/bin/bash
for i in *.flv;
do
name=$(echo $i | cut -d. -f1)
vlc $name.flv -I dummy –sout=”#transcode{acodec=mp3}:duplicate{dst=std{access=file,mux=raw,dst=$name.mp3},select=novideo}” –play-and-exit
done

Mark August 29th, 2009

After following Loubie’s instructions, my file was slightly off: the length of the audio was twice the original. FIX: I opened the final .mp3 file in Audacity and changed the rate (22050) to double (44100). Then Save As .mp3.

Thanks Loubie

Comment by Loubie

2008-04-14 @ 04:59:44

This method allows you to extract the audio using VLC grafical user interface. The mp3 file generated will also play in other media players like Winamp, Windows MP and Real:

1. Open the flv file with VLC and stop it as soon as it starts playing.
2. Open the VLC Wizard by clicking on File> Wizard…
3. Select Transcode/Save to File. Next
4. Select your file from the Playlist. Next
5. Check only the Transcode Audio checkmark, Leave Video unchecked). Select 192 KB BRate, and MP3 as the Audio codec. Next
6. Select MPEG-1 for encapsulation method. Save the file with any name, but with the extension MPG.(Don’t use MP3 at this time). Press Finish.

Once the bar runs it course, repeat exactly from 1 through 6, except for: a) Choose the MPG file you just created as your input file, b) Change the encapsulation method as RAW and b) Save the new file with the extension MP3.

Sud December 9th, 2009

Thanks Loubie…..It worked & I have my mp3…!

Nelson P December 13th, 2009

Sirs, it seems now with the new version all you have to do is:

1. Open VLC
2. From the Media Menu choose “Convert/Save”
3. Click Add, and browse to the FLV file that you have
4. Click convert/save
5. Under Destination file choose “Browse”
6. Choose Desktop or whevere you want to save
7. Type what you want the name to be, and add .mp3 to the end of it
8. Under Profile, choose AUDIO-MP3
9 Click start and watch the status bar move a little as if it’s playing and then stop. When it stops, the file is done.
10. Find you file on the desktop and play!

Sometimes it may work better to add .ogg to your filename and choose AUDIO-OGG under the profiles, you can later convert an OGG to MP3 or AAC later… Sometimes the MP3 profile comes out skipping and garbled.

Intend on writing this up on my website with pics :) thanks for this thread to get me started! VLC VLC VLC!!

-NELSON

thankful December 18th, 2009

Nelson

Thanks for the directions above. it worked great.!

Raff January 25th, 2010

Posting my results:
@Loubie
I’m using VLC 1.0.3 and the audio extraction works great. Thanks!
@Nelson
Your easier way came up with a mp3 file too, but when I play it’s all damaged, with horrible sounds in the middle + it result a bigger file than the original with video. :(

AaronJamesPatterson February 7th, 2010

@ Loubie
I consistently use your method successfully on my Mac with VLC version 0.9.9a. Thanks.

Damian March 4th, 2010

Thanks Nelson, this was doing my head in.

khom April 21st, 2010

GUI and command line instructions for Windows and OS X
http://khom.wordpress.com/2010/04/21/convert-mp4-and-flv-video-to-mp3-with-vlc/

Chris May 24th, 2010
Leave a Reply

 

Bad Behavior has blocked 933 access attempts in the last 7 days.