[FFmpeg-user] ffmpeg architecture question #3

Mark Filipak markfilipak.windows+ffmpeg at gmail.com
Wed Apr 29 14:03:59 EEST 2020


The issue: When ffmpeg decodes a soft telecined video, does the decoder output 24 FPS progressive? 
or 30 FPS progressive? or 30 FPS "interlaced"?

Regarding MPV: Yesterday I chatted with an MPV developer regarding how MPV derives the numbers it 
displays (Shift-I) during playback of soft telecined video, to wit:

"FPS: 29.970 (specified) 23.976 (estimated)"

I asked whether "23.976" was the value of 'estimated-vf-fps'. He said, "Yes."

#mpv Chat session (reformatted for this mailing list):
<markfilipak> When MPV (Shift-I) shows "FPS: 29.970 (specified)
   23.976 (estimated)" for soft telecined video, what causes it to
   say "23.976 (estimated)"? Is it the previous 10 frame durations
   (i.e., estimated-vf-fps)?
<markfilipak> Does that mean that the decoder is actually outputting
   23.976 FPS?
<markfilipak> If so, what is the decoder? Is it available to ffmpeg?
<sfan5> markfilipak: yes that's exactly the property it displays:
   https://github.com/mpv-player/mpv/blob/master/player/lua/stats.lua#L530
<markfilipak> Thanks! Stay safe, stay healthy.
<markfilipak> Oh, is the decoder available to ffmpeg?
<sfan5> "available"?
<markfilipak> Does MPV use the same decoders that ffmpeg uses? If
   not, what's the name & source of MPV's decoder(s)?
<sfan5> yes it uses the same

Here's the definition of 'estimated-vf-fps' from 'mpv.html' (reformatted for this mailing list).
"estimated-vf-fps
"    Estimated/measured FPS of the video filter chain output. (If
"    no filters are used, this corresponds to decoder output.) This
"    uses the average of the 10 past frame durations to calculate
"    the FPS. It will be inaccurate if "frame-dropping is involved
"    (such as when framedrop is explicitly enabled, or after precise
"    seeking). Files with imprecise timestamps (such as Matroska)
"    might lead to unstable results."

So it is plain that the ffmpeg decoder (H262) is outputting 24/1.001 FPS to the front end of the 
filter chain. That's consistent with what I thought, but it's not consistent with what ffmpeg & 
ffprobe reports.

"    Stream #0:1[0x1e0]: Video: ... 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc"
                                     |||||||||
                                     How does ffmpeg determine this?

I've been told that ffmpeg uses PTSs, not metadata, but "29.97 fps" above seems to contradict that.

Please, please, clarify this issue. For soft telecine video, what does the decoder output and how 
does ffmpeg treat it?

Regards,
Mark.


More information about the ffmpeg-user mailing list