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!?

This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-No Derivative Works 3.0 Germany License.


Is there any way to do this with regular video files, say, avi or mpeg?
Sure, just give VLC an AVI/MPEG file for the input filename
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.
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\â€}
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″
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.
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\â€}
just add
vlc:quit
at the end of the line to make to auto-close the VLC window
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
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!
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. [...]
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.
You and VLC are my new heroes.
@ 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,
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!
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.
Mac, your method worked no problem. Thanks.
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
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.
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}
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
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.
Thanks Loubie…..It worked & I have my mp3…!
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
Nelson
Thanks for the directions above. it worked great.!
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.
@ Loubie
I consistently use your method successfully on my Mac with VLC version 0.9.9a. Thanks.
Thanks Nelson, this was doing my head in.
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/
Screenshot(36K)
http://habreffect.ru/files/5f7/fa33a9adb/vlc-play-and-exit.png
how about http://www.oggconvert.com