Help - Search - Members - Calendar
Full Version: Low volume when encoding AC3 in Linux with ffmpeg
Hydrogenaudio Forums > Lossy Audio Compression > Other Lossy Codecs
Ben Franske
Here's the situation: I'm using a MythTV system with a Hauppage PVR-350 capture device which creates MPEG-2 files with MP2 audio. I would like to format these files for DVD playback and as such need to transcode the MP2 audio to AC3. Originally I was moving the files to a Windows system and using BeLight (BeSweet) to do this which works fine but I'd like to keep it all on the linux side. I was able to make this work with the mpegdemux, ffmpeg and mplex tools but the volume of the resulting AC3 audio is too low. In BeLight I am able to apply OTA "HybridGain" and Azid "Dynamic Compression" to fix this problem but have been unable to find a way to do this in Linux. Is anyone aware of a solution for boosting AC3 gain in Linux?

The Linux commands I'm using now are:
ffmpeg -i orig.mpg -ab 256 -ar 48000 -ac 2 -acodec ac3 -y ffmpeg.ac3
mpegdemux -d -s 0xe0 orig.mpg video.m2v
mplex -f 8 -o final_ac3.mpg video.m2v ffmpeg.ac3

Where orig.mpg is the original file with MP2 audio and final_ac3.mpg is the finished video file with AC3 audio.

Thanks for any help!
julesh
QUOTE(Ben Franske @ Aug 16 2005, 12:59 AM)
Here's the situation: I'm using a MythTV system with a Hauppage PVR-350 capture device which creates MPEG-2 files with MP2 audio. I would like to format these files for DVD playback and as such need to transcode the MP2 audio to AC3.


Query: why? MP2 is a perfectly acceptable codec for DVDs.

QUOTE
The Linux commands I'm using now are:
ffmpeg -i orig.mpg -ab 256 -ar 48000 -ac 2 -acodec ac3 -y ffmpeg.ac3
mpegdemux -d -s 0xe0 orig.mpg video.m2v
mplex -f 8 -o final_ac3.mpg video.m2v ffmpeg.ac3

Where orig.mpg is the original file with MP2 audio and final_ac3.mpg is the finished video file with AC3 audio.


Another query: why are you demultiplexing & remultiplexing the files? The same results ought to be achieved with, and will take substantially less time, as for a full DVD's worth of video, approximately 9GB of file I/O time is saved:

ffmpeg -i orig.mpg -target dvd -ab 256 -ar 48000 -ac 2 -acodec ac3 -vcodec copy -y final_ac3.mpg

On the subject of your original question, I'm not sure about compression but you can apply gain by using ffmpeg's "-vol" option. Try "-vol 384", for example.
Latexxx
As julesh said, mp2 audio is completely ok for dvd at least in region 2.
Ben Franske
QUOTE(julesh @ Sep 18 2005, 08:51 AM)
Query: why?  MP2 is a perfectly acceptable codec for DVDs.

Where I'm located, in region 1, MP2 audio is only acceptable on secondary tracks, the primary track must be AC3. Some players will play a primary MP2 track but not all will (including one JVC I have). I can't say I like it but it's what I'm stuck with.

QUOTE
Another query: why are you demultiplexing & remultiplexing the files?  The same results ought to be achieved with, and will take substantially less time, as for a full DVD's worth of video, approximately 9GB of file I/O time is saved:

ffmpeg -i orig.mpg -target dvd -ab 256 -ar 48000 -ac 2 -acodec ac3 -vcodec copy -y final_ac3.mpg

I'm not very experienced with ffmpeg, that was me being foolish. I thought there should be a way to do it all within ffmpeg but hadn't had time to fully read up on it.

QUOTE
On the subject of your original question, I'm not sure about compression but you can apply gain by using ffmpeg's "-vol" option.  Try "-vol 384", for example.

Thanks! I doubt that the compression was very helpful in this case so that shouldn't be a problem. Do you know what the scale/unit is for the -vol switch? Is it percent or some arbitrary scale?
julesh
QUOTE(Ben Franske @ Sep 18 2005, 05:49 PM)
QUOTE(julesh @ Sep 18 2005, 08:51 AM)
Query: why?  MP2 is a perfectly acceptable codec for DVDs.

Thanks! I doubt that the compression was very helpful in this case so that shouldn't be a problem. Do you know what the scale/unit is for the -vol switch? Is it percent or some arbitrary scale?


256 is no change; I believe the scale is linear.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.