[MEncoder-users] AAC encoding

Olivier Rolland billl at users.sf.net
Mon Jan 29 20:38:10 CET 2007


Hi,

I'm trying to mux an AAC audio stream and a X264 video stream into an
AVI container. The audio file has been extracted in PCM from a DVD and
encoded in AAC with faac. The video file has been encoded directly
from the DVD:

$ mplayer -mc 0 -vc null -vo null -ao
pcm:fast:nowaveheader:file=audio.wav -aid 129 dvd://1
$ faac -P -R 48000 -q 157 -C 2 -X --mpeg-vers 4 -o audio.aac audio.wav
$ mencoder -mc 0 -oac pcm -channels 1 -srate 4000 -aid 129 -sws 7 -vf
crop=720:416:0:80,scale=464:192,hqdn3d=2:1:2,harddup -ovc x264
-x264encopts subq=5:b_pyramid:weight_b:8x8dct:frameref=2:turbo=1:bitrate=549
-o video.avi dvd://1

If I play both files with mplayer, they are perfectly in sync:

$ mplayer -audiofile audio.aac video.avi

However, I'm having problems when I want to mux them together in AVI.
First, I must add -audio-demuxer aac -fafmttag 0x706D in order for
mencoder to correclty identify the audio file (this was not needed
with mplayer). Second, the resulting file is always out of sync. I've
tried all combinations of -mc 0 and -noskip with no avail. I've also
played with faac options (-r, -w, --mpeg-vers) but this doesn't help
either and can even be worse with -w: the audio file is never demuxed
by "mencoder --audiofile" whatever the audio-demuxer even though it is
perfectly demuxed by "mplayer --audiofile".

$ mencoder -nosound -noskip -mc 0 -ovc copy -oac copy -o movie.avi
-audiofile audio.aac -audio-demuxer aac -fafmttag 0x706D video.avi

I've then tried to merge in MP4 with no better result.

Any idea ?

Thanks,

Olivier



More information about the MEncoder-users mailing list