PDA

View Full Version : trancecode 6h AAC to 6ch AC3?


GizmoDerMokwai
19th December 2006, 00:43
Hi Forum,
i'm in search of a way to get 6ch AAC (in MOV Container) transcoded to 6ch AC3. I'm getting some trailers from apple.com/trailers and wouldt like to watch them on my xvid/dvd player. for stereo audio i'm encoding with, eg:
mencoder -ofps 24 -nosound -vf scale=720:304 -ovc xvid -xvidencopts bitrate=1200:me_quality=6:vhq=4:quant_type=mpeg:chroma_me=0:chroma_opt=0:trellis=0:hq_ac=0:gmc=0:pass=1 -sws 2 -o /dev/null harry_potter_phoenix-tlr1_h1080p.mov
mencoder -ofps 24 -vf scale=720:304 -ovc xvid -xvidencopts bitrate=1200:me_quality=6:vhq=4:quant_type=mpeg:chroma_me=0:chroma_opt=0:trellis=0:hq_ac=0:gmc=0:pass=2 -sws 2 -oac mp3lame -lameopts vbr=2:q=3 -o Film.avi harry_potter_phoenix-tlr1_h1080p.mov

but there're also some trailers available featuring 6ch audio. watching them via mplayer is no problem, so decoding to mp3 via mencoder. is there a way to just transcode the stream to 6ch ac3 preserving each channel of the original aac file?

thanks in advance

r0lZ
19th December 2006, 08:56
I've tried to do that also (under windoze), without success so far.

A good AC3 encoder costs $, and the free or cheap ones are not able to encode the 6 channels, and even in stereo, the quality is horrible.

nm
20th December 2006, 23:03
A good AC3 encoder costs $, and the free or cheap ones are not able to encode the 6 channels, and even in stereo, the quality is horrible.
You are doing something wrong. The AC3 encoder in libavcodec is good enough for most purposes and is certainly capable of encoding all 5.1 channels.

r0lZ
20th December 2006, 23:23
Are you sure?

from wikipedia:
Implemented Audio Codecs
* Apple Lossless
* Cook Codec
* FLAC
* MP2
* MP3 (native decoder, encoding through LAME)
* Shorten
* QDM2
* RealAudio 1.0
* RealAudio 2.0
* Vorbis
* WavPack lossless audio decoder
* Windows Media Audio
I don't see AC3.

nm
21st December 2006, 10:37
Yes, it has for years: http://svn.mplayerhq.hu/ffmpeg/trunk/libavcodec/ac3enc.c?view=markup
The decoder uses liba52 (GPL instead of LGPL), which may be the reason it is not mentioned in Wikipedia. The same encoder is used in Ac3filter (http://ac3filter.net/) for realtime 6-channel encoding, so it is quite fast.

Also see the AC3 section in the Audio FAQ (http://forum.doom9.org/showthread.php?s=&threadid=68300#post424067), esp. question 2b.

As to the original question, you should be able to encode the audio with MEncoder directly:
mencoder -ofps 24 -vf scale=720:304 -lavcopts acodec=ac3:abitrate=448 -channels 6 -oac lavc -ovc xvid -xvidencopts bitrate=1200:me_quality=6:vhq=4:quant_type=mpeg:chroma_me=0:chroma_opt=0:trellis=0:hq_ac=0:gmc=0:pass=2 -sws 2 -o Film.avi harry_potter_phoenix-tlr1_h1080p.mov