[mythtv-users] anyone h.264 transcoding? want to share your magic?

Peter Bennett (cats22) cats22 at comcast.net
Sun Feb 15 22:35:54 UTC 2015


On 02/15/2015 03:50 PM, Brian J. Murrell wrote:
> Hi,
>
> So, I've decided that I want to post-recording transcode to h.264 with
> ffmpeg.  I wonder if anyone has any reasonable SD resolution ffpmeg
> command lines for such that they have found to be reasonable and produce
> files that mythtv will play.
>
> My first two samples went OK.  In my third sample, I managed to create a
> file that mythtv chokes on about 14 mins into a 60 minute recording.
> Mplayer plays it just fine.  When hitting the fail point, mythavtest
> would stop playing, bring up the recording finished menu and emit the
> following error repeated many times:
>
> 2015-02-15 14:58:21.336504 E  decoding error
> 			eno: Unknown error 541478725 (541478725)
>
> I of course tried rebuilding the seek table with "mythcommflag --rebuild
> --file ..." but that just made mythtv believe the file was only ~14
> minutes long.  mythcommflag produced the following output:
>
> 2015-02-15 15:00:39.748064 C  mythcommflag version: fixes/0.27 [v0.27.4-4-gb305eb5] www.mythtv.org
> 2015-02-15 15:00:39.748123 C  Qt version: compile: 4.8.1, runtime: 4.8.1
> MythTV Commercial Flagger, building seek table for:
>     The West Block
> Rebuild started at Sun Feb 15 15:00:40 2015
> No I-frames found, rewinding...
> Rebuild completed at Sun Feb 15 15:02:17 2015
> 2015-02-15 15:02:17.379780 E  decoding error
> 			eno: Unknown error 541478725 (541478725)
>
> I'm guessing it hit the same error and figured the file was only as long
> as it was able to read.
>
> So, I could continue mucking around with ffmpeg flags, but if somebody
> has already blazed this trail, I'd sure appreciate the fruits of your
> labour.
>
> FWIW, this is what I am using currently:
>
> ffmpeg -i /storage2/3093_20150215155900.mpg -y -map 0:0 -map 0:1 -er 4 -acodec libvo_aacenc -ac 2 -ab 128k -ar 44100 -deinterlace -vf crop=720:360:0:60 -vcodec libx264 -crf 18 -level 30 -g 90 -async 2 -threads 0 -v 0 /storage2/3093_20150215155900.mkv
>
> if somebody cares to critique/suggest alternate flags/switches.  ffmpeg version is:
>
> ffmpeg version 0.8.16-4:0.8.16-0ubuntu0.12.04.1, Copyright (c) 2000-2014 the Libav developers
>   built on Sep 16 2014 18:35:14 with gcc 4.6.3
>
> Cheers,
> b.
>
>

I believe handbrake is the best option. I have encoded hundreds of
recordings this way. Get the latest version from ppa
ppa:stebbins/handbrake-releases

    HandBrakeCLI  -i "$input" -o "$output" -f mkv -e x264 --x264-preset
faster --x264-profile high --x264-tune film  \
        -q 21  -E lame --ac 2 --ab 128 \
          -l 480 -X 852 \
        --decomb 

Peter


More information about the mythtv-users mailing list