[MEncoder-users] mencoder concatenation warps audio out of sync
mencoder at perlmeister.com
mencoder at perlmeister.com
Sat Nov 7 03:07:06 CET 2009
On Fri, 6 Nov 2009, Reimar Döffinger wrote:
> Probably copying sample_size*channels*sample_rate*desired_duration
> bytes from /dev/null and using the -rawaudio stuff. ... First step
> as above and use -audiofile -audio-demuxer rawaudio -rawaudio ....
Unfortunately, that doesn't work either:
With sample_size=1, channels=1, sample_rate=8000, duration=2s, here's
a file with 16,000 zero bytes, silence.dat:
dd if=/dev/zero of=silence.dat bs=1 count=16000
With your suggestion, let's add the silence to the JPEG movie:
mencoder 'mf:///tmp/*.jpg' -mf fps=30 -o titleraw.avi \
-audiofile silence.dat -audio-demuxer rawaudio -rawaudio \
channels=1:rate=8000:samplesize=1:bitrate=64:format=0x0000 -oac \
copy -ovc lavc -lavcopts vcodec=mjpeg:vbitrate=1000
Out comes titleraw.avi with
AUDIO: 8000 Hz, 1 ch, u8, 64.0 kbit/100.00% (ratio: 8000->8000)
VIDEO: [MJPG] 160x120 24bpp 30.000 fps 349.9 kbps (42.7 kbyte/s)
and it plays approximately 2 secs both with and without -novideo.
But if you listen in on
http://perlmeister.com/tmp/titleraw.avi
you can hear two loud cracks at the beginning and at the end.
And what's worse is that mencoder now refuses to concatenate the
two videos:
mencoder titleraw.avi soundtest.avi -ovc copy -oac copy -o outraw.avi
All files must have identical audio codec and format for -oac copy.
Exiting ...
and if I force a reencoding of both audio and video with
mencoder titleraw.avi soundtest.avi -ovc lavc -lavcopts \
vcodec=mjpeg:vbitrate=1000 -oac mp3lame -o outraw.avi
you can hear at
http://perlmeister.com/tmp/outraw.avi
that the sound syncronisation in the 2nd part is way off on the 2nd
click and you get a bunch of "Cannot sync MAD frame" errors at the end.
-- Mike
Mike Schilli
More information about the MEncoder-users
mailing list