[mythtv] [RFC] AvFormatDecoder Improvements.
Kenneth Aafløy
ke-aa at frisurf.no
Mon Nov 10 14:28:54 EST 2003
On Mon, 2003-11-10 at 14:20, Doug Larrick wrote:
> 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.
Lovely, I'm just holding off a bit, as there has been a boatload of
useful additions to ffmpeg cvs, which I want to have a look at before
choosing a good aproach.
Kenneth
More information about the mythtv-dev
mailing list