[mythtv] [DVB] Broken keyframe detection

William Uther willu.mailingLists at cse.unsw.edu.au
Mon Mar 21 22:47:51 UTC 2005


On Mon, 21 Mar 2005 14:20:20 +0100, Jesper Sörensen wrote:

> William Uther wrote:
>
>> My current working theory is that the TS recording code has a very
>> simple parser in it to detect frames, and this parser is simply not
>> detecting all the frames.  Does this sound plausible?  I know very
>> little about MPEG.  How would I go about checking this?
>
>
> I don't know exactly how the keyframe detection works, but I can tell
> you this: PS & TS uses different (although very similar) code for
> keyframe detection so it fits with the problem description. As you know
> the TS keyframe stuff is in dtvrec

Yup.

> while the PS keyframe stuff is in LocalProcessData (IIRC) in dvbrec.

Hadn't tracked that down yet.  Thanks for the pointer.

>> This suggested that using mythcommflag to re-build the seek table
>> might be a work-around.  It seems to get frames by playing the video,
>> and seeing as normal playback can count frames ok (it is the recorder
>> that is broken), this might fix things.  As has already been noted on
>> this list, it doesn't seem to fix the problem.  I haven't started
>> looking into why.
>
> Which keyframe detection code is used when rebuilding the index? That
> might be "broken" too...

Good thought.  I'll try and track it down.

> It seems we have this code duplicated in
> several places in myth (some kind of keyframe stuff is in
> mpegrecorder/recorderbase too).
>
> If you look at the differences between the PS/TS code you might be able
> to figure out what's causing your problems? In the long run it would be
> nice to merge all the keyframe code though (move it to recorderbase?),
> or at least the TS/PS stuff, although that might be a little more work?

Okie - I don't have MPEG specs yet...  est. 3 days till the dead trees 
come in.

I'll see if I can spot the difference between TS recording and TS 
playback frame detection.  I had been waiting to look at this PCR PID 
thing.

I'm not sure that it is 'key'frame detection that is broken.  It is the 
frames between the key frames that aren't being counted.  That is also 
why I had an interest in the 'keyframedist' variable 
DecoderBase::SyncPositionMap().

> BTW, there is a little on the PES header (which I believe is what's
> scanned in the keyframe detector) in the MPEG spec if you want to read
> up. I've read some of it but unfortunately it's not that easy. :-(

I'll take a look when I get the spec.

Thanks for the input.

Will        :-}

--
Dr William Uther                           National ICT Australia
Phone: +61 2 9385 6357               Computer Science and Engineering
Email: willu at cse.unsw.edu.au          University of New South Wales
Web: http://www.cse.unsw.edu.au/~willu/     Sydney, Australia



More information about the mythtv-dev mailing list