Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
transcoding: set 30fps by default when the video decoder cannot deter…
…mine frame timing, fixes #3315
  • Loading branch information
perexg committed Nov 23, 2015
1 parent 9065b52 commit 7329323
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/plumbing/transcoding.c
Expand Up @@ -1239,6 +1239,15 @@ transcoder_stream_video(transcoder_t *t, transcoder_stream_t *ts, th_pkt_t *pkt)
// Encoder uses "time_base" for bitrate calculation, but "time_base" from decoder
// will be deprecated in the future, therefore calculate "time_base" from "framerate" if available.
octx->ticks_per_frame = ictx->ticks_per_frame;
if (ictx->framerate.num == 0) {
ictx->framerate.num = 30;
ictx->framerate.den = 1;
}
if (ictx->time_base.num == 0) {
ictx->time_base.num = ictx->framerate.den;
ictx->time_base.den = ictx->framerate.num;
}
octx->framerate = ictx->framerate;
#if LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 13, 100) // ffmpeg 2.5
octx->time_base = av_inv_q(av_mul_q(ictx->framerate, av_make_q(ictx->ticks_per_frame, 1)));
#else
Expand Down

0 comments on commit 7329323

Please sign in to comment.