[mythtv-users] Lossless Cut (mythcommflag vs mythtranscode)

HP-mini blm-ubunet at slingshot.co.nz
Tue May 7 19:35:32 UTC 2013


On Tue, 2013-05-07 at 06:49 -0400, Doug Vaughan wrote:
> Angela,
>      Here is some information about how the Lossless Cut scripts work 
> with MythTV's seektable.
> 
> 1) The seektable is used to estimate the excact time (duration) into the 
> video where a cut should start or end. (seektable keyframe * frames per 
> second).
> 2) The calculated cut point in time (HH:MM:SS.nnnnnnnnn) is passed to 
> mkvmergeduring the cut process. mkvmerge itself determines the nearest 
> actual keyframe in the video source correspondingto the given time and 
> makes the cut.
> 
> If there is any inaccuracy between the datain the seektable and/or how 
> mkvmerge interrupts the video source the cut pointwill be inaccurate. In 
> a large way theLossless Cut scripts are a major hack but it was the only 
> way I found, when the scripts where written, to utilize Myth's 
> commflagging, cutlist editor and creating lossless cut recordings for a 
> HDPVR recording device.
> 
> It was pure happenstance that the scripts worked with recordings made by 
> other recording devices.The accuracyof the lossless cuts points will 
> only get better if mkvmerge improvesbut the fact a translation between 
> MythTV's data and mkvmerge's own keyframe determination means it will 
> never be perfect. For example, mkvmergecannotaccurately handle variable 
> bit rate recordings (e.g. HDHomerun). That eliminates a whole series of 
> recording devices.
> 
> Doug
> 

The new millisec duration data in the seektable is meant to help solve
the problem of changing framerate. If this is done right (in mythtv)
then you have the exact time cut-points for mkvmerge or ffmpeg.

The recorded seektable & the mythcommflag --rebuild & ffmpeg can be made
to match see ticket 11435.
My cutting script (byte/packet offset based) yields frame accurate cuts.
The byte offset is from file start & not any assumed packet type.

A possible remaining issue is the start time of a file is it audio or
video PTS. The mkvtoolnix author stated time starts on the lowest first
valid PTS & that's going to be audio in a TS stream. This time delta is
typ 1-3 sec or very likely about 3-4 keyframes offset..


Because mkvtoolnix does not support LATM-AAC & mythtv does not support
seektables in .mkv files ...I haven't tried LosslessCut after patches in
ticket 11435.

Brett



More information about the mythtv-users mailing list