[mythtv] pts values

Mark Spieth mark at digivation.com.au
Fri Sep 7 22:41:49 UTC 2018



On 8 September 2018 07:40:22 GMT+10:00, Peter Bennett <pb.mythtv at gmail.com> wrote:
>Regarding the clip that I recorded from ABC.
>
>https://www.dropbox.com/s/18psskmw79ujavf/interlace.mkv?dl=0
>
>Once the show gets underway, the predictor is regularly dropping
>frames, 
>although the frame rate is 50 (25 doubled) and the monitor refresh rate
>
>is 60. If I turn off the predictor by commenting the line where it is 
>enabled, the clip plays fine without dropping any frames.
>
>I captured the PTS values (before deinterlace) from the first 30 
>seconds. In 30 seconds, the FPS does this:
>
>201 frames at 25 fps
>15 frames at 30fps
>80 frames at 25fps
>25 frames at 30fps
>36 frames at 25fps
>159 frames at 30fps
>21 frames that seem to jiggle between 25 and 30 fps
>29 frames at 25fps
>29 frames at 30fps
>12 frames at 25fps
>40 frames at 30fps
>10 frames at 25fps
>18 frames at 30fps
>
>and so on.
>
>Eventually the main show starts and it goes to 25fps consistently.
>
>When it is 30fps the pts values go up by 33 or 34 milliseconds for each
>
>frame - which is perfectly correct
>
>When it is 25fps the pts values go up by 33 or 34 milliseconds 
>alternating with 50 milliseconds - this makes no sense to me at all,
>but 
>that does average out to 25fps.
>
>The fps value that is indicated by ffmpeg is 29.97, however the main 
>show is actually at 25 fps.
>
>How do we sort this out? The avsync predictor is not really doing a
>good 
>job (it thinks everything is 29.97fps).
>
>Add to this that there is a frame doubling deinterlacer. The vaapi
>frame 
>doubling interlacer gives garbage for pts values so I am trying to 
>insert appropriate values, but not doing very well with the 33 and 50 
>millisecond alternating pts values. I don't know if I can rely on this 
>being a normal occurrence and try to compensate.
>
>Note - I ran this with vaapi2 and with software decoding - the PTS 
>values are identical so vaapi2 is not corrupting them.
>

This is bizarre! It looks like perhaps the clip was rate converted fron 60hz to 50hz, and is then again rate converted back to 60hz. The only way to deal with this assuming we cant believe the fps is to use the pts directly assuming that we can trust those too, which in the past we couldnt.

My tvs are a mix of 50 and 60hz, au being traditionally a 50hz place. But they are being run at 60.

Maybe we need to change how fps is determined which I think currently uses a ffmpeg call.

Mark


More information about the mythtv-dev mailing list