* [FFmpeg-devel] [PATCH] avcodec/mediacodecenc: enable B frames only with -strict experimental
@ 2023-01-05 16:58 Zhao Zhili
2023-01-05 17:11 ` Tomas Härdin
0 siblings, 1 reply; 4+ messages in thread
From: Zhao Zhili @ 2023-01-05 16:58 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
libavcodec/mediacodecenc.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index 4c1809093c..7a498f039e 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -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);
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,
+ "Enable 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);
+ }
if (s->pts_as_dts == -1)
s->pts_as_dts = avctx->max_b_frames <= 0;
--
2.25.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/mediacodecenc: enable B frames only with -strict experimental
2023-01-05 16:58 [FFmpeg-devel] [PATCH] avcodec/mediacodecenc: enable B frames only with -strict experimental Zhao Zhili
@ 2023-01-05 17:11 ` Tomas Härdin
2023-01-06 16:07 ` [FFmpeg-devel] [PATCH v2] " Zhao Zhili
0 siblings, 1 reply; 4+ messages in thread
From: Tomas Härdin @ 2023-01-05 17:11 UTC (permalink / raw)
To: FFmpeg development discussions and patches
fre 2023-01-06 klockan 00:58 +0800 skrev Zhao Zhili:
> From: Zhao Zhili <zhilizhao@tencent.com>
>
> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
> ---
> libavcodec/mediacodecenc.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
> index 4c1809093c..7a498f039e 100644
> --- a/libavcodec/mediacodecenc.c
> +++ b/libavcodec/mediacodecenc.c
> @@ -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);
> 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,
> + "Enable B frames will produce packets with no
> DTS. "
Enabling
Also did you get my e-mail? I have some patches coming hopefully later
today
/Tomas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avcodec/mediacodecenc: enable B frames only with -strict experimental
2023-01-06 16:07 ` [FFmpeg-devel] [PATCH v2] " Zhao Zhili
@ 2023-01-06 15:41 ` Tomas Härdin
0 siblings, 0 replies; 4+ messages in thread
From: Tomas Härdin @ 2023-01-06 15:41 UTC (permalink / raw)
To: FFmpeg development discussions and patches
lör 2023-01-07 klockan 00:07 +0800 skrev Zhao Zhili:
> From: Zhao Zhili <zhilizhao@tencent.com>
>
> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
> ---
> v2: Enable -> Enabling
>
> libavcodec/mediacodecenc.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
> index 4c1809093c..a92a8dc5a9 100644
> --- a/libavcodec/mediacodecenc.c
> +++ b/libavcodec/mediacodecenc.c
> @@ -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);
> 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);
> + }
> if (s->pts_as_dts == -1)
> s->pts_as_dts = avctx->max_b_frames <= 0;
>
Looks OK since all packets should get dts and pts = dts by pts_as_dts
/Tomas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* [FFmpeg-devel] [PATCH v2] avcodec/mediacodecenc: enable B frames only with -strict experimental
2023-01-05 17:11 ` Tomas Härdin
@ 2023-01-06 16:07 ` Zhao Zhili
2023-01-06 15:41 ` Tomas Härdin
0 siblings, 1 reply; 4+ messages in thread
From: Zhao Zhili @ 2023-01-06 16:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
v2: Enable -> Enabling
libavcodec/mediacodecenc.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index 4c1809093c..a92a8dc5a9 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -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);
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);
+ }
if (s->pts_as_dts == -1)
s->pts_as_dts = avctx->max_b_frames <= 0;
--
2.25.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-01-06 15:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-05 16:58 [FFmpeg-devel] [PATCH] avcodec/mediacodecenc: enable B frames only with -strict experimental Zhao Zhili
2023-01-05 17:11 ` Tomas Härdin
2023-01-06 16:07 ` [FFmpeg-devel] [PATCH v2] " Zhao Zhili
2023-01-06 15:41 ` Tomas Härdin
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git