Skip to content

Commit

Permalink
use android camera fps metadata in avformat producer
Browse files Browse the repository at this point in the history
See https://forum.shotcut.org/t/some-android-variable-fps-videos-are-
detected-as-120-240fps-instead-of-30/45610
  • Loading branch information
ddennedy committed Aug 31, 2024
1 parent f104d17 commit 278e9a0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/avformat/producer_avformat.c
Original file line number Diff line number Diff line change
Expand Up @@ -2868,6 +2868,10 @@ static int video_codec_init(producer_avformat self, int index, mlt_properties pr
}
}

fps = mlt_properties_get_double(properties, "meta.attr.com.android.capture.fps.markup");
if (fps > 0.0 && isfinite(fps))
frame_rate = av_d2q(fps, 1024);

self->video_time_base = stream->time_base;
if (mlt_properties_get(properties, "force_fps")) {
AVRational force_fps = av_d2q(mlt_properties_get_double(properties, "force_fps"), 1024);
Expand Down

0 comments on commit 278e9a0

Please sign in to comment.