Skip to content

Commit

Permalink
fix variable framerate
Browse files Browse the repository at this point in the history
  • Loading branch information
leandromoreira committed Jan 3, 2020
1 parent a527920 commit 8ed2c1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 3_transcoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ int prepare_encoder(StreamingContext *sc, AVCodecContext *decoder_ctx, AVRationa
sc->video_avcc->pix_fmt = sc->video_avc->pix_fmts[0];
else
sc->video_avcc->pix_fmt = decoder_ctx->pix_fmt;
sc->video_avcc->time_base = input_framerate;
sc->video_avs->time_base = input_framerate;
sc->video_avcc->time_base = av_inv_q(input_framerate);
sc->video_avs->time_base = sc->video_avcc->time_base;

if (avcodec_open2(sc->video_avcc, sc->video_avc, NULL) < 0) {logging("could not open the codec"); return -1;}
avcodec_parameters_from_context(sc->video_avs->codecpar, sc->video_avcc);
Expand Down

0 comments on commit 8ed2c1f

Please sign in to comment.