return to I Love My Journal
A Little Closer to Center...
Musings about Life, Linux, and Latter-day Saints.
Pages
About Me
Links


Tags
PERSONAL 520
SPIRITUAL 416
LDS 312
BOOK OF MORMON 237
SCRIPTURES 154
STUDIO-JOURNEY 129
RELIGION 112
LINUX 79
COMPUTERS 65
LIFE 60
GENERAL CONFERENCE 46
GENTOO 39
MISCELLANEOUS 37
MUSIC 37
PROGRAMMING 33
CARS 29
MICROSOFT 23
FAMILY 23
AUDIO 21
I LOVE MY JOURNAL 18
FUN 15
CHILDREN 12
CURRENT EVENTS 10
NATURE'S WAY 10
VIDEO 9
DRM 9
CONEXM 7
BABBLINGS 7
PROVO CITY CENTER TEMPLE 6
FRIENDS 6
HEROD THE FINK 5
GAMES 5
COMPUTER HARDWARE 5
DRUMS 4
HAND OF GOD 3
ADVERSITY 3
KDENLIVE 3
AUDIO HARDWARE 3
GENERAL INSANITY 3
STUDIO 3
THANKS4GIVING 2
CATS 2
MY JOURNAL 1
POETRY 1
FOREVERGREEN 1
EVERYDAY THOUGHTS 1
GOSPEL 1
PARENTING 1
YOUTH CONFERENCE 1
CHURCH NOTES 1
POLITICS 1


RSS Feed

RSS FeedSubscribe!
Thu - Jul 16, 2009 : 12:28 am
tired
   rated 8 times
>>next>>
<<previous<<
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.
Comment by anonymous on Feb. 08, 2010 @ 08:05 am
Thank You very much!

It could be used for a single audio file as well. I've tested it and it is OK.

 

ffmpeg -i audio.ac3 -acodec libmp3lame -ar 48000 -ab 256k -ac 2 output.mp3
 

 

Regards!
Comment by Rodrigo M. S. de Oliveira on Feb. 08, 2010 @ 08:06 am
Sorry, I've forgot to type my name for the comment above.

Regards.
Comment by Kingstrum on Mar. 04, 2010 @ 12:56 pm
 Simply brilliant!

Banging my head trying to figure out why it won't use the install LAME codec -- plus I suspect the need to downmix 5.1 --> 2 was a hang up as well.

Excellent and timely! Thanks so much for sharing.
Comment by Schein on Mar. 17, 2010 @ 02:52 pm
Thanks!

Just what I was looking for! I used it with an AVI-file as input, which worked great as well.
Comment by anonymous on May. 15, 2010 @ 09:56 am
Thanks! Exactly what I was looking for. It worked great!

Regards!
Comment by Fredrik on May. 24, 2011 @ 03:02 pm
Thanks a lot for this!
Comment by videoknower on Jul. 10, 2011 @ 05:08 pm
pretty good guys!!!!

i extract audio with virtualdub as wav, besplit to correct it and convert it as mp3

then i muxed it with virtualdub and i am ready!!!!!

usefull info!
Comment by joeblow on Jun. 09, 2012 @ 09:48 pm
I reworked this into a shellscript to convert movies from ac3 to mp3 audio for the blackberry playbook. Hopefully there are some playbook users that will find this here :D 

 

#!/bin/bash
clear;
echo "";
echo "Preparing video for playbook";
ffmpeg -i @$ -f avi -vcodec copy -acodec libmp3lame -ar 44100 -ab 128k -ac 2 converted_@$ && echo "Video file prepared for playbook as coverted_@$";