[mythtv] NuppelVideo format, keyframes, and the cutlist

Geoffrey Hausheer ou401cru02 at sneakemail.com
Tue Jun 17 23:48:07 EDT 2003


Well, the simplest solution of those I came up with seems to be to add a
new frame-type to the nuv format.  

Here is a patch (untested, and incomplete) of what I am thinking.

The new keyFrameAdjustMap is based on positionMap.  Anytime a cut
happens, the subsequent key frame is tagged with an adjustment, which is
the discrepency between the actual frame number and the next expected
keyframe number.

The current implementation incrementally adjusts the keyframes (so the
adjust value can never be larger than 30), but perhaps it would be better
to keep the absolute adjustment.

If this isn't clear take the following example:
'#' denotes a key frame:
'b' denotes the begining of a cut section
'e' denotes the end of a cut section
(the example assumes key frames occur every 10 frames)

original file:
1---------2---b-----3---------4-----e---5---------6
cut file (no key adjustment done)
1---------2---x--5---------6
(a new key frame is added at 'x' since it is a sudden scene change)
the frames now get renumbered as:
1---------2---3--4---------5
and the key-adjust map contains:
key : adjustment
3   : 6 (frame 3 is 10 - 6 frames from frame 2)
4   : 7 (frame 4 is 10 - 7 frames from frame 3)

I hope that sort of makes sense.  Note that the whole point here is to
not have key-frames equally spaced, since that would require reencoding
everything after the 'e' frame.  This way, I only need to reencode from
'x' to 5.

This new map-frame (kfa) is optional and maintains backwards
compatability.  The new 'kfa' frame can only exist if the positionMap is
stored in the nuv (i.e. the recording needs to be completed), which
should be acceptable.  It is also only valid for mpeg4/rtjpeg files,
which should be okay too, since we can't write  mpeg2.

Anyhow, this patch should let me implement the ability to remove all
frames marked in the cutlist without reencoding the entire file.  I have
only implemented the decoder portion so far, so the actual writing of the
map isn't done yet (and I haven't actually started on the reencode file
portion).  However, FastForward/rewind/seek should all theoretically work
correctly.

comments are appreciated, and if someone thinks this is the wrong way to
go, I'd appreciate the say-so, so I don't spend too much time on it.

once again, this patch is only to give an idea of what I am doing.  It
almost certainly won't work as is, and is not ready for including in
myth.

.Geoff
-- 
  Geoffrey Hausheer
  XXXXXXXXXXXXXXXXXXXXX
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keyadjust1.patch
Type: application/unknown
Size: 9069 bytes
Desc: not available
Url : http://lists.snowman.net/pipermail/mythtv-dev/attachments/20030617/820e4c32/keyadjust1.bin


More information about the mythtv-dev mailing list