[MEncoder-users] Reencoding mjpeg from Pana TZ10/SZ7 offsets sound from video

Marc MERLIN marc_mplayer at merlins.org
Thu Aug 25 19:40:07 CEST 2011


I have my Panasonic TZ10 record videos as MJPEG since mplayer does not deal
well with the H264 video that the camera creates.

It can play its MJPEG MOVs just fine, but when I reencode them to something
more efficient, the video and audio get out of sync.
I tried encoding to h264, xvid, and divx and the result is the same: sound
and video get offset.

This has happened with multiple mencoder versoin up to 
MEncoder 1.0rc4-4.4.5 (C) 2000-2010 MPlayer Team

I use this script (portion below) to encode. Are there other command line
options I should give, or one I should change to get sound and video synchronized?

Example:
http://marc.merlins.org/tmp/vid/p1080047.mov (original)
http://marc.merlins.org/tmp/vid/p1080047.mov_divx.avi (encoding #1)
http://marc.merlins.org/tmp/vid/p1080047.mov_h264.avi (encoding #2)

Thanks,
Marc

vf="-vf kerndeint"
if [ "$codec" = xvid ]; then
    nice -19 mencoder -oac mp3lame -lameopts mode=3:abr:br=$abr $time $vf -ovc xvid -xvidencopts bitrate=$br $rot -o "$dest" "$src"
else
    pass="$dest".pass
    for i in 1 2
    do
	echo "DOING $codec PASS $i"
	echo "------------------"
	if [ "$codec" = h264 ]; then
	    #vf=$vf,dsize=4/3,scale
	    vf=$vf,scale
	    nice -19 mencoder -passlogfile "$pass" -oac mp3lame -lameopts mode=3:abr:br=$abr $time $vf -ovc x264 -x264encopts bitrate=$br:turbo=1:pass=1:threads=0 $rot -o "$dest" "$src" || die "multipass failed on pass $i"
	elif [ "$codec" = divx ]; then
	    nice -19 mencoder -passlogfile "$pass" -oac mp3lame -lameopts mode=3:abr:br=$abr $time $vf -ovc lavc -lavcopts vcodec=mpeg4:vhq:trell=yes:v4mv=yes:vbitrate=$br:vpass=$i -ffourcc DX50 $rot -o "$dest" "$src" || die "multipass failed on pass $i"
	fi
    done
    /bin/rm $pass *.pass.mbtree &>/dev/null
fi


-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  


More information about the MEncoder-users mailing list