Re: [FFmpeg-devel] FFmpeg 4.0.3 fails to compile

2018-11-02 Thread Helmut K. C. Tessarek
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 2018-11-02 23:23, James Almer wrote:
> Since libaom still hasn't tagged a release with that define
> removed, it's not reason enough to rush a new point release for the
> 4.0 branch.

That's fine. I just wanted to mention it. I guess in the days to come
a few people will be running into this issue.
At least they will find this thread...

Cheers.
  K. C.

- -- 
regards Helmut K. C. Tessarek  KeyID 0x172380A011EF4944
Key fingerprint = 8A55 70C1 BD85 D34E ADBC 386C 1723 80A0 11EF 4944

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await thee at its end.
*/
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEE191csiqpm8f5Ln9WvgmFNJ1E3QAFAlvdG0wACgkQvgmFNJ1E
3QCpqRAAnlfJh46iTGqig4DNoSP6X6JyzgC0mmFyiHxmyO/OaSaCjF5Ji1cc0pE8
ryTk3cdlYOI201my8Duh3KVXBcNc1ABZfo08FxzwilUV+w3vvS5+ffqbqQ3JO/wd
jSswFehA1jclacs9Y0LmD8VXJdjHiONdD1+a5Uz0OjNRX33yZakCbJiNyRXPWgsX
FepLPrUHpIFmEddRU5BHXMPPVUj1XtAHus3eODIcWdS3g202/BDHSGqTsXBqU0dS
UAytYS5hTYVXj1djJEMdBOal0UaTkaXoXYCOiMJLFWp5cAhj6xK4PdNQncLwgzDE
0EIsD2177+yrSLeAxv090omzR0vONI2XxZObns4agTHAGcULRKQ+2YrqHya6iRsN
WVHyMwdUNZWA4rTGM38hY5RJHePNF7SwbBsQG7EdeQtNvS7tH4xfB0+EwOvEXm8j
+gHASItYceqxf9y4jb3iCV135sDv75sHfucqPDXZLVGGt5BiGzQfC4IHAbA97PTm
T1bNLKi75eaET3fcygFGvyfRvNLWp2bm2id8C1CW3Hcah/zCGo9SBsadBzyTjNC4
H+eOnfSjBn2buNywLAQK9Gske1MCeApsTBTEccVxUo7485ZXWzX4Vi44Zp2KJDx8
KKMr5AZIgIbxY3Ad5cZeY8DCiUR74z009clY12n4HnapHtGzP7c=
=QR4d
-END PGP SIGNATURE-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] FFmpeg 4.0.3 fails to compile

2018-11-02 Thread James Almer
On 11/3/2018 12:13 AM, Helmut K. C. Tessarek wrote:
> Unfortunately FFmpeg 4.0.3 does not compile with libaom.
> 
> error: use of undeclared identifier 'AOM_ERROR_RESILIENT_PARTITIONS'
> 
> It seems that
> http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=b69ea742ab23ad74b2ae2772764743642212a139
> has not been applied.
> 
> Cheers,
>   K. C.

Ah well. I backported it just now.

Since libaom still hasn't tagged a release with that define removed,
it's not reason enough to rush a new point release for the 4.0 branch.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] FFmpeg 4.0.3 fails to compile

2018-11-02 Thread Helmut K. C. Tessarek
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Unfortunately FFmpeg 4.0.3 does not compile with libaom.

error: use of undeclared identifier 'AOM_ERROR_RESILIENT_PARTITIONS'

It seems that
http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=b69ea742ab23ad74b2ae2772764743642212a139
has not been applied.

Cheers,
  K. C.

- -- 
regards Helmut K. C. Tessarek  KeyID 0x172380A011EF4944
Key fingerprint = 8A55 70C1 BD85 D34E ADBC 386C 1723 80A0 11EF 4944

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await thee at its end.
*/
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEE191csiqpm8f5Ln9WvgmFNJ1E3QAFAlvdEnEACgkQvgmFNJ1E
3QDsNQ//YzVYy/eYUuZy54OBzba6RaSIdoR6MZcTxVX4t31SUz4e6NoN7BHsCyOc
VZzcf5QnLf4aCp+mPds7Rus3Ni6n6KiJ3WzYEMrY/XF0qoTyFI6qFWpovKYTBt+7
KpBYLUwFu1+pD0b19VkqC/cp2lOi4xvtTzC4tK2uiPhjspq9OFPgkAo4CcZxDPYH
hWqyvB4LfTyNzUJCEeolsE2tXaKJh+yQ+7A1LhVECCTmfHQBkO/WwdLuHrmiXvr6
q5ZLxeb79/XvbqI6JUltSr8srDlrP/qI4j20QFxzOe1VYMZPJs+bgeLHsp8VbZvQ
ga8Baq3PaVMxKUvJqzsL8lT43mWTiyzzl2vYAJLuM0lUYU6dclPcmP6X7iNOafVy
uflF65LKWkXj0HKEgmheajqmRwjM2Q1LyetcQUjXHYHAjazAQBYFp8b6TQ3dUAex
s37NSmiD4+Fiubq5SxMpthvOxf8l4rIqSD85cuKvXBNINQlqD1fUmpObjxmdXZw9
gjlBEAYLyleFyTBA0mdj1IzIylIdC1PtZCBuuFw6x/85a31Q4HtEU8XmOjV+Mf5n
E0auv+ltbqbAuHd699FlOOo+sONWVCNqMo2vtRVYdqpa+BnPW+JIOVDM7KMJmCtF
9nuytQksRSbVbLTYigTG9vqImWLuddVbMJ8ZaOIs4V5lTDrAfHQ=
=iMwf
-END PGP SIGNATURE-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/7] lavc/vaapi_encode: Add codec-specific bit rate control callback.

2018-11-02 Thread Jun Zhao
Add extra codec-specific bit rate control configuration callback
interface.

Signed-off-by: Jun Zhao 
---
 libavcodec/vaapi_encode.c |9 +
 libavcodec/vaapi_encode.h |3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 2fe8501..0e7f0a1 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1261,6 +1261,7 @@ static av_cold int 
vaapi_encode_init_rate_control(AVCodecContext *avctx)
 int fr_num, fr_den;
 VAConfigAttrib rc_attr = { VAConfigAttribRateControl };
 VAStatus vas;
+int err;
 
 vas = vaGetConfigAttributes(ctx->hwctx->display,
 ctx->va_profile, ctx->va_entrypoint,
@@ -1412,6 +1413,14 @@ static av_cold int 
vaapi_encode_init_rate_control(AVCodecContext *avctx)
 .max_qp= (avctx->qmax > 0 ? avctx->qmax : 0),
 #endif
 };
+if (ctx->codec->bit_rate_control) {
+err = ctx->codec->bit_rate_control(avctx);
+if (err < 0) {
+av_log(avctx, AV_LOG_ERROR, "Codec specific bit rate control 
setting "
+   "failed: %d.\n", err);
+return err;
+}
+}
 vaapi_encode_add_global_param(avctx, >rc_params.misc,
   sizeof(ctx->rc_params));
 
diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h
index 965fe65..c40de65 100644
--- a/libavcodec/vaapi_encode.h
+++ b/libavcodec/vaapi_encode.h
@@ -268,6 +268,9 @@ typedef struct VAAPIEncodeType {
 // add any necessary global parameters).
 int (*configure)(AVCodecContext *avctx);
 
+// Perform any extra codec-specific bit rate control configuration
+int (*bit_rate_control)(AVCodecContext *avctx);
+
 // The size of the parameter structures:
 // sizeof(VAEnc{type}ParameterBuffer{codec}).
 size_t sequence_params_size;
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 3/7] doc/encoders: Add docs for mb_rate_control option

2018-11-02 Thread Jun Zhao
Add mb_rate_control option docs for h264_vaapi encoder.

Signed-off-by: Jun Zhao 
---
 doc/encoders.texi |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 899faac..6851e75 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -2620,6 +2620,10 @@ Each encoder also has its own specific options:
 @option{profile} sets the value of @emph{profile_idc} and the 
@emph{constraint_set*_flag}s.
 @option{level} sets the value of @emph{level_idc}.
 
+@option{mb_rate_control} enabled the macro block level bit rate control, that 
generally
+improves subjective visual quality. It may have a negative impact on 
performance and
+objective visual quality metrics. Default is off and can't compatible with 
Constant QP.
+
 @table @option
 @item coder
 Set entropy encoder (default is @emph{cabac}).  Possible values:
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 7/7] doc/encoders: Add sliding_window docs for hevc_vaapi.

2018-11-02 Thread Jun Zhao
Add sliding_window docs for hevc_vaapi encoder.

Signed-off-by: Jun Zhao 
---
 doc/encoders.texi |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index c558b76..1987686 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -2665,6 +2665,10 @@ Include recovery points where appropriate 
(@emph{recovery_point} messages).
 @option{profile} and @option{level} set the values of
 @emph{general_profile_idc} and @emph{general_level_idc} respectively.
 
+@option{sliding_window} enabled the sliding windows bit rate control, that is 
a feature to
+reduce the instant bitrate fluctuation, occasional big frame size for intra 
and scene
+change frames are allowed. And the fluctuation level can be controlled by max 
bit rate.
+
 @table @option
 @item aud
 Include access unit delimiters in the stream (not included by default).
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 4/7] lavc/vaapi_encode_h264: Enable sliding window control.

2018-11-02 Thread Jun Zhao
Sliding window control is a feature to reduce the instant bitrate
fluctuation, and occasional big frame size for intra and scene
change frames are allowed. And the fluctuation level can be
controlled by max bit rate.

Signed-off-by: Jun Zhao 
---
 libavcodec/vaapi_encode_h264.c |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index 060277b..5219522 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -59,6 +59,7 @@ typedef struct VAAPIEncodeH264Context {
 int profile;
 int level;
 int mb_rate_control;
+int sliding_window;
 
 // Derived settings.
 int mb_width;
@@ -903,6 +904,16 @@ static av_cold int 
vaapi_encode_h264_bit_rate_control(AVCodecContext *avctx)
"supported with this VAAPI version.\n");
  #endif
 }
+
+if (priv->sliding_window) {
+#if VA_CHECK_VERSION(1, 1, 0)
+ctx->rc_params.rc.rc_flags.bits.frame_tolerance_mode = 
priv->sliding_window;
+#else
+av_log(avctx, AV_LOG_WARNING, "The sliding window is not "
+   "supported with this VAAPI version.\n");
+#endif
+}
+
 return 0;
 }
 
@@ -1022,6 +1033,8 @@ static const AVOption vaapi_encode_h264_options[] = {
   OFFSET(quality), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
 { "mb_rate_control", "MB level bitrate control (only supported on GEN9+)",
   OFFSET(mb_rate_control), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS, 
"mb_rate_control" },
+{ "sliding_window", "Use sliding window to reduce the instant bitrate 
fluctuations",
+  OFFSET(sliding_window), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS, 
"sliding_window" },
 { "coder", "Entropy coder type",
   OFFSET(coder), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, FLAGS, "coder" },
 { "cavlc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, 
FLAGS, "coder" },
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 5/7] doc/encoders: Add sliding_window docs for h264_vaapi.

2018-11-02 Thread Jun Zhao
Add sliding_window docs for h264_vaapi encoder.

Signed-off-by: Jun Zhao 
---
 doc/encoders.texi |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 6851e75..c558b76 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -2624,6 +2624,10 @@ Each encoder also has its own specific options:
 improves subjective visual quality. It may have a negative impact on 
performance and
 objective visual quality metrics. Default is off and can't compatible with 
Constant QP.
 
+@option{sliding_window} enabled the sliding windows bit rate control, that is 
a feature to
+reduce the instant bitrate fluctuation, occasional big frame size for intra 
and scene
+change frames are allowed. And the fluctuation level can be controlled by max 
bit rate.
+
 @table @option
 @item coder
 Set entropy encoder (default is @emph{cabac}).  Possible values:
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 6/7] lavc/vaapi_encode_h265: Enable sliding window control.

2018-11-02 Thread Jun Zhao
 Sliding window control is a feature to reduce the instant bitrate
 fluctuation, and occasional big frame size for intra and scene
 change frames are allowed. And the fluctuation level can be
 controlled by max bit rate.

Signed-off-by: Jun Zhao 
---
 libavcodec/vaapi_encode_h265.c |   24 
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index 367fa5f..2f243da 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -52,6 +52,7 @@ typedef struct VAAPIEncodeH265Context {
 int tier;
 int level;
 int sei;
+int sliding_window;
 
 // Derived settings.
 int fixed_qp_idr;
@@ -1067,6 +1068,24 @@ static av_cold int 
vaapi_encode_h265_configure(AVCodecContext *avctx)
 return 0;
 }
 
+
+static av_cold int vaapi_encode_h265_bit_rate_control(AVCodecContext *avctx)
+{
+VAAPIEncodeContext  *ctx = avctx->priv_data;
+VAAPIEncodeH265Context *priv = avctx->priv_data;
+
+if (priv->sliding_window) {
+#if VA_CHECK_VERSION(1, 1, 0)
+ctx->rc_params.rc.rc_flags.bits.frame_tolerance_mode = 
priv->sliding_window;
+#else
+av_log(avctx, AV_LOG_WARNING, "The sliding window is not "
+   "supported with this VAAPI version.\n");
+#endif
+}
+
+return 0;
+}
+
 static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = {
 { FF_PROFILE_HEVC_MAIN, 8, 3, 1, 1, VAProfileHEVCMain   },
 { FF_PROFILE_HEVC_REXT, 8, 3, 1, 1, VAProfileHEVCMain   },
@@ -1084,6 +1103,8 @@ static const VAAPIEncodeType vaapi_encode_type_h265 = {
 
 .configure = _encode_h265_configure,
 
+.bit_rate_control  = _encode_h265_bit_rate_control,
+
 .sequence_params_size  = sizeof(VAEncSequenceParameterBufferHEVC),
 .init_sequence_params  = _encode_h265_init_sequence_params,
 
@@ -1151,6 +1172,9 @@ static const AVOption vaapi_encode_h265_options[] = {
 { "qp", "Constant QP (for P-frames; scaled by qfactor/qoffset for I/B)",
   OFFSET(qp), AV_OPT_TYPE_INT, { .i64 = 25 }, 0, 52, FLAGS },
 
+{ "sliding_window", "Use sliding window to reduce the instant bitrate 
fluctuations",
+  OFFSET(sliding_window), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS, 
"sliding_window" },
+
 { "aud", "Include AUD",
   OFFSET(aud), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
 
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 0/7] Enhancement VA-API encoder bitrate control

2018-11-02 Thread Jun Zhao
V1:
- add codec-specific bit rate control callback.
- enable macro block level bit rate control in h264_vaapi encoder and update 
the docs.
- enable sliding windows in [h264|hevc]_vaapi encoder and update the docs.

Jun Zhao (7):
  lavc/vaapi_encode: Add codec-specific bit rate control callback.
  lavc/vaapi_encode_h264: Enable macro block level bit rate control.
  doc/encoders: Add docs for mb_rate_control option
  lavc/vaapi_encode_h264: Enable sliding window control.
  doc/encoders: Add sliding_window docs for h264_vaapi.
  lavc/vaapi_encode_h265: Enable sliding window control.
  doc/encoders: Add sliding_window docs for hevc_vaapi.

 doc/encoders.texi  |   12 
 libavcodec/vaapi_encode.c  |9 +
 libavcodec/vaapi_encode.h  |3 +++
 libavcodec/vaapi_encode_h264.c |   34 ++
 libavcodec/vaapi_encode_h265.c |   24 
 5 files changed, 82 insertions(+), 0 deletions(-)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/7] lavc/vaapi_encode_h264: Enable macro block level bit rate control.

2018-11-02 Thread Jun Zhao
Enables macro block level bit rate control, that generally improves
subjective visual quality. It may have a negative impact on
performance and objective visual quality metrics. Default is off
and can't compatible with Constant QP.

Signed-off-by: Jun Zhao 
---
 libavcodec/vaapi_encode_h264.c |   21 +
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index 7bb77cf..060277b 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -58,6 +58,7 @@ typedef struct VAAPIEncodeH264Context {
 int sei;
 int profile;
 int level;
+int mb_rate_control;
 
 // Derived settings.
 int mb_width;
@@ -889,6 +890,22 @@ static av_cold int 
vaapi_encode_h264_configure(AVCodecContext *avctx)
 return 0;
 }
 
+static av_cold int vaapi_encode_h264_bit_rate_control(AVCodecContext *avctx)
+{
+VAAPIEncodeContext  *ctx = avctx->priv_data;
+VAAPIEncodeH264Context *priv = avctx->priv_data;
+
+if (priv->mb_rate_control) {
+ #if VA_CHECK_VERSION(0, 39, 2)
+ctx->rc_params.rc.rc_flags.bits.mb_rate_control = 
priv->mb_rate_control;
+ #else
+av_log(avctx, AV_LOG_WARNING, "The MB rate control option is not "
+   "supported with this VAAPI version.\n");
+ #endif
+}
+return 0;
+}
+
 static const VAAPIEncodeProfile vaapi_encode_h264_profiles[] = {
 { FF_PROFILE_H264_HIGH, 8, 3, 1, 1, VAProfileH264High },
 { FF_PROFILE_H264_MAIN, 8, 3, 1, 1, VAProfileH264Main },
@@ -904,6 +921,8 @@ static const VAAPIEncodeType vaapi_encode_type_h264 = {
 
 .configure = _encode_h264_configure,
 
+.bit_rate_control  = _encode_h264_bit_rate_control,
+
 .sequence_params_size  = sizeof(VAEncSequenceParameterBufferH264),
 .init_sequence_params  = _encode_h264_init_sequence_params,
 
@@ -1001,6 +1020,8 @@ static const AVOption vaapi_encode_h264_options[] = {
   OFFSET(qp), AV_OPT_TYPE_INT, { .i64 = 20 }, 0, 52, FLAGS },
 { "quality", "Set encode quality (trades off against speed, higher is 
faster)",
   OFFSET(quality), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS },
+{ "mb_rate_control", "MB level bitrate control (only supported on GEN9+)",
+  OFFSET(mb_rate_control), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS, 
"mb_rate_control" },
 { "coder", "Entropy coder type",
   OFFSET(coder), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, FLAGS, "coder" },
 { "cavlc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, 
FLAGS, "coder" },
-- 
1.7.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/vp9_parser: export profile and pixel format

2018-11-02 Thread Chris Cunningham
> Also, when dealing with a super frame, to get other values like pixel
> format and frame dimensions we'd have to make sure to parse the visible
> frame, and if it's an inter frame also keep the reference frames around
> to take said values from them.

Could we avoid the challenges around reference and invisible frame by only
doing this parsing for key frames? IIUC these properties would only be
expected to change at the GOP boundary.

> I don't think that change should be reverted, at least not without
> further changes. Otherwise, WebM specific extradata (the one defined in
> https://www.webmproject.org/docs/container) could make its way to other
> containers. We'd have to add checks in supported muxers to ignore it
> instead.

Sorry, I forgot just how different webm is in this regard. We do have some
separate parsing code for the CodecPrivate, but you're also correct that it
is often not set.

> Also, what muxer currently writes that to CodecPrivate? I've looked at
> Youtube samples and none has it.

Maybe libWebM
https://github.com/webmproject/libwebm/blob/01c1d1d76f139345c442bfc8e61b4e1cba809059/common/hdr_util.h#L31

YouTube isn't doing it yet for VP9. But I think its required with AV1
content, so maybe we'll see it with new VP9 encodes too down the road.
Parsing the frame is definitely our best bet.

Chris
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/4] avcodec/prosumer: Check for bytestream eof in decompress()

2018-11-02 Thread Michael Niedermayer
On Wed, Oct 31, 2018 at 12:13:50PM +0100, Paul B Mahol wrote:
> On 10/31/18, Michael Niedermayer  wrote:
> > Fixes: Infinite loop
> > Fixes:
> > 10685/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PROSUMER_fuzzer-5652236881887232
> >
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/prosumer.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> 
> patchset looks ok.

will apply

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 4/4] mjpeg: Use profile names in the encoder and decoder

2018-11-02 Thread Carl Eugen Hoyos
2018-11-02 20:35 GMT+01:00, Vittorio Giovara :
> ---
>  libavcodec/codec_desc.c | 1 +
>  libavcodec/mjpegdec.c   | 2 ++
>  libavcodec/profiles.c   | 9 +
>  libavcodec/profiles.h   | 1 +
>  libavcodec/version.h| 2 +-
>  5 files changed, 14 insertions(+), 1 deletion(-)

How does this patch affect the encoder?

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/4] prores: Use profile names in the various encoders and decoders

2018-11-02 Thread Vittorio Giovara
Export FF_PROFILE_PRORES_* symbols to the public header.
---
 libavcodec/avcodec.h|  7 +++
 libavcodec/codec_desc.c |  1 +
 libavcodec/profiles.c   | 10 ++
 libavcodec/profiles.h   |  1 +
 libavcodec/proresdec2.c |  2 ++
 libavcodec/proresenc_anatoliy.c | 11 +++
 libavcodec/proresenc_kostya.c   |  2 ++
 libavcodec/version.h|  4 ++--
 8 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 705a3ce4f3..cff821c3d4 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2960,6 +2960,13 @@ typedef struct AVCodecContext {
 
 #define FF_PROFILE_SBC_MSBC 1
 
+#define FF_PROFILE_PRORES_PROXY 0
+#define FF_PROFILE_PRORES_LT1
+#define FF_PROFILE_PRORES_STANDARD  2
+#define FF_PROFILE_PRORES_HQ3
+#define FF_PROFILE_PRORES_  4
+#define FF_PROFILE_PRORES_XQ5
+
 /**
  * level
  * - encoding: Set by user.
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 67a30542d1..ce6d265d13 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1077,6 +1077,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .name  = "prores",
 .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"),
 .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
+.profiles  = NULL_IF_CONFIG_SMALL(ff_prores_profiles),
 },
 {
 .id= AV_CODEC_ID_JV,
diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c
index c31399f83e..8a4447e438 100644
--- a/libavcodec/profiles.c
+++ b/libavcodec/profiles.c
@@ -151,4 +151,14 @@ const AVProfile ff_sbc_profiles[] = {
 { FF_PROFILE_UNKNOWN },
 };
 
+const AVProfile ff_prores_profiles[] = {
+{ FF_PROFILE_PRORES_PROXY,"Proxy"},
+{ FF_PROFILE_PRORES_LT,   "LT"   },
+{ FF_PROFILE_PRORES_STANDARD, "Standard" },
+{ FF_PROFILE_PRORES_HQ,   "HQ"   },
+{ FF_PROFILE_PRORES_, "" },
+{ FF_PROFILE_PRORES_XQ,   "XQ"   },
+{ FF_PROFILE_UNKNOWN }
+};
+
 #endif /* !CONFIG_SMALL */
diff --git a/libavcodec/profiles.h b/libavcodec/profiles.h
index 9d7e211e15..4669dad8d5 100644
--- a/libavcodec/profiles.h
+++ b/libavcodec/profiles.h
@@ -33,5 +33,6 @@ extern const AVProfile ff_vc1_profiles[];
 extern const AVProfile ff_vp9_profiles[];
 extern const AVProfile ff_av1_profiles[];
 extern const AVProfile ff_sbc_profiles[];
+extern const AVProfile ff_prores_profiles[];
 
 #endif /* AVCODEC_PROFILES_H */
diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index d818e5d8da..6b3021bdfa 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -33,6 +33,7 @@
 #include "get_bits.h"
 #include "idctdsp.h"
 #include "internal.h"
+#include "profiles.h"
 #include "simple_idct.h"
 #include "proresdec.h"
 #include "proresdata.h"
@@ -730,4 +731,5 @@ AVCodec ff_prores_decoder = {
 .close  = decode_close,
 .decode = decode_frame,
 .capabilities   = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | 
AV_CODEC_CAP_FRAME_THREADS,
+.profiles   = NULL_IF_CONFIG_SMALL(ff_prores_profiles),
 };
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index dbbf13f4c0..f35f049a78 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -30,6 +30,7 @@
 #include "avcodec.h"
 #include "dct.h"
 #include "internal.h"
+#include "profiles.h"
 #include "proresdata.h"
 #include "put_bits.h"
 #include "bytestream.h"
@@ -37,12 +38,6 @@
 
 #define DEFAULT_SLICE_MB_WIDTH 8
 
-#define FF_PROFILE_PRORES_PROXY 0
-#define FF_PROFILE_PRORES_LT1
-#define FF_PROFILE_PRORES_STANDARD  2
-#define FF_PROFILE_PRORES_HQ3
-#define FF_PROFILE_PRORES_  4
-
 static const AVProfile profiles[] = {
 { FF_PROFILE_PRORES_PROXY,"apco"},
 { FF_PROFILE_PRORES_LT,   "apcs"},
@@ -679,7 +674,7 @@ AVCodec ff_prores_aw_encoder = {
 .encode2= prores_encode_frame,
 .pix_fmts   = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV422P10, 
AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE},
 .capabilities   = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
-.profiles   = profiles
+.profiles   = NULL_IF_CONFIG_SMALL(ff_prores_profiles),
 };
 
 AVCodec ff_prores_encoder = {
@@ -693,5 +688,5 @@ AVCodec ff_prores_encoder = {
 .encode2= prores_encode_frame,
 .pix_fmts   = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV422P10, 
AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE},
 .capabilities   = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY,
-.profiles   = profiles
+.profiles   = NULL_IF_CONFIG_SMALL(ff_prores_profiles),
 };
diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index 81f3865ea6..9a77d24fb6 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -28,6 

[FFmpeg-devel] [PATCH 4/4] mjpeg: Use profile names in the encoder and decoder

2018-11-02 Thread Vittorio Giovara
---
 libavcodec/codec_desc.c | 1 +
 libavcodec/mjpegdec.c   | 2 ++
 libavcodec/profiles.c   | 9 +
 libavcodec/profiles.h   | 1 +
 libavcodec/version.h| 2 +-
 5 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index ce6d265d13..7bf39862d2 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -81,6 +81,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("Motion JPEG"),
 .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
 .mime_types= MT("image/jpeg"),
+.profiles  = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles),
 },
 {
 .id= AV_CODEC_ID_MJPEGB,
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index b0cb3ffc83..96c425515a 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -43,6 +43,7 @@
 #include "mjpeg.h"
 #include "mjpegdec.h"
 #include "jpeglsdec.h"
+#include "profiles.h"
 #include "put_bits.h"
 #include "tiff.h"
 #include "exif.h"
@@ -2796,6 +2797,7 @@ AVCodec ff_mjpeg_decoder = {
 .capabilities   = AV_CODEC_CAP_DR1,
 .max_lowres = 3,
 .priv_class = _class,
+.profiles   = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles),
 .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE |
   FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
 .hw_configs = (const AVCodecHWConfigInternal*[]) {
diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c
index 8a4447e438..e6f937fdb4 100644
--- a/libavcodec/profiles.c
+++ b/libavcodec/profiles.c
@@ -161,4 +161,13 @@ const AVProfile ff_prores_profiles[] = {
 { FF_PROFILE_UNKNOWN }
 };
 
+const AVProfile ff_mjpeg_profiles[] = {
+{ FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,"Baseline"},
+{ FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential"  },
+{ FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT, "Progressive" },
+{ FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS,"Lossless"},
+{ FF_PROFILE_MJPEG_JPEG_LS, "JPEG LS" },
+{ FF_PROFILE_UNKNOWN }
+};
+
 #endif /* !CONFIG_SMALL */
diff --git a/libavcodec/profiles.h b/libavcodec/profiles.h
index 4669dad8d5..ab61e03e15 100644
--- a/libavcodec/profiles.h
+++ b/libavcodec/profiles.h
@@ -34,5 +34,6 @@ extern const AVProfile ff_vp9_profiles[];
 extern const AVProfile ff_av1_profiles[];
 extern const AVProfile ff_sbc_profiles[];
 extern const AVProfile ff_prores_profiles[];
+extern const AVProfile ff_mjpeg_profiles[];
 
 #endif /* AVCODEC_PROFILES_H */
diff --git a/libavcodec/version.h b/libavcodec/version.h
index d2ac30d4a8..068004ac9d 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR  34
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
-- 
2.18.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 3/4] proresdec2: Parse codec_tag and export profile information

2018-11-02 Thread Vittorio Giovara
---
 libavcodec/proresdec2.c | 24 
 libavcodec/version.h|  2 +-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index 6b3021bdfa..130a4e3fe8 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -62,6 +62,30 @@ static av_cold int decode_init(AVCodecContext *avctx)
 permute(ctx->progressive_scan, ff_prores_progressive_scan, 
idct_permutation);
 permute(ctx->interlaced_scan, ff_prores_interlaced_scan, idct_permutation);
 
+switch (avctx->codec_tag) {
+case MKTAG('a','p','c','o'):
+avctx->profile = FF_PROFILE_PRORES_PROXY;
+break;
+case MKTAG('a','p','c','s'):
+avctx->profile = FF_PROFILE_PRORES_LT;
+break;
+case MKTAG('a','p','c','n'):
+avctx->profile = FF_PROFILE_PRORES_STANDARD;
+break;
+case MKTAG('a','p','c','h'):
+avctx->profile = FF_PROFILE_PRORES_HQ;
+break;
+case MKTAG('a','p','4','h'):
+avctx->profile = FF_PROFILE_PRORES_;
+break;
+case MKTAG('a','p','4','x'):
+avctx->profile = FF_PROFILE_PRORES_XQ;
+break;
+default:
+avctx->profile = FF_PROFILE_UNKNOWN;
+av_log(avctx, AV_LOG_WARNING, "Unknown prores profile %d\n", 
avctx->codec_tag);
+}
+
 return 0;
 }
 
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 91809641b4..d2ac30d4a8 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR  34
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
-- 
2.18.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/4] proresenc_nanatoliy: Rename a profile name with the correct one

2018-11-02 Thread Vittorio Giovara
In all Apple documentation, this profile is called Prores .
---
 libavcodec/proresenc_anatoliy.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 6b9ce4a59a..dbbf13f4c0 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -41,14 +41,14 @@
 #define FF_PROFILE_PRORES_LT1
 #define FF_PROFILE_PRORES_STANDARD  2
 #define FF_PROFILE_PRORES_HQ3
-#define FF_PROFILE_PRORES_444   4
+#define FF_PROFILE_PRORES_  4
 
 static const AVProfile profiles[] = {
 { FF_PROFILE_PRORES_PROXY,"apco"},
 { FF_PROFILE_PRORES_LT,   "apcs"},
 { FF_PROFILE_PRORES_STANDARD, "apcn"},
 { FF_PROFILE_PRORES_HQ,   "apch"},
-{ FF_PROFILE_PRORES_444,  "ap4h"},
+{ FF_PROFILE_PRORES_, "ap4h"},
 { FF_PROFILE_UNKNOWN }
 };
 
@@ -550,7 +550,7 @@ static int prores_encode_frame(AVCodecContext *avctx, 
AVPacket *pkt,
 bytestream_put_buffer(, "fmpg", 4);
 bytestream_put_be16(, avctx->width);
 bytestream_put_be16(, avctx->height);
-if (avctx->profile == FF_PROFILE_PRORES_444) {
+if (avctx->profile == FF_PROFILE_PRORES_) {
 *buf++ = 0xC2; // 444, not interlaced
 } else {
 *buf++ = 0x82; // 422, not interlaced
@@ -605,13 +605,13 @@ static av_cold int prores_encode_init(AVCodecContext 
*avctx)
 av_log(avctx, AV_LOG_INFO,
 "encoding with ProRes standard (apcn) profile\n");
 } else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) {
-avctx->profile = FF_PROFILE_PRORES_444;
+avctx->profile = FF_PROFILE_PRORES_;
 av_log(avctx, AV_LOG_INFO,
-   "encoding with ProRes 444 (ap4h) profile\n");
+   "encoding with ProRes  (ap4h) profile\n");
 }
 
 } else if (avctx->profile < FF_PROFILE_PRORES_PROXY
-|| avctx->profile > FF_PROFILE_PRORES_444) {
+|| avctx->profile > FF_PROFILE_PRORES_) {
 av_log(
 avctx,
 AV_LOG_ERROR,
@@ -622,13 +622,13 @@ static av_cold int prores_encode_init(AVCodecContext 
*avctx)
 av_log(avctx, AV_LOG_ERROR,
"encoding with ProRes 444 (ap4h) profile, need YUV444P10 
input\n");
 return AVERROR(EINVAL);
-}  else if ((avctx->pix_fmt == AV_PIX_FMT_YUV444P10) && (avctx->profile < 
FF_PROFILE_PRORES_444)){
+}  else if ((avctx->pix_fmt == AV_PIX_FMT_YUV444P10) && (avctx->profile < 
FF_PROFILE_PRORES_)){
 av_log(avctx, AV_LOG_ERROR,
"encoding with ProRes Proxy/LT/422/422 HQ (apco, apcs, apcn, 
ap4h) profile, need YUV422P10 input\n");
 return AVERROR(EINVAL);
 }
 
-if (avctx->profile < FF_PROFILE_PRORES_444) { /* 422 versions */
+if (avctx->profile < FF_PROFILE_PRORES_) { /* 422 versions */
 ctx->is_422 = 1;
 if ((avctx->height & 0xf) || (avctx->width & 0xf)) {
 ctx->fill_y = av_malloc(4 * (DEFAULT_SLICE_MB_WIDTH << 8));
-- 
2.18.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Add CUDA function cuDeviceGetAttribute V2

2018-11-02 Thread Soft Works
> LGTM, will apply next time I get a chance.

Thank you very much!

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avformat/hlsenc: check dirname and fix vtt problem

2018-11-02 Thread Steven Liu
check dirname before use it
refine webvtt code in the hls_delete_old_segments

Signed-off-by: Steven Liu 
---
 libavformat/hlsenc.c | 19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index f8f060d065..e0048aa9d8 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -415,6 +415,7 @@ static int hls_delete_old_segments(AVFormatContext *s, 
HLSContext *hls,
 int segment_cnt = 0;
 char *dirname = NULL, *p, *sub_path;
 char *path = NULL;
+char *vtt_dirname = NULL;
 AVDictionary *options = NULL;
 AVIOContext *out = NULL;
 const char *proto = NULL;
@@ -461,7 +462,7 @@ static int hls_delete_old_segments(AVFormatContext *s, 
HLSContext *hls,
 char * r_dirname = dirname;
 
 /* if %v is present in the file's directory */
-if (av_stristr(dirname, "%v")) {
+if (dirname && av_stristr(dirname, "%v")) {
 
 if (replace_int_data_in_filename(_dirname, dirname, 'v', 
segment->var_stream_idx) < 1) {
 ret = AVERROR(EINVAL);
@@ -499,23 +500,30 @@ static int hls_delete_old_segments(AVFormatContext *s, 
HLSContext *hls,
 }
 
 if ((segment->sub_filename[0] != '\0')) {
-sub_path_size = strlen(segment->sub_filename) + 1 + (dirname ? 
strlen(dirname) : 0);
+vtt_dirname = av_strdup(vs->vtt_avf->url);
+if (!vtt_dirname) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
+p = (char *)av_basename(vtt_dirname);
+*p = '\0';
+sub_path_size = strlen(segment->sub_filename) + 1 + (vtt_dirname ? 
strlen(vtt_dirname) : 0);
 sub_path = av_malloc(sub_path_size);
 if (!sub_path) {
 ret = AVERROR(ENOMEM);
 goto fail;
 }
 
-av_strlcpy(sub_path, dirname, sub_path_size);
+av_strlcpy(sub_path, vtt_dirname, sub_path_size);
 av_strlcat(sub_path, segment->sub_filename, sub_path_size);
 
 if (hls->method || (proto && !av_strcasecmp(proto, "http"))) {
 av_dict_set(, "method", "DELETE", 0);
-if ((ret = vs->avf->io_open(vs->avf, , sub_path, 
AVIO_FLAG_WRITE, )) < 0) {
+if ((ret = vs->vtt_avf->io_open(vs->vtt_avf, , sub_path, 
AVIO_FLAG_WRITE, )) < 0) {
 av_free(sub_path);
 goto fail;
 }
-ff_format_io_close(vs->avf, );
+ff_format_io_close(vs->vtt_avf, );
 } else if (unlink(sub_path) < 0) {
 av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: 
%s\n",
  sub_path, strerror(errno));
@@ -531,6 +539,7 @@ static int hls_delete_old_segments(AVFormatContext *s, 
HLSContext *hls,
 fail:
 av_free(path);
 av_free(dirname);
+av_free(vtt_dirname);
 
 return ret;
 }
-- 
2.15.1



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v5 4/4] lavc/libdavs2: fix wrong return value

2018-11-02 Thread hwren
Signed-off-by: hwren 
---
 libavcodec/libdavs2.c | 20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index 3e59d41..6e4bd50 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -147,15 +147,17 @@ static int davs2_decode_frame(AVCodecContext *avctx, void 
*data,
 if (!buf_size) {
 ret = davs2_decoder_flush(cad->decoder, >headerset, 
>out_frame);
 if (ret == DAVS2_END) {
-return 0;
+ret = 0;
 } else if (ret == DAVS2_GOT_FRAME) {
-*got_frame = davs2_dump_frames(avctx, >out_frame, 
>headerset, ret, frame);
+ret = davs2_dump_frames(avctx, >out_frame, >headerset, 
ret, frame);
 davs2_decoder_frame_unref(cad->decoder, >out_frame);
-return ret;
+if (ret == 0 || ret == 1) {
+*got_frame = ret;
+}
 } else {
-av_log(avctx, AV_LOG_ERROR, "Decoder error: dump frames failed\n");
-return AVERROR_EXTERNAL;
+av_log(avctx, AV_LOG_ERROR, "Decoder error: flush frames 
failed\n");
 }
+return ret;
 }
 
 cad->packet.data = buf_ptr;
@@ -174,8 +176,14 @@ static int davs2_decode_frame(AVCodecContext *avctx, void 
*data,
 ret = davs2_decoder_recv_frame(cad->decoder, >headerset, 
>out_frame);
 
 if (ret != DAVS2_DEFAULT) {
-*got_frame = davs2_dump_frames(avctx, >out_frame, 
>headerset, ret, frame);
+ret = davs2_dump_frames(avctx, >out_frame, >headerset, ret, 
frame);
 davs2_decoder_frame_unref(cad->decoder, >out_frame);
+if (ret == 0 || ret == 1) {
+*got_frame = ret;
+} else {
+av_log(avctx, AV_LOG_ERROR, "Decoder error: dump frames failed\n");
+return ret;
+}
 }
 
 return buf_size;
-- 
2.7.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v5 1/4] lavc/libdavs2: fix sequence incomplete output error

2018-11-02 Thread hwren
Signed-off-by: hwren 
---
 libavcodec/libdavs2.c | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index cadf995..e36bfed 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -129,7 +129,17 @@ static int davs2_decode_frame(AVCodecContext *avctx, void 
*data,
 int   ret  = DAVS2_DEFAULT;
 
 if (!buf_size) {
-return 0;
+ret = davs2_decoder_flush(cad->decoder, >headerset, 
>out_frame);
+if (ret == DAVS2_END) {
+return 0;
+} else if (ret == DAVS2_GOT_FRAME) {
+*got_frame = davs2_dump_frames(avctx, >out_frame, 
>headerset, ret, frame);
+davs2_decoder_frame_unref(cad->decoder, >out_frame);
+return ret;
+} else {
+av_log(avctx, AV_LOG_ERROR, "Decoder error: dump frames failed\n");
+return AVERROR_EXTERNAL;
+}
 }
 
 cad->packet.data = buf_ptr;
-- 
2.7.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v5 3/4] lavc/libdavs2: correct frame type setting

2018-11-02 Thread hwren
Signed-off-by: hwren 
---
 libavcodec/libdavs2.c | 21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index 6dc1173..3e59d41 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -76,6 +76,26 @@ static int davs2_dump_frames(AVCodecContext *avctx, 
davs2_picture_t *pic,
 return 0;
 }
 
+switch (pic->type) {
+case DAVS2_PIC_I:
+case DAVS2_PIC_G:
+frame->pict_type = AV_PICTURE_TYPE_I;
+break;
+case DAVS2_PIC_P:
+case DAVS2_PIC_S:
+frame->pict_type = AV_PICTURE_TYPE_P;
+break;
+case DAVS2_PIC_B:
+frame->pict_type = AV_PICTURE_TYPE_B;
+break;
+case DAVS2_PIC_F:
+frame->pict_type = AV_PICTURE_TYPE_S;
+break;
+default:
+av_log(avctx, AV_LOG_ERROR, "Decoder error: unknown frame type\n");
+return AVERROR_EXTERNAL;
+}
+
 for (plane = 0; plane < 3; ++plane) {
 int size_line = pic->widths[plane] * bytes_per_sample;
 frame->buf[plane]  = av_buffer_alloc(size_line * pic->lines[plane]);
@@ -97,7 +117,6 @@ static int davs2_dump_frames(AVCodecContext *avctx, 
davs2_picture_t *pic,
 frame->width = cad->headerset.width;
 frame->height= cad->headerset.height;
 frame->pts   = cad->out_frame.pts;
-frame->pict_type = pic->type;
 frame->format= avctx->pix_fmt;
 
 return 1;
-- 
2.7.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v5 2/4] lavc/libdavs2: remove unused frame counter

2018-11-02 Thread hwren
Signed-off-by: hwren 
---
 libavcodec/libdavs2.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index e36bfed..6dc1173 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -32,8 +32,6 @@ typedef struct DAVS2Context {
 davs2_param_tparam;  // decoding parameters
 davs2_packet_t   packet; // input bitstream
 
-int decoded_frames;
-
 davs2_picture_t  out_frame;  // output data, frame data
 davs2_seq_info_t headerset;  // output data, sequence header
 
@@ -102,7 +100,6 @@ static int davs2_dump_frames(AVCodecContext *avctx, 
davs2_picture_t *pic,
 frame->pict_type = pic->type;
 frame->format= avctx->pix_fmt;
 
-cad->decoded_frames++;
 return 1;
 }
 
-- 
2.7.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/vf_transpose_npp: adding NV12 support to transpose_npp filter

2018-11-02 Thread Timo Rothenpieler

On 02/11/2018 13:35, Roman Arzumanyan wrote:

Hello,

This patch adds NV12 support to vf_transpose_npp filter.
Now filter can be used in nvdec -> nvenc transcoding scenarios like this:
ffmpeg -hwaccel cuvid -c:v h264_cuvid  -i input.h264 -c:v h264_nvenc -vf 
transpose_npp="dir=clock" -y output.h264

--
BR, Roman Arzumanyan


This was intentionally omitted to avoid code duplication with scale_npp.

What you can do right now is
-vf scale_npp=format=yuv420p,transpose_npp=dir=clock

Optionally another ,scale_npp=format=nv12 at the end, to go back to 
nv12. But as nvenc can take yuv420p input, this is not necessary in most 
cases.


This should perform the exact same operations as adding the 
de/interleaving functionality to the transpose_npp filter itself, and 
thus not perform worse in any way.




smime.p7s
Description: S/MIME Cryptographic Signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter/vf_transpose_npp: adding NV12 support to transpose_npp filter

2018-11-02 Thread Roman Arzumanyan
Hello,

This patch adds NV12 support to vf_transpose_npp filter.
Now filter can be used in nvdec -> nvenc transcoding scenarios like this:
ffmpeg -hwaccel cuvid -c:v h264_cuvid  -i input.h264 -c:v h264_nvenc -vf 
transpose_npp="dir=clock" -y output.h264

--
BR, Roman Arzumanyan


---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---


0001-Adding-NV12-support-to-transpose_npp-filter.patch
Description: 0001-Adding-NV12-support-to-transpose_npp-filter.patch
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/aacenc: set pce value by options pce

2018-11-02 Thread Carl Eugen Hoyos
2018-11-02 13:20 GMT+01:00, Hendrik Leppkes :
> On Fri, Nov 2, 2018 at 1:13 PM Carl Eugen Hoyos  wrote:

>> Isn't the main issue that FFmpeg suddenly started to assume for
>> some very common layouts that they are not supported while
>> they were supported without PCE before and worked fine in every
>> sensible use-case?
>
> How can a layout be supported without PCE if its not part of the
> default channel layout map?

IRL, there is no difference between 5.1 back and 5.1 side.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/aacenc: set pce value by options pce

2018-11-02 Thread Hendrik Leppkes
On Fri, Nov 2, 2018 at 1:13 PM Carl Eugen Hoyos  wrote:
>
> 2018-11-02 11:13 GMT+01:00, Hendrik Leppkes :
> > On Fri, Nov 2, 2018 at 10:17 AM Steven Liu  wrote:
> >>
> >> fix ticket: 7504
> >>
> >> Signed-off-by: Steven Liu 
> >> ---
> >>  libavcodec/aacenc.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
> >> index 4d0abb107f..26175bdb39 100644
> >> --- a/libavcodec/aacenc.c
> >> +++ b/libavcodec/aacenc.c
> >> @@ -973,7 +973,7 @@ static av_cold int aac_encode_init(AVCodecContext
> >> *avctx)
> >>  /* Channel map and unspecified bitrate guessing */
> >>  s->channels = avctx->channels;
> >>
> >> -s->needs_pce = 1;
> >> +s->needs_pce = s->options.pce;
> >>  for (i = 0; i < FF_ARRAY_ELEMS(aac_normal_chan_layouts); i++) {
> >>  if (avctx->channel_layout == aac_normal_chan_layouts[i]) {
> >>  s->needs_pce = s->options.pce;
> >
> > This doesn't seem correct. PCE should be used if you feed the
> > encode a channel layout thats not supported without PCE
>
> Isn't the main issue that FFmpeg suddenly started to assume for
> some very common layouts that they are not supported while
> they were supported without PCE before and worked fine in every
> sensible use-case?

How can a layout be supported without PCE if its not part of the
default channel layout map?
Does it give you a best guess match? That seems terrible. It should
explicitly encode what you give it, and not "interpet" it, thats up to
the user.

- Hendrik
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v4 1/4] lavc/libdavs2: fix sequence incomplete output error

2018-11-02 Thread Carl Eugen Hoyos
2018-11-02 9:47 GMT+01:00, hwren :
> Signed-off-by: hwren 
> ---
>  libavcodec/libdavs2.c | 11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
> index cadf995..e463b2e 100644
> --- a/libavcodec/libdavs2.c
> +++ b/libavcodec/libdavs2.c
> @@ -129,7 +129,16 @@ static int davs2_decode_frame(AVCodecContext *avctx,
> void *data,
>  int   ret  = DAVS2_DEFAULT;
>
>  if (!buf_size) {
> -return 0;
> +ret = davs2_decoder_flush(cad->decoder, >headerset,
> >out_frame);
> +if (ret == DAVS2_END) {
> +return 0;
> +} else if (ret == DAVS2_GOT_FRAME) {
> +*got_frame = davs2_dump_frames(avctx, >out_frame,
> >headerset, ret, frame);
> +davs2_decoder_frame_unref(cad->decoder, >out_frame);
> +return ret;
> +} else {

> +return AVERROR_EXTERNAL;

Do I understand correctly that this is not supposed to happen?
If it can happen, please print an error message.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/aacenc: set pce value by options pce

2018-11-02 Thread Carl Eugen Hoyos
2018-11-02 11:13 GMT+01:00, Hendrik Leppkes :
> On Fri, Nov 2, 2018 at 10:17 AM Steven Liu  wrote:
>>
>> fix ticket: 7504
>>
>> Signed-off-by: Steven Liu 
>> ---
>>  libavcodec/aacenc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
>> index 4d0abb107f..26175bdb39 100644
>> --- a/libavcodec/aacenc.c
>> +++ b/libavcodec/aacenc.c
>> @@ -973,7 +973,7 @@ static av_cold int aac_encode_init(AVCodecContext
>> *avctx)
>>  /* Channel map and unspecified bitrate guessing */
>>  s->channels = avctx->channels;
>>
>> -s->needs_pce = 1;
>> +s->needs_pce = s->options.pce;
>>  for (i = 0; i < FF_ARRAY_ELEMS(aac_normal_chan_layouts); i++) {
>>  if (avctx->channel_layout == aac_normal_chan_layouts[i]) {
>>  s->needs_pce = s->options.pce;
>
> This doesn't seem correct. PCE should be used if you feed the
> encode a channel layout thats not supported without PCE

Isn't the main issue that FFmpeg suddenly started to assume for
some very common layouts that they are not supported while
they were supported without PCE before and worked fine in every
sensible use-case?
(And that apparently typical decoders do not support these "new"
layouts with PCE?)

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/aacenc: set pce value by options pce

2018-11-02 Thread Hendrik Leppkes
On Fri, Nov 2, 2018 at 10:17 AM Steven Liu  wrote:
>
> fix ticket: 7504
>
> Signed-off-by: Steven Liu 
> ---
>  libavcodec/aacenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
> index 4d0abb107f..26175bdb39 100644
> --- a/libavcodec/aacenc.c
> +++ b/libavcodec/aacenc.c
> @@ -973,7 +973,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
>  /* Channel map and unspecified bitrate guessing */
>  s->channels = avctx->channels;
>
> -s->needs_pce = 1;
> +s->needs_pce = s->options.pce;
>  for (i = 0; i < FF_ARRAY_ELEMS(aac_normal_chan_layouts); i++) {
>  if (avctx->channel_layout == aac_normal_chan_layouts[i]) {
>  s->needs_pce = s->options.pce;

This doesn't seem correct. PCE should be used if you feed the encode a
channel layout thats not supported without PCE - and the loop just
below your changed line will turn PCE off (or rather defer to the user
option) if a layout is used that doesn't need PCE.
If you just blindly turn PCE off, you'll cause  endless regressions
for uncommon channel layouts.

- Hendrik
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/aacenc: set pce value by options pce

2018-11-02 Thread Hendrik Leppkes
On Fri, Nov 2, 2018 at 11:13 AM Hendrik Leppkes  wrote:
>
> On Fri, Nov 2, 2018 at 10:17 AM Steven Liu  wrote:
> >
> > fix ticket: 7504
> >
> > Signed-off-by: Steven Liu 
> > ---
> >  libavcodec/aacenc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
> > index 4d0abb107f..26175bdb39 100644
> > --- a/libavcodec/aacenc.c
> > +++ b/libavcodec/aacenc.c
> > @@ -973,7 +973,7 @@ static av_cold int aac_encode_init(AVCodecContext 
> > *avctx)
> >  /* Channel map and unspecified bitrate guessing */
> >  s->channels = avctx->channels;
> >
> > -s->needs_pce = 1;
> > +s->needs_pce = s->options.pce;
> >  for (i = 0; i < FF_ARRAY_ELEMS(aac_normal_chan_layouts); i++) {
> >  if (avctx->channel_layout == aac_normal_chan_layouts[i]) {
> >  s->needs_pce = s->options.pce;
>
> This doesn't seem correct. PCE should be used if you feed the encode a
> channel layout thats not supported without PCE - and the loop just
> below your changed line will turn PCE off (or rather defer to the user
> option) if a layout is used that doesn't need PCE.
> If you just blindly turn PCE off, you'll cause  endless regressions
> for uncommon channel layouts.
>

What I forgot to say, the actual problem with HLS is that it doesn't
deal properly with PCEs. The solution is not to turn off PCEs, but to
actually fix the ADTS muxer to properly handle PCE.

- Hendrik
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v4 3/4] lavc/libdavs2: correct frame type setting

2018-11-02 Thread hwren
Signed-off-by: hwren 
---
 libavcodec/libdavs2.c | 21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index a1815d2..4dbce73 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -76,6 +76,26 @@ static int davs2_dump_frames(AVCodecContext *avctx, 
davs2_picture_t *pic,
 return 0;
 }
 
+switch (pic->type) {
+case DAVS2_PIC_I:
+case DAVS2_PIC_G:
+frame->pict_type = AV_PICTURE_TYPE_I;
+break;
+case DAVS2_PIC_P:
+case DAVS2_PIC_S:
+frame->pict_type = AV_PICTURE_TYPE_P;
+break;
+case DAVS2_PIC_B:
+frame->pict_type = AV_PICTURE_TYPE_B;
+break;
+case DAVS2_PIC_F:
+frame->pict_type = AV_PICTURE_TYPE_S;
+break;
+default:
+av_log(avctx, AV_LOG_ERROR, "Decoder error: unknown frame type\n");
+return AVERROR_EXTERNAL;
+}
+
 for (plane = 0; plane < 3; ++plane) {
 int size_line = pic->widths[plane] * bytes_per_sample;
 frame->buf[plane]  = av_buffer_alloc(size_line * pic->lines[plane]);
@@ -97,7 +117,6 @@ static int davs2_dump_frames(AVCodecContext *avctx, 
davs2_picture_t *pic,
 frame->width = cad->headerset.width;
 frame->height= cad->headerset.height;
 frame->pts   = cad->out_frame.pts;
-frame->pict_type = pic->type;
 frame->format= avctx->pix_fmt;
 
 return 1;
-- 
2.7.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v4 2/4] lavc/libdavs2: remove unused frame counter

2018-11-02 Thread hwren
Signed-off-by: hwren 
---
 libavcodec/libdavs2.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index e463b2e..a1815d2 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -32,8 +32,6 @@ typedef struct DAVS2Context {
 davs2_param_tparam;  // decoding parameters
 davs2_packet_t   packet; // input bitstream
 
-int decoded_frames;
-
 davs2_picture_t  out_frame;  // output data, frame data
 davs2_seq_info_t headerset;  // output data, sequence header
 
@@ -102,7 +100,6 @@ static int davs2_dump_frames(AVCodecContext *avctx, 
davs2_picture_t *pic,
 frame->pict_type = pic->type;
 frame->format= avctx->pix_fmt;
 
-cad->decoded_frames++;
 return 1;
 }
 
-- 
2.7.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v4 4/4] lavc/libdavs2: fix wrong return value

2018-11-02 Thread hwren
Signed-off-by: hwren 
---
 libavcodec/libdavs2.c | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index 4dbce73..d912dd8 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -147,14 +147,15 @@ static int davs2_decode_frame(AVCodecContext *avctx, void 
*data,
 if (!buf_size) {
 ret = davs2_decoder_flush(cad->decoder, >headerset, 
>out_frame);
 if (ret == DAVS2_END) {
-return 0;
+ret = 0;
 } else if (ret == DAVS2_GOT_FRAME) {
-*got_frame = davs2_dump_frames(avctx, >out_frame, 
>headerset, ret, frame);
+ret = davs2_dump_frames(avctx, >out_frame, >headerset, 
ret, frame);
 davs2_decoder_frame_unref(cad->decoder, >out_frame);
-return ret;
-} else {
-return AVERROR_EXTERNAL;
+if (ret == 0 || ret == 1) {
+*got_frame = ret;
+}
 }
+return ret;
 }
 
 cad->packet.data = buf_ptr;
@@ -173,8 +174,13 @@ static int davs2_decode_frame(AVCodecContext *avctx, void 
*data,
 ret = davs2_decoder_recv_frame(cad->decoder, >headerset, 
>out_frame);
 
 if (ret != DAVS2_DEFAULT) {
-*got_frame = davs2_dump_frames(avctx, >out_frame, 
>headerset, ret, frame);
+ret = davs2_dump_frames(avctx, >out_frame, >headerset, ret, 
frame);
 davs2_decoder_frame_unref(cad->decoder, >out_frame);
+if (ret == 0 || ret == 1) {
+*got_frame = ret;
+} else {
+return ret;
+}
 }
 
 return buf_size;
-- 
2.7.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v4 1/4] lavc/libdavs2: fix sequence incomplete output error

2018-11-02 Thread hwren
Signed-off-by: hwren 
---
 libavcodec/libdavs2.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index cadf995..e463b2e 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -129,7 +129,16 @@ static int davs2_decode_frame(AVCodecContext *avctx, void 
*data,
 int   ret  = DAVS2_DEFAULT;
 
 if (!buf_size) {
-return 0;
+ret = davs2_decoder_flush(cad->decoder, >headerset, 
>out_frame);
+if (ret == DAVS2_END) {
+return 0;
+} else if (ret == DAVS2_GOT_FRAME) {
+*got_frame = davs2_dump_frames(avctx, >out_frame, 
>headerset, ret, frame);
+davs2_decoder_frame_unref(cad->decoder, >out_frame);
+return ret;
+} else {
+return AVERROR_EXTERNAL;
+}
 }
 
 cad->packet.data = buf_ptr;
-- 
2.7.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec/aacenc: set pce value by options pce

2018-11-02 Thread Steven Liu
fix ticket: 7504

Signed-off-by: Steven Liu 
---
 libavcodec/aacenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 4d0abb107f..26175bdb39 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -973,7 +973,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
 /* Channel map and unspecified bitrate guessing */
 s->channels = avctx->channels;
 
-s->needs_pce = 1;
+s->needs_pce = s->options.pce;
 for (i = 0; i < FF_ARRAY_ELEMS(aac_normal_chan_layouts); i++) {
 if (avctx->channel_layout == aac_normal_chan_layouts[i]) {
 s->needs_pce = s->options.pce;
-- 
2.15.2 (Apple Git-101.1)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Add CUDA function cuDeviceGetAttribute V2

2018-11-02 Thread Timo Rothenpieler

LGTM, will apply next time I get a chance.



smime.p7s
Description: S/MIME Cryptographic Signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add skipblend filter

2018-11-02 Thread Matthias Troffaes
Dear Paul,

On Thu, Nov 1, 2018 at 5:26 PM Paul B Mahol  wrote:
> > I found a way of doing this differently, as I now found that tmix
> > doesn't actually step frames, unlike skipblend. For history's sake,
> > the way to get skipblend behaviour is to do something like
> > "tmix=frames=100,framestep=150" for instance assuming you want to
> > blend 100 frames, skip 50, and so on. It is *much* slower compared to
> > skipblend by quite a large factor, as tmix does a lot of redundant
> > computations, but it works.
>
> I think that adding option to skip some frames can be added.

Thanks, that would be quite useful for performance. I'll then have a
look at contributing a patch to implement such option.

Kind regards,
Matthias
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH V3] libavfilter/vaapi: enable vaapi rotation feature via call Intel iHD driver

2018-11-02 Thread Zhou, Zachary
Thanks Mark, I am considering it.
I will send a new patch including  both vaapi rotation and mirroring.

> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of
> Mark Thompson
> Sent: Thursday, November 1, 2018 7:36 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH V3] libavfilter/vaapi: enable vaapi
> rotation feature via call Intel iHD driver
> 
> On 31/10/18 02:43, Zachary Zhou wrote:
> > libavfilter/vaapi: enable vaapi rotation feature via call Intel iHD
> > driver
> 
> I'd make the title something like "libavfilter: add rotate_vaapi filter".  
> There is
> no reason to mention a particular implementation - anyone can implement
> this API.
> 
> > It supports clockwise rotation by 0/90/180/270 degrees defined in
> > va/va_vpp.h, tested following command line on SKL platform
> >
> > ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128
> > -hwaccel_output_format vaapi -i input.264 -vf "rotation_vaapi=angle=180"
> > -c:v h264_vaapi output.h264
> >
> > Signed-off-by: Zachary Zhou 
> > ---
> >  configure |   4 +
> >  libavfilter/Makefile  |   1 +
> >  libavfilter/allfilters.c  |   1 +
> >  libavfilter/vaapi_vpp.h   |   1 +
> >  libavfilter/vf_rotate_vaapi.c | 252
> > ++
> >  5 files changed, 259 insertions(+)
> >  create mode 100644 libavfilter/vf_rotate_vaapi.c
> 
> Referencing other discussion, I think this filter should do both the rotation 
> and
> mirroring features.  I don't know what the filter should be called, though -
> matching the transpose filter as transpose_vaapi seems the most logical
> choice to me, but I admit the exact options aren't quite right.
> 
> The effect of rotating by one or three right angles surprised me - I would
> expect the size to be changed as well, so a 1280x720 input becomes a
> 720x1280 output rather than squishing the video.
> 
> > diff --git a/configure b/configure
> > index 85d5dd5962..4b5718135e 100755
> > --- a/configure
> > +++ b/configure
> > @@ -3439,6 +3439,7 @@ scale_filter_deps="swscale"
> >  scale_qsv_filter_deps="libmfx"
> >  select_filter_select="pixelutils"
> >  sharpness_vaapi_filter_deps="vaapi"
> > +rotation_vaapi_filter_deps="vaapi"
> >  showcqt_filter_deps="avcodec avformat swscale"
> >  showcqt_filter_suggest="libfontconfig libfreetype"
> >  showcqt_filter_select="fft"
> > @@ -6390,6 +6391,9 @@ if enabled vaapi; then
> >  fi
> >
> >  check_cpp_condition vaapi_1 "va/va.h" "VA_CHECK_VERSION(1, 0, 0)"
> > +if ! check_struct "va/va.h" "struct _VAProcPipelineCaps" 
> > rotation_flags;
> then
> > +disable rotation_vaapi_filter
> > +fi
> 
> Use the dependencies instead like other components.  (See
> vp9_vaapi_hwaccel for a check_struct like this one.)
> 
> >  fi
> >
> >  if enabled_all opencl libdrm ; then
> > diff --git a/libavfilter/Makefile b/libavfilter/Makefile index
> > 108a2f87d7..534650364a 100644
> > --- a/libavfilter/Makefile
> > +++ b/libavfilter/Makefile
> > @@ -349,6 +349,7 @@ OBJS-$(CONFIG_SETRANGE_FILTER)   +=
> vf_setparams.o
> >  OBJS-$(CONFIG_SETSAR_FILTER) += vf_aspect.o
> >  OBJS-$(CONFIG_SETTB_FILTER)  += settb.o
> >  OBJS-$(CONFIG_SHARPNESS_VAAPI_FILTER)+= vf_misc_vaapi.o
> vaapi_vpp.o
> > +OBJS-$(CONFIG_ROTATION_VAAPI_FILTER) += vf_rotate_vaapi.o
> vaapi_vpp.o
> >  OBJS-$(CONFIG_SHOWINFO_FILTER)   += vf_showinfo.o
> >  OBJS-$(CONFIG_SHOWPALETTE_FILTER)+= vf_showpalette.o
> >  OBJS-$(CONFIG_SHUFFLEFRAMES_FILTER)  += vf_shuffleframes.o
> > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index
> > 557590850b..4b90a7f440 100644
> > --- a/libavfilter/allfilters.c
> > +++ b/libavfilter/allfilters.c
> > @@ -333,6 +333,7 @@ extern AVFilter ff_vf_setrange;  extern AVFilter
> > ff_vf_setsar;  extern AVFilter ff_vf_settb;  extern AVFilter
> > ff_vf_sharpness_vaapi;
> > +extern AVFilter ff_vf_rotation_vaapi;
> >  extern AVFilter ff_vf_showinfo;
> >  extern AVFilter ff_vf_showpalette;
> >  extern AVFilter ff_vf_shuffleframes;
> > diff --git a/libavfilter/vaapi_vpp.h b/libavfilter/vaapi_vpp.h index
> > 0bc31018d4..cfe19b689f 100644
> > --- a/libavfilter/vaapi_vpp.h
> > +++ b/libavfilter/vaapi_vpp.h
> > @@ -44,6 +44,7 @@ typedef struct VAAPIVPPContext {
> >  int output_width;   // computed width
> >  int output_height;  // computed height
> >
> > +int rotation_state;
> 
> No reason to put this in the common context, it can be in the rotate-specific
> one.

I put int rotation_state here, just because of the share code between this 
filter and vf_misc_vaapi.c,
I will consider move it.

> 
> >  VABufferID filter_buffers[VAProcFilterCount];
> >  intnb_filter_buffers;
> >
> > diff --git a/libavfilter/vf_rotate_vaapi.c
> > b/libavfilter/vf_rotate_vaapi.c new file mode 100644 index
> > 00..82e2a0fce4
> > --- /dev/null
> > +++