[mythtvnz] Cutting H.264 DVB-T files with ffmpeg without transcoding

David Moore dmoo1790 at ihug.co.nz
Mon Jul 26 09:24:48 BST 2010


Hi folks. I have posted a very raw version of a script called mythcutnz 
at git://gist.github.com/490296.git or http://gist.github.com/490296. If 
you want to try it I suggest you use recordings you don't mind losing or 
back up the recording before you run the script. You'll still have 
issues with the seek table if you go back to a backup but that can be 
fixed with mythtranscode and some sql.

Please read the help/usage text before you try it.

As Jeremy Clarkson says "how hard can it be"? Well harder than I 
initially thought because:

- Frames to time conversion needs either divide by 25 or divide by 50 
depending on channel. Not a lot of testing so far but I'm using the 
"tbc" parameter reported by ffmpeg to work this out. Might not work on 
all channels.

- Mythcommflag has never worked well for me and threw a bunch of 
database errors when I tested it so I used mythtranscode for rebuilding 
the seek table. However it (or the ffmpeg code it uses) seems to double 
the real frame numbers. There seems to be a connection between the seek 
table and myth's timeline when playing/editing a recording. This caused 
weirdness like the recording magically doubling in length. Fixed (maybe) 
by updating the frame numbers with sql.

- &%#$! vlc threw a spurious error about a missing codec when actually 
it was a missing codec parameter.

For speedy testing use a recording with an AC3 audio track (only TV3 
AFAIK) otherwise the whole recording has to be transcoded with vlc 
before cutting starts. Or use a short recording without AC3 audio.

I haven't actually run the script as a user job yet. Just tested from 
the command line. Probably needs a bit of sql to add to the myth job 
queue before running as a user job.



More information about the mythtvnz mailing list