[mythtv-users] Lossless Cut and keyframe cuts off
blm-ubunet at slingshot.co.nz
Wed Nov 14 19:37:50 UTC 2012
On Wed, 2012-11-14 at 02:28 -0500, Ian Evans wrote:
> On Mon, Nov 12, 2012 at 8:23 PM, Ian Evans <dheianevans at gmail.com> wrote:
> > Running the latest lossless cut and noticed the last few times that I
> > did cuts (after running the keyframe adjust script) that it would cut
> > a second or two earlier than the keyframe I had chosen. Just noticed
> > this in the last few days.
> > Anyone else?
> Did a further test today. Recorded the NBC Nightly News, ran the
> keyframe adjust and then edited the show. Went to the end and did a
> single cut, Cut to End. It was the next keyframe after the anchor says
> "I'm Brian Williams". The next keyframe after he says that was an NYC
> shot. Did the Cut to end there and ran the Lossless_Cut script.
> When I looked at the show after the script ran it cut off about a
> second or so before the cut at "I'm Brian..." cutting off the
> I noticed this earlier this weekend on SNL. Did a cut in a black
> keyframe, but got the last second of the previous sketch. I didn't
> have this issue when I used Myth's mpeg2 transcode, but as a few of us
> have reported, that hasn't worked for me since moving to .26.
> I can't say for sure but I'm pretty certain this has just crept into
> the lossless_cut script as I don't recall the problem with the alpha.
There could be several causes for this..I have no experience with mpeg2
recordings but have spent months playing with cut-lists & dd based
1. The cut-list editor is misleading with H264 video recordings
(mpeg2-ts from dvb-t). H264 uses out-of-order frames & keyframes can be
2 sec apart & can even be intra-refresh B frames.
Mpeg2 uses out of order frames as well.
For example a recording with first keyframe at frame =24.
The editor shows a valid picture at frames that it can not (before the
The editor can not frame advance from frame 1 (not wrong) but there is
no possible image.
The editor seems to display the picture created by the first possible
returned decoded frame. It seems to stuff as many frames in until the
decoder returns anything. So the editor shows an image from 1 frame to
20+ frames in advance of the current time.
This results in cut-list offset error.
A possible explanation is that ffmpeg decoder only returns decoded
frames when "enough" frames are passed to it. With out-of-order
encoding, this can be of the order of 1 sec (25+ frames)..
2. mkvmerge cut points are at the keyframe immediately preceding the cut
3. could be bug in lossless_cut keyframe adjust..moving the wrong way..
Possibly setting the tuner to start on a sequence header might help
reduce the offset error.
I have not tried this.
More information about the mythtv-users