[mythtv] h264 recordings showing double length - counting fields rather than frames?

Mark Buechler mark.buechler at gmail.com
Mon May 12 18:01:13 UTC 2008

Yes, another "double length" thread. This time I think the problem is a bit

I have several channels all coded in h264 interlaced. MythTV shows these
recordings as being double length. In poking around, I found that in
DTVRecorder::FindH264Keyframes(), _frames_seen_count is incrementing double
what it should (~60) given the content is only 30 fps. It was suggested on
#mythtv that we're counting fields rather than frames here.

So next I poked around in mpeg/h264utils.cpp in
KeyframeSequencer::KeyframePredicate() and looked at the h264 spec and found
that NAL type SEI should tell us whether or not the content is interlaced. I
don't know if parsing each SLICE NAL is what's required here or simply
looking at the ct_type in the SEI to determine if the stream is interlaced
and, if it is, skip every other SLICE (sounds hackish).

I'm really not familiar with h264 so I'm looking for suggestions and/or
sample code or maybe a sanity check on what I've found.

Thanks, Mark.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-dev/attachments/20080512/0c36d2ab/attachment.htm 

More information about the mythtv-dev mailing list