Thu - Jul 16, 2009 : 12:28 am
tired
Notes on AC3 to MP3 using ffmpeg
I recently put up a video which I took from a network broadcast, HD recording. It, of course, was using the AC3 audio code. As I was trying to get the video chopped and converted to view in the flash player, I encountered an interesting challenge.
When I put the video into kdenlive (which failed miserably to do even the most basic of video editing. Back when it was version 5, I could actually use it. Now it seems to not be able to do even basic stuff like cutting and pasting... Anyway.. That's another post entirely... anyway)...
When I put the video into kdenlive after chopping the video using -ss and -endpos (-endpos didn't end up working) with mencoder, I noticed that the AC3 audio hadn't been properly muxed into stereo. The only two channels which seemed to be playing were the two rear channels. So, no voices could be heard, and the music was distant. Not acceptable. So...
I used ffmpeg to mix the 5.1 channels down to two, and encode them into mp3 in just a few seconds (the clip is 4:20 long).
Here's the ffmpeg command to down-mix the channels:
ffmpeg -i input_filename.mpg -f avi -vcodec copy -acodec libmp3lame -ar 44100 -ab 128k -ac 2 file_output.avi
worked like a charm. Anyway... Just thought I'd see if that helps anyone else out there.
Also - I'm just about done with kdenlive. It's almost useless to me now. I used to use it to do all my video editing. I haven't used it in months, because it just can't seem to do anything right. What a shame.
Audio / Linux / Video