Re: [FFmpeg-devel] dash: add descriptor which is useful to the scheme defined by ISO/IEC 23009-1:2014/Amd.2:2015.

2019-07-17 Thread Jeyapal, Karthick

On 7/17/19 10:21 AM, Tao Zhang wrote:
> Jeyapal, Karthick  于2019年7月17日周三 上午10:46写道:
>>
>>
>> On 7/15/19 8:41 AM, leozhang wrote:
>>> change history:
>>> 1. remove unnecessary cast.
>>> 2. add some braces.
>>>
>>> Please comment, Thanks
>> Thanks for sending the patch. Please find some of my comments inlined below.
> Thanks for your comments. I made some changes below. Please review it, thanks.
>>>
>>> Signed-off-by: leozhang 
>>> ---
>>>  doc/muxers.texi   |  3 +++
>>>  libavformat/dashenc.c | 35 ---
>>>  2 files changed, 35 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/doc/muxers.texi b/doc/muxers.texi
>>> index b109297..ac06ad2 100644
>>> --- a/doc/muxers.texi
>>> +++ b/doc/muxers.texi
>>> @@ -275,6 +275,9 @@ of the adaptation sets and a,b,c,d and e are the 
>>> indices of the mapped streams.
>>>  To map all video (or audio) streams to an AdaptationSet, "v" (or "a") can 
>>> be used as stream identifier instead of IDs.
>>>
>>>  When no assignment is defined, this defaults to an AdaptationSet for each 
>>> stream.
>>> +
>>> +Optional syntax is "id=x,descriptor=descriptor_str,streams=a,b,c 
>>> id=y,streams=d,e" and so on, descriptor is useful to the scheme defined by 
>>> ISO/IEC 23009-1:2014/Amd.2:2015.
>>> +And descriptor_str must be a properly formatted XML element, which is 
>>> encoded by base64.
>> Two comments:
>> 1. Please provide an example here. So that it is easier for people to 
>> understand
> For the instance using descriptor in VR tiled video application,
> this short interesting video
> https://www.hhi.fraunhofer.de/en/departments/vca/research-groups/multimedia-communications/research-topics/mpeg-omaf.html
> is more intuitive than a textual description.
> Then, how DASH pack media data in tile based streaming?
> Refer ISO/IEC 23009-1:2014/Amd.2:2015, for example, the descriptor
> string  value="0,0,0,1,1,2,2"/> indicates that AdaptationSet is
> the top-left corner tile of full video divided into 2x2 tiles.
> Finally, how to use FFmpeg DASH muxer to generate the tile based streaming?
> We split the video by NxN tiles, insert descriptor syntax together
> with AdaptationSet in MPD.
> For example, the pseudo ffmpeg command {-adaptation_sets
> "id=0,descriptor=PFN1cHBsZW1lbnRhbFByb3BlcnR5IHNjaGVtZUlkVXJpPSJ1cm46bXBlZzpkYXNoOnNyZDoyMDE0IiB2YWx1ZT0iMCwwLDAsMSwxLDIsMiIvPg==,streams=v"}
> will
> insert descriptor string  schemeIdUri="urn:mpeg:dash:srd:2014" value="0,0,0,1,1,2,2"/> like
> below
> 
>  subsegmentStartsWithSAP="1">
>  value="0,0,0,1,1,2,2"/>
>  width="640" height="360" bandwidth="218284" startWithSAP="1">
>   ...
> 
> 
>
> In addition to VR applications, zoomed video part can also be
> indicated by descriptor.
Thanks for the detailed explanation. Please add the following/similar line to 
muxers.texi
For example, 
-adaptation_sets "id=0,descriptor=,streams=v"
>> 2. Why do we need this to be base64 encoded? What is the use-case where a 
>> normal string doesn't work?
> The parser code used comma and space as separator. The unencrypted
> descriptor string like  schemeIdUri="urn:mpeg:dash:srd:2014" value="0,0,0,1,1,2,2"/> contains
> comma and space, which disturbs the normal parse result.
Space is used as separator, only outside the if..else.. conditions. So, it 
won't count for spaces inside the descriptor string.
Regarding comma separator you can change the logic for descriptor alone, as the 
relevant code is anyways inside an "else if" for descriptor. 
You can look for ''>" symbol as the terminating char, instead of looking for a 
separator. Also add a note in muxers.texi mentioning that descriptor string 
should be a self-closing xml tag.
It is easier for users to send a self-closing xml tag as a command line input, 
rather than a base64 encoded string.
>>>  @item timeout @var{timeout}
>>>  Set timeout for socket I/O operations. Applicable only for HTTP output.
>>>  @item index_correction @var{index_correction}
>>> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
>>> index b25afb4..a48031c 100644
>>> --- a/libavformat/dashenc.c
>>> +++ b/libavformat/dashenc.c
>>> @@ -34,6 +34,7 @@
>>>  #include "libavutil/rational.h"
>>>  #include "libavutil/time.h"
>>>  #include "libavutil/time_internal.h"
>>> +#include "libavutil/base64.h"
>>>
>>>  #include "avc.h"
>>>  #include "avformat.h"
>>> @@ -68,6 +69,7 @@ typedef struct Segment {
>>>
>>>  typedef struct AdaptationSet {
>>>  char id[10];
>>> +char descriptor[1024];
>> Please change this char * and allocate it dynamically. I understand there 
>> are some legacy code in dashenc using this 1024 length.
>> But at least new code should follow dynamic allocation.
> Agree, will fix it
>>>  enum AVMediaType media_type;
>>>  AVDictionary *metadata;
>>>  AVRational min_frame_rate, max_frame_rate;
>>> @@ -748,7 +750,8 @@ static int write_adaptation_set(AVFormatContext *s, 
>>> AVIOContext *out, int as_ind
>>>  role = av_dict_get(as->metadata, "role", NULL, 0);

[FFmpeg-devel] [PATCH] Issue#6001:Fix for incorrect refs frame count in ffprobe

2019-07-17 Thread Mukund Manikarnike
Hi,

Please find the patch for issue#6001 attached.
I tried git send-email without any success.
I'm getting a success message. But, it doesn't show up in the ffmpeg-devel
list.

Sendmail: /usr/sbin/sendmail -i ffmpeg-devel@ffmpeg.org muk...@gmail.com
From: Mukund Manikarnike 
To: ffmpeg-devel@ffmpeg.org
Cc: Mukund Manikarnike 
Subject: [PATCH] Issue#6001:Fix for incorrect refs frame count in ffprobe
Date: Wed, 17 Jul 2019 20:05:29 -0700
Message-Id: <20190718030529.90547-1-muk...@gmail.com>
X-Mailer: git-send-email 2.21.0
In-Reply-To: 
References: 
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Result: OK

Regards,
Mukund Manikarnike


issue_6001_set_ref_frame_count.patch
Description: Binary data
___
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 2/3] fate: change the scenecut fate threshold for one more scenecut scenes

2019-07-17 Thread Limin Wang
On Wed, Jul 17, 2019 at 09:26:42PM +0200, Michael Niedermayer wrote:
> On Tue, Jul 16, 2019 at 06:53:57AM +0800, lance.lmw...@gmail.com wrote:
> > From: Limin Wang 
> > 
> > Signed-off-by: Limin Wang 
> > ---
> >  tests/fate/filter-video.mak| 2 +-
> >  tests/ref/fate/filter-metadata-scenedetect | 1 +
> >  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> The commit message should also say "why" the change is done

When I'm testing the fate sample, it has one scenecut is missing for the
0.4 threshold, so I change it, why to 0.25, it's for the next patch to
detect the same scene. Now the 10bit format testing isn't expected, I'll
update the comment message if have further updated.


Thanks,

> 
> Thanks
> 
> [...]
> -- 
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Never trust a computer, one day, it may think you are the virus. -- Compn



> ___
> 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] avformat/ifv: Check for EOF in read_index()

2019-07-17 Thread Michael Niedermayer
Fixes: Timeout
Fixes: 
15567/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5758451487080448

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/ifv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/ifv.c b/libavformat/ifv.c
index 6acbb29a75..f95e9b0e52 100644
--- a/libavformat/ifv.c
+++ b/libavformat/ifv.c
@@ -68,6 +68,8 @@ static int read_index(AVFormatContext *s,
 }
 
 for (i = start_index; i < end_index; i++) {
+if (avio_feof(s->pb))
+return AVERROR_EOF;
 pos = avio_rl32(s->pb);
 size = avio_rl32(s->pb);
 
-- 
2.22.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] Setup for extracting quantization parameters from encoded streams

2019-07-17 Thread Juan De León
For context
https://docs.google.com/document/d/1WClt3EqhjwdGXhEw386O0wfn3IBQ1Ib-_5emVM1gbnA/edit?usp=sharing
Feel free to comment the doc.

On Wed, Jul 17, 2019 at 4:18 PM Juan De León  wrote:

> ---
>  libavfilter/vf_extractqp.c  | 116 
>  libavutil/Makefile  |   2 +
>  libavutil/quantization_params.c |  28 
>  libavutil/quantization_params.h |  98 +++
>  4 files changed, 244 insertions(+)
>  create mode 100644 libavfilter/vf_extractqp.c
>  create mode 100644 libavutil/quantization_params.c
>  create mode 100644 libavutil/quantization_params.h
>
> diff --git a/libavfilter/vf_extractqp.c b/libavfilter/vf_extractqp.c
> new file mode 100644
> index 00..4332012cc4
> --- /dev/null
> +++ b/libavfilter/vf_extractqp.c
> @@ -0,0 +1,116 @@
> +/*
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301 USA
> + */
> +
> +#include "libavutil/frame.h"
> +#include "libavutil/opt.h"
> +#include "libavutil/quantization_params.h"
> +#include "libavfilter/avfilter.h"
> +#include "libavfilter/internal.h"
> +
> +typedef struct QPExtractContext {
> +const AVClass *class;
> +FILE *stats_file;
> +char *stats_file_str;
> +} QPExtractContext;
> +
> +#define OFFSET(x) offsetof(QPExtractContext, x)
> +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
> +
> +static const AVOption qpextract_options[] = {
> +{"stats_file", "Set file to store QP information",
> OFFSET(stats_file_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
> +{"f",  "Set file to store QP information",
> OFFSET(stats_file_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
> +{ NULL }
> +};
> +
> +AVFILTER_DEFINE_CLASS(qpextract);
> +
> +static av_cold int init(AVFilterContext *ctx)
> +{
> +QPExtractContext *s = ctx->priv;
> +
> +if (s->stats_file_str) {
> +if (!strcmp(s->stats_file_str, "-")) {
> +s->stats_file = stdout;
> +} else {
> +s->stats_file = fopen(s->stats_file_str, "w");
> +if (!s->stats_file) {
> +int err = AVERROR(errno);
> +char buf[128];
> +av_strerror(err, buf, sizeof(buf));
> +av_log(ctx, AV_LOG_ERROR, "Could not open log file %s:
> %s\n",
> +   s->stats_file_str, buf);
> +return err;
> +}
> +}
> +}
> +return 0;
> +}
> +
> +static av_cold int uninit(AVFilterContext *ctx) {
> +return 0;
> +}
> +
> +static int filter_frame(AVFilterLink *inlink, AVFrame *in) {
> +AVFilterContext *ctx = inlink->dst;
> +AVFilterLink *outlink = ctx->outputs[0];
> +QPExtractContext *s = ctx->priv;
> +AVFrame *out = NULL;
> +
> +if (ctx->is_disabled) {
> +return ff_filter_frame(outlink, in);
> +}
> +
> +AVFrameSideData *sd = av_frame_get_side_data(in,
> AV_FRAME_DATA_QUANTIZATION_PARAMS);
> +
> +if (!sd) {
> +fprintf(s->stats_file, "no side data");
> +}
> +else {
> +fprintf(s->stats_file, "yes side data");
> +}
> +
> +return ff_filter_frame(outlink, in);
> +}
> +
> +static const AVFilterPad qpextract_inputs[] = {
> +{
> +.name = "default",
> +.type = AVMEDIA_TYPE_VIDEO,
> +.filter_frame = filter_frame,
> +},
> +{ NULL }
> +};
> +
> +static const AVFilterPad qpextract_outputs[] = {
> +{
> +.name  = "default",
> +.type  = AVMEDIA_TYPE_VIDEO,
> +},
> +{ NULL }
> +};
> +
> +AVFilter ff_vf_qpextract = {
> +.name  = "extractqp",
> +.description   = NULL_IF_CONFIG_SMALL("Extract quantization
> parameters."),
> +.init  = init,
> +.uninit= uninit,
> +.priv_size = sizeof(QPExtractContext),
> +.priv_class= _class,
> +.inputs= qpextract_inputs,
> +.outputs   = qpextract_outputs,
> +};
> diff --git a/libavutil/Makefile b/libavutil/Makefile
> index 8a7a44e4b5..be1a9c3a9c 100644
> --- a/libavutil/Makefile
> +++ b/libavutil/Makefile
> @@ -60,6 +60,7 @@ HEADERS = adler32.h
>\
>pixdesc.h \
>pixelutils.h   

[FFmpeg-devel] [PATCH] Setup for extracting quantization parameters from encoded streams

2019-07-17 Thread Juan De León
---
 libavfilter/vf_extractqp.c  | 116 
 libavutil/Makefile  |   2 +
 libavutil/quantization_params.c |  28 
 libavutil/quantization_params.h |  98 +++
 4 files changed, 244 insertions(+)
 create mode 100644 libavfilter/vf_extractqp.c
 create mode 100644 libavutil/quantization_params.c
 create mode 100644 libavutil/quantization_params.h

diff --git a/libavfilter/vf_extractqp.c b/libavfilter/vf_extractqp.c
new file mode 100644
index 00..4332012cc4
--- /dev/null
+++ b/libavfilter/vf_extractqp.c
@@ -0,0 +1,116 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/frame.h"
+#include "libavutil/opt.h"
+#include "libavutil/quantization_params.h"
+#include "libavfilter/avfilter.h"
+#include "libavfilter/internal.h"
+
+typedef struct QPExtractContext {
+const AVClass *class;
+FILE *stats_file;
+char *stats_file_str;
+} QPExtractContext;
+
+#define OFFSET(x) offsetof(QPExtractContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption qpextract_options[] = {
+{"stats_file", "Set file to store QP information", OFFSET(stats_file_str), 
AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
+{"f",  "Set file to store QP information", OFFSET(stats_file_str), 
AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
+{ NULL }
+};
+
+AVFILTER_DEFINE_CLASS(qpextract);
+
+static av_cold int init(AVFilterContext *ctx)
+{
+QPExtractContext *s = ctx->priv;
+
+if (s->stats_file_str) {
+if (!strcmp(s->stats_file_str, "-")) {
+s->stats_file = stdout;
+} else {
+s->stats_file = fopen(s->stats_file_str, "w");
+if (!s->stats_file) {
+int err = AVERROR(errno);
+char buf[128];
+av_strerror(err, buf, sizeof(buf));
+av_log(ctx, AV_LOG_ERROR, "Could not open log file %s: %s\n",
+   s->stats_file_str, buf);
+return err;
+}
+}
+}
+return 0;
+}
+
+static av_cold int uninit(AVFilterContext *ctx) {
+return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in) {
+AVFilterContext *ctx = inlink->dst;
+AVFilterLink *outlink = ctx->outputs[0];
+QPExtractContext *s = ctx->priv;
+AVFrame *out = NULL;
+
+if (ctx->is_disabled) {
+return ff_filter_frame(outlink, in);
+}
+
+AVFrameSideData *sd = av_frame_get_side_data(in, 
AV_FRAME_DATA_QUANTIZATION_PARAMS);
+
+if (!sd) {
+fprintf(s->stats_file, "no side data");
+}
+else {
+fprintf(s->stats_file, "yes side data");
+}
+
+return ff_filter_frame(outlink, in);
+}
+
+static const AVFilterPad qpextract_inputs[] = {
+{
+.name = "default",
+.type = AVMEDIA_TYPE_VIDEO,
+.filter_frame = filter_frame,
+},
+{ NULL }
+};
+
+static const AVFilterPad qpextract_outputs[] = {
+{
+.name  = "default",
+.type  = AVMEDIA_TYPE_VIDEO,
+},
+{ NULL }
+};
+
+AVFilter ff_vf_qpextract = {
+.name  = "extractqp",
+.description   = NULL_IF_CONFIG_SMALL("Extract quantization parameters."),
+.init  = init,
+.uninit= uninit,
+.priv_size = sizeof(QPExtractContext),
+.priv_class= _class,
+.inputs= qpextract_inputs,
+.outputs   = qpextract_outputs,
+};
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 8a7a44e4b5..be1a9c3a9c 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -60,6 +60,7 @@ HEADERS = adler32.h   
  \
   pixdesc.h \
   pixelutils.h  \
   pixfmt.h  \
+  quantization_params.h \
   random_seed.h \
   rc4.h \
   rational.h\
@@ -140,6 +141,7 @@ 

[FFmpeg-devel] [PATCH] lavc/videotoolboxenc: make transfer_fnc initialized for unsupport function

2019-07-17 Thread lance . lmwang
From: Limin Wang 

The current function will report one error message, but the caller func 
haven't check it, so change the default to process as AVCOL_TRC_UNSPECIFIED.

Signed-off-by: Limin Wang 
---
 libavcodec/videotoolboxenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index ece9d6e..d76bb7f 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -949,6 +949,7 @@ static int get_cv_transfer_function(AVCodecContext *avctx,
 break;
 
 default:
+*transfer_fnc = NULL;
 av_log(avctx, AV_LOG_ERROR, "Transfer function %s is not 
supported.\n", av_color_transfer_name(trc));
 return -1;
 }
-- 
2.6.4

___
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] lavc/videotoolboxenc: add hdr10, linear, hlg color transfer function for videotoolboxenc

2019-07-17 Thread Limin Wang
On Wed, Jul 17, 2019 at 10:53:08AM -0400, Vittorio Giovara wrote:
> On Tue, Jul 16, 2019 at 10:29 PM Limin Wang  wrote:
> 
> > On Tue, Jul 16, 2019 at 09:36:32PM -0400, Rick Kern wrote:
> > > Testing for the new transfer functions when compiling for OSX 10.12
> > reports
> > > the color settings as "yuv420p(tv, bt2020nc/bt2020/reserved)" in ffprobe.
> > > Is "reserved" (0) the expected default when the transfer function isn't
> > > supported?
> > mac 10.13 support:
> > kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ
> > kCVImageBufferTransferFunction_ITU_R_2100_HLG
> >
> > OSX 10.14 support:
> > kCVImageBufferTransferFunction_Linear
> >
> > For 10.12, the HAVE_* macros should be detected as 0 if correct.
> >
> 
> 0 is a reserved value in the color specification and should be avoided if
> possible.
> Would it be possible to fallback on 2 (unknown) when these macros are not
> found?

My old mac pro don't support hevc, so I can test it. Please check the
HAVE* is 0

➜  ffmpeg.git git:(videotoolboxenc_v2) ✗ sw_vers -productVersion
10.11.6
➜  ffmpeg.git git:(videotoolboxenc_v2) ✗ grep "HAVE_KCV*" config.h
#define HAVE_KCMVIDEOCODECTYPE_HEVC 1
#define HAVE_KCVPIXELFORMATTYPE_420YPCBCR10BIPLANARVIDEORANGE 0
#define HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_SMPTE_ST_2084_PQ 0
#define HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_ITU_R_2100_HLG 0
#define HAVE_KCVIMAGEBUFFERTRANSFERFUNCTION_LINEAR 0

I have submited another patch to fix it, please try whether it's OK.

> -- 
> Vittorio
> ___
> 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/tak_parser: don't return error values

2019-07-17 Thread James Almer
The API does not allow it.

Also set poutbuf and poutbuf_size to NULL/0 on error to avoid leaving
them uninitialized.

Signed-off-by: James Almer 
---
 libavcodec/tak_parser.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/libavcodec/tak_parser.c b/libavcodec/tak_parser.c
index 835a47bd52..7943d2ed3a 100644
--- a/libavcodec/tak_parser.c
+++ b/libavcodec/tak_parser.c
@@ -49,7 +49,7 @@ static int tak_parse(AVCodecParserContext *s, AVCodecContext 
*avctx,
 if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
 TAKStreamInfo ti;
 if ((ret = init_get_bits8(, buf, buf_size)) < 0)
-return ret;
+goto fail;
 if (!ff_tak_decode_frame_header(avctx, , , 127))
 s->duration = t->ti.last_frame_samples ? t->ti.last_frame_samples
: t->ti.frame_samples;
@@ -65,7 +65,7 @@ static int tak_parse(AVCodecParserContext *s, AVCodecContext 
*avctx,
 const uint8_t *tmp_buf = buf;
 
 if (ff_combine_frame(pc, END_NOT_FOUND, _buf, _buf_size) 
!= -1)
-return AVERROR(ENOMEM);
+goto fail;
 consumed += tmp_buf_size;
 buf  += tmp_buf_size;
 buf_size -= tmp_buf_size;
@@ -78,7 +78,7 @@ static int tak_parse(AVCodecParserContext *s, AVCodecContext 
*avctx,
 
 if ((ret = init_get_bits8(, pc->buffer + t->index,
   pc->index - t->index)) < 0)
-return ret;
+goto fail;
 if (!ff_tak_decode_frame_header(avctx, ,
 pc->frame_start_found ?  : >ti, 127) &&
 !ff_tak_check_crc(pc->buffer + t->index,
@@ -103,9 +103,7 @@ found:
 
 if (consumed && !buf_size && next == END_NOT_FOUND ||
 ff_combine_frame(pc, next, , _size) < 0) {
-*poutbuf  = NULL;
-*poutbuf_size = 0;
-return buf_size + consumed;
+goto fail;
 }
 
 if (next != END_NOT_FOUND) {
@@ -116,6 +114,12 @@ found:
 *poutbuf  = buf;
 *poutbuf_size = buf_size;
 return next;
+
+fail:
+
+*poutbuf  = NULL;
+*poutbuf_size = 0;
+return buf_size + consumed;
 }
 
 AVCodecParser ff_tak_parser = {
-- 
2.22.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 1/5] avcodec/parser: Check next index validity in ff_combine_frame()

2019-07-17 Thread Michael Niedermayer
On Sat, Jul 06, 2019 at 12:57:45PM +0200, Michael Niedermayer wrote:
> Fixes: out of array access
> Fixes: 
> 15522/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DNXHD_fuzzer-5747756078989312
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/parser.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply patchset

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

Take away the freedom of one citizen and you will be jailed, take away
the freedom of all citizens and you will be congratulated by your peers
in Parliament.


signature.asc
Description: PGP signature
___
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: list the allocation requirements for intra_matrix and inter_matrix fields

2019-07-17 Thread James Almer
On 7/17/2019 4:47 PM, Paul B Mahol wrote:
> LGTM
> 
> On 7/15/19, James Almer  wrote:
>> Signed-off-by: James Almer 
>> ---
>> See
>> https://git.videolan.org/?p=vlc.git;a=commitdiff;h=d86c4c87aa78130a4fd00294e25df865d0e2b327
>>
>>  libavcodec/avcodec.h | 12 
>>  1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>> index 2528bd89ab..646b8f05fc 100644
>> --- a/libavcodec/avcodec.h
>> +++ b/libavcodec/avcodec.h
>> @@ -2057,15 +2057,19 @@ typedef struct AVCodecContext {
>>
>>  /**
>>   * custom intra quantization matrix
>> - * - encoding: Set by user, can be NULL.
>> - * - decoding: Set by libavcodec.
>> + * Must be allocated with the av_malloc() family of functions, and will
>> be freed in
>> + * avcodec_free_context().
>> + * - encoding: Set/allocated by user. Freed by libavcodec. Can be NULL.
>> + * - decoding: Set/allocated/freed by libavcodec.
>>   */
>>  uint16_t *intra_matrix;
>>
>>  /**
>>   * custom inter quantization matrix
>> - * - encoding: Set by user, can be NULL.
>> - * - decoding: Set by libavcodec.
>> + * Must be allocated with the av_malloc() family of functions, and will
>> be freed in
>> + * avcodec_free_context().
>> + * - encoding: Set/allocated by user. Freed by libavcodec. Can be NULL.
>> + * - decoding: Set/allocated/freed by libavcodec.
>>   */
>>  uint16_t *inter_matrix;

Pushed, thanks.
___
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/3] avcodec/ivi: Ask for samples with odd tiles

2019-07-17 Thread Michael Niedermayer
On Tue, Jul 02, 2019 at 09:59:04PM +0200, Michael Niedermayer wrote:
> Fixes: Assertion failure
> Fixes: 
> 15422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5676625481433088
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/ivi.c | 4 
>  1 file changed, 4 insertions(+)

will apply patchset

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

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus


signature.asc
Description: PGP signature
___
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 v1] Bug #8027 - Wrong result for FFSIGN(0)

2019-07-17 Thread Ulf Zibis

Am 17.07.19 um 19:21 schrieb Nicolas George:
> Ulf Zibis (12019-07-17):
>> Because anyone I ask including mathematicians, is the opinion that the
>> sign of 0 is positive.
> They were not very competent mathematicians.
In normal arithmetic, yes, sgn(0) is 0, but here we are in floating
point arithmetics where sgn(0) is 1, see:
https://en.wikipedia.org/wiki/Floating-point_arithmetic#Signed_zero

But FFSIGN(0) results as -1, which is never correct.

-Ulf

___
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 v6] Fix integer parameters size check in SDP fmtp line

2019-07-17 Thread Michael Niedermayer
On Fri, Jul 12, 2019 at 08:40:40AM +0200, Olivier Maignial wrote:
> === PROBLEM ===
> 
> I was trying to record h264 + aac streams from an RTSP server to mp4 file. 
> using this command line:
> ffmpeg -v verbose -y -i "rtsp:///my_resources" -codec copy -bsf:a 
> aac_adtstoasc test.mp4
> 
> FFmpeg then fail to record audio and output this logs:
> [rtsp @ 0xcda1f0] The profile-level-id field size is invalid (40)
> [rtsp @ 0xcda1f0] Error parsing AU headers
> ...
> [rtsp @ 0xcda1f0] Could not find codec parameters for stream 1 (Audio: 
> aac, 48000 Hz, 1 channels): unspecified sample format
> 
> In SDP provided by my RTSP server I had this fmtp line:
> a=fmtp:98 streamType=5; profile-level-id=40; mode=AAC-hbr; config=1188; 
> sizeLength=13; indexLength=3; indexDeltaLength=3;
> 
> In FFmpeg code, I found a check introduced by commit 
> 24130234cd9dd733116d17b724ea4c8e12ce097a. It disallows values greater than 32 
> for fmtp line parameters.
> However, In RFC-6416 (RTP Payload Format for MPEG-4 Audio/Visual Streams) 
> give examples of "profile-level-id" values for AAC, up to 55.
> Furthermore, RFC-4566 (SDP: Session Description Protocol) do not give any 
> limit of size on interger parameters given in fmtp line.
> 
> === FIX ===
> 
> Instead of prohibit values over 32, I propose to check the possible integer 
> overflow.
> The use of strtoll allow to check the string validity and the possible 
> overflow.
> Value is then checked against INT32_MIN and INT32_MAX. Using INT32_MIN/MAX 
> ensure to have the same behavior on 32 or 64 bits platforms.
> 
> This patch fix my problem and I now can record my RTSP AAC stream to mp4.
> It has passed the full fate tests suite sucessfully.
> 
> Signed-off-by: Olivier Maignial 
> ---
> 
> Changes V6 --> V7:
> - Use long long int and strtoll. LLONG_MAX is always greather than 
> INT32_MIN while LONG_MAX can be equal to INT32_MAX. It allows to accept full 
> INT32 range.
> - Avoid to use errno
> 
>  libavformat/rtpdec_mpeg4.c | 13 -
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/libavformat/rtpdec_mpeg4.c b/libavformat/rtpdec_mpeg4.c
> index 4f70599..f1cbedf 100644
> --- a/libavformat/rtpdec_mpeg4.c
> +++ b/libavformat/rtpdec_mpeg4.c
> @@ -289,15 +289,18 @@ static int parse_fmtp(AVFormatContext *s,
>  for (i = 0; attr_names[i].str; ++i) {
>  if (!av_strcasecmp(attr, attr_names[i].str)) {
>  if (attr_names[i].type == ATTR_NAME_TYPE_INT) {
> -int val = atoi(value);
> -if (val > 32) {
> +char *end_ptr = NULL;
> +long long int val = strtoll(value, _ptr, 10);
> +if (end_ptr == value || end_ptr[0] != '\0' ||
> +val < INT32_MIN || val > INT32_MAX) {
>  av_log(s, AV_LOG_ERROR,
> -   "The %s field size is invalid (%d)\n",
> -   attr, val);
> +   "The %s field value is not a valid number, or 
> overflows int32: %s\n",
> +   attr, value);
>  return AVERROR_INVALIDDATA;
>  }
> +
>  *(int *)((char *)data+
> -attr_names[i].offset) = val;
> +attr_names[i].offset) = (int) val;

Looking at this a bit deeper, this reads several specific values
for example sizelength which is then used to read with get_bits_long()
that is limited to 32bit. Maybe iam missing some check but if not
that is adding a bug.
I did not check what the valid range of the other cases is but
they may have similar problems

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

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


signature.asc
Description: PGP signature
___
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/2] fftools/ffmpeg_filter: add -autoscale to disable/enable the default scale

2019-07-17 Thread Michael Niedermayer
On Mon, Jul 15, 2019 at 06:38:35PM +0800, Linjie Fu wrote:
> Currently, ffmpeg inserts scale filter by default in the filter graph
> to force the whole decoded stream to scale into the same size with the
> first frame. It's not quite make sense in resolution changing cases if
> user wants the rawvideo without any scale.
> 
> Using autoscale/noautoscale to indicate whether auto inserting the scale
> filter in the filter graph:
> -noautoscale or -autoscale 0:
> disable the default auto scale filter inserting.
> 
> Signed-off-by: Linjie Fu 
> ---
>  fftools/ffmpeg.c| 1 +
>  fftools/ffmpeg.h| 4 
>  fftools/ffmpeg_filter.c | 2 +-
>  fftools/ffmpeg_opt.c| 5 +
>  4 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index 01f04103cf..5d52430b1e 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -2133,6 +2133,7 @@ static int ifilter_send_frame(InputFilter *ifilter, 
> AVFrame *frame)
>  
>  /* determine if the parameters for this input changed */
>  need_reinit = ifilter->format != frame->format;
> +fg->autoscale = ifilter->ist->autoscale;
>  
>  switch (ifilter->ist->st->codecpar->codec_type) {
>  case AVMEDIA_TYPE_AUDIO:
> diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
> index 7b6f802082..1602406581 100644
> --- a/fftools/ffmpeg.h
> +++ b/fftools/ffmpeg.h
> @@ -133,6 +133,8 @@ typedef struct OptionsContext {
>  intnb_hwaccel_output_formats;
>  SpecifierOpt *autorotate;
>  intnb_autorotate;
> +SpecifierOpt *autoscale;
> +intnb_autoscale;
>  
>  /* output options */
>  StreamMap *stream_maps;
> @@ -285,6 +287,7 @@ typedef struct FilterGraph {
>  
>  AVFilterGraph *graph;
>  int reconfiguration;
> +int autoscale;
>  
>  InputFilter   **inputs;
>  int  nb_inputs;
> @@ -335,6 +338,7 @@ typedef struct InputStream {
>  int guess_layout_max;
>  
>  int autorotate;
> +int autoscale;
>  
>  int fix_sub_duration;
>  struct { /* previous decoded subtitle and related variables */
> diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
> index 72838de1e2..2a2eb080eb 100644
> --- a/fftools/ffmpeg_filter.c
> +++ b/fftools/ffmpeg_filter.c
> @@ -469,7 +469,7 @@ static int configure_output_video_filter(FilterGraph *fg, 
> OutputFilter *ofilter,
>  if (ret < 0)
>  return ret;
>  
> -if (ofilter->width || ofilter->height) {
> +if ((ofilter->width || ofilter->height) && fg->autoscale) {
>  char args[255];
>  AVFilterContext *filter;
>  AVDictionaryEntry *e = NULL;
> diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
> index f5ca18aa64..47f90c22aa 100644
> --- a/fftools/ffmpeg_opt.c
> +++ b/fftools/ffmpeg_opt.c
> @@ -742,7 +742,9 @@ static void add_input_streams(OptionsContext *o, 
> AVFormatContext *ic)
>  MATCH_PER_STREAM_OPT(ts_scale, dbl, ist->ts_scale, ic, st);
>  
>  ist->autorotate = 1;
> +ist->autoscale  = 1;
>  MATCH_PER_STREAM_OPT(autorotate, i, ist->autorotate, ic, st);
> +MATCH_PER_STREAM_OPT(autoscale, i, ist->autoscale, ic, st);
>  
>  MATCH_PER_STREAM_OPT(codec_tags, str, codec_tag, ic, st);
>  if (codec_tag) 
{

> @@ -3640,6 +3642,9 @@ const OptionDef options[] = {
>  { "autorotate",   HAS_ARG | OPT_BOOL | OPT_SPEC |
>OPT_EXPERT | OPT_INPUT,
> { .off = OFFSET(autorotate) },
>  "automatically insert correct rotate filters" },
> +{ "autoscale",HAS_ARG | OPT_BOOL | OPT_SPEC |
> +  OPT_EXPERT | OPT_INPUT,
> { .off = OFFSET(autoscale) },
> +"automatically insert correct scale filters" },

I think this description is inadequate to understand what the option does.
Scale filters are inserted at various places (for example within a filter
graph). This option here affects a specific case.

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety -- Benjamin Franklin


signature.asc
Description: PGP signature
___
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] libavformat/subfile: Fix SEEK_CUR and SEEK_END seeking

2019-07-17 Thread Andreas Rheinhardt
Michael Niedermayer:
> On Mon, Jul 15, 2019 at 07:48:35PM +0200, Andreas Rheinhardt wrote:
>> Up until now, when performing a SEEK_END seek, the subfile protocol
>> ignored the desired position (relative to EOF) and used the current
>> absolute offset in the input file instead.
> 
> I think this comment is only intended to be in the previous patch
> 
> [...]
No, the new patch supersedes the previous patch and therefore the
commit message explains what is wrong with SEEK_END as well as with
SEEK_CUR. Or do you want the changes to be split in two commits?

- Andreas



___
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: list the allocation requirements for intra_matrix and inter_matrix fields

2019-07-17 Thread Paul B Mahol
LGTM

On 7/15/19, James Almer  wrote:
> Signed-off-by: James Almer 
> ---
> See
> https://git.videolan.org/?p=vlc.git;a=commitdiff;h=d86c4c87aa78130a4fd00294e25df865d0e2b327
>
>  libavcodec/avcodec.h | 12 
>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 2528bd89ab..646b8f05fc 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -2057,15 +2057,19 @@ typedef struct AVCodecContext {
>
>  /**
>   * custom intra quantization matrix
> - * - encoding: Set by user, can be NULL.
> - * - decoding: Set by libavcodec.
> + * Must be allocated with the av_malloc() family of functions, and will
> be freed in
> + * avcodec_free_context().
> + * - encoding: Set/allocated by user. Freed by libavcodec. Can be NULL.
> + * - decoding: Set/allocated/freed by libavcodec.
>   */
>  uint16_t *intra_matrix;
>
>  /**
>   * custom inter quantization matrix
> - * - encoding: Set by user, can be NULL.
> - * - decoding: Set by libavcodec.
> + * Must be allocated with the av_malloc() family of functions, and will
> be freed in
> + * avcodec_free_context().
> + * - encoding: Set/allocated by user. Freed by libavcodec. Can be NULL.
> + * - decoding: Set/allocated/freed by libavcodec.
>   */
>  uint16_t *inter_matrix;
>
> --
> 2.22.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".

Re: [FFmpeg-devel] [PATCH] libavformat/subfile: Fix SEEK_CUR and SEEK_END seeking

2019-07-17 Thread Michael Niedermayer
On Mon, Jul 15, 2019 at 07:48:35PM +0200, Andreas Rheinhardt wrote:
> Up until now, when performing a SEEK_END seek, the subfile protocol
> ignored the desired position (relative to EOF) and used the current
> absolute offset in the input file instead.

I think this comment is only intended to be in the previous patch

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

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu


signature.asc
Description: PGP signature
___
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 2/3] fate: change the scenecut fate threshold for one more scenecut scenes

2019-07-17 Thread Michael Niedermayer
On Tue, Jul 16, 2019 at 06:53:57AM +0800, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  tests/fate/filter-video.mak| 2 +-
>  tests/ref/fate/filter-metadata-scenedetect | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)

The commit message should also say "why" the change is done

Thanks

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

Never trust a computer, one day, it may think you are the virus. -- Compn


signature.asc
Description: PGP signature
___
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 2/2] doc/ffmpeg.texi: update docs for autoscale/autorotate

2019-07-17 Thread Nicolas George
Linjie Fu (12019-07-16):
> Add docs for autoscale.
> 
> Update information for autorotate according to ffplay.
> 
> Signed-off-by: Linjie Fu 
> ---
>  doc/ffmpeg.texi | 14 ++
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
> index cd35eb49c8..b91da2b2b4 100644
> --- a/doc/ffmpeg.texi
> +++ b/doc/ffmpeg.texi
> @@ -734,10 +734,6 @@ ffmpeg -dump_attachment:t "" -i INPUT
>  Technical note -- attachments are implemented as codec extradata, so this
>  option can actually be used to extract extradata from any stream, not just
>  attachments.
> -
> -@item -noautorotate
> -Disable automatically rotating video based on file metadata.
> -
>  @end table
>  
>  @section Video Options
> @@ -819,6 +815,16 @@ Create the filtergraph specified by @var{filtergraph} 
> and use it to
>  filter the stream.
>  
>  This is an alias for @code{-filter:v}, see the @ref{filter_option,,-filter 
> option}.
> +
> +@item -autorotate
> +Automatically rotate the video according to file metadata. Enabled by
> +default, use @option{-noautorotate} to disable it.
> +

> +@item -autoscale
> +Automatically scale the video according to the resolution of first frame.
> +Enabled by default, use @option{-noautoscale} to disable it. Each frame of
> +the output raw video can be in different resolutions and is in need to be
> +handled next.

Since this is completely hackish in lavfi, I think it needs to warn the
user much more strongly to expect problems.

>  @end table
>  
>  @section Advanced Video options

Regards,

-- 
  Nicolas George
___
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: list the allocation requirements for intra_matrix and inter_matrix fields

2019-07-17 Thread James Almer
On 7/15/2019 11:39 AM, James Almer wrote:
> Signed-off-by: James Almer 
> ---
> See 
> https://git.videolan.org/?p=vlc.git;a=commitdiff;h=d86c4c87aa78130a4fd00294e25df865d0e2b327
> 
>  libavcodec/avcodec.h | 12 
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 2528bd89ab..646b8f05fc 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -2057,15 +2057,19 @@ typedef struct AVCodecContext {
>  
>  /**
>   * custom intra quantization matrix
> - * - encoding: Set by user, can be NULL.
> - * - decoding: Set by libavcodec.
> + * Must be allocated with the av_malloc() family of functions, and will 
> be freed in
> + * avcodec_free_context().
> + * - encoding: Set/allocated by user. Freed by libavcodec. Can be NULL.
> + * - decoding: Set/allocated/freed by libavcodec.
>   */
>  uint16_t *intra_matrix;
>  
>  /**
>   * custom inter quantization matrix
> - * - encoding: Set by user, can be NULL.
> - * - decoding: Set by libavcodec.
> + * Must be allocated with the av_malloc() family of functions, and will 
> be freed in
> + * avcodec_free_context().
> + * - encoding: Set/allocated by user. Freed by libavcodec. Can be NULL.
> + * - decoding: Set/allocated/freed by libavcodec.
>   */
>  uint16_t *inter_matrix;

Ping.
___
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] FFmpeg classification

2019-07-17 Thread Paul B Mahol
On 7/17/19, Nicolas George  wrote:
> Tomas Härdin (12019-07-17):
>> > blocked-based, or not.
>> > multi-thread capable, or not.
>> > has assembler optimisations, or not.
>> > is direct render capable, or not
>> > standard derived or reverse engineered <- more of a numerical scale than
>> > categorical variable
>>
>> Game codec, or not
>> VQ based, or not
>> Palette based, or not
>> Intra-only, or not
>> Supported sample depths/pixel formats
>> Supported frame rates/sample rates
>
> Community-driven or industry-driven.

Maintained and not maintained.

>
> Regards,
>
> --
>   Nicolas George
> ___
> 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] FFmpeg classification

2019-07-17 Thread Nicolas George
Tomas Härdin (12019-07-17):
> > blocked-based, or not.
> > multi-thread capable, or not.
> > has assembler optimisations, or not.
> > is direct render capable, or not
> > standard derived or reverse engineered <- more of a numerical scale than 
> > categorical variable
> 
> Game codec, or not
> VQ based, or not
> Palette based, or not
> Intra-only, or not
> Supported sample depths/pixel formats
> Supported frame rates/sample rates

Community-driven or industry-driven.

Regards,

-- 
  Nicolas George
___
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 v1] Bug #8027 - Wrong result for FFSIGN(0)

2019-07-17 Thread Nicolas George
Ulf Zibis (12019-07-17):
> Because anyone I ask including mathematicians, is the opinion that the
> sign of 0 is positive.

They were not very competent mathematicians.

Regards,

-- 
  Nicolas George
___
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] matroskadec: Add sizes to forward declarations

2019-07-17 Thread Paul B Mahol
On 7/17/19, Andreas Rheinhardt  wrote:
> Unknown-length elements end when an element not allowed in them, but
> allowed at a higher level is encountered. In order to check for this,
> c1abd95a added a pointer to every syntax level's parent to each
> EbmlSyntax. Given that the parent must of course also reference the
> child in order to be able to enter said child level, one needs to use
> forward declarations.
> These forward declarations constitute tentative definitions and tentative
> definitions with internal linkage (like our syntaxes) must not be an
> incomplete type. Yet they were an incomplete type and while GCC and
> Clang did not even warn about this (on default warning levels), it
> broke compilation with MSVC. Therefore this commit adds the sizes.
>
> Signed-off-by: Andreas Rheinhardt 
> ---
> 1. I am terribly sorry for this. I did test with both GCC and Clang, but
> not with -pedantic, but only with default warning levels.
> 2. I don't have an MSVC setup here, so could please someone confirm that
> this patch indeed fixes the compilation? All I know is that GCC's
> -pedantic warnings are gone with this patch and that the requirement
> that tentative definitions with internal linkage must not be of
> incomplete type is fulfilled now.
>
>  libavformat/matroskadec.c | 16 ++--
>  1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> index b97189e674..fb0356e7b7 100644
> --- a/libavformat/matroskadec.c
> +++ b/libavformat/matroskadec.c
> @@ -389,12 +389,16 @@ typedef struct MatroskaDemuxContext {
>
>  #define CHILD_OF(parent) { .def = { .n = parent } }
>
> -static const EbmlSyntax ebml_syntax[], matroska_segment[],
> matroska_track_video_color[], matroska_track_video[],
> -matroska_track[], matroska_track_encoding[],
> matroska_track_encodings[],
> -matroska_track_combine_planes[],
> matroska_track_operation[], matroska_tracks[],
> -matroska_attachments[], matroska_chapter_entry[],
> matroska_chapter[], matroska_chapters[],
> -matroska_index_entry[], matroska_index[],
> matroska_tag[], matroska_tags[], matroska_seekhead[],
> -matroska_blockadditions[], matroska_blockgroup[],
> matroska_cluster_parsing[];
> +// The following forward declarations need their size because
> +// a tentative definition with internal linkage must not be an
> +// incomplete type (6.7.2 in C90, 6.9.2 in C99).
> +// Removing the sizes breaks MSVC.
> +static const EbmlSyntax ebml_syntax[3], matroska_segment[9],
> matroska_track_video_color[15], matroska_track_video[19],
> +matroska_track[27], matroska_track_encoding[6],
> matroska_track_encodings[2],
> +matroska_track_combine_planes[2],
> matroska_track_operation[2], matroska_tracks[2],
> +matroska_attachments[2], matroska_chapter_entry[9],
> matroska_chapter[6], matroska_chapters[2],
> +matroska_index_entry[3], matroska_index[2],
> matroska_tag[3], matroska_tags[2], matroska_seekhead[2],
> +matroska_blockadditions[2], matroska_blockgroup[8],
> matroska_cluster_parsing[8];
>
>  static const EbmlSyntax ebml_header[] = {
>  { EBML_ID_EBMLREADVERSION,EBML_UINT, 0, offsetof(Ebml, version),
>  { .u = EBML_VERSION } },
> --
> 2.21.0
>

Looks fine.

> ___
> 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/prores_ks reduce twice fdct calls

2019-07-17 Thread Paul B Mahol
Do we want to apply this?

On 1/4/19, Alex Mogurenko  wrote:
> ping
>
> On Mon, Dec 31, 2018 at 11:02 PM Alex Mogurenko  wrote:
>
>> thanks,
>> just sent new patch
>>
>> On Mon, Dec 31, 2018 at 5:56 PM Derek Buitenhuis <
>> derek.buitenh...@gmail.com> wrote:
>>
>>> On 31/12/2018 09:12, Alex Mogurenko wrote:
>>> > I seems to be lame as failed to find how to run fate to check prores_ks
>>> :(
>>>
>>> General way to run all of FATE:
>>>
>>> $ configure --samples=/home/path/for/samples/ --enable-gpl [...]
>>> $ make fate-rsync
>>> $ make fate
>>>
>>> There are sub-targets, too, as listed in Michaels mail, like
>>> fate-vsynth1.
>>>
>>> - Derek
>>> ___
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel@ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>
>>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
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] lavc/videotoolboxenc: add hdr10, linear, hlg color transfer function for videotoolboxenc

2019-07-17 Thread Vittorio Giovara
On Tue, Jul 16, 2019 at 10:29 PM Limin Wang  wrote:

> On Tue, Jul 16, 2019 at 09:36:32PM -0400, Rick Kern wrote:
> > Testing for the new transfer functions when compiling for OSX 10.12
> reports
> > the color settings as "yuv420p(tv, bt2020nc/bt2020/reserved)" in ffprobe.
> > Is "reserved" (0) the expected default when the transfer function isn't
> > supported?
> mac 10.13 support:
> kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ
> kCVImageBufferTransferFunction_ITU_R_2100_HLG
>
> OSX 10.14 support:
> kCVImageBufferTransferFunction_Linear
>
> For 10.12, the HAVE_* macros should be detected as 0 if correct.
>

0 is a reserved value in the color specification and should be avoided if
possible.
Would it be possible to fallback on 2 (unknown) when these macros are not
found?
-- 
Vittorio
___
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 2/2] doc/ffmpeg.texi: update docs for autoscale/autorotate

2019-07-17 Thread Eoff, Ullysses A
> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of 
> Linjie Fu
> Sent: Tuesday, July 16, 2019 4:20 AM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Fu, Linjie 
> Subject: [FFmpeg-devel] [PATCH, v2 2/2] doc/ffmpeg.texi: update docs for 
> autoscale/autorotate
> 
> Add docs for autoscale.
> 
> Update information for autorotate according to ffplay.
> 
> Signed-off-by: Linjie Fu 
> ---
>  doc/ffmpeg.texi | 14 ++
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
> index cd35eb49c8..b91da2b2b4 100644
> --- a/doc/ffmpeg.texi
> +++ b/doc/ffmpeg.texi
> @@ -734,10 +734,6 @@ ffmpeg -dump_attachment:t "" -i INPUT
>  Technical note -- attachments are implemented as codec extradata, so this
>  option can actually be used to extract extradata from any stream, not just
>  attachments.
> -
> -@item -noautorotate
> -Disable automatically rotating video based on file metadata.
> -
>  @end table
> 
>  @section Video Options
> @@ -819,6 +815,16 @@ Create the filtergraph specified by @var{filtergraph} 
> and use it to
>  filter the stream.
> 
>  This is an alias for @code{-filter:v}, see the @ref{filter_option,,-filter 
> option}.
> +
> +@item -autorotate
> +Automatically rotate the video according to file metadata. Enabled by
> +default, use @option{-noautorotate} to disable it.
> +
> +@item -autoscale
> +Automatically scale the video according to the resolution of first frame.
> +Enabled by default, use @option{-noautoscale} to disable it. Each frame of
> +the output raw video can be in different resolutions and is in need to be
> +handled next.

This last sentence has strange grammar.  Here's my shot at it:

"When autoscale is disabled, all output frames might not be in the
same resolution and may require some additional explicit processing
according to your final rendering/output destination."

>  @end table
> 
>  @section Advanced Video options
> --
> 2.17.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] avfilter/vf_convolution: add x86 SIMD for filter_3x3()

2019-07-17 Thread Paul B Mahol
On 7/15/19, Song, Ruiling  wrote:
>> -Original Message-
>> From: Song, Ruiling
>> Sent: Tuesday, July 9, 2019 9:15 AM
>> To: ffmpeg-devel@ffmpeg.org
>> Cc: Song, Ruiling 
>> Subject: [PATCH] avfilter/vf_convolution: add x86 SIMD for filter_3x3()
>>
>> Tested using a simple command (apply edge enhance):
>> ./ffmpeg_g -i ~/Downloads/bbb_sunflower_1080p_30fps_normal.mp4 \
>>  -vf convolution="0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0
>> 0:0 0 0 -1 1 0 0
>> 0 0:5:1:1:1:0:128:128:128" \
>>  -an -vframes 1000 -f null /dev/null
>>
>> The fps increase from 151 to 270 on my local machine.
>>
>> Signed-off-by: Ruiling Song 
> Ping?

Should be fine IFF output is exact with C version (under different parameters).
___
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/3] lavf/f_select: support scenecut with more pixel formats

2019-07-17 Thread Limin Wang
On Wed, Jul 17, 2019 at 12:58:04AM +0200, Marton Balint wrote:
> 
> 
> On Tue, 16 Jul 2019, lance.lmw...@gmail.com wrote:
> 
> >From: Limin Wang 
> >
> >This patch haven't make other pixel format usable yet to make sure the test
> >result is same with rgb format.
> >
> >Signed-off-by: Limin Wang 
> >---
> >libavfilter/f_select.c | 34 ++
> >1 file changed, 30 insertions(+), 4 deletions(-)
> >
> >diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
> >index 1132375..eed8df3 100644
> >--- a/libavfilter/f_select.c
> >+++ b/libavfilter/f_select.c
> >@@ -28,6 +28,8 @@
> >#include "libavutil/fifo.h"
> >#include "libavutil/internal.h"
> >#include "libavutil/opt.h"
> >+#include "libavutil/imgutils.h"
> >+#include "libavutil/pixdesc.h"
> >#include "avfilter.h"
> >#include "audio.h"
> >#include "formats.h"
> >@@ -144,6 +146,10 @@ typedef struct SelectContext {
> >char *expr_str;
> >AVExpr *expr;
> >double var_values[VAR_VARS_NB];
> >+int bitdepth;
> >+int nb_planes;
> >+ptrdiff_t width[4];
> >+ptrdiff_t height[4];
> >int do_scene_detect;///< 1 if the expression requires scene 
> > detection variables, 0 otherwise
> >ff_scene_sad_fn sad;///< Sum of the absolute difference 
> > function (scene detect only)
> >double prev_mafd;   ///< previous MAFD   
> > (scene detect only)
> >@@ -202,6 +208,17 @@ static av_cold int init(AVFilterContext *ctx)
> >static int config_input(AVFilterLink *inlink)
> >{
> >SelectContext *select = inlink->dst->priv;
> >+const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
> >+
> >+select->bitdepth = desc->comp[0].depth;
> >+select->nb_planes = av_pix_fmt_count_planes(inlink->format);
> >+for (int plane = 0; plane < select->nb_planes; plane++) {
> >+ptrdiff_t line_size = av_image_get_linesize(inlink->format, 
> >inlink->w, plane);
> >+int vsub = desc->log2_chroma_h;
> >+
> >+select->width[plane] = line_size >> (select->bitdepth > 8);
> >+select->height[plane] = plane == 1 || plane == 2 ?  
> >AV_CEIL_RSHIFT(inlink->h, vsub) : inlink->h;
> >+}
> >
> >select->var_values[VAR_N]  = 0.0;
> >select->var_values[VAR_SELECTED_N] = 0.0;
> >@@ -242,7 +259,7 @@ static int config_input(AVFilterLink *inlink)
> >inlink->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN;
> >
> >if (CONFIG_SELECT_FILTER && select->do_scene_detect) {
> >-select->sad = ff_scene_sad_get_fn(8);
> >+select->sad = ff_scene_sad_get_fn(select->bitdepth == 8 ? 8 : 16);
> >if (!select->sad)
> >return AVERROR(EINVAL);
> >}
> >@@ -258,12 +275,21 @@ static double get_scene_score(AVFilterContext *ctx, 
> >AVFrame *frame)
> >if (prev_picref &&
> >frame->height == prev_picref->height &&
> >frame->width  == prev_picref->width) {
> >-uint64_t sad;
> >+uint64_t sad = 0;
> >double mafd, diff;
> >+int count = 0;
> >+
> >+for (int plane = 0; plane < select->nb_planes; plane++) {
> >+uint64_t plane_sad;
> >+select->sad(prev_picref->data[plane], 
> >prev_picref->linesize[plane],
> >+frame->data[plane], frame->linesize[plane],
> >+select->width[plane], select->height[plane], 
> >_sad);
> >+sad += plane_sad;
> >+count += select->width[plane] * select->height[plane];
> >+}
> >
> >-select->sad(prev_picref->data[0], prev_picref->linesize[0], 
> >frame->data[0], frame->linesize[0], frame->width * 3, frame->height, );
> >emms_c();
> >-mafd = (double)sad / (frame->width * 3 * frame->height);
> >+mafd = (double)sad / count;
> 
> mafd was in [0..255] before you added >8 bitdepth support. For >8
> bit you have to normalize it to this range becuase the metric should
> be bitdepth invariant.

I have redo the testing for the 10bit sample, it's downloaded from here:
http://samples.ffmpeg.org/4khdr/Passengers_Breakfast_4K.mkv

1. tested with the master without any change, have detected 5 scenecut

$./ffmpeg -y -i ~/Movies/Passengers_Breakfast_4K.mkv   -vf 
select='gt(scene\,0.25),showinfo,scale=320x240,tile'  -frames 1 mosaic.png 
[Parsed_showinfo_1 @ 0x7ff92ce91dc0] n:   0 pts:   3587 pts_time:3.587 pos: 
20598502 fmt:rgb24 sar:1/1 s:3840x2160 i:P iskey:1 type:I checksum:08D7000B 
plane_checksum:[08D7000B] mean:[65] stdev:[53.5]
[Parsed_showinfo_1 @ 0x7ff92ce91dc0] n:   1 pts:  16225 pts_time:16.225 pos: 
90031475 fmt:rgb24 sar:1/1 s:3840x2160 i:P iskey:1 type:I checksum:9BEE9923 
plane_checksum:[9BEE9923] mean:[81] stdev:[53.7]
[Parsed_showinfo_1 @ 0x7ff92ce91dc0] n:   2 pts:  19645 pts_time:19.645 
pos:106768564 fmt:rgb24 sar:1/1 s:3840x2160 i:P iskey:1 type:I 
checksum:A2B439F8 plane_checksum:[A2B439F8] mean:[69] stdev:[52.9]
[Parsed_showinfo_1 @ 0x7ff92ce91dc0] n:   3 pts:  22314 pts_time:22.314 

Re: [FFmpeg-devel] FFmpeg classification

2019-07-17 Thread Tomas Härdin
ons 2019-07-17 klockan 18:04 +1000 skrev Peter Ross:
> On Wed, Jul 17, 2019 at 10:10:13AM +0900, Maaya Murakami (JP) wrote:
> > Hello
> > 
> > Hope all is well.
> > Currently I am researching about the trends of FFmpeg and its supporting
> > codecs, and in order to do so I am trying to classify FFmpeg codecs into
> > different types. Are there meaningful categories to classify these codes
> > other than video/audio or lossy/lossless?
> 
> Yes, there are other ways to classify them.
> 
> blocked-based, or not.
> multi-thread capable, or not.
> has assembler optimisations, or not.
> is direct render capable, or not
> standard derived or reverse engineered <- more of a numerical scale than 
> categorical variable

Game codec, or not
VQ based, or not
Palette based, or not
Intra-only, or not
Supported sample depths/pixel formats
Supported frame rates/sample rates

/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] avformat/mpegenc - reject unsupported audio streams

2019-07-17 Thread Carl Eugen Hoyos



> Am 08.07.2019 um 14:05 schrieb Gyan :
> 
> 
> 
>> On 25-04-2019 01:48 PM, Gyan wrote:
>> 
>> 
>>> On 25-04-2019 01:23 PM, Ali KIZIL wrote:
>>> 
>>> There are also Dolby Codecs (ac3 & eac3). Will it also throw error for
>>> these codecs ?
>> 
>> AC3   is  supported before and after this patch.
>> EAC3 is unsupported before and after this patch.
>> 
>> But it's sent to the same decoder, so support could be added. I'll check.
> 
> Attached patch allows muxing EAC3 in MPEG-PS.  Stock ffmpeg can demux and 
> decode such streams fine.

Which descriptor is used for eac3?
Please do not commit just because decoding works with FFmpeg, at least try to 
find some specification.

Carl Eugen
___
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/1] libavcodec/h264: Handle ENOMEM error when decoding slice nal unit.

2019-07-17 Thread Asaf Kave
Populate the real error when alloc_picture failed, during decoding h264 slice.
When this error occurred, need to break the decoding process of the rest nal's, 
and need to rise this error back to the user, to indicate that there is decoder 
memory issue.
---
 libavcodec/h264_slice.c | 5 +++--
 libavcodec/h264dec.c| 4 
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 5ceee107a0..76353fe85b 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1644,9 +1644,10 @@ static int h264_field_start(H264Context *h, const 
H264SliceContext *sl,
 }
 
 if (!FIELD_PICTURE(h) || h->first_field) {
-if (h264_frame_start(h) < 0) {
+ret = h264_frame_start(h);
+if (ret < 0) {
 h->first_field = 0;
-return AVERROR_INVALIDDATA;
+return ret;
 }
 } else {
 int field = h->picture_structure == PICT_BOTTOM_FIELD;
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 8d1bd16a8e..0a4d4b8c62 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -754,6 +754,10 @@ static int decode_nal_units(H264Context *h, const uint8_t 
*buf, int buf_size)
 
 if (err < 0) {
 av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\n");
+if (err == AVERROR(ENOMEM)) {
+   ret = err;
+   goto end;
+}
 }
 }
 
-- 
2.17.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 v1] Bug #8027 - Wrong result for FFSIGN(0)

2019-07-17 Thread Hendrik Leppkes
On Wed, Jul 17, 2019 at 9:55 AM Ulf Zibis  wrote:
>
>
> Am 17.07.19 um 08:57 schrieb Song, Ruiling:
> > Why do you think FFSIGN(0.0) should return +1?
> Because anyone I ask including mathematicians, is the opinion that the
> sign of 0 is positive.

It really doesn't matter what anyone else thinks, the macro was
defined the way it  is, and changing it now has a chance of breaking
random places that rely on the current behavior.

>
> > What issue do you meet?
>
> I wanted to use the macro in my code, but with the current behaviour it
> is worthless.
>

Any macro starting with FF is technically internal to FFmpeg and
should not be relied upon by external software.
Furthermore, this macro is so extremely simple, you can just make your
own with no overhead or issues, if this one does not suit your needs.

- Hendrik
___
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 v1] Bug #8027 - Wrong result for FFSIGN(0)

2019-07-17 Thread Paul B Mahol
On 7/17/19, Ulf Zibis  wrote:
>
> Am 17.07.19 um 08:57 schrieb Song, Ruiling:
>> Why do you think FFSIGN(0.0) should return +1?
> Because anyone I ask including mathematicians, is the opinion that the
> sign of 0 is positive.
>
>> What issue do you meet?
>
> I wanted to use the macro in my code, but with the current behaviour it
> is worthless.

Use copysign(f), see relevant manual page for documentation of this function.
Also, you always can add own macro, in local to your developed filter.

>
> -Ulf
>
> ___
> 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] FFmpeg classification

2019-07-17 Thread Peter Ross
On Wed, Jul 17, 2019 at 10:10:13AM +0900, Maaya Murakami (JP) wrote:
> Hello
> 
> Hope all is well.
> Currently I am researching about the trends of FFmpeg and its supporting
> codecs, and in order to do so I am trying to classify FFmpeg codecs into
> different types. Are there meaningful categories to classify these codes
> other than video/audio or lossy/lossless?

Yes, there are other ways to classify them.

blocked-based, or not.
multi-thread capable, or not.
has assembler optimisations, or not.
is direct render capable, or not
standard derived or reverse engineered <- more of a numerical scale than 
categorical variable

Whether these classifications are meaningful is entirely up to you.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


signature.asc
Description: PGP signature
___
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 v1] Bug #8027 - Wrong result for FFSIGN(0)

2019-07-17 Thread Ulf Zibis

Am 17.07.19 um 08:57 schrieb Song, Ruiling:
> Why do you think FFSIGN(0.0) should return +1?
Because anyone I ask including mathematicians, is the opinion that the
sign of 0 is positive.

> What issue do you meet?

I wanted to use the macro in my code, but with the current behaviour it
is worthless.

-Ulf

___
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 v1] Bug #8027 - Wrong result for FFSIGN(0)

2019-07-17 Thread Song, Ruiling
> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Ulf Zibis
> Sent: Wednesday, July 17, 2019 2:34 PM
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v1] Bug #8027 - Wrong result for
> FFSIGN(0)
> 
> Again with the patch attached ...
> 
> Am 17.07.19 um 08:30 schrieb Ulf Zibis:
> > Hi,
> >
> > I have a patch for bug #8027  (see
> > attachment).
Why do you think FFSIGN(0.0) should return +1? What issue do you meet?
I think the value of FFSIGN(0) depends on how we define the behavior of 
FFSIGN().

Thanks!
Ruiling
> >
> > But there is still a problem with -0.0, but FFABS(-0.0) works fine.
> >
> > Testcode:
> >    av_log(NULL, AV_LOG_ERROR, "FFSIGN(0): %d\n", FFSIGN(0));
> >     av_log(NULL, AV_LOG_ERROR, "FFSIGN(-0): %d\n", FFSIGN(-0));
> >     av_log(NULL, AV_LOG_ERROR, "FFSIGN(0.0D): %d\n", FFSIGN(0.0D));
> >     av_log(NULL, AV_LOG_ERROR, "FFSIGN(-0.0D): %d\n", FFSIGN(-0.0D));
> >     av_log(NULL, AV_LOG_ERROR, "FFSIGN(-0.0F): %d\n", FFSIGN(-0.0F));
> >     av_log(NULL, AV_LOG_ERROR, "FFSIGN(-0.0): %d\n", FFSIGN(-0.0));
> >
> >     av_log(NULL, AV_LOG_ERROR, "FFABS(0): %d\n", FFABS(0));
> >     av_log(NULL, AV_LOG_ERROR, "FFABS(-0): %d\n", FFABS(-0));
> >     av_log(NULL, AV_LOG_ERROR, "FFABS(0.0D): %f\n", FFABS(0.0D));
> >     av_log(NULL, AV_LOG_ERROR, "FFABS(-0.0D): %f\n", FFABS(-0.0D));
> >     av_log(NULL, AV_LOG_ERROR, "FFABS(-0.0F): %f\n", FFABS(-0.0F));
> >     av_log(NULL, AV_LOG_ERROR, "FFABS(-0.0): %f\n", FFABS(-0.0));
> >
> > Results:
> > FFSIGN(0): 1
> > FFSIGN(-0): 1
> > FFSIGN(0.0D): 1
> > FFSIGN(-0.0D): 1
> > FFSIGN(-0.0F): 1
> > FFSIGN(-0.0): 1
> > FFABS(0): 0
> > FFABS(-0): 0
> > FFABS(0.0D): 0.00
> > FFABS(-0.0D): -0.00
> > FFABS(-0.0F): -0.00
> > FFABS(-0.0): -0.00
> >
> > -Ulf
> >
> > ___
> > 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 v1] Bug #8027 - Wrong result for FFSIGN(0)

2019-07-17 Thread Ulf Zibis
Again with the patch attached ...

Am 17.07.19 um 08:30 schrieb Ulf Zibis:
> Hi,
>
> I have a patch for bug #8027  (see
> attachment).
>
> But there is still a problem with -0.0, but FFABS(-0.0) works fine.
>
> Testcode:
>    av_log(NULL, AV_LOG_ERROR, "FFSIGN(0): %d\n", FFSIGN(0));
>     av_log(NULL, AV_LOG_ERROR, "FFSIGN(-0): %d\n", FFSIGN(-0));
>     av_log(NULL, AV_LOG_ERROR, "FFSIGN(0.0D): %d\n", FFSIGN(0.0D));
>     av_log(NULL, AV_LOG_ERROR, "FFSIGN(-0.0D): %d\n", FFSIGN(-0.0D));
>     av_log(NULL, AV_LOG_ERROR, "FFSIGN(-0.0F): %d\n", FFSIGN(-0.0F));
>     av_log(NULL, AV_LOG_ERROR, "FFSIGN(-0.0): %d\n", FFSIGN(-0.0));
>
>     av_log(NULL, AV_LOG_ERROR, "FFABS(0): %d\n", FFABS(0));
>     av_log(NULL, AV_LOG_ERROR, "FFABS(-0): %d\n", FFABS(-0));
>     av_log(NULL, AV_LOG_ERROR, "FFABS(0.0D): %f\n", FFABS(0.0D));
>     av_log(NULL, AV_LOG_ERROR, "FFABS(-0.0D): %f\n", FFABS(-0.0D));
>     av_log(NULL, AV_LOG_ERROR, "FFABS(-0.0F): %f\n", FFABS(-0.0F));
>     av_log(NULL, AV_LOG_ERROR, "FFABS(-0.0): %f\n", FFABS(-0.0));
>
> Results:
> FFSIGN(0): 1
> FFSIGN(-0): 1
> FFSIGN(0.0D): 1
> FFSIGN(-0.0D): 1
> FFSIGN(-0.0F): 1
> FFSIGN(-0.0): 1
> FFABS(0): 0
> FFABS(-0): 0
> FFABS(0.0D): 0.00
> FFABS(-0.0D): -0.00
> FFABS(-0.0F): -0.00
> FFABS(-0.0): -0.00
>
> -Ulf
>
> ___
> 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".
>From aa27ca089dafb3bc2f2c5aaa171856b235989ea4 Mon Sep 17 00:00:00 2001
From: Ulf Zibis 
Date: 16.07.2019, 23:36:51

avutil/common.h: Correct result for FFSIGN(0.0)

diff --git a/libavutil/common.h b/libavutil/common.h
index 8db0291..4b14e7b 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -70,7 +70,7 @@
  * @see FFNABS()
  */
 #define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
-#define FFSIGN(a) ((a) > 0 ? 1 : -1)
+#define FFSIGN(a) ((a) >= 0 ? 1 : -1)
 
 /**
  * Negative Absolute value.
___
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 v1] Bug #8027 - Wrong result for FFSIGN(0)

2019-07-17 Thread Ulf Zibis
Hi,

I have a patch for bug #8027  (see
attachment).

But there is still a problem with -0.0, but FFABS(-0.0) works fine.

Testcode:
   av_log(NULL, AV_LOG_ERROR, "FFSIGN(0): %d\n", FFSIGN(0));
    av_log(NULL, AV_LOG_ERROR, "FFSIGN(-0): %d\n", FFSIGN(-0));
    av_log(NULL, AV_LOG_ERROR, "FFSIGN(0.0D): %d\n", FFSIGN(0.0D));
    av_log(NULL, AV_LOG_ERROR, "FFSIGN(-0.0D): %d\n", FFSIGN(-0.0D));
    av_log(NULL, AV_LOG_ERROR, "FFSIGN(-0.0F): %d\n", FFSIGN(-0.0F));
    av_log(NULL, AV_LOG_ERROR, "FFSIGN(-0.0): %d\n", FFSIGN(-0.0));

    av_log(NULL, AV_LOG_ERROR, "FFABS(0): %d\n", FFABS(0));
    av_log(NULL, AV_LOG_ERROR, "FFABS(-0): %d\n", FFABS(-0));
    av_log(NULL, AV_LOG_ERROR, "FFABS(0.0D): %f\n", FFABS(0.0D));
    av_log(NULL, AV_LOG_ERROR, "FFABS(-0.0D): %f\n", FFABS(-0.0D));
    av_log(NULL, AV_LOG_ERROR, "FFABS(-0.0F): %f\n", FFABS(-0.0F));
    av_log(NULL, AV_LOG_ERROR, "FFABS(-0.0): %f\n", FFABS(-0.0));

Results:
FFSIGN(0): 1
FFSIGN(-0): 1
FFSIGN(0.0D): 1
FFSIGN(-0.0D): 1
FFSIGN(-0.0F): 1
FFSIGN(-0.0): 1
FFABS(0): 0
FFABS(-0): 0
FFABS(0.0D): 0.00
FFABS(-0.0D): -0.00
FFABS(-0.0F): -0.00
FFABS(-0.0): -0.00

-Ulf

___
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".