I've been around the houses on this for some time, so I thought I'd see if anyone else has a foolproof method of processing their files.
I used to use .mkv as the target tvheadend recording format, because mkvmerge could chop those up nicely. But I dropped that last year in favour of .ts due to audio problems (e.g. where audio switched from a stereo continuity announcement to 5.1 during the main programme).
Unfortunately, .ts files won't chop neatly in mkvmerge because of errors, so I tried ProjectX and a couple of other things before landing on re-encoding completely in Handbrake. It marginally shrinks the files (HD H.264) but produces something that mkvmerge can slice up (I've never got on with HB's encode from... to... settings to trim while encoding).
Downside 1: It takes f-o-r-e-v-e-r. Even on a quad-core i5, I'm spending up to 8 hours to re-encode a film. Utter nonsense.
Downside 2: HB uses x264, which defaults to a GOP of 250ish. That means 5-second accuracy on a 50Hz file, and that makes for ugly cutting. Yes, I can increase the I-frame frequency (e.g. keyint=25:min-keyint=13 to give half-second accuracy) but (a) the files now obviously get bigger and (b) the encoding takes even longer.
So, I've lurched back to avidemux (having stumbled on the way through ffmpeg, mencoder, mplayer...). Avidemux always used to have issues with MPEG-4 so I abandoned it when I moved off MPEG-2 - but a clean compile of 2.6.7 today seems to work well.
So I can:
1. Record on tvheadend
2. Load into avidemux
3. Trim pre- and post-amble (commercials in the middle TBD)
4. Copy the salient streams (e.g. dropping AD audio) and remux into .mkv or .ts
5. Leave the bloody thing alone and stop wasting my life fiddling with video files
I can't see any pros and cons of .ts versus .mkv here, so I'll stick with .mkv as the seeking is probably better supported. I initially tried .avi (avidemux's default) but that was a disaster in VLC and Parole - I don't think H.264 and .avi play nicely together.
Thoughts or comments? Any blow-you-away suggestions or improvements?
(Yes, I've tried comskip - Windows and Linux - but it struggles to identify most ad breaks and I end up tuning/doing the cut list by hand; yes, I genuinely do like to cut out the fluff and have a programme that starts where it should, end where it should, and doesn't need skipping around in the middle. Take those as for read :-) )