[mythtv] [RFC] AvFormatDecoder Improvements.

Doug Larrick doug at ties.org
Mon Nov 10 08:20:20 EST 2003


On 11/10/03 04:43:00, Kenneth Aafløy wrote:

> In AvFormatDecoder and the Recorders in MythTV there is code to
> generate a map of where keyframes in the recording is bytewise.  
> Although the concept of storing the keyframe locations for speeding  
> up seeking is a very good idea, I see some problems with files that  
> have a variable keyframe distance. When a clip with variable keyframe  
> distance is recorded and the keyframe locations are stored in the  
> database, the code 'frames / keyframedist' will cause random  
> overwrites when the keyframe distance changes. I propose (and are  
> willing to code as soon as the DVB code is done with) a change, so  
> that the key to positionMap will only be based on the frame number.  
> And that when doing seeking a search for the closest keyframe to the  
> frame requested will be performed.

I support this change, as HDTV streams have the exact same problem.  A  
couple comments:

* You'll need to store (or deduce) the recording's duration somehow.   
Right now it's computed based on # of keyframes * keyframe distance.
* For compatibility with old recordings, you'd need a converter, or to  
recognize and process the old-style marks (not so hard if you notice  
you're really far off from where you think you should be), or switch to  
a new recordedmarkup type.
* Some HDTV streams don't have traditional keyframes, or at least  
they're not marked as GOP in the TS headers (could be a "rolling  
keyframe" where only some of the macroblocks are "I" in each frame).  I  
guess these would fall into the "no markup" category.

There is definitely code in avformatdecoder to play streams without  
keyframes at all, though I have no idea how robust it is.  Care to  
describe your proposed approach for seeking without the positionMap?

I'm also willing to help with this.

-Doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20031110/1c5eeff3/attachment.pgp


More information about the mythtv-dev mailing list