[MEncoder-users] A/V sync issues with separately encoded streams

Andrew Berg bahamutzero8825 at gmail.com
Sun May 24 11:03:41 CEST 2009


Nicolas George wrote:
> To encode separately, I used two solutions:
>
> 	-oac lavc -lavcopts abitrate=32
>
> The encoding time is negligible compared to x264, and the size taken in the
> output file is really small also. Surprisingly, the output AVI file has
> completely wrong audio timestamps, but remuxing just the video works fine.
>
> 	-oac pcm -of rawvideo
>
> mencoder decodes the audio, encodes it in the trivial codec, and then
> ignores it. The resulting elementary H.264 stream can be muxed, it seems to
> work. I only used this technique recently, I do not know if it is completely
> reliable.
I was wrong initially. Using -ovc copy gives the same result as both of
those - out of sync, but not as much. It makes no difference whether I
have FFmpeg use the new AVI file or the original VOB (using -oac copy
obviously). The AVI file is in sync, but after I convert the audio, the
new MP4 file is not. I think I need to have MEncoder process audio as
well, but unfortunately, I cannot get it to output to a format that
neroaacenc likes (fortunately, I can get around that "Video stream
mandatory!" message by using -of rawaudio -ovc copy). Any idea how I can
get MEncoder to effectively ignore the video and decode the audio into a
format that neroaacenc will take?

ffmpeg -i test.vob -vn -f wav -ac 2 -ar 48000 - | neroaacenc
-ignorelength -q 0.25 -if - -of test.m4a

works (i.e. neroaacenc will accept the input), but the following do not:

mencoder test.vob -msglevel mencoder=1:statusline=5 -of rawaudio -oac
pcm -channels 2 -srate 48000 -ovc copy -o - | neroaacenc -ignorelength
-q 0.25 -if - -of test.m4a
mencoder test.vob -msglevel mencoder=1:statusline=5 -of rawaudio -oac
lavc -lavcopts acodec=adpcm_ima_wav -channels 2 -srate 48000 -ovc copy
-o - | neroaacenc -ignorelength -q 0.25 -if - -of test.m4a
mencoder test.vob -msglevel mencoder=1:statusline=5 -of rawaudio -oac
lavc -lavcopts acodec=pcm_s16le -channels 2 -srate 48000 -ovc copy -o -
| neroaacenc -ignorelength -q 0.25 -if - -of test.m4a

I would like to avoid writing an uncompressed audio stream to disk. The
help for neroaacenc says "The file must be in Microsoft WAV format and
contain PCM data."



I could provide a clip from the AVI file if that would help.


More information about the MEncoder-users mailing list