[mythtv-users] Auto-transcode to x264 and update MythTV database along the way

Tom Hayward esarfl at gmail.com
Fri Dec 9 00:45:28 UTC 2011


On Thu, Dec 8, 2011 at 16:58, Robert Waldner <waldner at waldner.priv.at> wrote:
>
> Aloha,
>
> after looking through Google search results for quite some time, I
>  can't find exactly what I'm looking for. Now, before I write it myself
>  ... maybe someone already did, and I just didn't use the right keywords
>  when searching.
>
> What I'm looking for is a script that:
>  - does the mythcommflag dance
>  - runs HandBrakeCLI to transcode to x264 in a way that won't actually
>   *cut* the commercials, just flag start/end with chapter markers
>  - puts the result in an MKV container
>  - in a prettified directory structure (like Title/Episode)
>  - deletes the original file
>  - updates the MythTV DB so that it points to the MKV file instead of
>   the original
>  - while retaining the original meta-data
>
> Any hints?

My first thought is that you probably want to run mythcommflag *after*
transcoding to x264 if you're not planning to cut the commercials.
This will make sure all of the seek points line up with the mkv, not
the original mpg.

I don't see a need to complicate things with handbrake when ffmpeg
will do the job. I just took one of my UserJobs and adapted it for
your requirements. I didn't test it after making the changes, so I'll
leave that up to you (you might want to comment out the rm commands
before testing). This script should get you started, even if it's not
exactly what you want. Here it is:

https://gist.github.com/1449482

That script is adapted from one found here:

http://eternalvoid.net/tutorials/mythtv-autotranscode/

You'll probably want to read up on each of the commands used in the
script so that you know what's happening:

http://www.mythtv.org/wiki/Mythcommflag
http://www.mythtv.org/wiki/Mythtranscode

This script was designed for 1080i and 720p content. You will want to
change the scaling if you have lower resolution content. I like to
test my UserJobs by making short live-tv recordings of shows I don't
care about. This keeps encoding time to a minimum and doesn't risk
deleting an important recording.

Tom


More information about the mythtv-users mailing list