Closed joeyparrish closed 3 years ago
As a workaround, the frame_rate
field can be used on the video section of the input config for such content.
$ ffprobe zdrone.mp4 -select_streams v:0 -show_entries stream=avg_frame_rate -of compact=p=0:nk=1 2> /dev/null
169920/3269
This was using avg_frame_rate
instead of r_frame_rate
for the probing. This sof discusses the difference which i didn't quiet understand.
>>> 169920/3269
51.979198531661055
Update: I understand the difference now. The r_frame_rate
will be different to fit some kind timestamp calculation when the video has mixed frame rates. See https://ffmpeg.org/faq.html#AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e
I think we should use avg_frame_rate
then.
Thank you for figuring this out! I'd be happy to review a PR.
I received a video from a colleague (drone.mp4) that breaks our framerate detection. We decide that it's 600 fps instead of 51.98, which leads to a bad keyframe interval for ffmpeg, which leads to failed segmentation.
Output from ffprobe: