-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fps incorrectly detected on Sony interlaced file #898
Comments
One option is to do nothing special for weird files like this and require transcode to use. We already have enough special frame rate logic as it is at this location. It seems ffmpeg defaults to using r_frame_rate when using it to transcode. One could argue that is what we should use as well, but I worry about that big of a change in this area after 19 years of evolution. Plus, it would make some things that appear variable frame rate today (strange fps value) as perfectly normal when perhaps they should be used with caution. |
Maybe you should look into why FFMpeg reports avg_frame_rate = 25/2. Perhaps it is incorrectly interpreting the frame rate as field rate and dividing by 2. Here is the output from FFProbe:
It reports "12.50 fps". Let's fix that. |
Fps is incorrectly guessed on some camcorder files. A sample video can be downloaded from here:
https://files.kde.org/kdenlive/media-samples/C0437.MXF
This is an interlaced video file. Fps is incorrectly guessed as 12.5 fps instead of 25 fps. Looking at it, the problem is that MLT uses the stream's avg_frame_rate to determine the fps.
Here are the stream data for this file:
avg_frame_rate = 25/2
r_frame_rate = 25/1
time_base = 1/25
I guess simply switching from avg_frame_rate to r_frame_rate would hurt other files, so my proposal (but I am by far not an expert here), would be to compare the time_base with both avg_frame_rate and r_frame_rate to decide which one is correct.
Here is a basic patch fixing fps detection and playback for me:
master...j-b-m:mlt:work/fps-fix
Let me know if you want me to make other tests.
Another problem is that we cannot simply fix the problem of this clip by setting force_fps=25, because this incorrectly modifies the video_time_base here:
https://github.com/mltframework/mlt/blob/master/src/modules/avformat/producer_avformat.c#L2631
So currently there is no way to play this file correctly.
The text was updated successfully, but these errors were encountered: