Skip to content

Commit

Permalink
Merge pull request wang-bin#959 from 0xFelix/master
Browse files Browse the repository at this point in the history
Set the avg_frame_rate for newly created AVStream (Fixes wang-bin#955)
  • Loading branch information
wang-bin authored Oct 6, 2017
2 parents dff05bb + abf42f5 commit b17b3f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/AVMuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ AVStream *AVMuxer::Private::addStream(AVFormatContext* ctx, const QString &codec
// set by avformat if unset
s->id = ctx->nb_streams - 1;
s->time_base = kTB;
// Set avg_frame_rate based on encoder frame_rate
s->avg_frame_rate = av_d2q(1.0/venc->frameRate(), venc->frameRate()*1001.0+2);
AVCodecContext *c = s->codec;
c->codec_id = codec->id;
// Using codec->time_base is deprecated, but needed for older lavf.
Expand Down

0 comments on commit b17b3f6

Please sign in to comment.