Extracting sound to mp3 from flv

I have some radio broadcasts which have been downloaded in flv format.
I confidently ran the command
ffmpeg -i inputfile.flv -acodec copy -f mp3 -y outfile.mp3
and duly made mp3 files but they will not play.
Please could somebody put me right here.
Budgie2

What test are you using to confirm the mp3 is not good ?

I on occasion have used something like this ffmpeg command:


ffmpeg -i inputfile.flv -vn -acodec libmp3lame -ar 44100 -ab 128k outfile.mp3

where


.. where

-vn                disable video
-acodec libmp3lame convert audio to mp3 using the lame codec
-ab 128k           set the audio bitrate to 128k

In addition to ffmpeg I have packman packager packaged lame and libmp3lame0 installed, but I do not know if they are needed.

Don’t test with 'aplay … ’ but use another command to test.

If you have mplayer you can open a konsole window, cd to the directory with the file and use the command:-

mplayer -dumpaudio song.flv -dumpfile song.mp3

@@@ with ‘song’ being the file name @@@

Thanks for both replies. After posting my question I found another thread referring to “audiokreator.” Couldn’t find this but already had Kaudiocreator installed which I had for ripping a difficult CD. Worked like magic with file conversion.
Thanks again.
Budgie2

On 2012-01-17 21:06, Budgie2 wrote:
> ffmpeg -i inputfile.flv -acodec copy -f mp3 -y outfile.mp3

If I’m not mistaken, the copy codec will simply copy the same bits, so your
mp3 file will be in fact an flv file.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On Tue, 17 Jan 2012 22:58:06 +0000, Carlos E. R. wrote:

> On 2012-01-17 21:06, Budgie2 wrote:
>> ffmpeg -i inputfile.flv -acodec copy -f mp3 -y outfile.mp3
>
> If I’m not mistaken, the copy codec will simply copy the same bits, so
> your mp3 file will be in fact an flv file.

Yes, that’s what I was thinking as well - I’ll bet “file” would show it
was an FLV file (or just data) rather than an MP3.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On Tue, 17 Jan 2012 22:26:55 +0000, dth2 wrote:

> If you have mplayer you can open a konsole window, cd to the directory
> with the file and use the command:-
>
> mplayer -dumpaudio song.flv -dumpfile song.mp3

That would dump it as a raw WAV file IIRC, mplayer doesn’t do mp3
encoding to the best of my knowledge.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Jim

Well so much for my suggestion! I wanted to check your comments about mplayer and mp3 - so I downloaded a flv file from youtube and ran the mplayer command to dumpaudio and it wouldn’t even produce a working mp3 file. That was the command that I used to use - in fairness a good few years ago - on my old eee to rip the music from youtube videos. I hadn’t tried the command for many years as we are so spoiled these days with easy to use audio converter programmes.