forked from FFmpeg/FFmpeg
avcodec/mediacodecenc: enable B frames only with -strict experimental
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
parent
fcd557a2c2
commit
a598be44df
1 changed files with 9 additions and 1 deletions
|
@ -276,8 +276,16 @@ static av_cold int mediacodec_init(AVCodecContext *avctx)
|
||||||
av_log(avctx, AV_LOG_DEBUG, "set level to 0x%x\n", s->level);
|
av_log(avctx, AV_LOG_DEBUG, "set level to 0x%x\n", s->level);
|
||||||
ff_AMediaFormat_setInt32(format, "level", s->level);
|
ff_AMediaFormat_setInt32(format, "level", s->level);
|
||||||
}
|
}
|
||||||
if (avctx->max_b_frames > 0)
|
if (avctx->max_b_frames > 0) {
|
||||||
|
if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
|
"Enabling B frames will produce packets with no DTS. "
|
||||||
|
"Use -strict experimental to use it anyway.\n");
|
||||||
|
ret = AVERROR(EINVAL);
|
||||||
|
goto bailout;
|
||||||
|
}
|
||||||
ff_AMediaFormat_setInt32(format, "max-bframes", avctx->max_b_frames);
|
ff_AMediaFormat_setInt32(format, "max-bframes", avctx->max_b_frames);
|
||||||
|
}
|
||||||
if (s->pts_as_dts == -1)
|
if (s->pts_as_dts == -1)
|
||||||
s->pts_as_dts = avctx->max_b_frames <= 0;
|
s->pts_as_dts = avctx->max_b_frames <= 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue