Skip to content

Commit

Permalink
Fix FPS setting on FFmpeg 4, which currently is not setting a valid FPS.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonoomph committed Jun 1, 2020
1 parent 10ed4ba commit e4dd726
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/FFmpegWriter.cpp
Expand Up @@ -1222,6 +1222,13 @@ AVStream *FFmpegWriter::add_video_stream() {
st->avg_frame_rate = av_inv_q(c->time_base);
st->time_base.num = info.video_timebase.num;
st->time_base.den = info.video_timebase.den;
#if (LIBAVFORMAT_VERSION_MAJOR >= 58)
_Pragma ("GCC diagnostic push");
_Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\""); \
st->codec->time_base.num = info.video_timebase.num;
st->codec->time_base.den = info.video_timebase.den;
_Pragma ("GCC diagnostic pop");
#endif

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

0 comments on commit e4dd726

Please sign in to comment.