Re: [FFmpeg-devel] [PATCH] avfilter/cropdetect: add option for initial skip

2020-12-08 Thread Gyan Doshi

Thanks. Pushed as e5119ad3377e2c4cb20a7aff56448d035b55

On 08-12-2020 07:02 pm, Paul B Mahol wrote:

lgtm

On Tue, Dec 8, 2020 at 2:29 PM Gyan Doshi  wrote:


The cropdetect filter, at present, skips the first two frames. This
behaviour is hardcoded.

New option 'skip' allows users to change this. Convenient for when
input is a single image or a trimmed video stream.

Default is kept at 2 to preserve current behaviour.
---
  doc/filters.texi|  4 
  libavfilter/vf_cropdetect.c | 10 ++
  2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 62d6e26a02..d9f606604e 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -8899,6 +8899,10 @@ The value which the width/height should be
divisible by. It defaults to
  get only even dimensions (needed for 4:2:2 video). 16 is best when
  encoding to most video codecs.

+@item skip
+Set the number of initial frames for which evaluation is skipped.
+Default is 2. Range is 0 to INT_MAX.
+
  @item reset_count, reset
  Set the counter that determines after how many frames cropdetect will
  reset the previously detected largest video area and start over to
diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
index 7c7d0b953a..5ae87cad2d 100644
--- a/libavfilter/vf_cropdetect.c
+++ b/libavfilter/vf_cropdetect.c
@@ -37,6 +37,7 @@ typedef struct CropDetectContext {
  int x1, y1, x2, y2;
  float limit;
  int round;
+int skip;
  int reset_count;
  int frame_nb;
  int max_pixsteps[4];
@@ -127,10 +128,10 @@ static av_cold int init(AVFilterContext *ctx)
  {
  CropDetectContext *s = ctx->priv;

-s->frame_nb = -2;
+s->frame_nb = -1 * s->skip;

-av_log(ctx, AV_LOG_VERBOSE, "limit:%f round:%d reset_count:%d\n",
-   s->limit, s->round, s->reset_count);
+av_log(ctx, AV_LOG_VERBOSE, "limit:%f round:%d skip:%d
reset_count:%d\n",
+   s->limit, s->round, s->skip, s->reset_count);

  return 0;
  }
@@ -167,7 +168,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
*frame)
  int outliers, last_y;
  int limit = lrint(s->limit);

-// ignore first 2 frames - they may be empty
+// ignore first s->skip frames
  if (++s->frame_nb > 0) {
  metadata = &frame->metadata;

@@ -247,6 +248,7 @@ static const AVOption cropdetect_options[] = {
  { "limit", "Threshold below which the pixel is considered black",
OFFSET(limit),   AV_OPT_TYPE_FLOAT, { .dbl = 24.0/255 }, 0, 65535,
FLAGS },
  { "round", "Value by which the width/height should be divisible",
OFFSET(round),   AV_OPT_TYPE_INT, { .i64 = 16 }, 0, INT_MAX, FLAGS },
  { "reset", "Recalculate the crop area after this many frames",
OFFSET(reset_count), AV_OPT_TYPE_INT, { .i64 = 0 },  0, INT_MAX, FLAGS },
+{ "skip",  "Number of initial frames to skip",
OFFSET(skip),AV_OPT_TYPE_INT, { .i64 = 2 },  0, INT_MAX, FLAGS },
  { "reset_count", "Recalculate the crop area after this many
frames",OFFSET(reset_count),AV_OPT_TYPE_INT,{ .i64 = 0 },  0, INT_MAX,
FLAGS },
  { "max_outliers", "Threshold count of outliers",
OFFSET(max_outliers),AV_OPT_TYPE_INT, { .i64 = 0 },  0, INT_MAX, FLAGS },
  { NULL }
--
2.27.0

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: check for SpeedHQ encoder

2020-12-08 Thread Gyan Doshi

Thanks. Pushed as b9b719fedc532ebc6bbde711d60985e8cb5957b2

On 08-12-2020 07:06 pm, Paul B Mahol wrote:

lgtm

On Tue, Dec 8, 2020 at 2:36 PM Gyan Doshi  wrote:


Avoids build failure when mpegvideo_enc is built but SpeedHQ encoder
isn't.
---
  libavcodec/mpegvideo_enc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 7afc789ec0..243d3ca632 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -2996,7 +2996,7 @@ static int encode_thread(AVCodecContext *c, void
*arg){
  s->first_slice_line = 1;
  s->ptr_lastgob = s->pb.buf;
  for (mb_y_order = s->start_mb_y; mb_y_order < s->end_mb_y;
mb_y_order++) {
-if (s->codec_id == AV_CODEC_ID_SPEEDHQ) {
+if (CONFIG_SPEEDHQ_ENCODER && s->codec_id == AV_CODEC_ID_SPEEDHQ)
{
  int first_in_slice;
  mb_y = ff_speedhq_mb_y_order_to_mb(mb_y_order, s->mb_height,
&first_in_slice);
  if (first_in_slice && mb_y_order != s->start_mb_y)
--
2.27.0

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2] doc/muxers: correct description of hls_enc_key and hls_enc_iv

2020-12-08 Thread Gyan Doshi

LGTM.

On 09-12-2020 11:09 am, liuqi05 wrote:

From: Steven Liu 

because hls_enc_key and hls_enc_iv get 16byte char
for example:
-hls_enc_key 0123456789abcdef -hls_enc_iv abcdefghijklmnop

Signed-off-by: liuqi05 
---
  doc/muxers.texi | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 179b923951..8e12acaa28 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -831,7 +831,7 @@ When enabled every segment generated is encrypted and the 
encryption key
  is saved as @var{playlist name}.key.
  
  @item -hls_enc_key @var{key}

-Hex-coded 16byte key to encrypt the segments, by default it
+16-octet key to encrypt the segments, by default it
  is randomly generated.
  
  @item -hls_enc_key_url @var{keyurl}

@@ -839,7 +839,7 @@ If set, @var{keyurl} is prepended instead of @var{baseurl} 
to the key filename
  in the playlist.
  
  @item -hls_enc_iv @var{iv}

-Hex-coded 16byte initialization vector for every segment instead
+16-octet initialization vector for every segment instead
  of the autogenerated ones.
  
  @item hls_segment_type @var{flags}


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] libavformat/movenc: add support for HEVC in .3gp

2020-12-08 Thread hisunzhenliang
From: SunZhenliang 

Just add HEVC's tag in 3gp tag list and it works to support HEVC in
3gp files.

Signed-off-by: SunZhenliang 
---
 libavformat/movenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 18fa3f9b5e..8715cb6e5c 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -7103,6 +7103,7 @@ static int mov_check_bitstream(struct AVFormatContext *s, 
const AVPacket *pkt)
 static const AVCodecTag codec_3gp_tags[] = {
 { AV_CODEC_ID_H263, MKTAG('s','2','6','3') },
 { AV_CODEC_ID_H264, MKTAG('a','v','c','1') },
+{ AV_CODEC_ID_HEVC, MKTAG('h','e','v','1') },
 { AV_CODEC_ID_MPEG4,MKTAG('m','p','4','v') },
 { AV_CODEC_ID_AAC,  MKTAG('m','p','4','a') },
 { AV_CODEC_ID_AMR_NB,   MKTAG('s','a','m','r') },
-- 
2.20.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-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] doc/muxers: correct decribe of hls_enc_key and hls_enc_iv

2020-12-08 Thread Steven Liu


> 2020年12月9日 下午12:42,Gyan Doshi  写道:
> 
> And title:
> 
> doc/muxers: correct description of hls_enc_key and hls_enc_iv
> 
> On 09-12-2020 09:52 am, Gyan Doshi wrote:
>> 
>> 
>> On 09-12-2020 06:52 am, liuqi05 wrote:
>>> From: Steven Liu 
>>> 
>>> because hls_enc_key and hls_enc_iv get 16byte char
>>> for example:
>>> -hls_enc_key 0123456789abcdef -hls_enc_iv abcdefghijklmnop
>>> 
>>> Signed-off-by: liuqi05 
>>> ---
>>>   doc/muxers.texi | 4 ++--
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/doc/muxers.texi b/doc/muxers.texi
>>> index 179b923951..5907fd0ba0 100644
>>> --- a/doc/muxers.texi
>>> +++ b/doc/muxers.texi
>>> @@ -831,7 +831,7 @@ When enabled every segment generated is encrypted and 
>>> the encryption key
>>>   is saved as @var{playlist name}.key.
>>> @item -hls_enc_key @var{key}
>>> -Hex-coded 16byte key to encrypt the segments, by default it
>>> +16byte key to encrypt the segments, by default it
>> 
>> 16-byte or 16-octet (what RFC 8216 uses)
>> 
>>>   is randomly generated.
>>> @item -hls_enc_key_url @var{keyurl}
>>> @@ -839,7 +839,7 @@ If set, @var{keyurl} is prepended instead of 
>>> @var{baseurl} to the key filename
>>>   in the playlist.
>>> @item -hls_enc_iv @var{iv}
>>> -Hex-coded 16byte initialization vector for every segment instead
>>> +16byte initialization vector for every segment instead
>> 
>> same
>>>   of the autogenerated ones.
>>> @item hls_segment_type @var{flags}
>> 
>> Regards,
>> Gyan

Thanks for your review, Gyan,
New version submitted.
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20201209053922.91123-1-liuq...@kuaishou.com/



Thanks

Steven Liu



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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH v2] doc/muxers: correct description of hls_enc_key and hls_enc_iv

2020-12-08 Thread liuqi05
From: Steven Liu 

because hls_enc_key and hls_enc_iv get 16byte char
for example:
-hls_enc_key 0123456789abcdef -hls_enc_iv abcdefghijklmnop

Signed-off-by: liuqi05 
---
 doc/muxers.texi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 179b923951..8e12acaa28 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -831,7 +831,7 @@ When enabled every segment generated is encrypted and the 
encryption key
 is saved as @var{playlist name}.key.
 
 @item -hls_enc_key @var{key}
-Hex-coded 16byte key to encrypt the segments, by default it
+16-octet key to encrypt the segments, by default it
 is randomly generated.
 
 @item -hls_enc_key_url @var{keyurl}
@@ -839,7 +839,7 @@ If set, @var{keyurl} is prepended instead of @var{baseurl} 
to the key filename
 in the playlist.
 
 @item -hls_enc_iv @var{iv}
-Hex-coded 16byte initialization vector for every segment instead
+16-octet initialization vector for every segment instead
 of the autogenerated ones.
 
 @item hls_segment_type @var{flags}
-- 
2.25.0



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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] doc/muxers: correct decribe of hls_enc_key and hls_enc_iv

2020-12-08 Thread Steven Liu


> 2020年12月9日 下午12:22,Gyan Doshi  写道:
> 
> 
> 
> On 09-12-2020 06:52 am, liuqi05 wrote:
>> From: Steven Liu 
>> 
>> because hls_enc_key and hls_enc_iv get 16byte char
>> for example:
>> -hls_enc_key 0123456789abcdef -hls_enc_iv abcdefghijklmnop
>> 
>> Signed-off-by: liuqi05 
>> ---
>>  doc/muxers.texi | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/doc/muxers.texi b/doc/muxers.texi
>> index 179b923951..5907fd0ba0 100644
>> --- a/doc/muxers.texi
>> +++ b/doc/muxers.texi
>> @@ -831,7 +831,7 @@ When enabled every segment generated is encrypted and 
>> the encryption key
>>  is saved as @var{playlist name}.key.
>>@item -hls_enc_key @var{key}
>> -Hex-coded 16byte key to encrypt the segments, by default it
>> +16byte key to encrypt the segments, by default it
> 
> 16-byte or 16-octet (what RFC 8216 uses)
8216 said " [AES_128] encryption uses 16-octet keys.  If the KEYFORMAT of an 
EXT-
   X-KEY tag is "identity", the Key file is a single packed array of 16
   octets in binary format."
> 
>>  is randomly generated.
>>@item -hls_enc_key_url @var{keyurl}
>> @@ -839,7 +839,7 @@ If set, @var{keyurl} is prepended instead of 
>> @var{baseurl} to the key filename
>>  in the playlist.
>>@item -hls_enc_iv @var{iv}
>> -Hex-coded 16byte initialization vector for every segment instead
>> +16byte initialization vector for every segment instead
> 
> same
>>  of the autogenerated ones.
>>@item hls_segment_type @var{flags}
> 
> Regards,
> Gyan
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Thanks

Steven Liu



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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] doc/muxers: correct decribe of hls_enc_key and hls_enc_iv

2020-12-08 Thread Gyan Doshi

And title:

doc/muxers: correct description of hls_enc_key and hls_enc_iv

On 09-12-2020 09:52 am, Gyan Doshi wrote:



On 09-12-2020 06:52 am, liuqi05 wrote:

From: Steven Liu 

because hls_enc_key and hls_enc_iv get 16byte char
for example:
-hls_enc_key 0123456789abcdef -hls_enc_iv abcdefghijklmnop

Signed-off-by: liuqi05 
---
  doc/muxers.texi | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 179b923951..5907fd0ba0 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -831,7 +831,7 @@ When enabled every segment generated is encrypted 
and the encryption key

  is saved as @var{playlist name}.key.
    @item -hls_enc_key @var{key}
-Hex-coded 16byte key to encrypt the segments, by default it
+16byte key to encrypt the segments, by default it


16-byte or 16-octet (what RFC 8216 uses)


  is randomly generated.
    @item -hls_enc_key_url @var{keyurl}
@@ -839,7 +839,7 @@ If set, @var{keyurl} is prepended instead of 
@var{baseurl} to the key filename

  in the playlist.
    @item -hls_enc_iv @var{iv}
-Hex-coded 16byte initialization vector for every segment instead
+16byte initialization vector for every segment instead


same

  of the autogenerated ones.
    @item hls_segment_type @var{flags}


Regards,
Gyan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] doc/muxers: correct decribe of hls_enc_key and hls_enc_iv

2020-12-08 Thread Gyan Doshi



On 09-12-2020 06:52 am, liuqi05 wrote:

From: Steven Liu 

because hls_enc_key and hls_enc_iv get 16byte char
for example:
-hls_enc_key 0123456789abcdef -hls_enc_iv abcdefghijklmnop

Signed-off-by: liuqi05 
---
  doc/muxers.texi | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 179b923951..5907fd0ba0 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -831,7 +831,7 @@ When enabled every segment generated is encrypted and the 
encryption key
  is saved as @var{playlist name}.key.
  
  @item -hls_enc_key @var{key}

-Hex-coded 16byte key to encrypt the segments, by default it
+16byte key to encrypt the segments, by default it


16-byte or 16-octet (what RFC 8216 uses)


  is randomly generated.
  
  @item -hls_enc_key_url @var{keyurl}

@@ -839,7 +839,7 @@ If set, @var{keyurl} is prepended instead of @var{baseurl} 
to the key filename
  in the playlist.
  
  @item -hls_enc_iv @var{iv}

-Hex-coded 16byte initialization vector for every segment instead
+16byte initialization vector for every segment instead


same

  of the autogenerated ones.
  
  @item hls_segment_type @var{flags}


Regards,
Gyan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 1/4] avformat/rtsp: set AV_OPT_FLAG_DEPRECATED on depracated options

2020-12-08 Thread Andriy Gelman
Hi Zhao, 

Thanks for reviewing.

On Tue, 08. Dec 13:25, "zhilizhao(赵志立)" wrote:
> 
> 
> > On Dec 8, 2020, at 12:08 PM, Andriy Gelman  wrote:
> > 
> > On Sun, 15. Nov 13:20, Andriy Gelman wrote:
> >> From: Andriy Gelman 
> >> 
> >> Signed-off-by: Andriy Gelman 
> >> ---
> >> libavformat/rtsp.c | 4 ++--
> >> 1 file changed, 2 insertions(+), 2 deletions(-)
> >> 
> >> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> >> index d9832bbf1f..2ef75f50e3 100644
> >> --- a/libavformat/rtsp.c
> >> +++ b/libavformat/rtsp.c
> >> @@ -94,7 +94,7 @@ const AVOption ff_rtsp_options[] = {
> >> { "max_port", "set maximum local UDP port", OFFSET(rtp_port_max), 
> >> AV_OPT_TYPE_INT, {.i64 = RTSP_RTP_PORT_MAX}, 0, 65535, DEC|ENC },
> >> { "listen_timeout", "set maximum timeout (in seconds) to wait for 
> >> incoming connections (-1 is infinite, imply flag listen)", 
> >> OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, 
> >> DEC },
> >> #if FF_API_OLD_RTSP_OPTIONS
> >> -{ "timeout", "set maximum timeout (in seconds) to wait for incoming 
> >> connections (-1 is infinite, imply flag listen) (deprecated, use 
> >> listen_timeout)", OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, 
> >> INT_MIN, INT_MAX, DEC },
> >> +{ "timeout", "set maximum timeout (in seconds) to wait for incoming 
> >> connections (-1 is infinite, imply flag listen) (deprecated, use 
> >> listen_timeout)", OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, 
> >> INT_MIN, INT_MAX, DEC|AV_OPT_FLAG_DEPRECATED },
> >> { "stimeout", "set timeout (in microseconds) of socket TCP I/O 
> >> operations", OFFSET(stimeout), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, 
> >> INT_MAX, DEC },
> 
> Looks good to me, although it’s a little weird that after major bump “timeout”
> will have a different meaning instead of being dropped. “stimeout” is
> deprecated, since there is not other option to replace it at the current time,
> it cannot be marked as AV_OPT_FLAG_DEPRECATED.
> 

Right, after the major bump timeout will become the suggested alternative for
stimeout, and stimeout will have the deprecated label.
I think the idea is to get away from timeout option implying the listen mode.

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH v2] avcodec/libaom: Support monochrome encoding with libaom >= 2.0.1

2020-12-08 Thread Philip Langdale
Monochrome encoding with libaom was buggy for a long time, but this was
finally sorted out in libaom 2.0.1 (2.0.0 is almost there but was still
buggy in realtime mode).

Signed-off-by: Philip Langdale 
---
 Changelog  |  1 +
 libavcodec/libaomenc.c | 42 --
 libavcodec/version.h   |  2 +-
 3 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/Changelog b/Changelog
index 503317dfae..8f5e849f8d 100644
--- a/Changelog
+++ b/Changelog
@@ -51,6 +51,7 @@ version :
 - asubcut filter
 - Microsoft Paint (MSP) version 2 decoder
 - Microsoft Paint (MSP) demuxer
+- AV1 monochrome encoding support via libaom >= 2.0.1
 
 
 version 4.3:
diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index 2b0581b15a..342d0883e4 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -338,6 +338,9 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
 enccfg->g_bit_depth = enccfg->g_input_bit_depth = desc->comp[0].depth;
 switch (avctx->pix_fmt) {
+case AV_PIX_FMT_GRAY8:
+enccfg->monochrome = 1;
+/* Fall-through */
 case AV_PIX_FMT_YUV420P:
 enccfg->g_profile = FF_PROFILE_AV1_MAIN;
 *img_fmt = AOM_IMG_FMT_I420;
@@ -351,6 +354,10 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
 enccfg->g_profile = FF_PROFILE_AV1_HIGH;
 *img_fmt = AOM_IMG_FMT_I444;
 return 0;
+case AV_PIX_FMT_GRAY10:
+case AV_PIX_FMT_GRAY12:
+enccfg->monochrome = 1;
+/* Fall-through */
 case AV_PIX_FMT_YUV420P10:
 case AV_PIX_FMT_YUV420P12:
 if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
@@ -1158,6 +1165,15 @@ static const enum AVPixelFormat av1_pix_fmts[] = {
 AV_PIX_FMT_NONE
 };
 
+static const enum AVPixelFormat av1_pix_fmts_with_gray[] = {
+AV_PIX_FMT_YUV420P,
+AV_PIX_FMT_YUV422P,
+AV_PIX_FMT_YUV444P,
+AV_PIX_FMT_GBRP,
+AV_PIX_FMT_GRAY8,
+AV_PIX_FMT_NONE
+};
+
 static const enum AVPixelFormat av1_pix_fmts_highbd[] = {
 AV_PIX_FMT_YUV420P,
 AV_PIX_FMT_YUV422P,
@@ -1174,13 +1190,35 @@ static const enum AVPixelFormat av1_pix_fmts_highbd[] = 
{
 AV_PIX_FMT_NONE
 };
 
+static const enum AVPixelFormat av1_pix_fmts_highbd_with_gray[] = {
+AV_PIX_FMT_YUV420P,
+AV_PIX_FMT_YUV422P,
+AV_PIX_FMT_YUV444P,
+AV_PIX_FMT_GBRP,
+AV_PIX_FMT_YUV420P10,
+AV_PIX_FMT_YUV422P10,
+AV_PIX_FMT_YUV444P10,
+AV_PIX_FMT_YUV420P12,
+AV_PIX_FMT_YUV422P12,
+AV_PIX_FMT_YUV444P12,
+AV_PIX_FMT_GBRP10,
+AV_PIX_FMT_GBRP12,
+AV_PIX_FMT_GRAY8,
+AV_PIX_FMT_GRAY10,
+AV_PIX_FMT_GRAY12,
+AV_PIX_FMT_NONE
+};
+
 static av_cold void av1_init_static(AVCodec *codec)
 {
+int supports_monochrome = aom_codec_version() >= 20001;
 aom_codec_caps_t codec_caps = aom_codec_get_caps(aom_codec_av1_cx());
 if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH)
-codec->pix_fmts = av1_pix_fmts_highbd;
+codec->pix_fmts = supports_monochrome ? av1_pix_fmts_highbd_with_gray :
+av1_pix_fmts_highbd;
 else
-codec->pix_fmts = av1_pix_fmts;
+codec->pix_fmts = supports_monochrome ? av1_pix_fmts_with_gray :
+av1_pix_fmts;
 
 if (aom_codec_version_major() < 2)
 codec->capabilities |= AV_CODEC_CAP_EXPERIMENTAL;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 1c10d105f6..5b92afe60a 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR 115
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
-- 
2.27.0

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] doc/muxers: correct decribe of hls_enc_key and hls_enc_iv

2020-12-08 Thread liuqi05
From: Steven Liu 

because hls_enc_key and hls_enc_iv get 16byte char
for example:
-hls_enc_key 0123456789abcdef -hls_enc_iv abcdefghijklmnop

Signed-off-by: liuqi05 
---
 doc/muxers.texi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index 179b923951..5907fd0ba0 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -831,7 +831,7 @@ When enabled every segment generated is encrypted and the 
encryption key
 is saved as @var{playlist name}.key.
 
 @item -hls_enc_key @var{key}
-Hex-coded 16byte key to encrypt the segments, by default it
+16byte key to encrypt the segments, by default it
 is randomly generated.
 
 @item -hls_enc_key_url @var{keyurl}
@@ -839,7 +839,7 @@ If set, @var{keyurl} is prepended instead of @var{baseurl} 
to the key filename
 in the playlist.
 
 @item -hls_enc_iv @var{iv}
-Hex-coded 16byte initialization vector for every segment instead
+16byte initialization vector for every segment instead
 of the autogenerated ones.
 
 @item hls_segment_type @var{flags}
-- 
2.25.0



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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avformat/matroska: Handle TargetType and nested SimpleTags in metadata

2020-12-08 Thread zsugabubus
Metadata names now recognized in the following format:

  [ [TargetTypeValue][TargetType] "/" ] TagName [ "/" TagName ]... [ "@" [ "-" 
] [TagLanguage] ]

Language designators separated with "@" instead of "-" to avoid future
ambiguity about IETF language tags, like "en-US" and similar.
"-" designates TagDefault := 0.

Signed-off-by: zsugabubus 
---

Tried correcting failing tests.

 libavformat/matroska.c|  56 ++-
 libavformat/matroska.h|   9 +
 libavformat/matroskadec.c | 286 +++
 libavformat/matroskaenc.c | 308 +++---
 tests/ref/lavf-fate/av1.mkv   |   4 +-
 tests/ref/lavf-fate/vp3.ogg   |   4 +-
 tests/ref/lavf/mka|   4 +-
 tests/ref/lavf/mkv|   4 +-
 tests/ref/lavf/mkv_attachment |   4 +-
 9 files changed, 459 insertions(+), 220 deletions(-)

diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index 7c56aba..4fcade2 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -120,11 +120,63 @@ const CodecTags ff_webm_codec_tags[] = {
 };
 
 const AVMetadataConv ff_mkv_metadata_conv[] = {
-{ "LEAD_PERFORMER", "performer" },
-{ "PART_NUMBER"   , "track"  },
+{ "TRACK/ARTIST","artist"   },
+{ "ALBUM/ARTIST","album_artist" },
+{ "ALBUM/TITLE", "album"},
+{ "ALBUM/DATE_RELEASED", "date" },
+{ "TRACK/TITLE", "title"},
+{ "ALBUM/PART_NUMBER",   "track"},
+{ "ALBUM/TOTAL_PARTS",   "track_total"  },
+{ "VOLUME/PART_NUMBER",  "disc" },
+{ "VOLUME/TOTAL_PARTS",  "disc_total"   },
+{ "TRACK/GENRE", "genre"},
+
+{ "50/COMMENT",  "comment"  },
+{ "ALBUM/COMMENT",   "comment"  },
+{ "EPISODE/COMMENT", "comment"  },
 { 0 }
 };
 
+#define A (1 << AVMEDIA_TYPE_AUDIO)
+#define V (1 << AVMEDIA_TYPE_VIDEO)
+#define AV A | V
+
+/* Note: When converting from typevalues -> strings first matching entry is 
used. */
+const TypeValueConv ff_mkv_typevalue_conv[] = {
+{ "COLLECTION", 70, AV },
+
+{ "SEASON", 60, V  },
+{ "VOLUME", 60, AV },
+{ "EDITION",60, A  },
+{ "ISSUE",  60, A  },
+{ "OPUS",   60, A  },
+{ "SEQUEL", 60, V  },
+
+{ "ALBUM",  50, A  },
+{ "EPISODE",50, V  },
+{ "OPERA",  50, A  },
+{ "MOVIE",  50, V  },
+{ "CONCERT",50, AV },
+
+{ "PART",   40, AV },
+{ "SESSION",40, AV },
+
+{ "TRACK",  30, A  },
+{ "CHAPTER",30, V  },
+{ "SONG",   30, A  },
+
+{ "SUBTRACK",   20, A  },
+{ "MOVEMENT",   20, A  },
+{ "SCENE",  20, V  },
+
+{ "SHOT",   10, V  },
+{ "",0, -1 }
+};
+
+#undef A
+#undef V
+#undef AV
+
 const char * const 
ff_matroska_video_stereo_mode[MATROSKA_VIDEO_STEREOMODE_TYPE_NB] = {
 "mono",
 "left_right",
diff --git a/libavformat/matroska.h b/libavformat/matroska.h
index 6f198f0..6dc9582 100644
--- a/libavformat/matroska.h
+++ b/libavformat/matroska.h
@@ -355,14 +355,23 @@ typedef struct CodecTags{
 enum AVCodecID id;
 }CodecTags;
 
+typedef struct {
+char str[sizeof "COLLECTION"];
+uint8_t typevalue;
+uint8_t codec_types; /* (1 << AVMEDIA_TYPE_*)... */
+} TypeValueConv;
+
 /* max. depth in the EBML tree structure */
 #define EBML_MAX_DEPTH 16
 
 #define MATROSKA_VIDEO_STEREO_PLANE_COUNT  3
 
+enum { MATROSKA_DEFAULT_TAGTARGETS_TYPEVALUE = 50 };
+
 extern const CodecTags ff_mkv_codec_tags[];
 extern const CodecTags ff_webm_codec_tags[];
 extern const AVMetadataConv ff_mkv_metadata_conv[];
+extern const TypeValueConv ff_mkv_typevalue_conv[];
 extern const char * const 
ff_matroska_video_stereo_mode[MATROSKA_VIDEO_STEREOMODE_TYPE_NB];
 extern const char * const 
ff_matroska_video_stereo_plane[MATROSKA_VIDEO_STEREO_PLANE_COUNT];
 
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 44db2c8..333d6dc 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -98,8 +98,8 @@ typedef enum {
 typedef const struct EbmlSyntax {
 uint32_t id;
 EbmlType type;
-size_t list_elem_size;
-size_t data_offset;
+unsigned list_elem_size;
+unsigned data_offset;
 union {
 int64_t i;
 uint64_tu;
@@ -228,8 +228,8 @@ typedef struct MatroskaTrackOperation {
 } MatroskaTrackOperation;
 
 typedef struct MatroskaTrack {
+uint64_t uid; /* Must be the first field. */
 uint64_t num;
-uint64_t uid;
 uint64_t type;
 char*name;
 char*codec_id;
@@ -258,7 +258,7 @@ typedef struct MatroskaTrack {
 } MatroskaTrack;
 
 typedef struct MatroskaAttachment {
-uint64_t uid;
+uint64_t uid; /* Must be the first field. */
 char *filename;
 char *description;
 char *mime;
@@ -268,9 +268,9 @@ typedef struct MatroskaAttachment {
 } MatroskaAttachment;
 
 typedef struct MatroskaChapter {
+uint64_t uid; /* Must be the first 

[FFmpeg-devel] [PATCH] avcodec/bitstream: Rewrite code to avoid triggering compiler warning

2020-12-08 Thread Andreas Rheinhardt
Clang infers from the existence of a default case that said case can be
taken. In case of libavcodec/bitstream.c said default case consisted of
an av_assert1 that evaluates to nothing in case of the ordinary assert
level. In this case (that doesn't happen) a variable wouldn't be
initialized, so Clang emitted Wsometimes-uninitialized warnings.
This solves this by checking the assert condition outside of the switch
and removing the default case.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/bitstream.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 7570fb2204..9966323a9b 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -96,6 +96,7 @@ void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int 
length)
 #define GET_DATA(v, table, i, wrap, size)   \
 {   \
 const uint8_t *ptr = (const uint8_t *)table + i * wrap; \
+av_assert1(size == 1 || size == 2 || size == 4);\
 switch(size) {  \
 case 1: \
 v = *(const uint8_t *)ptr;  \
@@ -106,8 +107,6 @@ void ff_copy_bits(PutBitContext *pb, const uint8_t *src, 
int length)
 case 4: \
 v = *(const uint32_t *)ptr; \
 break;  \
-default:\
-av_assert1(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-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avcodec/bitstream: use av_assert0 in GET_DATA

2020-12-08 Thread Marvin Scholz
For builds with asserts disabled, if the default case would ever be
reached it could lead to uninitialized use of variables as v is never
assigned to anything.

This caused the following clang warning:

  libavcodec/bitstream.c:374:5: warning: variable 'len' is used
  uninitialized whenever switch default is taken
[-Wsometimes-uninitialized]
  COPY(len && len <= nb_bits);
  ^~~
  libavcodec/bitstream.c:343:9: note: expanded from macro 'COPY'
  GET_DATA(len, bits, i, bits_wrap, bits_size);
  […]

To prevent the uninitialized use, use av_assert0 which aborts when
assertions are disabled.
---
 libavcodec/bitstream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 7570fb2204..875e9302f3 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -107,7 +107,7 @@ void ff_copy_bits(PutBitContext *pb, const uint8_t *src, 
int length)
 v = *(const uint32_t *)ptr; \
 break;  \
 default:\
-av_assert1(0);  \
+av_assert0(0);  \
 }   \
 }
 
-- 
2.24.3 (Apple Git-128)

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] lavu: use address-of operator checking clock_gettime

2020-12-08 Thread Marvin Scholz
When targeting a recent enough macOS/iOS version that has clock_gettime
it won't be a weak symbol, in which case clang warns for this check
as it's always true:

  warning: address of function 'clock_gettime' will always
  evaluate to 'true'

This warning is silenced by using the address-of operator to make
the intent explicit.
---
 libavutil/time.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/time.c b/libavutil/time.c
index afa6658aa6..740afc4785 100644
--- a/libavutil/time.c
+++ b/libavutil/time.c
@@ -57,7 +57,7 @@ int64_t av_gettime_relative(void)
 {
 #if HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC)
 #ifdef __APPLE__
-if (clock_gettime)
+if (&clock_gettime)
 #endif
 {
 struct timespec ts;
@@ -72,7 +72,7 @@ int av_gettime_relative_is_monotonic(void)
 {
 #if HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC)
 #ifdef __APPLE__
-if (!clock_gettime)
+if (!&clock_gettime)
 return 0;
 #endif
 return 1;
-- 
2.24.3 (Apple Git-128)

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2] avcodec/libaom: Support monochrome encoding with libaom >= 2.0.1

2020-12-08 Thread James Almer

On 12/8/2020 6:45 PM, Philip Langdale wrote:

Monochrome encoding with libaom was buggy for a long time, but this was
finally sorted out in libaom 2.0.1 (2.0.0 is almost there but was still
buggy in realtime mode).

Signed-off-by: Philip Langdale 
---
  Changelog  |  1 +
  libavcodec/libaomenc.c | 42 --
  libavcodec/version.h   |  2 +-
  3 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/Changelog b/Changelog
index 503317dfae..8f5e849f8d 100644
--- a/Changelog
+++ b/Changelog
@@ -51,6 +51,7 @@ version :
  - asubcut filter
  - Microsoft Paint (MSP) version 2 decoder
  - Microsoft Paint (MSP) demuxer
+- AV1 monochrome encoding support via libaom >= 2.0.1
  
  
  version 4.3:

diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index 2b0581b15a..342d0883e4 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -338,6 +338,9 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
  enccfg->g_bit_depth = enccfg->g_input_bit_depth = desc->comp[0].depth;
  switch (avctx->pix_fmt) {
+case AV_PIX_FMT_GRAY8:
+enccfg->monochrome = 1;
+/* Fall-through */
  case AV_PIX_FMT_YUV420P:
  enccfg->g_profile = FF_PROFILE_AV1_MAIN;
  *img_fmt = AOM_IMG_FMT_I420;
@@ -351,6 +354,10 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
  enccfg->g_profile = FF_PROFILE_AV1_HIGH;
  *img_fmt = AOM_IMG_FMT_I444;
  return 0;
+case AV_PIX_FMT_GRAY10:
+case AV_PIX_FMT_GRAY12:
+enccfg->monochrome = 1;
+/* Fall-through */
  case AV_PIX_FMT_YUV420P10:
  case AV_PIX_FMT_YUV420P12:
  if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
@@ -1158,6 +1165,15 @@ static const enum AVPixelFormat av1_pix_fmts[] = {
  AV_PIX_FMT_NONE
  };
  
+static const enum AVPixelFormat av1_pix_fmts_with_gray[] = {

+AV_PIX_FMT_YUV420P,
+AV_PIX_FMT_YUV422P,
+AV_PIX_FMT_YUV444P,
+AV_PIX_FMT_GBRP,
+AV_PIX_FMT_GRAY8,
+AV_PIX_FMT_NONE
+};
+
  static const enum AVPixelFormat av1_pix_fmts_highbd[] = {
  AV_PIX_FMT_YUV420P,
  AV_PIX_FMT_YUV422P,
@@ -1174,13 +1190,35 @@ static const enum AVPixelFormat av1_pix_fmts_highbd[] = 
{
  AV_PIX_FMT_NONE
  };
  
+static const enum AVPixelFormat av1_pix_fmts_highbd_with_gray[] = {

+AV_PIX_FMT_YUV420P,
+AV_PIX_FMT_YUV422P,
+AV_PIX_FMT_YUV444P,
+AV_PIX_FMT_GBRP,
+AV_PIX_FMT_YUV420P10,
+AV_PIX_FMT_YUV422P10,
+AV_PIX_FMT_YUV444P10,
+AV_PIX_FMT_YUV420P12,
+AV_PIX_FMT_YUV422P12,
+AV_PIX_FMT_YUV444P12,
+AV_PIX_FMT_GBRP10,
+AV_PIX_FMT_GBRP12,
+AV_PIX_FMT_GRAY8,
+AV_PIX_FMT_GRAY10,
+AV_PIX_FMT_GRAY12,
+AV_PIX_FMT_NONE
+};
+
  static av_cold void av1_init_static(AVCodec *codec)
  {
+int supports_monochrome = aom_codec_version() >= 20001;
  aom_codec_caps_t codec_caps = aom_codec_get_caps(aom_codec_av1_cx());
  if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH)
-codec->pix_fmts = av1_pix_fmts_highbd;
+codec->pix_fmts = supports_monochrome ? av1_pix_fmts_highbd_with_gray :
+av1_pix_fmts_highbd;
  else
-codec->pix_fmts = av1_pix_fmts;
+codec->pix_fmts = supports_monochrome ? av1_pix_fmts_with_gray :
+av1_pix_fmts;
  
  if (aom_codec_version_major() < 2)

  codec->capabilities |= AV_CODEC_CAP_EXPERIMENTAL;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 1c10d105f6..5b92afe60a 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
  
  #define LIBAVCODEC_VERSION_MAJOR  58

  #define LIBAVCODEC_VERSION_MINOR 115
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
  
  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

 LIBAVCODEC_VERSION_MINOR, \


LGTM.

Once all LTS distros shipping libaom 1.0.0 are EOL we can remove support 
for anything older than 2.0.1 and simplify this.

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avformat/matroska: Handle TargetType and nested SimpleTags in metadata

2020-12-08 Thread Andreas Rheinhardt
zsugabubus@national.shitposting.agency:
> Metadata names now recognized in the following format:
> 
>   [ [TargetTypeValue][TargetType] "/" ] TagName [ "/" TagName ]... [ "@" [ 
> "-" ] [TagLanguage] ]
> 
> Language designators separated with "@" instead of "-" to avoid future
> ambiguity about IETF language tags, like "en-US" and similar.
> "-" designates TagDefault := 0.
> 
> Signed-off-by: zsugabubus 
> ---
>  libavformat/matroska.c|  56 ++-
>  libavformat/matroska.h|   9 ++
>  libavformat/matroskadec.c | 286 +--
>  libavformat/matroskaenc.c | 308 ++
>  4 files changed, 449 insertions(+), 210 deletions(-)
> 
> diff --git a/libavformat/matroska.c b/libavformat/matroska.c
> index 7c56aba..4fcade2 100644
> --- a/libavformat/matroska.c
> +++ b/libavformat/matroska.c
> @@ -120,11 +120,63 @@ const CodecTags ff_webm_codec_tags[] = {
>  };
>  
>  const AVMetadataConv ff_mkv_metadata_conv[] = {
> -{ "LEAD_PERFORMER", "performer" },
> -{ "PART_NUMBER"   , "track"  },
> +{ "TRACK/ARTIST","artist"   },
> +{ "ALBUM/ARTIST","album_artist" },
> +{ "ALBUM/TITLE", "album"},
> +{ "ALBUM/DATE_RELEASED", "date" },
> +{ "TRACK/TITLE", "title"},
> +{ "ALBUM/PART_NUMBER",   "track"},
> +{ "ALBUM/TOTAL_PARTS",   "track_total"  },
> +{ "VOLUME/PART_NUMBER",  "disc" },
> +{ "VOLUME/TOTAL_PARTS",  "disc_total"   },
> +{ "TRACK/GENRE", "genre"},
> +
> +{ "50/COMMENT",  "comment"  },
> +{ "ALBUM/COMMENT",   "comment"  },
> +{ "EPISODE/COMMENT", "comment"  },
>  { 0 }
>  };
>  
> +#define A (1 << AVMEDIA_TYPE_AUDIO)
> +#define V (1 << AVMEDIA_TYPE_VIDEO)
> +#define AV A | V
> +
> +/* Note: When converting from typevalues -> strings first matching entry is 
> used. */
> +const TypeValueConv ff_mkv_typevalue_conv[] = {
> +{ "COLLECTION", 70, AV },
> +
> +{ "SEASON", 60, V  },
> +{ "VOLUME", 60, AV },
> +{ "EDITION",60, A  },
> +{ "ISSUE",  60, A  },
> +{ "OPUS",   60, A  },
> +{ "SEQUEL", 60, V  },
> +
> +{ "ALBUM",  50, A  },
> +{ "EPISODE",50, V  },
> +{ "OPERA",  50, A  },
> +{ "MOVIE",  50, V  },
> +{ "CONCERT",50, AV },
> +
> +{ "PART",   40, AV },
> +{ "SESSION",40, AV },
> +
> +{ "TRACK",  30, A  },
> +{ "CHAPTER",30, V  },
> +{ "SONG",   30, A  },
> +
> +{ "SUBTRACK",   20, A  },
> +{ "MOVEMENT",   20, A  },
> +{ "SCENE",  20, V  },
> +
> +{ "SHOT",   10, V  },
> +{ "",0, -1 }
> +};
> +
> +#undef A
> +#undef V
> +#undef AV
> +
>  const char * const 
> ff_matroska_video_stereo_mode[MATROSKA_VIDEO_STEREOMODE_TYPE_NB] = {
>  "mono",
>  "left_right",
> diff --git a/libavformat/matroska.h b/libavformat/matroska.h
> index 6f198f0..6dc9582 100644
> --- a/libavformat/matroska.h
> +++ b/libavformat/matroska.h
> @@ -355,14 +355,23 @@ typedef struct CodecTags{
>  enum AVCodecID id;
>  }CodecTags;
>  
> +typedef struct {
> +char str[sizeof "COLLECTION"];
> +uint8_t typevalue;
> +uint8_t codec_types; /* (1 << AVMEDIA_TYPE_*)... */
> +} TypeValueConv;
> +
>  /* max. depth in the EBML tree structure */
>  #define EBML_MAX_DEPTH 16
>  
>  #define MATROSKA_VIDEO_STEREO_PLANE_COUNT  3
>  
> +enum { MATROSKA_DEFAULT_TAGTARGETS_TYPEVALUE = 50 };
> +
>  extern const CodecTags ff_mkv_codec_tags[];
>  extern const CodecTags ff_webm_codec_tags[];
>  extern const AVMetadataConv ff_mkv_metadata_conv[];
> +extern const TypeValueConv ff_mkv_typevalue_conv[];
>  extern const char * const 
> ff_matroska_video_stereo_mode[MATROSKA_VIDEO_STEREOMODE_TYPE_NB];
>  extern const char * const 
> ff_matroska_video_stereo_plane[MATROSKA_VIDEO_STEREO_PLANE_COUNT];
>  
> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> index 5455594..1c0478d 100644
> --- a/libavformat/matroskadec.c
> +++ b/libavformat/matroskadec.c
> @@ -98,8 +98,8 @@ typedef enum {
>  typedef const struct EbmlSyntax {
>  uint32_t id;
>  EbmlType type;
> -size_t list_elem_size;
> -size_t data_offset;
> +unsigned list_elem_size;
> +unsigned data_offset;
>  union {
>  int64_t i;
>  uint64_tu;
> @@ -228,8 +228,8 @@ typedef struct MatroskaTrackOperation {
>  } MatroskaTrackOperation;
>  
>  typedef struct MatroskaTrack {
> +uint64_t uid; /* Must be the first field. */
>  uint64_t num;
> -uint64_t uid;
>  uint64_t type;
>  char*name;
>  char*codec_id;
> @@ -258,7 +258,7 @@ typedef struct MatroskaTrack {
>  } MatroskaTrack;
>  
>  typedef struct MatroskaAttachment {
> -uint64_t uid;
> +uint64_t uid; /* Must be the first field. */
>  char *filename;
>  char *description;
>  char *mime;
> @@ -268,9 +268,9 @@ typedef struct MatroskaAttac

[FFmpeg-devel] [PATCH 4/4] avcodec/hevc_sei: print a log message when a unsupported ITU-T T35 SEI messages is parsed

2020-12-08 Thread James Almer
Signed-off-by: James Almer 
---
 libavcodec/hevc_sei.c | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/libavcodec/hevc_sei.c b/libavcodec/hevc_sei.c
index d30568c20d..0607b1f7b4 100644
--- a/libavcodec/hevc_sei.c
+++ b/libavcodec/hevc_sei.c
@@ -236,7 +236,7 @@ static int 
decode_registered_user_data_dynamic_hdr_plus(HEVCSEIDynamicHDRPlus *s
 }
 
 static int decode_nal_sei_user_data_registered_itu_t_t35(HEVCSEI *s, 
GetBitContext *gb,
- int size)
+ void *logctx, int 
size)
 {
 int country_code, provider_code;
 
@@ -250,8 +250,12 @@ static int 
decode_nal_sei_user_data_registered_itu_t_t35(HEVCSEI *s, GetBitConte
 size--;
 }
 
-if (country_code != 0xB5) // usa_country_code
+if (country_code != 0xB5) { // usa_country_code
+av_log(logctx, AV_LOG_VERBOSE,
+   "Unsupported User Data Registered ITU-T T35 SEI message 
(country_code = %d)\n",
+   country_code);
 goto end;
+}
 
 provider_code = get_bits(gb, 16);
 
@@ -287,11 +291,17 @@ static int 
decode_nal_sei_user_data_registered_itu_t_t35(HEVCSEI *s, GetBitConte
 case MKBETAG('G', 'A', '9', '4'):
 return decode_registered_user_data_closed_caption(&s->a53_caption, 
gb, size);
 default:
+av_log(logctx, AV_LOG_VERBOSE,
+   "Unsupported User Data Registered ITU-T T35 SEI message 
(atsc user_identifier = 0x%04x)\n",
+   user_identifier);
 break;
 }
 break;
 }
 default:
+av_log(logctx, AV_LOG_VERBOSE,
+   "Unsupported User Data Registered ITU-T T35 SEI message 
(provider_code = %d)\n",
+   provider_code);
 break;
 }
 
@@ -402,7 +412,7 @@ static int decode_nal_sei_prefix(GetBitContext *gb, void 
*logctx, HEVCSEI *s,
 case HEVC_SEI_TYPE_ACTIVE_PARAMETER_SETS:
 return decode_nal_sei_active_parameter_sets(s, gb, logctx);
 case HEVC_SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35:
-return decode_nal_sei_user_data_registered_itu_t_t35(s, gb, size);
+return decode_nal_sei_user_data_registered_itu_t_t35(s, gb, logctx, 
size);
 case HEVC_SEI_TYPE_USER_DATA_UNREGISTERED:
 return decode_nal_sei_user_data_unregistered(&s->unregistered, gb, 
size);
 case HEVC_SEI_TYPE_ALTERNATIVE_TRANSFER_CHARACTERISTICS:
-- 
2.29.2

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 3/4] avcodec/hevc_sei: refactor parsing User Data Registered ITU-T T35 SEI messages

2020-12-08 Thread James Almer
Signed-off-by: James Almer 
---
 libavcodec/hevc_sei.c | 23 +++
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/libavcodec/hevc_sei.c b/libavcodec/hevc_sei.c
index 3b0fa43439..d30568c20d 100644
--- a/libavcodec/hevc_sei.c
+++ b/libavcodec/hevc_sei.c
@@ -238,11 +238,7 @@ static int 
decode_registered_user_data_dynamic_hdr_plus(HEVCSEIDynamicHDRPlus *s
 static int decode_nal_sei_user_data_registered_itu_t_t35(HEVCSEI *s, 
GetBitContext *gb,
  int size)
 {
-const uint8_t usa_country_code = 0xB5;
-const uint16_t smpte_provider_code = 0x003C;
-
-uint8_t country_code = 0;
-uint16_t provider_code = 0;
+int country_code, provider_code;
 
 if (size < 3)
 return AVERROR(EINVAL);
@@ -254,10 +250,13 @@ static int 
decode_nal_sei_user_data_registered_itu_t_t35(HEVCSEI *s, GetBitConte
 size--;
 }
 
+if (country_code != 0xB5) // usa_country_code
+goto end;
+
 provider_code = get_bits(gb, 16);
 
-if (country_code == usa_country_code &&
-provider_code == smpte_provider_code) {
+switch (provider_code) {
+case 0x3C: { // smpte_provider_code
 // A/341 Amendment - 2094-40
 const uint16_t smpte2094_40_provider_oriented_code = 0x0001;
 const uint8_t smpte2094_40_application_identifier = 0x04;
@@ -274,7 +273,9 @@ static int 
decode_nal_sei_user_data_registered_itu_t_t35(HEVCSEI *s, GetBitConte
 application_identifier == smpte2094_40_application_identifier) {
 return 
decode_registered_user_data_dynamic_hdr_plus(&s->dynamic_hdr_plus, gb, size);
 }
-} else {
+break;
+}
+case 0x31: { // atsc_provider_code
 uint32_t user_identifier;
 
 if (size < 4)
@@ -288,7 +289,13 @@ static int 
decode_nal_sei_user_data_registered_itu_t_t35(HEVCSEI *s, GetBitConte
 default:
 break;
 }
+break;
 }
+default:
+break;
+}
+
+end:
 skip_bits_long(gb, size * 8);
 return 0;
 }
-- 
2.29.2

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 2/4] avcodec/h264_sei: print a log message when a unsupported ITU-T T35 SEI messages is parsed

2020-12-08 Thread James Almer
Signed-off-by: James Almer 
---
 libavcodec/h264_sei.c | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index 42ba94114c..96ae50a24a 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -195,8 +195,12 @@ static int decode_registered_user_data(H264SEIContext *h, 
GetBitContext *gb,
 size--;
 }
 
-if (country_code != 0xB5) // usa_country_code
+if (country_code != 0xB5) { // usa_country_code
+av_log(logctx, AV_LOG_VERBOSE,
+   "Unsupported User Data Registered ITU-T T35 SEI message 
(country_code = %d)\n",
+   country_code);
 return 0;
+}
 
 /* itu_t_t35_payload_byte follows */
 provider_code = get_bits(gb, 16);
@@ -217,11 +221,17 @@ static int decode_registered_user_data(H264SEIContext *h, 
GetBitContext *gb,
 return decode_registered_user_data_closed_caption(&h->a53_caption, 
gb,
   logctx, size);
 default:
+av_log(logctx, AV_LOG_VERBOSE,
+   "Unsupported User Data Registered ITU-T T35 SEI message 
(atsc user_identifier = 0x%04x)\n",
+   user_identifier);
 break;
 }
 break;
 }
 default:
+av_log(logctx, AV_LOG_VERBOSE,
+   "Unsupported User Data Registered ITU-T T35 SEI message 
(provider_code = %d)\n",
+   provider_code);
 break;
 }
 
-- 
2.29.2

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 1/4] avcodec/h264_sei: refactor parsing User Data Registered ITU-T T35 SEI messages

2020-12-08 Thread James Almer
Signed-off-by: James Almer 
---
 libavcodec/h264_sei.c | 31 ++-
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index 669560ae5f..42ba94114c 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -183,12 +183,11 @@ static int 
decode_registered_user_data_closed_caption(H264SEIA53Caption *h,
 static int decode_registered_user_data(H264SEIContext *h, GetBitContext *gb,
void *logctx, int size)
 {
-uint32_t country_code;
-uint32_t user_identifier;
+int country_code, provider_code;
 
-if (size < 7)
+if (size < 3)
 return AVERROR_INVALIDDATA;
-size -= 7;
+size -= 3;
 
 country_code = get_bits(gb, 8); // itu_t_t35_country_code
 if (country_code == 0xFF) {
@@ -196,20 +195,34 @@ static int decode_registered_user_data(H264SEIContext *h, 
GetBitContext *gb,
 size--;
 }
 
+if (country_code != 0xB5) // usa_country_code
+return 0;
+
 /* itu_t_t35_payload_byte follows */
-skip_bits(gb, 8);  // terminal provider code
-skip_bits(gb, 8);  // terminal provider oriented code
-user_identifier = get_bits_long(gb, 32);
+provider_code = get_bits(gb, 16);
+
+switch (provider_code) {
+case 0x31: { // atsc_provider_code
+uint32_t user_identifier;
 
-switch (user_identifier) {
+if (size < 4)
+return AVERROR(EINVAL);
+size -= 4;
+
+user_identifier = get_bits_long(gb, 32);
+switch (user_identifier) {
 case MKBETAG('D', 'T', 'G', '1'):   // afd_data
 return decode_registered_user_data_afd(&h->afd, gb, size);
 case MKBETAG('G', 'A', '9', '4'):   // closed captions
 return decode_registered_user_data_closed_caption(&h->a53_caption, 
gb,
   logctx, size);
 default:
-skip_bits(gb, size * 8);
 break;
+}
+break;
+}
+default:
+break;
 }
 
 return 0;
-- 
2.29.2

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/matroska: Handle TargetType and nested SimpleTags in metadata

2020-12-08 Thread zsugabubus
Metadata names now recognized in the following format:

  [ [TargetTypeValue][TargetType] "/" ] TagName [ "/" TagName ]... [ "@" [ "-" 
] [TagLanguage] ]

Language designators separated with "@" instead of "-" to avoid future
ambiguity about IETF language tags, like "en-US" and similar.
"-" designates TagDefault := 0.

Signed-off-by: zsugabubus 
---
 libavformat/matroska.c|  56 ++-
 libavformat/matroska.h|   9 ++
 libavformat/matroskadec.c | 286 +--
 libavformat/matroskaenc.c | 308 ++
 4 files changed, 449 insertions(+), 210 deletions(-)

diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index 7c56aba..4fcade2 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -120,11 +120,63 @@ const CodecTags ff_webm_codec_tags[] = {
 };
 
 const AVMetadataConv ff_mkv_metadata_conv[] = {
-{ "LEAD_PERFORMER", "performer" },
-{ "PART_NUMBER"   , "track"  },
+{ "TRACK/ARTIST","artist"   },
+{ "ALBUM/ARTIST","album_artist" },
+{ "ALBUM/TITLE", "album"},
+{ "ALBUM/DATE_RELEASED", "date" },
+{ "TRACK/TITLE", "title"},
+{ "ALBUM/PART_NUMBER",   "track"},
+{ "ALBUM/TOTAL_PARTS",   "track_total"  },
+{ "VOLUME/PART_NUMBER",  "disc" },
+{ "VOLUME/TOTAL_PARTS",  "disc_total"   },
+{ "TRACK/GENRE", "genre"},
+
+{ "50/COMMENT",  "comment"  },
+{ "ALBUM/COMMENT",   "comment"  },
+{ "EPISODE/COMMENT", "comment"  },
 { 0 }
 };
 
+#define A (1 << AVMEDIA_TYPE_AUDIO)
+#define V (1 << AVMEDIA_TYPE_VIDEO)
+#define AV A | V
+
+/* Note: When converting from typevalues -> strings first matching entry is 
used. */
+const TypeValueConv ff_mkv_typevalue_conv[] = {
+{ "COLLECTION", 70, AV },
+
+{ "SEASON", 60, V  },
+{ "VOLUME", 60, AV },
+{ "EDITION",60, A  },
+{ "ISSUE",  60, A  },
+{ "OPUS",   60, A  },
+{ "SEQUEL", 60, V  },
+
+{ "ALBUM",  50, A  },
+{ "EPISODE",50, V  },
+{ "OPERA",  50, A  },
+{ "MOVIE",  50, V  },
+{ "CONCERT",50, AV },
+
+{ "PART",   40, AV },
+{ "SESSION",40, AV },
+
+{ "TRACK",  30, A  },
+{ "CHAPTER",30, V  },
+{ "SONG",   30, A  },
+
+{ "SUBTRACK",   20, A  },
+{ "MOVEMENT",   20, A  },
+{ "SCENE",  20, V  },
+
+{ "SHOT",   10, V  },
+{ "",0, -1 }
+};
+
+#undef A
+#undef V
+#undef AV
+
 const char * const 
ff_matroska_video_stereo_mode[MATROSKA_VIDEO_STEREOMODE_TYPE_NB] = {
 "mono",
 "left_right",
diff --git a/libavformat/matroska.h b/libavformat/matroska.h
index 6f198f0..6dc9582 100644
--- a/libavformat/matroska.h
+++ b/libavformat/matroska.h
@@ -355,14 +355,23 @@ typedef struct CodecTags{
 enum AVCodecID id;
 }CodecTags;
 
+typedef struct {
+char str[sizeof "COLLECTION"];
+uint8_t typevalue;
+uint8_t codec_types; /* (1 << AVMEDIA_TYPE_*)... */
+} TypeValueConv;
+
 /* max. depth in the EBML tree structure */
 #define EBML_MAX_DEPTH 16
 
 #define MATROSKA_VIDEO_STEREO_PLANE_COUNT  3
 
+enum { MATROSKA_DEFAULT_TAGTARGETS_TYPEVALUE = 50 };
+
 extern const CodecTags ff_mkv_codec_tags[];
 extern const CodecTags ff_webm_codec_tags[];
 extern const AVMetadataConv ff_mkv_metadata_conv[];
+extern const TypeValueConv ff_mkv_typevalue_conv[];
 extern const char * const 
ff_matroska_video_stereo_mode[MATROSKA_VIDEO_STEREOMODE_TYPE_NB];
 extern const char * const 
ff_matroska_video_stereo_plane[MATROSKA_VIDEO_STEREO_PLANE_COUNT];
 
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 5455594..1c0478d 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -98,8 +98,8 @@ typedef enum {
 typedef const struct EbmlSyntax {
 uint32_t id;
 EbmlType type;
-size_t list_elem_size;
-size_t data_offset;
+unsigned list_elem_size;
+unsigned data_offset;
 union {
 int64_t i;
 uint64_tu;
@@ -228,8 +228,8 @@ typedef struct MatroskaTrackOperation {
 } MatroskaTrackOperation;
 
 typedef struct MatroskaTrack {
+uint64_t uid; /* Must be the first field. */
 uint64_t num;
-uint64_t uid;
 uint64_t type;
 char*name;
 char*codec_id;
@@ -258,7 +258,7 @@ typedef struct MatroskaTrack {
 } MatroskaTrack;
 
 typedef struct MatroskaAttachment {
-uint64_t uid;
+uint64_t uid; /* Must be the first field. */
 char *filename;
 char *description;
 char *mime;
@@ -268,9 +268,9 @@ typedef struct MatroskaAttachment {
 } MatroskaAttachment;
 
 typedef struct MatroskaChapter {
+uint64_t uid; /* Must be the first field. */
 uint64_t start;
 uint64_t end;
-uint64_t uid;
 char*title;
 
 AVChapter *chapter;
@@ -286,26 +286,26 @@ typedef struct MatroskaIndex {
 EbmlList pos;
 } MatroskaIndex;
 
-typedef struct MatroskaTag {
+t

Re: [FFmpeg-devel] [PATCH 1/6] fate: Add dpx-probe test

2020-12-08 Thread Paul B Mahol
big endian is dead.

On Tue, Dec 8, 2020 at 6:18 PM Andriy Gelman 
wrote:

> Hi,
>
> On Mon, 07. Dec 10:32, Harry Mallon wrote:
> > Signed-off-by: Harry Mallon 
> > ---
> >  tests/fate/image.mak |  4 ++
> >  tests/ref/fate/dpx-probe | 85 
> >  2 files changed, 89 insertions(+)
> >  create mode 100644 tests/ref/fate/dpx-probe
> >
> > diff --git a/tests/fate/image.mak b/tests/fate/image.mak
> > index 22072a62f1..d18054d3d8 100644
> > --- a/tests/fate/image.mak
> > +++ b/tests/fate/image.mak
> > @@ -97,6 +97,10 @@ fate-dpx: CMD = framecrc -i
> $(TARGET_SAMPLES)/dpx/lighthouse_rgb48.dpx
> >  FATE_SAMPLES_AVCONV-$(call PARSERDEMDEC, DPX, IMAGE2PIPE, DPX) +=
> fate-dpxparser
> >  fate-dpxparser: CMD = framecrc -f image2pipe -i
> $(TARGET_SAMPLES)/dpx/lena_4x_concat.dpx -sws_flags +accurate_rnd+bitexact
> >
> > +FATE_IMAGE-$(call DEMDEC, IMAGE2, DPX) += fate-dpx-probe
> > +fate-dpx-probe: SRC = $(TARGET_SAMPLES)/dpx/cyan.dpx
> > +fate-dpx-probe: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_streams
> -show_frames -print_format default -bitexact -v 0 -i "$(SRC)"
> > +
> >  FATE_EXR += fate-exr-slice-raw
> >  fate-exr-slice-raw: CMD = framecrc -i
> $(TARGET_SAMPLES)/exr/rgba_slice_raw.exr -pix_fmt gbrapf32le
> >
> > diff --git a/tests/ref/fate/dpx-probe b/tests/ref/fate/dpx-probe
> > new file mode 100644
> > index 00..a69c45ad29
> > --- /dev/null
> > +++ b/tests/ref/fate/dpx-probe
> > @@ -0,0 +1,85 @@
> > +[FRAME]
> > +media_type=video
> > +stream_index=0
> > +key_frame=1
> > +pkt_pts=0
> > +pkt_pts_time=0.00
> > +pkt_dts=0
> > +pkt_dts_time=0.00
> > +best_effort_timestamp=0
> > +best_effort_timestamp_time=0.00
> > +pkt_duration=1
> > +pkt_duration_time=0.04
> > +pkt_pos=0
> > +pkt_size=419072
> > +width=428
> > +height=240
> > +pix_fmt=gbrp10le
> > +sample_aspect_ratio=1:1
> > +pict_type=?
> > +coded_picture_number=0
> > +display_picture_number=0
> > +interlaced_frame=0
> > +top_field_first=0
> > +repeat_pict=0
> > +color_range=unknown
> > +color_space=unknown
> > +color_primaries=unknown
> > +color_transfer=unknown
> > +chroma_location=unspecified
> > +TAG:Creator=Apple Compressor
> > +TAG:Input Device=
> > +[/FRAME]
> > +[STREAM]
> > +index=0
> > +codec_name=dpx
> > +profile=unknown
> > +codec_type=video
> > +codec_time_base=1/24
> > +codec_tag_string=[0][0][0][0]
> > +codec_tag=0x
> > +width=428
> > +height=240
> > +coded_width=428
> > +coded_height=240
> > +closed_captions=0
> > +has_b_frames=0
> > +sample_aspect_ratio=1:1
> > +display_aspect_ratio=107:60
> > +pix_fmt=gbrp10le
> > +level=-99
> > +color_range=unknown
> > +color_space=unknown
> > +color_transfer=unknown
> > +color_primaries=unknown
> > +chroma_location=unspecified
> > +field_order=unknown
> > +timecode=N/A
> > +refs=1
> > +id=N/A
> > +r_frame_rate=24/1
> > +avg_frame_rate=0/0
> > +time_base=1/25
> > +start_pts=N/A
> > +start_time=N/A
> > +duration_ts=N/A
> > +duration=N/A
> > +bit_rate=N/A
> > +max_bit_rate=N/A
> > +bits_per_raw_sample=10
> > +nb_frames=N/A
> > +nb_read_frames=1
> > +nb_read_packets=N/A
> > +DISPOSITION:default=0
> > +DISPOSITION:dub=0
> > +DISPOSITION:original=0
> > +DISPOSITION:comment=0
> > +DISPOSITION:lyrics=0
> > +DISPOSITION:karaoke=0
> > +DISPOSITION:forced=0
> > +DISPOSITION:hearing_impaired=0
> > +DISPOSITION:visual_impaired=0
> > +DISPOSITION:clean_effects=0
> > +DISPOSITION:attached_pic=0
> > +DISPOSITION:timed_thumbnails=0
> > +[/STREAM]
>
> This fails on big-endian PPC64 qemu:
> https://patchwork.ffmpeg.org/check/22076/
>
> TESTdpx-probe
> --- ./tests/ref/fate/dpx-probe  2020-12-08 16:37:42.631082285 +
> +++ tests/data/fate/dpx-probe   2020-12-08 16:54:05.673088160 +
> @@ -14,7 +14,7 @@
>  pkt_size=419072
>  width=428
>  height=240
> -pix_fmt=gbrp10le
> +pix_fmt=gbrp10be
>  sample_aspect_ratio=1:1
>  pict_type=?
>  coded_picture_number=0
> @@ -46,7 +46,7 @@
>  has_b_frames=0
>  sample_aspect_ratio=1:1
>  display_aspect_ratio=107:60
> -pix_fmt=gbrp10le
> +pix_fmt=gbrp10be
>  level=-99
>  color_range=unknown
>  color_space=unknown
> Test dpx-probe failed. Look at tests/data/fate/dpx-probe.err for details.
> tests/Makefile:255: recipe for target 'fate-dpx-probe' failed
> make: *** [fate-dpx-probe] Error 1
>
> --
> Andriy
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 1/6] fate: Add dpx-probe test

2020-12-08 Thread Andriy Gelman
Hi,

On Mon, 07. Dec 10:32, Harry Mallon wrote:
> Signed-off-by: Harry Mallon 
> ---
>  tests/fate/image.mak |  4 ++
>  tests/ref/fate/dpx-probe | 85 
>  2 files changed, 89 insertions(+)
>  create mode 100644 tests/ref/fate/dpx-probe
> 
> diff --git a/tests/fate/image.mak b/tests/fate/image.mak
> index 22072a62f1..d18054d3d8 100644
> --- a/tests/fate/image.mak
> +++ b/tests/fate/image.mak
> @@ -97,6 +97,10 @@ fate-dpx: CMD = framecrc -i 
> $(TARGET_SAMPLES)/dpx/lighthouse_rgb48.dpx
>  FATE_SAMPLES_AVCONV-$(call PARSERDEMDEC, DPX, IMAGE2PIPE, DPX) += 
> fate-dpxparser
>  fate-dpxparser: CMD = framecrc -f image2pipe -i 
> $(TARGET_SAMPLES)/dpx/lena_4x_concat.dpx -sws_flags +accurate_rnd+bitexact
>  
> +FATE_IMAGE-$(call DEMDEC, IMAGE2, DPX) += fate-dpx-probe
> +fate-dpx-probe: SRC = $(TARGET_SAMPLES)/dpx/cyan.dpx
> +fate-dpx-probe: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_streams 
> -show_frames -print_format default -bitexact -v 0 -i "$(SRC)"
> +
>  FATE_EXR += fate-exr-slice-raw
>  fate-exr-slice-raw: CMD = framecrc -i 
> $(TARGET_SAMPLES)/exr/rgba_slice_raw.exr -pix_fmt gbrapf32le
>  
> diff --git a/tests/ref/fate/dpx-probe b/tests/ref/fate/dpx-probe
> new file mode 100644
> index 00..a69c45ad29
> --- /dev/null
> +++ b/tests/ref/fate/dpx-probe
> @@ -0,0 +1,85 @@
> +[FRAME]
> +media_type=video
> +stream_index=0
> +key_frame=1
> +pkt_pts=0
> +pkt_pts_time=0.00
> +pkt_dts=0
> +pkt_dts_time=0.00
> +best_effort_timestamp=0
> +best_effort_timestamp_time=0.00
> +pkt_duration=1
> +pkt_duration_time=0.04
> +pkt_pos=0
> +pkt_size=419072
> +width=428
> +height=240
> +pix_fmt=gbrp10le
> +sample_aspect_ratio=1:1
> +pict_type=?
> +coded_picture_number=0
> +display_picture_number=0
> +interlaced_frame=0
> +top_field_first=0
> +repeat_pict=0
> +color_range=unknown
> +color_space=unknown
> +color_primaries=unknown
> +color_transfer=unknown
> +chroma_location=unspecified
> +TAG:Creator=Apple Compressor
> +TAG:Input Device=
> +[/FRAME]
> +[STREAM]
> +index=0
> +codec_name=dpx
> +profile=unknown
> +codec_type=video
> +codec_time_base=1/24
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x
> +width=428
> +height=240
> +coded_width=428
> +coded_height=240
> +closed_captions=0
> +has_b_frames=0
> +sample_aspect_ratio=1:1
> +display_aspect_ratio=107:60
> +pix_fmt=gbrp10le
> +level=-99
> +color_range=unknown
> +color_space=unknown
> +color_transfer=unknown
> +color_primaries=unknown
> +chroma_location=unspecified
> +field_order=unknown
> +timecode=N/A
> +refs=1
> +id=N/A
> +r_frame_rate=24/1
> +avg_frame_rate=0/0
> +time_base=1/25
> +start_pts=N/A
> +start_time=N/A
> +duration_ts=N/A
> +duration=N/A
> +bit_rate=N/A
> +max_bit_rate=N/A
> +bits_per_raw_sample=10
> +nb_frames=N/A
> +nb_read_frames=1
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +[/STREAM]

This fails on big-endian PPC64 qemu:
https://patchwork.ffmpeg.org/check/22076/

TESTdpx-probe
--- ./tests/ref/fate/dpx-probe  2020-12-08 16:37:42.631082285 +
+++ tests/data/fate/dpx-probe   2020-12-08 16:54:05.673088160 +
@@ -14,7 +14,7 @@
 pkt_size=419072
 width=428
 height=240
-pix_fmt=gbrp10le
+pix_fmt=gbrp10be
 sample_aspect_ratio=1:1
 pict_type=?
 coded_picture_number=0
@@ -46,7 +46,7 @@
 has_b_frames=0
 sample_aspect_ratio=1:1
 display_aspect_ratio=107:60
-pix_fmt=gbrp10le
+pix_fmt=gbrp10be
 level=-99
 color_range=unknown
 color_space=unknown
Test dpx-probe failed. Look at tests/data/fate/dpx-probe.err for details.
tests/Makefile:255: recipe for target 'fate-dpx-probe' failed
make: *** [fate-dpx-probe] Error 1

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [RFC] Machines & Platforms of interest for testing

2020-12-08 Thread Kieran Kunhya
On Tue, 8 Dec 2020 at 14:10, Kieran Kunhya  wrote:

> On Tue, 8 Dec 2020 at 14:03, Josh Dekker  wrote:
>
>> Kieran offered to host one Mac Mini, though I'm unsure what his capacity
>> for
>> hosting is.
>>
>
> I can host as many devices as you see fit and give access to appropriate
> people.
> I've done this in the past when avx2 was a new feature set.
>

I am happy to buy any equipment and get it reimbursed from SPI. Obviously I
can put a sticker on it saying it's property of FFmpeg project etc.

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 164/217] avcodec/idcinvideo: Mark decoder as init-threadsafe

2020-12-08 Thread Tomas Härdin
ons 2020-12-02 klockan 05:21 +0100 skrev Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/idcinvideo.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c
> index 6b2d8087ae..941a89d36d 100644
> --- a/libavcodec/idcinvideo.c
> +++ b/libavcodec/idcinvideo.c
> @@ -258,4 +258,5 @@ AVCodec ff_idcin_decoder = {
>  .decode = idcin_decode_frame,
>  .capabilities   = AV_CODEC_CAP_DR1,
>  .defaults   = idcin_defaults,
> +.caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
>  };

This one is also fine

/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-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 142/217] avcodec/cinepakenc: Mark encoder as init-threadsafe

2020-12-08 Thread Tomas Härdin
ons 2020-12-02 klockan 05:21 +0100 skrev Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/cinepakenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/cinepakenc.c b/libavcodec/cinepakenc.c
> index cc125ed39e..9eaa972a9c 100644
> --- a/libavcodec/cinepakenc.c
> +++ b/libavcodec/cinepakenc.c
> @@ -1189,5 +1189,5 @@ AVCodec ff_cinepak_encoder = {
>  .close  = cinepak_encode_end,
>  .pix_fmts   = (const enum AVPixelFormat[]) {
> AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE },
>  .priv_class = &cinepak_class,
> -.caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
> +.caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE |
> FF_CODEC_CAP_INIT_CLEANUP,
>  };

Looks fine also

/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-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 143/217] avcodec/cinepak: Mark decoder as init-threadsafe

2020-12-08 Thread Tomas Härdin
ons 2020-12-02 klockan 05:21 +0100 skrev Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/cinepak.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
> index 9c5b254231..17148a3577 100644
> --- a/libavcodec/cinepak.c
> +++ b/libavcodec/cinepak.c
> @@ -522,4 +522,5 @@ AVCodec ff_cinepak_decoder = {
>  .close  = cinepak_decode_end,
>  .decode = cinepak_decode_frame,
>  .capabilities   = AV_CODEC_CAP_DR1,
> +.caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
>  };

Looks fine

/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-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [RFC] Machines & Platforms of interest for testing

2020-12-08 Thread Kieran Kunhya
On Tue, 8 Dec 2020 at 14:03, Josh Dekker  wrote:

> Kieran offered to host one Mac Mini, though I'm unsure what his capacity
> for
> hosting is.
>

I can host as many devices as you see fit and give access to appropriate
people.
I've done this in the past when avx2 was a new feature set.

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [RFC] Machines & Platforms of interest for testing

2020-12-08 Thread Josh Dekker

Hi,

As discussed in the meeting, I'm starting a RFC for Machines & Platforms of
interest for testing, developer access and FATE. These would be funded by SPI.

The two platforms mentioned were a Mac Mini (M1 Apple Silicon platform) and a
TALOS II (POWER9 platform). My personal suggestion would be a machine with
both a modern nVidia GPU and AMD GPU for testing hardware acceleration
integration.

Kieran offered to host one Mac Mini, though I'm unsure what his capacity for
hosting is.

Any comments and suggestions welcome.

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avcodec/libaom: Support monochrome encoding with libaom >= 2.0.1

2020-12-08 Thread James Almer

On 12/8/2020 2:04 AM, Philip Langdale wrote:

Monochrome encoding with libaom was buggy for a long time, but this was
finally sorted out in libaom 2.0.1 (2.0.0 is almost there but was still
buggy in realtime mode).

Surprisingly, we've never had an external library feature flag in
configure before, but it seems reasonable to add such a category.

Signed-off-by: Philip Langdale 
---
  Changelog  |  1 +
  configure  |  8 
  libavcodec/libaomenc.c | 14 ++
  libavcodec/version.h   |  2 +-
  4 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index 503317dfae..8f5e849f8d 100644
--- a/Changelog
+++ b/Changelog
@@ -51,6 +51,7 @@ version :
  - asubcut filter
  - Microsoft Paint (MSP) version 2 decoder
  - Microsoft Paint (MSP) demuxer
+- AV1 monochrome encoding support via libaom >= 2.0.1
  
  
  version 4.3:

diff --git a/configure b/configure
index 10dd40cab8..6c83895414 100755
--- a/configure
+++ b/configure
@@ -1829,6 +1829,10 @@ EXTERNAL_LIBRARY_LIST="
  vapoursynth
  "
  
+EXTERNAL_LIBRARY_FEATURES="

+libaom2
+"
+
  HWACCEL_AUTODETECT_LIBRARY_LIST="
  amf
  audiotoolbox
@@ -2314,6 +2318,7 @@ HAVE_LIST="
  $ARCH_FEATURES
  $BUILTIN_LIST
  $COMPLEX_FUNCS
+$EXTERNAL_LIBRARY_FEATURES
  $HAVE_LIST_CMDLINE
  $HAVE_LIST_PUB
  $HEADERS_LIST
@@ -6329,6 +6334,9 @@ enabled gnutls&& require_pkg_config gnutls 
gnutls gnutls/gnutls.h gn
  enabled jni   && { [ $target_os = "android" ] && check_headers jni.h && 
enabled pthreads || die "ERROR: jni not found"; }
  enabled ladspa&& require_headers "ladspa.h dlfcn.h"
  enabled libaom&& require_pkg_config libaom "aom >= 1.0.0" 
aom/aom_codec.h aom_codec_version
+if enabled libaom; then
+check_pkg_config libaom2 "aom >= 2.0.1" aom/aom_codec.h aom_codec_version


It should be cleaner to do the version check in libaomenc.c

Look at av1_init_static(), where we check for libaom 2 in order to tag 
the wrapper as experimental if the library is too old. In there you can 
add a check for 2.0.1 (like aom_codec_version() >= 0x20001) and make it 
set codec->pix_fmts to a new list of formats that include the gray ones 
depending on the result.



+fi
  enabled libaribb24&& { check_pkg_config libaribb24 "aribb24 > 1.0.3" 
"aribb24/aribb24.h" arib_instance_new ||
 { enabled gpl && require_pkg_config libaribb24 aribb24 
"aribb24/aribb24.h" arib_instance_new; } ||
 die "ERROR: libaribb24 requires version higher than 
1.0.3 or --enable-gpl."; }
diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index 2b0581b15a..6110472b68 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -338,6 +338,10 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
  enccfg->g_bit_depth = enccfg->g_input_bit_depth = desc->comp[0].depth;
  switch (avctx->pix_fmt) {
+#if HAVE_LIBAOM2
+case AV_PIX_FMT_GRAY8:
+enccfg->monochrome = 1;
+#endif


Add a line like

// Fall-through

Here, to hint the compiler to not warn about a missing break.


  case AV_PIX_FMT_YUV420P:
  enccfg->g_profile = FF_PROFILE_AV1_MAIN;
  *img_fmt = AOM_IMG_FMT_I420;
@@ -351,6 +355,11 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
  enccfg->g_profile = FF_PROFILE_AV1_HIGH;
  *img_fmt = AOM_IMG_FMT_I444;
  return 0;
+#if HAVE_LIBAOM2
+case AV_PIX_FMT_GRAY10:
+case AV_PIX_FMT_GRAY12:
+enccfg->monochrome = 1;
+#endif


Ditto.


  case AV_PIX_FMT_YUV420P10:
  case AV_PIX_FMT_YUV420P12:
  if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
@@ -1171,6 +1180,11 @@ static const enum AVPixelFormat av1_pix_fmts_highbd[] = {
  AV_PIX_FMT_YUV444P12,
  AV_PIX_FMT_GBRP10,
  AV_PIX_FMT_GBRP12,
+#if HAVE_LIBAOM2
+AV_PIX_FMT_GRAY8,
+AV_PIX_FMT_GRAY10,
+AV_PIX_FMT_GRAY12,
+#endif
  AV_PIX_FMT_NONE
  };
  
diff --git a/libavcodec/version.h b/libavcodec/version.h

index 1c10d105f6..5b92afe60a 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
  
  #define LIBAVCODEC_VERSION_MAJOR  58

  #define LIBAVCODEC_VERSION_MINOR 115
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
  
  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

 LIBAVCODEC_VERSION_MINOR, \



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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: check for SpeedHQ encoder

2020-12-08 Thread Paul B Mahol
lgtm

On Tue, Dec 8, 2020 at 2:36 PM Gyan Doshi  wrote:

> Avoids build failure when mpegvideo_enc is built but SpeedHQ encoder
> isn't.
> ---
>  libavcodec/mpegvideo_enc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
> index 7afc789ec0..243d3ca632 100644
> --- a/libavcodec/mpegvideo_enc.c
> +++ b/libavcodec/mpegvideo_enc.c
> @@ -2996,7 +2996,7 @@ static int encode_thread(AVCodecContext *c, void
> *arg){
>  s->first_slice_line = 1;
>  s->ptr_lastgob = s->pb.buf;
>  for (mb_y_order = s->start_mb_y; mb_y_order < s->end_mb_y;
> mb_y_order++) {
> -if (s->codec_id == AV_CODEC_ID_SPEEDHQ) {
> +if (CONFIG_SPEEDHQ_ENCODER && s->codec_id == AV_CODEC_ID_SPEEDHQ)
> {
>  int first_in_slice;
>  mb_y = ff_speedhq_mb_y_order_to_mb(mb_y_order, s->mb_height,
> &first_in_slice);
>  if (first_in_slice && mb_y_order != s->start_mb_y)
> --
> 2.27.0
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: check for SpeedHQ encoder

2020-12-08 Thread Gyan Doshi
Avoids build failure when mpegvideo_enc is built but SpeedHQ encoder
isn't.
---
 libavcodec/mpegvideo_enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 7afc789ec0..243d3ca632 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -2996,7 +2996,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
 s->first_slice_line = 1;
 s->ptr_lastgob = s->pb.buf;
 for (mb_y_order = s->start_mb_y; mb_y_order < s->end_mb_y; mb_y_order++) {
-if (s->codec_id == AV_CODEC_ID_SPEEDHQ) {
+if (CONFIG_SPEEDHQ_ENCODER && s->codec_id == AV_CODEC_ID_SPEEDHQ) {
 int first_in_slice;
 mb_y = ff_speedhq_mb_y_order_to_mb(mb_y_order, s->mb_height, 
&first_in_slice);
 if (first_in_slice && mb_y_order != s->start_mb_y)
-- 
2.27.0

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avfilter/cropdetect: add option for initial skip

2020-12-08 Thread Paul B Mahol
lgtm

On Tue, Dec 8, 2020 at 2:29 PM Gyan Doshi  wrote:

> The cropdetect filter, at present, skips the first two frames. This
> behaviour is hardcoded.
>
> New option 'skip' allows users to change this. Convenient for when
> input is a single image or a trimmed video stream.
>
> Default is kept at 2 to preserve current behaviour.
> ---
>  doc/filters.texi|  4 
>  libavfilter/vf_cropdetect.c | 10 ++
>  2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 62d6e26a02..d9f606604e 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -8899,6 +8899,10 @@ The value which the width/height should be
> divisible by. It defaults to
>  get only even dimensions (needed for 4:2:2 video). 16 is best when
>  encoding to most video codecs.
>
> +@item skip
> +Set the number of initial frames for which evaluation is skipped.
> +Default is 2. Range is 0 to INT_MAX.
> +
>  @item reset_count, reset
>  Set the counter that determines after how many frames cropdetect will
>  reset the previously detected largest video area and start over to
> diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
> index 7c7d0b953a..5ae87cad2d 100644
> --- a/libavfilter/vf_cropdetect.c
> +++ b/libavfilter/vf_cropdetect.c
> @@ -37,6 +37,7 @@ typedef struct CropDetectContext {
>  int x1, y1, x2, y2;
>  float limit;
>  int round;
> +int skip;
>  int reset_count;
>  int frame_nb;
>  int max_pixsteps[4];
> @@ -127,10 +128,10 @@ static av_cold int init(AVFilterContext *ctx)
>  {
>  CropDetectContext *s = ctx->priv;
>
> -s->frame_nb = -2;
> +s->frame_nb = -1 * s->skip;
>
> -av_log(ctx, AV_LOG_VERBOSE, "limit:%f round:%d reset_count:%d\n",
> -   s->limit, s->round, s->reset_count);
> +av_log(ctx, AV_LOG_VERBOSE, "limit:%f round:%d skip:%d
> reset_count:%d\n",
> +   s->limit, s->round, s->skip, s->reset_count);
>
>  return 0;
>  }
> @@ -167,7 +168,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
> *frame)
>  int outliers, last_y;
>  int limit = lrint(s->limit);
>
> -// ignore first 2 frames - they may be empty
> +// ignore first s->skip frames
>  if (++s->frame_nb > 0) {
>  metadata = &frame->metadata;
>
> @@ -247,6 +248,7 @@ static const AVOption cropdetect_options[] = {
>  { "limit", "Threshold below which the pixel is considered black",
> OFFSET(limit),   AV_OPT_TYPE_FLOAT, { .dbl = 24.0/255 }, 0, 65535,
> FLAGS },
>  { "round", "Value by which the width/height should be divisible",
> OFFSET(round),   AV_OPT_TYPE_INT, { .i64 = 16 }, 0, INT_MAX, FLAGS },
>  { "reset", "Recalculate the crop area after this many frames",
> OFFSET(reset_count), AV_OPT_TYPE_INT, { .i64 = 0 },  0, INT_MAX, FLAGS },
> +{ "skip",  "Number of initial frames to skip",
> OFFSET(skip),AV_OPT_TYPE_INT, { .i64 = 2 },  0, INT_MAX, FLAGS },
>  { "reset_count", "Recalculate the crop area after this many
> frames",OFFSET(reset_count),AV_OPT_TYPE_INT,{ .i64 = 0 },  0, INT_MAX,
> FLAGS },
>  { "max_outliers", "Threshold count of outliers",
> OFFSET(max_outliers),AV_OPT_TYPE_INT, { .i64 = 0 },  0, INT_MAX, FLAGS },
>  { NULL }
> --
> 2.27.0
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avfilter/cropdetect: add option for initial skip

2020-12-08 Thread Gyan Doshi
The cropdetect filter, at present, skips the first two frames. This
behaviour is hardcoded.

New option 'skip' allows users to change this. Convenient for when
input is a single image or a trimmed video stream.

Default is kept at 2 to preserve current behaviour.
---
 doc/filters.texi|  4 
 libavfilter/vf_cropdetect.c | 10 ++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 62d6e26a02..d9f606604e 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -8899,6 +8899,10 @@ The value which the width/height should be divisible by. 
It defaults to
 get only even dimensions (needed for 4:2:2 video). 16 is best when
 encoding to most video codecs.
 
+@item skip
+Set the number of initial frames for which evaluation is skipped.
+Default is 2. Range is 0 to INT_MAX.
+
 @item reset_count, reset
 Set the counter that determines after how many frames cropdetect will
 reset the previously detected largest video area and start over to
diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
index 7c7d0b953a..5ae87cad2d 100644
--- a/libavfilter/vf_cropdetect.c
+++ b/libavfilter/vf_cropdetect.c
@@ -37,6 +37,7 @@ typedef struct CropDetectContext {
 int x1, y1, x2, y2;
 float limit;
 int round;
+int skip;
 int reset_count;
 int frame_nb;
 int max_pixsteps[4];
@@ -127,10 +128,10 @@ static av_cold int init(AVFilterContext *ctx)
 {
 CropDetectContext *s = ctx->priv;
 
-s->frame_nb = -2;
+s->frame_nb = -1 * s->skip;
 
-av_log(ctx, AV_LOG_VERBOSE, "limit:%f round:%d reset_count:%d\n",
-   s->limit, s->round, s->reset_count);
+av_log(ctx, AV_LOG_VERBOSE, "limit:%f round:%d skip:%d reset_count:%d\n",
+   s->limit, s->round, s->skip, s->reset_count);
 
 return 0;
 }
@@ -167,7 +168,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 int outliers, last_y;
 int limit = lrint(s->limit);
 
-// ignore first 2 frames - they may be empty
+// ignore first s->skip frames
 if (++s->frame_nb > 0) {
 metadata = &frame->metadata;
 
@@ -247,6 +248,7 @@ static const AVOption cropdetect_options[] = {
 { "limit", "Threshold below which the pixel is considered black", 
OFFSET(limit),   AV_OPT_TYPE_FLOAT, { .dbl = 24.0/255 }, 0, 65535, FLAGS },
 { "round", "Value by which the width/height should be divisible", 
OFFSET(round),   AV_OPT_TYPE_INT, { .i64 = 16 }, 0, INT_MAX, FLAGS },
 { "reset", "Recalculate the crop area after this many frames",
OFFSET(reset_count), AV_OPT_TYPE_INT, { .i64 = 0 },  0, INT_MAX, FLAGS },
+{ "skip",  "Number of initial frames to skip",
OFFSET(skip),AV_OPT_TYPE_INT, { .i64 = 2 },  0, INT_MAX, FLAGS },
 { "reset_count", "Recalculate the crop area after this many 
frames",OFFSET(reset_count),AV_OPT_TYPE_INT,{ .i64 = 0 },  0, INT_MAX, FLAGS },
 { "max_outliers", "Threshold count of outliers",  
OFFSET(max_outliers),AV_OPT_TYPE_INT, { .i64 = 0 },  0, INT_MAX, FLAGS },
 { NULL }
-- 
2.27.0

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/fifo: utilize a clone packet for muxing

2020-12-08 Thread Jan Ekström
From: Jan Ekström 

This way the timestamp adjustments do not have to be manually
undone in case of failure and need to recover/retry.

Fixes an issue where the timestamp adjustment would be re-done over
and over again when recovery by muxing the same AVPacket again is
attempted. Would become visible if the fifo muxer's time base and
the output muxer's time base do not match (by the value either
becoming smaller and smaller, or larger and larger).

Signed-off-by: Jan Ekström 
---
 libavformat/fifo.c | 39 ++-
 1 file changed, 34 insertions(+), 5 deletions(-)

diff --git a/libavformat/fifo.c b/libavformat/fifo.c
index 17748e94ce..aa8bea6d5a 100644
--- a/libavformat/fifo.c
+++ b/libavformat/fifo.c
@@ -43,6 +43,8 @@ typedef struct FifoContext {
 int queue_size;
 AVThreadMessageQueue *queue;
 
+AVPacket *out_pkt;
+
 pthread_t writer_thread;
 
 /* Return value of last write_trailer_call */
@@ -181,6 +183,7 @@ static int fifo_thread_write_packet(FifoThreadContext *ctx, 
AVPacket *pkt)
 AVFormatContext *avf = ctx->avf;
 FifoContext *fifo = avf->priv_data;
 AVFormatContext *avf2 = fifo->avf;
+AVPacket *out_pkt = fifo->out_pkt;
 AVRational src_tb, dst_tb;
 int ret, s_idx;
 
@@ -198,14 +201,34 @@ static int fifo_thread_write_packet(FifoThreadContext 
*ctx, AVPacket *pkt)
 }
 }
 
-s_idx = pkt->stream_index;
+// We will be muxing a packet, so clone it by utilizing references.
+// This way we do not have to undo any of the tweaking for timestamps etc
+// that we are doing in this function in case another attempt through
+// recovery is required.
+if ((ret = av_packet_ref(out_pkt, pkt)) < 0) {
+av_log(avf, AV_LOG_ERROR,
+   "Error creating a new reference for output packet (%s)!\n",
+   av_err2str(ret));
+return ret;
+}
+
+s_idx = out_pkt->stream_index;
 src_tb = avf->streams[s_idx]->time_base;
 dst_tb = avf2->streams[s_idx]->time_base;
-av_packet_rescale_ts(pkt, src_tb, dst_tb);
 
-ret = av_write_frame(avf2, pkt);
-if (ret >= 0)
-av_packet_unref(pkt);
+av_packet_rescale_ts(out_pkt, src_tb, dst_tb);
+
+ret = av_write_frame(avf2, out_pkt);
+
+// Always clear the output packet, as we have no more use for it.
+av_packet_unref(out_pkt);
+
+if (ret < 0)
+return ret;
+
+// We hit success, unref the actual source packet.
+av_packet_unref(pkt);
+
 return ret;
 }
 
@@ -525,6 +548,11 @@ static int fifo_init(AVFormatContext *avf)
 return ret;
 }
 
+if (!(fifo->out_pkt = av_packet_alloc())) {
+av_log(avf, AV_LOG_ERROR, "Failed to allocate output packet!\n");
+return AVERROR(ENOMEM);
+}
+
 ret = fifo_mux_init(avf, oformat, avf->url);
 if (ret < 0)
 return ret;
@@ -650,6 +678,7 @@ static void fifo_deinit(AVFormatContext *avf)
 av_thread_message_queue_free(&fifo->queue);
 if (fifo->overflow_flag_lock_initialized)
 pthread_mutex_destroy(&fifo->overflow_flag_lock);
+av_packet_free(&fifo->out_pkt);
 }
 
 #define OFFSET(x) offsetof(FifoContext, x)
-- 
2.29.2

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avcodec: set AV_CODEC_CAP_CHANNEL_CONF on decoders which set their own channels

2020-12-08 Thread Paul B Mahol
LGTM
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avformat/hashenc: Reuse hash_free() for framehash muxers

2020-12-08 Thread Paul B Mahol
LGTM

On Mon, Dec 7, 2020 at 1:11 AM Andreas Rheinhardt <
andreas.rheinha...@gmail.com> wrote:

> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavformat/hashenc.c | 14 +++---
>  1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/libavformat/hashenc.c b/libavformat/hashenc.c
> index ce609f6efa..5523dfd1cd 100644
> --- a/libavformat/hashenc.c
> +++ b/libavformat/hashenc.c
> @@ -156,6 +156,7 @@ static int hash_write_trailer(struct AVFormatContext
> *s)
>
>  return 0;
>  }
> +#endif
>
>  static void hash_free(struct AVFormatContext *s)
>  {
> @@ -168,7 +169,6 @@ static void hash_free(struct AVFormatContext *s)
>  }
>  av_freep(&c->hashes);
>  }
> -#endif
>
>  #if CONFIG_HASH_MUXER
>  static const AVClass hashenc_class = {
> @@ -326,14 +326,6 @@ static int framehash_write_packet(struct
> AVFormatContext *s, AVPacket *pkt)
>  avio_printf(s->pb, "\n");
>  return 0;
>  }
> -
> -static void framehash_free(struct AVFormatContext *s)
> -{
> -struct HashContext *c = s->priv_data;
> -if (c->hashes)
> -av_hash_freep(&c->hashes[0]);
> -av_freep(&c->hashes);
> -}
>  #endif
>
>  #if CONFIG_FRAMEHASH_MUXER
> @@ -353,7 +345,7 @@ AVOutputFormat ff_framehash_muxer = {
>  .init  = framehash_init,
>  .write_header  = framehash_write_header,
>  .write_packet  = framehash_write_packet,
> -.deinit= framehash_free,
> +.deinit= hash_free,
>  .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
>   AVFMT_TS_NEGATIVE,
>  .priv_class= &framehash_class,
> @@ -377,7 +369,7 @@ AVOutputFormat ff_framemd5_muxer = {
>  .init  = framehash_init,
>  .write_header  = framehash_write_header,
>  .write_packet  = framehash_write_packet,
> -.deinit= framehash_free,
> +.deinit= hash_free,
>  .flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
>   AVFMT_TS_NEGATIVE,
>  .priv_class= &framemd5_class,
> --
> 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-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 1/6] fate: Add dpx-probe test

2020-12-08 Thread Paul B Mahol
Will upload a dpx sample and apply patches after 48h.

On Mon, Dec 7, 2020 at 12:39 PM Harry Mallon 
wrote:

> I attach the cyan.dpx that I generated for this test, it needs to be in
> the dpx folder in fate.
>
> Best,
> Harry
>
>
>
>
> > On 7 Dec 2020, at 10:32, Harry Mallon  wrote:
> >
> > Signed-off-by: Harry Mallon 
> > ---
> > [...]
> > --
> > 2.29.2
> >
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 3/3] avformat/mov: remove an always true condition

2020-12-08 Thread myp...@gmail.com
On Sat, Oct 17, 2020 at 11:48 PM Zhao Zhili  wrote:
>
>
>
> > On Sep 18, 2020, at 10:33 PM, Zhao Zhili  wrote:
> >
> > From: Zhao Zhili 
> >
> > ---
> > libavformat/mov.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavformat/mov.c b/libavformat/mov.c
> > index 9fc0db24d5..f99605c2cd 100644
> > --- a/libavformat/mov.c
> > +++ b/libavformat/mov.c
> > @@ -1475,7 +1475,7 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext 
> > *pb, MOVAtom atom)
> > c->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* 
> > duration */
> > // set the AVFormatContext duration because the duration of individual 
> > tracks
> > // may be inaccurate
> > -if (c->time_scale > 0 && !c->trex_data)
> > +if (!c->trex_data)
> > c->fc->duration = av_rescale(c->duration, AV_TIME_BASE, 
> > c->time_scale);
> > avio_rb32(pb); /* preferred scale */
>
> Ping for review.
>
> The always true condition is not obvious in the patch. time_scale is checked 
> a few lines before explicitly.
>
> 1471 if (c->time_scale <= 0) {
> 1472 av_log(c->fc, AV_LOG_ERROR, "Invalid mvhd time scale %d, 
> defaulting to 1\n", c->time_scale);
> 1473 c->time_scale = 1;
> 1474 }
> 1475 av_log(c->fc, AV_LOG_TRACE, "time scale = %i\n", c->time_scale);
> 1476
> 1477 c->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* 
> duration */
> 1478 // set the AVFormatContext duration because the duration of 
> individual tracks
> 1479 // may be inaccurate
> 1480 if (c->time_scale > 0 && !c->trex_data)
> 1481 c->fc->duration = av_rescale(c->duration, AV_TIME_BASE, 
> c->time_scale);
>
LGTM, will apply if no object
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avcodec/libaom: Support monochrome encoding with libaom >= 2.0.1

2020-12-08 Thread Philip Langdale
Monochrome encoding with libaom was buggy for a long time, but this was
finally sorted out in libaom 2.0.1 (2.0.0 is almost there but was still
buggy in realtime mode).

Surprisingly, we've never had an external library feature flag in
configure before, but it seems reasonable to add such a category.

Signed-off-by: Philip Langdale 
---
 Changelog  |  1 +
 configure  |  8 
 libavcodec/libaomenc.c | 14 ++
 libavcodec/version.h   |  2 +-
 4 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index 503317dfae..8f5e849f8d 100644
--- a/Changelog
+++ b/Changelog
@@ -51,6 +51,7 @@ version :
 - asubcut filter
 - Microsoft Paint (MSP) version 2 decoder
 - Microsoft Paint (MSP) demuxer
+- AV1 monochrome encoding support via libaom >= 2.0.1
 
 
 version 4.3:
diff --git a/configure b/configure
index 10dd40cab8..6c83895414 100755
--- a/configure
+++ b/configure
@@ -1829,6 +1829,10 @@ EXTERNAL_LIBRARY_LIST="
 vapoursynth
 "
 
+EXTERNAL_LIBRARY_FEATURES="
+libaom2
+"
+
 HWACCEL_AUTODETECT_LIBRARY_LIST="
 amf
 audiotoolbox
@@ -2314,6 +2318,7 @@ HAVE_LIST="
 $ARCH_FEATURES
 $BUILTIN_LIST
 $COMPLEX_FUNCS
+$EXTERNAL_LIBRARY_FEATURES
 $HAVE_LIST_CMDLINE
 $HAVE_LIST_PUB
 $HEADERS_LIST
@@ -6329,6 +6334,9 @@ enabled gnutls&& require_pkg_config gnutls 
gnutls gnutls/gnutls.h gn
 enabled jni   && { [ $target_os = "android" ] && check_headers 
jni.h && enabled pthreads || die "ERROR: jni not found"; }
 enabled ladspa&& require_headers "ladspa.h dlfcn.h"
 enabled libaom&& require_pkg_config libaom "aom >= 1.0.0" 
aom/aom_codec.h aom_codec_version
+if enabled libaom; then
+check_pkg_config libaom2 "aom >= 2.0.1" aom/aom_codec.h aom_codec_version
+fi
 enabled libaribb24&& { check_pkg_config libaribb24 "aribb24 > 1.0.3" 
"aribb24/aribb24.h" arib_instance_new ||
{ enabled gpl && require_pkg_config libaribb24 
aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
die "ERROR: libaribb24 requires version higher 
than 1.0.3 or --enable-gpl."; }
diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index 2b0581b15a..6110472b68 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -338,6 +338,10 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
 enccfg->g_bit_depth = enccfg->g_input_bit_depth = desc->comp[0].depth;
 switch (avctx->pix_fmt) {
+#if HAVE_LIBAOM2
+case AV_PIX_FMT_GRAY8:
+enccfg->monochrome = 1;
+#endif
 case AV_PIX_FMT_YUV420P:
 enccfg->g_profile = FF_PROFILE_AV1_MAIN;
 *img_fmt = AOM_IMG_FMT_I420;
@@ -351,6 +355,11 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
 enccfg->g_profile = FF_PROFILE_AV1_HIGH;
 *img_fmt = AOM_IMG_FMT_I444;
 return 0;
+#if HAVE_LIBAOM2
+case AV_PIX_FMT_GRAY10:
+case AV_PIX_FMT_GRAY12:
+enccfg->monochrome = 1;
+#endif
 case AV_PIX_FMT_YUV420P10:
 case AV_PIX_FMT_YUV420P12:
 if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
@@ -1171,6 +1180,11 @@ static const enum AVPixelFormat av1_pix_fmts_highbd[] = {
 AV_PIX_FMT_YUV444P12,
 AV_PIX_FMT_GBRP10,
 AV_PIX_FMT_GBRP12,
+#if HAVE_LIBAOM2
+AV_PIX_FMT_GRAY8,
+AV_PIX_FMT_GRAY10,
+AV_PIX_FMT_GRAY12,
+#endif
 AV_PIX_FMT_NONE
 };
 
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 1c10d105f6..5b92afe60a 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR 115
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
-- 
2.27.0

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] help

2020-12-08 Thread Akshay Bhuradia
Hi Dev Team,

Why  -hls_enc_key  and -hls_enc_iv  are taking 16 characters only. For
AES-128 it should be 32 characters. whenever i provide 32 characters it
takes only 16 characters.

*Thanks and Regards*
*Akshay Bhuradia*
*Software Engineer*
*Contact No : +91-9716414797 |  SkypeId : akshay.bhura...@nebularc.com
*
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".