[mythtv] pts values

Peter Bennett pb.mythtv at gmail.com
Sat Sep 8 15:55:24 UTC 2018



On 09/08/2018 05:27 AM, Mark Spieth wrote:
> Here is some info playing interlaced.mkv on one of my systems. At x1 I 
> get no skipping, perfect playback AFAICT but its hard to tell. The 
> repeats below should be noticable. No fps changes detected. vdpau to 
> NVIDIA GeForce 8400 GS Rev. 2 with legacy driver v340. TV is an older 
> Samsung R series (not true HD but looks like it to anything so it 
> doesnt matter) connected via PC connector (not hdmi). My test system.
>
> I used -v playback,audio,timestamp logging options.
>
> 2018-09-08 19:08:29.156367 I [15115/15115] CoreContext 
> mythplayer.cpp:1811 (InitAVSync) - Player(0): Video timing method: 
> USleep with busy wait
> 2018-09-08 19:08:29.156374 I [15115/15115] CoreContext 
> mythplayer.cpp:1815 (InitAVSync) - Player(0): Display Refresh Rate: 
> 60.017 Video Frame Rate: 29.970
>
> I get the odd repeat_pict like:
>
> 2018-09-08 19:08:31.656289 I [15115/15115] CoreContext 
> mythplayer.cpp:2000 (AVSync) - Player(0): A/V repeat_pict, adding 
> 16683 repeat delay
> 2018-09-08 19:08:31.656318 I [15115/15115] CoreContext 
> mythplayer.cpp:2048 (AVSync) - Player(0): A/V timecodes audio 45376 
> video 45363 frameinterval 33367 avdel -13 avg -12534 tcoffset 0 avp 0 
> avpen 0 avdc 0 diverge -0.375641
>
> You need to look at the avdel value as it jitters, the repeats are a 
> direct consequence of this. This tends to indicate that we have around 
> 400ms of A/V delay, A precedes V.
>
> Now that I have this log I need to dig into it a bit more.
>
> Mark
>

I get the frame dropping messages when playing using my new vaapi2 code, 
with frame doubling deinterlacer. The vaapi2 frame doubling works like 
the android, in that the deinterlace is done in the decoder and the 
frame rate seen my mythplayer is double the normal, the 
m_double_framerate flag does not apply as that causes the same frame to 
be sent to the renderer twice for deinterlacing and this is not the 
desired behavior.

I have a spreadsheet of the pts values and calculated framerates from 
this clip here.
https://www.dropbox.com/s/dsydzf67aslbemp/vaapi_transcode?dl=0

I realize now there is likely a problem with the double framerate 
calculation. The code sets a flag to know that it is using a doubled 
framerate based on sequential PTS values, but with the PTS values 
jumping around like this it will likely never get the correct value. It 
looks like if I calculate the frame rate over three PTS values instead 
of two, like I did in column E, I get a much better framerate value. I 
plan to change the code to do that, and also to update the base 
framerate for MythPlayer when it changes between 24 and 30.

Normal framerate values are 23.976, 29.97, 59.94 (USA values), 25, 50 
(Other country values). I think it is best to use the closest integer, 
except set it to one of those three values when the rate comes to 24, 
30, or 60.

Peter


More information about the mythtv-dev mailing list