Toronto Passions

I need help with FFMPEG (audio problem)

freestuff

New member
Jul 6, 2008
5,685
1
0
So I was able to extract a scene from a movie using this command:
ffmpeg -i original.avi -ss 0.0 -t 60.0 -acodec copy -vcodec copy extract.avi
However, when I play extract.avi, the sound is garbled/incoherent. I'm using VLC.
(Ironically, the sound is fine when I use Windows Media Player.)
I noticed that the audio in the original file is MP3 but in the output file is libmp3lame. Am I suppose alter the FFMPEG file to allow the output file to be MP3? Any help would be appreciated. Thanks.
 

Anynym

Just a bit to the right
Dec 28, 2005
2,953
6
38
Hmm.

Do you know if you have the mp3lame encoder installed? There are rights issues with MP3 encoders, and I'm not sure what your particulars are.

I'd try extracting just the audio & see if you can get anywhere with that, then see what the inferred parameters are for each of the streams as reported in the ffmpeg data that you see while it's doing the encoding.

It's been a while since I've done it, but I wonder if the syntax would be something like this:
> ffmpeg -i input.avi -acodec copy -vcodec none -ss 0.0 -t 60.0 output.mp3

Or others may have a better idea what might be happening. (I never deal with .avi's, myself.)
 

benstt

Well-known member
Jan 20, 2004
1,636
501
113
So I was able to extract a scene from a movie using this command:
ffmpeg -i original.avi -ss 0.0 -t 60.0 -acodec copy -vcodec copy extract.avi
However, when I play extract.avi, the sound is garbled/incoherent. I'm using VLC.
(Ironically, the sound is fine when I use Windows Media Player.)
I noticed that the audio in the original file is MP3 but in the output file is libmp3lame. Am I suppose alter the FFMPEG file to allow the output file to be MP3? Any help would be appreciated. Thanks.
Your command works for me in a test.

Try 'ffmpeg -codecs' and look for mp3. That will tell you what audio formats (the 'A's in the third column) ffmpeg can encode with (the 'E's in the second column). Looking for mp3 will tell you if it can encode mp3. Mine looks like it can do libmp3lame and aac, for example, and it extracted the first 60 seconds of an avi with mp3 with audio no problem. If you can't make mp3 work, try aac - perhaps it can read mp3 but not encode it, and transcoding to aac might work as a test.
 

freestuff

New member
Jul 6, 2008
5,685
1
0
Thanks for all your help.
I figured it out. Yeah, my FFMPEG cannot encode mp3. So I tried aac but got no sound. In the end, I tried this:
ffmpeg -i original.avi -ss 0.0 -t 60.0 -acodec LIBMP3LAME -vcodec copy extract.avi
and it actually worked.
 

WoodPeckr

Protuberant Member
May 29, 2002
47,064
6,192
113
North America
thewoodpecker.net
FFMPEG is a neat program, you just have to make sure you have all your codecs and encoders installed....
 
Toronto Escorts