On 15/06/07, <b class="gmail_sendername">Bill</b> &lt;<a href="mailto:level42@sympatico.ca">level42@sympatico.ca</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ok now I&#39;m confused. I decided to look at the frame counting on the playback<br>side first, since the decode is already been done, its a little easier to<br>get started and familar with the code.&nbsp;&nbsp;But it looks it me like the frame
<br>counting is ok on playback; its incremented only after a successful decode<br>and anyway, av_read_frame performs some partial parsing and is suppose to<br>return only complete video frames.<br><br>So I ran a test based on a tutorial using ffmeg at
<br><a href="http://dranger.com/ffmpeg/tutorial01.html">http://dranger.com/ffmpeg/tutorial01.html</a> to count the frames of a file I<br>have problems with.&nbsp;&nbsp;Since the tutorial should be doing frame accurate<br>counting, I thought it would give different numbers than mythtv, but it
<br>didn&#39;t.&nbsp;&nbsp;So what am I missing?????<br><br>Here&#39;s the facts, the last value in the filemarkup position map for the mpeg<br>is 148891.&nbsp;&nbsp;Due to the way mythtv generates the position map this is not<br>quite the end of the file, but close, close enough.&nbsp;&nbsp;As the position map is
<br>generated using calls to av_read_frame in mythtv, the frame counting for the<br>position map is correct.<br><br>My tutorial based test file gives 148903 total frames, similar to mythtv, so<br>mythtv is counting frames ok on playback.&nbsp;&nbsp;The mpeg header reported by
<br>dump_format is 1:42:23 for length and 29.97 for frame rate. The length<br>calculated by Mythtv is 148891 / 29.97 = 1:22:48 which is too short.&nbsp;&nbsp;The<br>actual play time by Mythtv is 1:42, but the OSD will show the 1:22 time.
<br><br>What am I missing for this problem?&nbsp;&nbsp;I checked the repeat_pic field in<br>AVFrame (I think it is); this is not the problem.&nbsp;&nbsp;It is almost as if the<br>actual frame rate is 24, or the frame rate is not constant or for DVB
<br>broadcast they are playing some other tricks to save bandwidth.</blockquote><div><br>Is the mpeg telecined (ie the stream frame rate is marked as 29.97 fields per second, but only 23.97 are actually transmitted)? - check if the repeat_first_field flag is set on every other frame.
<br><br>Ian<br></div><br></div><br>