* [FFmpeg-devel] [PATCH] avcodec/amfenc: add query_timeout option for h264/hevc
@ 2022-05-12 10:26 Zhao Zhili
2022-05-12 11:20 ` [FFmpeg-devel] [PATCH v2] " Zhao Zhili
0 siblings, 1 reply; 3+ messages in thread
From: Zhao Zhili @ 2022-05-12 10:26 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: 21pages, Zhao Zhili
From: 21pages <pages21@163.com>
Signed-off-by: 21pages <pages21@163.com>
Co-authored-by: Zhao Zhili <zhilizhao@tencent.com>
---
libavcodec/amfenc.h | 1 +
libavcodec/amfenc_h264.c | 4 ++++
libavcodec/amfenc_hevc.c | 4 ++++
libavcodec/version.h | 2 +-
4 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/libavcodec/amfenc.h b/libavcodec/amfenc.h
index 1ab98d2f78..e92120ea39 100644
--- a/libavcodec/amfenc.h
+++ b/libavcodec/amfenc.h
@@ -87,6 +87,7 @@ typedef struct AmfContext {
int quality;
int b_frame_delta_qp;
int ref_b_frame_delta_qp;
+ int64_t query_timeout;
// Dynamic options, can be set after Init() call
diff --git a/libavcodec/amfenc_h264.c b/libavcodec/amfenc_h264.c
index efb04589f6..ccf4aaf496 100644
--- a/libavcodec/amfenc_h264.c
+++ b/libavcodec/amfenc_h264.c
@@ -121,6 +121,7 @@ static const AVOption options[] = {
{ "aud", "Inserts AU Delimiter NAL unit", OFFSET(aud) ,AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "log_to_dbg", "Enable AMF logging to debug output", OFFSET(log_to_dbg) , AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
+ { "query_timeout", "Timeout for QueryOutput call in ms", OFFSET(query_timeout), AV_OPT_TYPE_INT64, { .i64 = -1 }, 0, 60000, VE },
{ NULL }
};
@@ -155,6 +156,9 @@ static av_cold int amf_encode_init_h264(AVCodecContext *avctx)
AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_FRAMERATE, framerate);
+ if (ctx->query_timeout >= 0)
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_QUERY_TIMEOUT, ctx->query_timeout);
+
switch (avctx->profile) {
case FF_PROFILE_H264_BASELINE:
profile = AMF_VIDEO_ENCODER_PROFILE_BASELINE;
diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c
index 8ab9330730..864274d4ae 100644
--- a/libavcodec/amfenc_hevc.c
+++ b/libavcodec/amfenc_hevc.c
@@ -89,6 +89,7 @@ static const AVOption options[] = {
{ "aud", "Inserts AU Delimiter NAL unit", OFFSET(aud) ,AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE },
{ "log_to_dbg", "Enable AMF logging to debug output", OFFSET(log_to_dbg), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE },
+ { "query_timeout", "Timeout for QueryOutput call in ms", OFFSET(query_timeout), AV_OPT_TYPE_INT64, { .i64 = -1 }, 0, 60000, VE },
{ NULL }
};
@@ -122,6 +123,9 @@ static av_cold int amf_encode_init_hevc(AVCodecContext *avctx)
AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_FRAMERATE, framerate);
+ if (ctx->query_timeout >= 0)
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_QUERY_TIMEOUT, ctx->query_timeout);
+
switch (avctx->profile) {
case FF_PROFILE_HEVC_MAIN:
profile = AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 87b7284a95..b564e2d849 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@
#include "version_major.h"
#define LIBAVCODEC_VERSION_MINOR 28
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
--
2.35.3
_______________________________________________
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] 3+ messages in thread
* [FFmpeg-devel] [PATCH v2] avcodec/amfenc: add query_timeout option for h264/hevc
2022-05-12 10:26 [FFmpeg-devel] [PATCH] avcodec/amfenc: add query_timeout option for h264/hevc Zhao Zhili
@ 2022-05-12 11:20 ` Zhao Zhili
[not found] ` <ca28167.731e.180b80c82ac.Coremail.pages21@163.com>
0 siblings, 1 reply; 3+ messages in thread
From: Zhao Zhili @ 2022-05-12 11:20 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: 21pages, Zhao Zhili
From: 21pages <pages21@163.com>
Signed-off-by: 21pages <pages21@163.com>
Co-authored-by: Zhao Zhili <zhilizhao@tencent.com>
---
v2: fix range
libavcodec/amfenc.h | 1 +
libavcodec/amfenc_h264.c | 4 ++++
libavcodec/amfenc_hevc.c | 4 ++++
libavcodec/version.h | 2 +-
4 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/libavcodec/amfenc.h b/libavcodec/amfenc.h
index 1ab98d2f78..e92120ea39 100644
--- a/libavcodec/amfenc.h
+++ b/libavcodec/amfenc.h
@@ -87,6 +87,7 @@ typedef struct AmfContext {
int quality;
int b_frame_delta_qp;
int ref_b_frame_delta_qp;
+ int64_t query_timeout;
// Dynamic options, can be set after Init() call
diff --git a/libavcodec/amfenc_h264.c b/libavcodec/amfenc_h264.c
index efb04589f6..13e2b01a0a 100644
--- a/libavcodec/amfenc_h264.c
+++ b/libavcodec/amfenc_h264.c
@@ -121,6 +121,7 @@ static const AVOption options[] = {
{ "aud", "Inserts AU Delimiter NAL unit", OFFSET(aud) ,AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
{ "log_to_dbg", "Enable AMF logging to debug output", OFFSET(log_to_dbg) , AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
+ { "query_timeout", "Timeout for QueryOutput call in ms", OFFSET(query_timeout), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, 60000, VE },
{ NULL }
};
@@ -155,6 +156,9 @@ static av_cold int amf_encode_init_h264(AVCodecContext *avctx)
AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_FRAMERATE, framerate);
+ if (ctx->query_timeout >= 0)
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_QUERY_TIMEOUT, ctx->query_timeout);
+
switch (avctx->profile) {
case FF_PROFILE_H264_BASELINE:
profile = AMF_VIDEO_ENCODER_PROFILE_BASELINE;
diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c
index 8ab9330730..e4f268ef67 100644
--- a/libavcodec/amfenc_hevc.c
+++ b/libavcodec/amfenc_hevc.c
@@ -89,6 +89,7 @@ static const AVOption options[] = {
{ "aud", "Inserts AU Delimiter NAL unit", OFFSET(aud) ,AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE },
{ "log_to_dbg", "Enable AMF logging to debug output", OFFSET(log_to_dbg), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE },
+ { "query_timeout", "Timeout for QueryOutput call in ms", OFFSET(query_timeout), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, 60000, VE },
{ NULL }
};
@@ -122,6 +123,9 @@ static av_cold int amf_encode_init_hevc(AVCodecContext *avctx)
AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_FRAMERATE, framerate);
+ if (ctx->query_timeout >= 0)
+ AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_QUERY_TIMEOUT, ctx->query_timeout);
+
switch (avctx->profile) {
case FF_PROFILE_HEVC_MAIN:
profile = AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 87b7284a95..b564e2d849 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@
#include "version_major.h"
#define LIBAVCODEC_VERSION_MINOR 28
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
--
2.35.3
_______________________________________________
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] 3+ messages in thread
* Re: [FFmpeg-devel] [PATCH v2] avcodec/amfenc: add query_timeout option for h264/hevc
[not found] ` <ca28167.731e.180b80c82ac.Coremail.pages21@163.com>
@ 2022-05-12 13:06 ` "zhilizhao(赵志立)"
0 siblings, 0 replies; 3+ messages in thread
From: "zhilizhao(赵志立)" @ 2022-05-12 13:06 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> On May 12, 2022, at 7:34 PM, 孙波 <pages21@163.com> wrote:
>
> I think set maximum to 1000ms is better, because value bigger than 1000 can't effect in my test.
Please send v3 to update the default value and range. And check
AMF_VIDEO_ENCODER_HEVC_QUERY_TIMEOUT/AMF_VIDEO_ENCODER_QUERY_TIMEOUT
are defined. Current patch can break the build.
By the way, please don’t top-post.
> At 2022-05-12 19:20:22, "Zhao Zhili" <quinkblack@foxmail.com> wrote:
>> From: 21pages <pages21@163.com>
>>
>> Signed-off-by: 21pages <pages21@163.com>
>>
>> Co-authored-by: Zhao Zhili <zhilizhao@tencent.com>
>> ---
>> v2: fix range
>>
>> libavcodec/amfenc.h | 1 +
>> libavcodec/amfenc_h264.c | 4 ++++
>> libavcodec/amfenc_hevc.c | 4 ++++
>> libavcodec/version.h | 2 +-
>> 4 files changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/amfenc.h b/libavcodec/amfenc.h
>> index 1ab98d2f78..e92120ea39 100644
>> --- a/libavcodec/amfenc.h
>> +++ b/libavcodec/amfenc.h
>> @@ -87,6 +87,7 @@ typedef struct AmfContext {
>> int quality;
>> int b_frame_delta_qp;
>> int ref_b_frame_delta_qp;
>> + int64_t query_timeout;
>>
>> // Dynamic options, can be set after Init() call
>>
>> diff --git a/libavcodec/amfenc_h264.c b/libavcodec/amfenc_h264.c
>> index efb04589f6..13e2b01a0a 100644
>> --- a/libavcodec/amfenc_h264.c
>> +++ b/libavcodec/amfenc_h264.c
>> @@ -121,6 +121,7 @@ static const AVOption options[] = {
>> { "aud", "Inserts AU Delimiter NAL unit", OFFSET(aud) ,AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
>>
>> { "log_to_dbg", "Enable AMF logging to debug output", OFFSET(log_to_dbg) , AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
>> + { "query_timeout", "Timeout for QueryOutput call in ms", OFFSET(query_timeout), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, 60000, VE },
>>
>> { NULL }
>> };
>> @@ -155,6 +156,9 @@ static av_cold int amf_encode_init_h264(AVCodecContext *avctx)
>>
>> AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_FRAMERATE, framerate);
>>
>> + if (ctx->query_timeout >= 0)
>> + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_QUERY_TIMEOUT, ctx->query_timeout);
>> +
>> switch (avctx->profile) {
>> case FF_PROFILE_H264_BASELINE:
>> profile = AMF_VIDEO_ENCODER_PROFILE_BASELINE;
>> diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c
>> index 8ab9330730..e4f268ef67 100644
>> --- a/libavcodec/amfenc_hevc.c
>> +++ b/libavcodec/amfenc_hevc.c
>> @@ -89,6 +89,7 @@ static const AVOption options[] = {
>> { "aud", "Inserts AU Delimiter NAL unit", OFFSET(aud) ,AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE },
>>
>> { "log_to_dbg", "Enable AMF logging to debug output", OFFSET(log_to_dbg), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE },
>> + { "query_timeout", "Timeout for QueryOutput call in ms", OFFSET(query_timeout), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, 60000, VE },
>> { NULL }
>> };
>>
>> @@ -122,6 +123,9 @@ static av_cold int amf_encode_init_hevc(AVCodecContext *avctx)
>>
>> AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_FRAMERATE, framerate);
>>
>> + if (ctx->query_timeout >= 0)
>> + AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_QUERY_TIMEOUT, ctx->query_timeout);
>> +
>> switch (avctx->profile) {
>> case FF_PROFILE_HEVC_MAIN:
>> profile = AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN;
>> diff --git a/libavcodec/version.h b/libavcodec/version.h
>> index 87b7284a95..b564e2d849 100644
>> --- a/libavcodec/version.h
>> +++ b/libavcodec/version.h
>> @@ -30,7 +30,7 @@
>> #include "version_major.h"
>>
>> #define LIBAVCODEC_VERSION_MINOR 28
>> -#define LIBAVCODEC_VERSION_MICRO 100
>> +#define LIBAVCODEC_VERSION_MICRO 101
>>
>> #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
>> LIBAVCODEC_VERSION_MINOR, \
>> --
>> 2.35.3
_______________________________________________
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] 3+ messages in thread
end of thread, other threads:[~2022-05-12 13:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12 10:26 [FFmpeg-devel] [PATCH] avcodec/amfenc: add query_timeout option for h264/hevc Zhao Zhili
2022-05-12 11:20 ` [FFmpeg-devel] [PATCH v2] " Zhao Zhili
[not found] ` <ca28167.731e.180b80c82ac.Coremail.pages21@163.com>
2022-05-12 13:06 ` "zhilizhao(赵志立)"
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