Skip to content

Commit 93d12e7

Browse files
committed
Include data for fps in clip created by ffmpeg 4+
1 parent 6476f93 commit 93d12e7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/FFmpegWriter.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,6 +1266,13 @@ AVStream *FFmpegWriter::add_video_stream() {
12661266
st->avg_frame_rate = av_inv_q(c->time_base);
12671267
st->time_base.num = info.video_timebase.num;
12681268
st->time_base.den = info.video_timebase.den;
1269+
#if (LIBAVFORMAT_VERSION_MAJOR >= 58)
1270+
_Pragma ("GCC diagnostic push");
1271+
_Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\""); \
1272+
st->codec->time_base.num = info.video_timebase.num;
1273+
st->codec->time_base.den = info.video_timebase.den;
1274+
_Pragma ("GCC diagnostic pop");
1275+
#endif
12691276

12701277
c->gop_size = 12; /* TODO: add this to "info"... emit one intra frame every twelve frames at most */
12711278
c->max_b_frames = 10;

0 commit comments

Comments
 (0)