I need to extract an MP3 audio track from an MP4 video with ffmpeg. I can do this for .flv -> mp3, but I don't know the command line parameters for mp4->mp3. For example, flv -> mp3:

ffmpeg -i video.flv -acodec copy audio.mp3

What parameters should I use for mp4 -> mp3?

link|improve this question
feedback

migrated from stackoverflow.com Sep 6 '11 at 6:06

This question came from our site for professional and enthusiast programmers.

2 Answers

ffmpeg -i filename.mp4 filename.mp3

or

ffmpeg -i video.mp4 -f mp3 -ab 192000 -vn music.mp3

check this URL http://donnieknows.com/blog/mp4-video-mp3-file-using-ffmpeg-ubuntu-910-karmic-koala

link|improve this answer
Beat me by seconds :). man ffmpeg shows how as well. – Joshua Sep 6 '11 at 5:26
Thank you! This quality is best, or I can do better? – user916350 Sep 6 '11 at 5:32
try with 320kbs en.wikipedia.org/wiki/MP3#Bit_rate – Naga Harish Movva Sep 6 '11 at 5:36
feedback

Actually, the better way is to use q

ffmpeg -i in.mp4 -q 1 out.mp3


http://svnpenn.blogspot.com/2011/11/ffmpeg-encode-mp3.html

link|improve this answer
feedback

Your Answer

 
or
required, but never shown