[mythtv] [DVB] Broken keyframe detection (was: Incorrect frame
counts)
Jesper Sörensen
jesper at datapartner.se
Mon Mar 21 13:20:20 UTC 2005
William Uther wrote:
> The broken channels look like this:
>
> 2005-03-12 14:59:19.386 GOP sc(28) wc(27) lgop(27) lseq(0)
> 2005-03-12 14:59:19.386 all sc(29) wc(28) lgop(28) lseq(0)
> 2005-03-12 14:59:19.866 GOP sc(29) wc(28) lgop(28) lseq(0)
> 2005-03-12 14:59:19.866 all sc(30) wc(29) lgop(29) lseq(0)
> 2005-03-12 14:59:20.354 GOP sc(30) wc(29) lgop(29) lseq(0)
> 2005-03-12 14:59:20.393 all sc(31) wc(30) lgop(30) lseq(0)
> 2005-03-12 14:59:20.824 GOP sc(31) wc(30) lgop(30) lseq(0)
> 2005-03-12 14:59:20.824 all sc(32) wc(31) lgop(31) lseq(0)
>
> Only one picture frame for each key frame.
>
> Is it possible that there are other picture frames, undetected by
> FindKeyframes(), that the player is picking up?
Yes, there is definitely something fishy going on there. Only four
frames per second...
> 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 while the PS keyframe stuff is in
LocalProcessData (IIRC) in dvbrec.
> 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... 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?
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. :-(
More information about the mythtv-dev
mailing list