[mythtv-users] convert recordings to h264

Ian Barton lists at manor-farm.org
Thu Dec 10 14:54:05 UTC 2009

Adam Skinner wrote:
> Hi list. 
> I've been trying to convert my myth recordings to H.264 suitable for
> playing on an android phone. Im currently using ffmpeg to convert the
> videos using a recent svn version of both ffmpeg and x264. 
> Videos do convert - but Im having trouble with AV sync on 40% of them. I
> think its because some of my recordings from UK DVB-T have reception
> problems. Myth TV handles the AV Sync fine for these recordings. (as its
> great)
> Im using a one pass encoding in a script setup as a user job with
> settings like:
> ffmpeg -v 0  -i "${directory}/${file}"  -acodec libfaac -ab 64k -ac 1 -s  ${width}x${height} -r 12 -vcodec libx264 -vpre hq -vpre ipod320 -b 250K -bt 288K -metadata "title=${title}" -threads 0 -f ipod "${directory}/android_tmp/${file}.mp4"
> Would a two pass encoding help my AV sync problems? 
> File size and/or quality isn't that important. AV sync is.
> Also can anyone please recommend a good setting for ffmpeg for two pass
> encoding thats pretty quick. 
I think the problem you are seeing is because the Myth audio and video 
are slightly out of sync. Editing and transcoding the file without first 
fixing the sync error makes this worse.

You need to do a lossless transcode first before converting to h264. 
Something like:

/usr/bin/mythtranscode --showprogress --honorcutlist --mpeg2 -c 
channelid -s starttime -o outfile.mpg

I have a python script that converts files to h264. It does commercial 
cutting and a lossless transcode first. I run it as a user job. I can pt 
it up on github if you think it might be useful.


More information about the mythtv-users mailing list