A lot of people have been running into a/v sync problems with .avi's
on the Creative Zen mp3 player, including myself. I didn't want to
resort to Windows and the wmv format, so I came up with a brute force
method using transcode.
For some reason, the zen plays .avi video slightly faster than the
audio, so you get a linear drift. Lots of people have come up with
various tweaks that sometimes work, sometimes don't. The following
method has worked for me every time. I'm scaling the speed of the audio
channel. What you get is a video that loses a/v sync on every known
player BUT the Zen, but hey, who watches 320x240 video on the PC? The
magic scale factor for xvid .avi files seems to be 1.00015. That is, if
you speed up the audio by that amount, the audio stays in sync. I've
transcoded over a 3 hour film and the audio was still bang on at the
end, so that seems to be the correct number.
I used transcode v1.1.0 for all my tests. The original video was
either xvid .ogm or .avi, 24 fps. The target resolutions should be
either 320x240 (4:3), 320x176 (16:9), or 320x144 (1:2.25). But, in
practice I just use zoom (-Z) values to keep the exact same aspect ratio
of the input with X=320, then pad with -Y to get Y up to a multiple of 16.
Examples:
For an input .ogm file, 24 fps, 720x320:
ogmdemux -o t in.ogm
lame --decode t-a1.mp3 t.wav
sox t.wav tt.wav speed 1.00015
transcode \
-i t-v1.avi \
-p tt.wav \
-o out.avi \
-Z 320x142 \
-Y 0,0,-2,0 \
-w 975,50 \
-b 192,0,0 \
-E 44100 \
-y xvid,tcaud \
--progress_rate 25
It's a very similar operation for input .avi files, but instead of
demuxing an .ogm, I just use transcode to pull out the .mp3 track.
Lets say the input is 720x384, 24 fps:
transcode -i in.avi -y null,raw -P 1 -m t.mp3
lame --decode t.mp3 t.wav
sox t.wav tt.wav speed 1.00015
transcode \
-i in.avi \
-p tt.wav \
-o out.avi \
-Z 320x172 \
-Y -2,0,-2,0 \
-w 975,50 \
-b 192,0,0 \
-E 44100 \
-y xvid,tcaud \
--progress_rate 25
So, you get good quality video and 192k mp3. I think the sound is one
of the Zen's best features, so why over compress? I use gnomad2 to copy
the .avi's onto the Zen. It correctly supplies the metadata the Zen
expects so that you can fast forward and rewind.
Allan
ps: Here's my toolset:
2.6.27-gentoo-r8
media-sound/ogmtools-1.5
with media-libs/libogg-1.1.2 (downgraded from 1.1.3)
media-sound/lame-3.98.2
media-sound/sox-14.2.0
media-video/transcode (1.1.0 installed from tar)
(gentoo still hasn't picked up 1.1.0 yet... Hmpf)
media-sound/gnomad-2.9.2