Re: [FFmpeg-devel] [PATCH] libopenjpegenc: fix out-of-bounds reads when filling the edges

2016-10-13 Thread Michael Bradshaw
On Thu, Oct 13, 2016 at 6:49 PM, Michael Niedermayer  wrote:
>
> >  libopenjpegenc.c |   18 +-
> >  1 file changed, 9 insertions(+), 9 deletions(-)
> > 17061aee3e88729993c9581f688cbfda01fccaac  0001-libopenjpegenc-fix-out-
> of-bounds-reads-when-filling-.patch
> > From 1461064c1eaabb71661f9ff68b94f35a1b98e3b5 Mon Sep 17 00:00:00 2001
> > From: Andreas Cadhalpun 
> > Date: Thu, 13 Oct 2016 22:14:46 +0200
> > Subject: [PATCH] libopenjpegenc: fix out-of-bounds reads when filling the
> >  edges
> >
> > The calculation of width/height should round up, not round down to
> > prevent setting width or height to 0.
> >
> > Also image->comps[compno].w is unsigned (at least in openjpeg2), so the
> > calculation could silently wrap around without the explicit cast to int.
>
> LGTM, iam not libopenjpegenc maintainer though


Looks good to me too. Please feel free to apply it. Thanks!
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libopenjpegenc: recreate image data buffer after encoding frame

2016-10-13 Thread Michael Bradshaw
On Thu, Oct 13, 2016 at 12:21 PM, Andreas Cadhalpun <
andreas.cadhal...@googlemail.com> wrote:
>
> OK. Attached patch does that for openjpeg 2.
> I didn't change the behavior for openjpeg 1, as reusing the image works
> there.


Looks good to me. Thanks! Please feel free to apply it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libopenjpegenc: fix out-of-bounds reads when filling the edges

2016-10-13 Thread Michael Niedermayer
On Fri, Oct 14, 2016 at 02:00:49AM +0200, Andreas Cadhalpun wrote:
> On 14.10.2016 00:49, Michael Niedermayer wrote:
> > On Fri, Oct 14, 2016 at 12:23:02AM +0200, Andreas Cadhalpun wrote:
> >> The avctx->width/avctx->height is not zero, but libopenjpeg_copy_unpacked8
> >> does:
> > 
> >> width  = avctx->width / image->comps[compno].dx;
> >> height = avctx->height / image->comps[compno].dy;
> > 
> > this looks wrong to me
> > the code in mj2_create_image() looks better:
> > cmptparm[i].dx = sub_dx[i];
> > cmptparm[i].dy = sub_dy[i];
> > cmptparm[i].w = (avctx->width + sub_dx[i] - 1) / sub_dx[i];
> > cmptparm[i].h = (avctx->height + sub_dy[i] - 1) / sub_dy[i];
> 
> Indeed this looks better, so I updated the patch (attached) to change the
> calculation of width/height.
> 
> Best regards,
> Andreas

>  libopenjpegenc.c |   18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 17061aee3e88729993c9581f688cbfda01fccaac  
> 0001-libopenjpegenc-fix-out-of-bounds-reads-when-filling-.patch
> From 1461064c1eaabb71661f9ff68b94f35a1b98e3b5 Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun 
> Date: Thu, 13 Oct 2016 22:14:46 +0200
> Subject: [PATCH] libopenjpegenc: fix out-of-bounds reads when filling the
>  edges
> 
> The calculation of width/height should round up, not round down to
> prevent setting width or height to 0.
> 
> Also image->comps[compno].w is unsigned (at least in openjpeg2), so the
> calculation could silently wrap around without the explicit cast to int.

LGTM, iam not libopenjpegenc maintainer though

also should be backported

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.


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


Re: [FFmpeg-devel] [PATCH] avfilter/showcqt: add csp option

2016-10-13 Thread Michael Niedermayer
On Fri, Oct 14, 2016 at 08:05:15AM +0700, Muhammad Faiz wrote:
> On Fri, Oct 14, 2016 at 3:20 AM, Michael Niedermayer
>  wrote:
> > On Fri, Oct 14, 2016 at 02:50:52AM +0700, Muhammad Faiz wrote:
> >> On Thu, Oct 13, 2016 at 10:38 PM, Michael Niedermayer
> >>  wrote:
> >> > On Thu, Oct 13, 2016 at 06:05:19AM +0700, Muhammad Faiz wrote:
> >> >> from colorspace filter
> >> >>
> >> >> Signed-off-by: Muhammad Faiz 
> >> >> ---
> >> >>  doc/filters.texi  | 26 ++
> >> >>  libavfilter/avf_showcqt.c | 56 
> >> >> ++-
> >> >>  libavfilter/avf_showcqt.h |  2 ++
> >> >>  3 files changed, 79 insertions(+), 5 deletions(-)
> >> >>
> >> >> diff --git a/doc/filters.texi b/doc/filters.texi
> >> >> index 76265e7..a79972b 100644
> >> >> --- a/doc/filters.texi
> >> >> +++ b/doc/filters.texi
> >> >> @@ -16884,6 +16884,32 @@ Enable/disable drawing text to the axis. If it 
> >> >> is set to @code{0}, drawing to
> >> >>  the axis is disabled, ignoring @var{fontfile} and @var{axisfile} 
> >> >> option.
> >> >>  Default value is @code{1}.
> >> >>
> >> >> +@item csp
> >> >> +Set colorspace. The accepted values are:
> >> >> +@table @samp
> >> >> +@item unspecified
> >> >> +Unspecified (default)
> >> >> +
> >> >> +@item bt709
> >> >> +BT.709
> >> >> +
> >> >> +@item fcc
> >> >> +FCC
> >> >> +
> >> >> +@item bt470bg
> >> >> +BT.470BG or BT.601-6 625
> >> >> +
> >> >> +@item smpte170m
> >> >> +SMPTE-170M or BT.601-6 525
> >> >> +
> >> >> +@item smpte240m
> >> >> +SMPTE-240M
> >> >> +
> >> >> +@item bt2020ncl
> >> >> +BT.2020 with non-constant luminance
> >> >> +
> >> >> +@end table
> >> >> +
> >> >>  @end table
> >> >>
> >> >>  @subsection Examples
> >> >> diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c
> >> >> index 16bb2be..7c76b1f 100644
> >> >> --- a/libavfilter/avf_showcqt.c
> >> >> +++ b/libavfilter/avf_showcqt.c
> >> >> @@ -83,6 +83,14 @@ static const AVOption showcqt_options[] = {
> >> >>  { "axisfile", "set axis image", OFFSET(axisfile),  
> >> >> AV_OPT_TYPE_STRING, { .str = NULL },  CHAR_MIN, CHAR_MAX, FLAGS },
> >> >>  { "axis",  "draw axis", OFFSET(axis),
> >> >> AV_OPT_TYPE_BOOL, { .i64 = 1 },0, 1,FLAGS },
> >> >>  { "text",  "draw axis", OFFSET(axis),
> >> >> AV_OPT_TYPE_BOOL, { .i64 = 1 },0, 1,FLAGS },
> >> >> +{ "csp", "set color space", OFFSET(csp),  
> >> >> AV_OPT_TYPE_INT, { .i64 = AVCOL_SPC_UNSPECIFIED }, 0, INT_MAX, FLAGS, 
> >> >> "csp" },
> >> >> +{ "unspecified", "unspecified", 0,  
> >> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_UNSPECIFIED }, 0, 0, FLAGS, "csp" 
> >> >> },
> >> >> +{ "bt709", "bt709", 0,  
> >> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_BT709 },   0, 0, FLAGS, "csp" 
> >> >> },
> >> >> +{ "fcc", "fcc", 0,  
> >> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_FCC }, 0, 0, FLAGS, "csp" 
> >> >> },
> >> >> +{ "bt470bg", "bt470bg", 0,  
> >> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_BT470BG }, 0, 0, FLAGS, "csp" 
> >> >> },
> >> >> +{ "smpte170m", "smpte170m", 0,  
> >> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_SMPTE170M },   0, 0, FLAGS, "csp" 
> >> >> },
> >> >> +{ "smpte240m", "smpte240m", 0,  
> >> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_SMPTE240M },   0, 0, FLAGS, "csp" 
> >> >> },
> >> >> +{ "bt2020ncl", "bt2020ncl", 0,  
> >> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_BT2020_NCL },  0, 0, FLAGS, "csp" 
> >> >> },
> >> >>  { NULL }
> >> >>  };
> >> >>
> >> >> @@ -656,7 +664,7 @@ static void rgb_from_cqt(ColorFloat *c, const 
> >> >> FFTComplex *v, float g, int len)
> >> >>  }
> >> >>  }
> >> >>
> >> >> -static void yuv_from_cqt(ColorFloat *c, const FFTComplex *v, float 
> >> >> gamma, int len)
> >> >> +static void yuv_from_cqt(ColorFloat *c, const FFTComplex *v, float 
> >> >> gamma, int len, float cm[3][3])
> >> >>  {
> >> >>  int x;
> >> >>  for (x = 0; x < len; x++) {
> >> >> @@ -664,9 +672,9 @@ static void yuv_from_cqt(ColorFloat *c, const 
> >> >> FFTComplex *v, float gamma, int le
> >> >>  r = calculate_gamma(FFMIN(1.0f, v[x].re), gamma);
> >> >>  g = calculate_gamma(FFMIN(1.0f, 0.5f * (v[x].re + v[x].im)), 
> >> >> gamma);
> >> >>  b = calculate_gamma(FFMIN(1.0f, v[x].im), gamma);
> >> >> -c[x].yuv.y = 65.481f * r + 128.553f * g + 24.966f * b;
> >> >> -c[x].yuv.u = -37.797f * r - 74.203f * g + 112.0f * b;
> >> >> -c[x].yuv.v = 112.0f * r - 93.786f * g - 18.214 * b;
> >> >> +c[x].yuv.y = cm[0][0] * r + cm[0][1] * g + cm[0][2] * b;
> >> >> +c[x].yuv.u = cm[1][0] * r + cm[1][1] * g + cm[1][2] * b;
> >> >> +

Re: [FFmpeg-devel] [PATCH] avfilter/af_silenceremove: add optional tone when silence is removed

2016-10-13 Thread Michael Niedermayer
On Thu, Oct 13, 2016 at 08:48:11PM +, Greg Rowe wrote:
> The attached patch adds two optional parameters to af_silenceremove for the 
> purpose of inserting a tone in place of where silence was removed.  This 
> alerts the user that silence has been trimmed from the original stream.  The 
> parameters are tone_duration which defaults to 0.0 which disables the feature 
> and tone_hz which allows you to specify the frequency of the tone.
> 
> 
> Thanks,
> 
> Greg
> 
> 
> --
> 
> Greg Rowe
> 
> www.shoretel.com

> From 41405e90cb2fb41441a6cf29c7a0d14362fd1b1f Mon Sep 17 00:00:00 2001
> From: Greg Rowe 
> Date: Fri, 7 Oct 2016 13:39:58 -0400
> Subject: [PATCH] avfilter/af_silenceremove: add optional tone when silence is
>  removed
> 
> This commit adds two options to the af_silenceremove filter.  It adds
> tone_duration and tone_hz making it possible to insert a tone when
> silence is removed.  Tone insertion is disabled by default (by using a
> tone_duration of 0.0 seconds).
> 
> Signed-off-by: Greg Rowe 
> ---
>  Changelog  |   1 +
>  doc/filters.texi   |  11 ++-
>  libavfilter/af_silenceremove.c | 161 
> +++--
>  libavfilter/version.h  |   2 +-
>  4 files changed, 151 insertions(+), 24 deletions(-)
> 
> diff --git a/Changelog b/Changelog
> index 0da009c..86e031c 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -2,6 +2,7 @@ Entries are sorted chronologically from oldest to youngest 
> within each release,
>  releases are sorted from youngest to oldest.
>  
>  version :
> +- Added optional tone insertion in af_silenceremove
>  - libopenmpt demuxer
>  - tee protocol
>  - Changed metadata print option to accept general urls
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 4b2f7bf..e09a303 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -3340,7 +3340,8 @@ ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f 
> null -
>  
>  @section silenceremove
>  
> -Remove silence from the beginning, middle or end of the audio.
> +Remove silence from the beginning, middle or end of the audio while
> +optionally inserting a tone where silence was removed.
>  
>  The filter accepts the following options:
>  
> @@ -3401,6 +3402,14 @@ Default value is @code{rms}.
>  @item window
>  Set ratio used to calculate size of window for detecting silence.
>  Default value is @code{0.02}. Allowed range is from @code{0} to @code{10}.
> +
> +@item tone_duration
> +Set the duration of the tone inserted in the stream when silence is removed. 
>  A value of @code{0} disables tone insertion.
> +Default value is @code{0.0}.
> +
> +@item tone_hz
> +Set the frequency of the tone inserted in the stream when silence is removed.
> +Default value is @code{1000.0}.
>  @end table
>  
>  @subsection Examples
> diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c
> index f156d18..07cf428 100644
> --- a/libavfilter/af_silenceremove.c
> +++ b/libavfilter/af_silenceremove.c
> @@ -3,6 +3,7 @@
>   * Copyright (c) 2001 Chris Bagwell
>   * Copyright (c) 2003 Donnie Smith
>   * Copyright (c) 2014 Paul B Mahol
> + * Copyright (c) 2016 Shoretel 
>   *
>   * This file is part of FFmpeg.
>   *

> @@ -31,11 +32,20 @@
>  #include "internal.h"
>  
>  enum SilenceMode {
> -SILENCE_TRIM,
> +SILENCE_TRIM = 0,

unrelated change and thus should not be in this patch


>  SILENCE_TRIM_FLUSH,
>  SILENCE_COPY,
>  SILENCE_COPY_FLUSH,
> -SILENCE_STOP
> +SILENCE_STOP,
> +SILENCE_END_MARKER
> +};
> +
> +static const char* SILENCE_MODE_NAMES[] = {
> +NULL_IF_CONFIG_SMALL("TRIM"),
> +NULL_IF_CONFIG_SMALL("TRIM_FLUSH"),
> +NULL_IF_CONFIG_SMALL("COPY"),
> +NULL_IF_CONFIG_SMALL("COPY_FLUSH"),
> +NULL_IF_CONFIG_SMALL("STOP")
>  };
>  
>  typedef struct SilenceRemoveContext {
> @@ -75,6 +85,10 @@ typedef struct SilenceRemoveContext {
>  int detection;
>  void (*update)(struct SilenceRemoveContext *s, double sample);
>  double(*compute)(struct SilenceRemoveContext *s, double sample);
> +
> +double last_pts_seconds;
> +double tone_duration;
> +double tone_hz;
>  } SilenceRemoveContext;
>  
>  #define OFFSET(x) offsetof(SilenceRemoveContext, x)
> @@ -91,11 +105,51 @@ static const AVOption silenceremove_options[] = {
>  {   "peak",  0,0,   AV_OPT_TYPE_CONST,   
>  {.i64=0}, 0,   0, FLAGS, "detection" },
>  {   "rms",   0,0,   AV_OPT_TYPE_CONST,   
>  {.i64=1}, 0,   0, FLAGS, "detection" },
>  { "window",  NULL, OFFSET(window_ratio),AV_OPT_TYPE_DOUBLE,  
>  {.dbl=0.02},  0,  10, FLAGS },
> +{
> +.name = "tone_duration",
> +.help = "length of tone inserted when silence is detected (0 to 
> disable)",
> +.offset = OFFSET(tone_duration),
> +.type = AV_OPT_TYPE_DOUBLE,
> +.default_val = 

Re: [FFmpeg-devel] [PATCH] avfilter/showcqt: add csp option

2016-10-13 Thread Muhammad Faiz
On Fri, Oct 14, 2016 at 3:20 AM, Michael Niedermayer
 wrote:
> On Fri, Oct 14, 2016 at 02:50:52AM +0700, Muhammad Faiz wrote:
>> On Thu, Oct 13, 2016 at 10:38 PM, Michael Niedermayer
>>  wrote:
>> > On Thu, Oct 13, 2016 at 06:05:19AM +0700, Muhammad Faiz wrote:
>> >> from colorspace filter
>> >>
>> >> Signed-off-by: Muhammad Faiz 
>> >> ---
>> >>  doc/filters.texi  | 26 ++
>> >>  libavfilter/avf_showcqt.c | 56 
>> >> ++-
>> >>  libavfilter/avf_showcqt.h |  2 ++
>> >>  3 files changed, 79 insertions(+), 5 deletions(-)
>> >>
>> >> diff --git a/doc/filters.texi b/doc/filters.texi
>> >> index 76265e7..a79972b 100644
>> >> --- a/doc/filters.texi
>> >> +++ b/doc/filters.texi
>> >> @@ -16884,6 +16884,32 @@ Enable/disable drawing text to the axis. If it 
>> >> is set to @code{0}, drawing to
>> >>  the axis is disabled, ignoring @var{fontfile} and @var{axisfile} option.
>> >>  Default value is @code{1}.
>> >>
>> >> +@item csp
>> >> +Set colorspace. The accepted values are:
>> >> +@table @samp
>> >> +@item unspecified
>> >> +Unspecified (default)
>> >> +
>> >> +@item bt709
>> >> +BT.709
>> >> +
>> >> +@item fcc
>> >> +FCC
>> >> +
>> >> +@item bt470bg
>> >> +BT.470BG or BT.601-6 625
>> >> +
>> >> +@item smpte170m
>> >> +SMPTE-170M or BT.601-6 525
>> >> +
>> >> +@item smpte240m
>> >> +SMPTE-240M
>> >> +
>> >> +@item bt2020ncl
>> >> +BT.2020 with non-constant luminance
>> >> +
>> >> +@end table
>> >> +
>> >>  @end table
>> >>
>> >>  @subsection Examples
>> >> diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c
>> >> index 16bb2be..7c76b1f 100644
>> >> --- a/libavfilter/avf_showcqt.c
>> >> +++ b/libavfilter/avf_showcqt.c
>> >> @@ -83,6 +83,14 @@ static const AVOption showcqt_options[] = {
>> >>  { "axisfile", "set axis image", OFFSET(axisfile),  
>> >> AV_OPT_TYPE_STRING, { .str = NULL },  CHAR_MIN, CHAR_MAX, FLAGS },
>> >>  { "axis",  "draw axis", OFFSET(axis),
>> >> AV_OPT_TYPE_BOOL, { .i64 = 1 },0, 1,FLAGS },
>> >>  { "text",  "draw axis", OFFSET(axis),
>> >> AV_OPT_TYPE_BOOL, { .i64 = 1 },0, 1,FLAGS },
>> >> +{ "csp", "set color space", OFFSET(csp),  
>> >> AV_OPT_TYPE_INT, { .i64 = AVCOL_SPC_UNSPECIFIED }, 0, INT_MAX, FLAGS, 
>> >> "csp" },
>> >> +{ "unspecified", "unspecified", 0,  
>> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_UNSPECIFIED }, 0, 0, FLAGS, "csp" },
>> >> +{ "bt709", "bt709", 0,  
>> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_BT709 },   0, 0, FLAGS, "csp" },
>> >> +{ "fcc", "fcc", 0,  
>> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_FCC }, 0, 0, FLAGS, "csp" },
>> >> +{ "bt470bg", "bt470bg", 0,  
>> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_BT470BG }, 0, 0, FLAGS, "csp" },
>> >> +{ "smpte170m", "smpte170m", 0,  
>> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_SMPTE170M },   0, 0, FLAGS, "csp" },
>> >> +{ "smpte240m", "smpte240m", 0,  
>> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_SMPTE240M },   0, 0, FLAGS, "csp" },
>> >> +{ "bt2020ncl", "bt2020ncl", 0,  
>> >> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_BT2020_NCL },  0, 0, FLAGS, "csp" },
>> >>  { NULL }
>> >>  };
>> >>
>> >> @@ -656,7 +664,7 @@ static void rgb_from_cqt(ColorFloat *c, const 
>> >> FFTComplex *v, float g, int len)
>> >>  }
>> >>  }
>> >>
>> >> -static void yuv_from_cqt(ColorFloat *c, const FFTComplex *v, float 
>> >> gamma, int len)
>> >> +static void yuv_from_cqt(ColorFloat *c, const FFTComplex *v, float 
>> >> gamma, int len, float cm[3][3])
>> >>  {
>> >>  int x;
>> >>  for (x = 0; x < len; x++) {
>> >> @@ -664,9 +672,9 @@ static void yuv_from_cqt(ColorFloat *c, const 
>> >> FFTComplex *v, float gamma, int le
>> >>  r = calculate_gamma(FFMIN(1.0f, v[x].re), gamma);
>> >>  g = calculate_gamma(FFMIN(1.0f, 0.5f * (v[x].re + v[x].im)), 
>> >> gamma);
>> >>  b = calculate_gamma(FFMIN(1.0f, v[x].im), gamma);
>> >> -c[x].yuv.y = 65.481f * r + 128.553f * g + 24.966f * b;
>> >> -c[x].yuv.u = -37.797f * r - 74.203f * g + 112.0f * b;
>> >> -c[x].yuv.v = 112.0f * r - 93.786f * g - 18.214 * b;
>> >> +c[x].yuv.y = cm[0][0] * r + cm[0][1] * g + cm[0][2] * b;
>> >> +c[x].yuv.u = cm[1][0] * r + cm[1][1] * g + cm[1][2] * b;
>> >> +c[x].yuv.v = cm[2][0] * r + cm[2][1] * g + cm[2][2] * b;
>> >>  }
>> >>  }
>> >>
>> >> @@ -1036,7 +1044,7 @@ static void process_cqt(ShowCQTContext *s)
>> >>  if (s->format == AV_PIX_FMT_RGB24)
>> >>  rgb_from_cqt(s->c_buf, s->cqt_result, s->sono_g, s->width);
>> >>  else
>> >> -yuv_from_cqt(s->c_buf, s->cqt_result, 

Re: [FFmpeg-devel] [PATCH] libopenjpegenc: fix out-of-bounds reads when filling the edges

2016-10-13 Thread Andreas Cadhalpun
On 14.10.2016 00:49, Michael Niedermayer wrote:
> On Fri, Oct 14, 2016 at 12:23:02AM +0200, Andreas Cadhalpun wrote:
>> The avctx->width/avctx->height is not zero, but libopenjpeg_copy_unpacked8
>> does:
> 
>> width  = avctx->width / image->comps[compno].dx;
>> height = avctx->height / image->comps[compno].dy;
> 
> this looks wrong to me
> the code in mj2_create_image() looks better:
> cmptparm[i].dx = sub_dx[i];
> cmptparm[i].dy = sub_dy[i];
> cmptparm[i].w = (avctx->width + sub_dx[i] - 1) / sub_dx[i];
> cmptparm[i].h = (avctx->height + sub_dy[i] - 1) / sub_dy[i];

Indeed this looks better, so I updated the patch (attached) to change the
calculation of width/height.

Best regards,
Andreas
>From 1461064c1eaabb71661f9ff68b94f35a1b98e3b5 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun 
Date: Thu, 13 Oct 2016 22:14:46 +0200
Subject: [PATCH] libopenjpegenc: fix out-of-bounds reads when filling the
 edges

The calculation of width/height should round up, not round down to
prevent setting width or height to 0.

Also image->comps[compno].w is unsigned (at least in openjpeg2), so the
calculation could silently wrap around without the explicit cast to int.

Signed-off-by: Andreas Cadhalpun 
---
 libavcodec/libopenjpegenc.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index 857ee1a..1b7e168 100644
--- a/libavcodec/libopenjpegenc.c
+++ b/libavcodec/libopenjpegenc.c
@@ -421,7 +421,7 @@ static int libopenjpeg_copy_packed8(AVCodecContext *avctx, const AVFrame *frame,
 for (; y < image->comps[compno].h; ++y) {
 image_line = image->comps[compno].data + y * image->comps[compno].w;
 for (x = 0; x < image->comps[compno].w; ++x) {
-image_line[x] = image_line[x - image->comps[compno].w];
+image_line[x] = image_line[x - (int)image->comps[compno].w];
 }
 }
 }
@@ -461,7 +461,7 @@ static int libopenjpeg_copy_packed12(AVCodecContext *avctx, const AVFrame *frame
 for (; y < image->comps[compno].h; ++y) {
 image_line = image->comps[compno].data + y * image->comps[compno].w;
 for (x = 0; x < image->comps[compno].w; ++x) {
-image_line[x] = image_line[x - image->comps[compno].w];
+image_line[x] = image_line[x - (int)image->comps[compno].w];
 }
 }
 }
@@ -501,7 +501,7 @@ static int libopenjpeg_copy_packed16(AVCodecContext *avctx, const AVFrame *frame
 for (; y < image->comps[compno].h; ++y) {
 image_line = image->comps[compno].data + y * image->comps[compno].w;
 for (x = 0; x < image->comps[compno].w; ++x) {
-image_line[x] = image_line[x - image->comps[compno].w];
+image_line[x] = image_line[x - (int)image->comps[compno].w];
 }
 }
 }
@@ -528,8 +528,8 @@ static int libopenjpeg_copy_unpacked8(AVCodecContext *avctx, const AVFrame *fram
 }
 
 for (compno = 0; compno < numcomps; ++compno) {
-width  = avctx->width / image->comps[compno].dx;
-height = avctx->height / image->comps[compno].dy;
+width  = (avctx->width + image->comps[compno].dx - 1) / image->comps[compno].dx;
+height = (avctx->height + image->comps[compno].dy - 1) / image->comps[compno].dy;
 for (y = 0; y < height; ++y) {
 image_line = image->comps[compno].data + y * image->comps[compno].w;
 frame_index = y * frame->linesize[compno];
@@ -542,7 +542,7 @@ static int libopenjpeg_copy_unpacked8(AVCodecContext *avctx, const AVFrame *fram
 for (; y < image->comps[compno].h; ++y) {
 image_line = image->comps[compno].data + y * image->comps[compno].w;
 for (x = 0; x < image->comps[compno].w; ++x) {
-image_line[x] = image_line[x - image->comps[compno].w];
+image_line[x] = image_line[x - (int)image->comps[compno].w];
 }
 }
 }
@@ -570,8 +570,8 @@ static int libopenjpeg_copy_unpacked16(AVCodecContext *avctx, const AVFrame *fra
 }
 
 for (compno = 0; compno < numcomps; ++compno) {
-width = avctx->width / image->comps[compno].dx;
-height= avctx->height / image->comps[compno].dy;
+width = (avctx->width + image->comps[compno].dx - 1) / image->comps[compno].dx;
+height= (avctx->height + image->comps[compno].dy - 1) / image->comps[compno].dy;
 frame_ptr = (uint16_t *)frame->data[compno];
 for (y = 0; y < height; ++y) {
 image_line = image->comps[compno].data + y * image->comps[compno].w;
@@ -585,7 +585,7 @@ static int libopenjpeg_copy_unpacked16(AVCodecContext *avctx, const AVFrame *fra
 for (; y < image->comps[compno].h; ++y) {
 image_line = image->comps[compno].data 

Re: [FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts

2016-10-13 Thread Michael Niedermayer
On Thu, Oct 13, 2016 at 04:41:00PM +0200, Ståle Kristoffersen wrote:
> On 2016-10-12 at 13:57, Carl Eugen Hoyos wrote:
> > 2016-10-11 16:27 GMT+02:00 Michael Niedermayer :
> > 
> > > also the img2 demuxer for mjpeg2000 from img2dec.c does not work
> > > for this ?
> > 
> > We separated the jpg from the mjpeg probe, jpg makes sure that the
> > sample starts like a jpg image and contains an end marker and can
> > be decoded, mjpeg probe is less strict but requires more than one
> > frame.
> > Same could be argued for j2k or was our reasoning bad?
> 
> Since nobody chimed in on this, I have created two new patches, one
> containing a separate mjpeg 2000 probe
> (0001-libavf-Auto-detect-mjpeg-2000-in-mpeg-ts2.patch), and one that
> incorporates it into the img2dec jpeg 2000 probe
> (0001-libavf-Make-jpeg-2000-probe-work-for-mjpeg-2000.patch).
> 

> I think it is best to have them separated, as that matches the mjpeg
> behaviour.

have you tested the demuxer ?
i dont think it works outside probing for mpegts
i think for j2k codestream support a jpeg2000 parser is needed first
same as we have for mjpeg

that said i have no preferrance for which way its done but i think
were not all aware that adding a identical mjpeg style demuxer was
only part of the stuff needed ...

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


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


[FFmpeg-devel] [PATCHv3] mov: Evaluate the movie display matrix

2016-10-13 Thread Vittorio Giovara
This matrix needs to be applied after all others have (currently only
display matrix from trak), but cannot be handled in movie box, since
streams are not allocated yet. So store it in main context, and apply
it when appropriate, that is after parsing the tkhd one.

Signed-off-by: Vittorio Giovara 
---
Reworked second matrix handling so that it is always applied, which makes
the code easier to read and test. Updated according reviews, rolled back
a couple of points for the reasons explained in the thread.

Needs a new sample to be uploaded to fate,
https://www.dropbox.com/s/qfio4bjhkpz3p4o/displaymatrix.mov?dl=0,
the previous one can be deleted.

Cheers,
Vittorio

 libavformat/isom.h|  2 ++
 libavformat/mov.c | 53 +++
 tests/fate/mov.mak|  6 -
 tests/ref/fate/mov-display-matrix | 10 
 4 files changed, 59 insertions(+), 12 deletions(-)
 create mode 100644 tests/ref/fate/mov-display-matrix

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 2246fed..2aeb8fa 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -238,6 +238,8 @@ typedef struct MOVContext {
 uint8_t *decryption_key;
 int decryption_key_len;
 int enable_drefs;
+
+int32_t movie_display_matrix[3][3]; ///< display matrix from mvhd
 } MOVContext;
 
 int ff_mp4_read_descr_len(AVIOContext *pb);
diff --git a/libavformat/mov.c b/libavformat/mov.c
index a15c8d1..e8da77f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1211,6 +1211,7 @@ static int mov_read_mdhd(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 
 static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
+int i;
 int64_t creation_time;
 int version = avio_r8(pb); /* version */
 avio_rb24(pb); /* flags */
@@ -1238,7 +1239,12 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 
 avio_skip(pb, 10); /* reserved */
 
-avio_skip(pb, 36); /* display matrix */
+/* movie display matrix, store it in main context and use it later on */
+for (i = 0; i < 3; i++) {
+c->movie_display_matrix[i][0] = avio_rb32(pb); // 16.16 fixed point
+c->movie_display_matrix[i][1] = avio_rb32(pb); // 16.16 fixed point
+c->movie_display_matrix[i][2] = avio_rb32(pb); //  2.30 fixed point
+}
 
 avio_rb32(pb); /* preview time */
 avio_rb32(pb); /* preview duration */
@@ -3798,16 +3804,33 @@ static int mov_read_meta(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 return 0;
 }
 
+// return 0 when matrix is identity, 1 otherwise
+#define IS_MATRIX_FULL(matrix)   \
+(matrix[0][0] != (1 << 16) ||\
+ matrix[1][1] != (1 << 16) ||\
+ matrix[2][2] != (1 << 30) ||\
+ matrix[0][1] || matrix[0][2] || \
+ matrix[1][0] || matrix[1][2] || \
+ matrix[2][0] || matrix[2][1])
+
+// fixed point to double
+#define CONV_FP(x, sh) ((double) (x)) / (1 << (sh))
+
+// double to fixed point
+#define CONV_DB(x, sh) ((int32_t) ((x) * (1 << (sh
+
 static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
-int i;
+int i, j, e;
 int width;
 int height;
 int display_matrix[3][3];
+int res_display_matrix[3][3];
 AVStream *st;
 MOVStreamContext *sc;
 int version;
 int flags;
+double val = 0;
 
 if (c->fc->nb_streams < 1)
 return 0;
@@ -3853,15 +3876,22 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 sc->width = width >> 16;
 sc->height = height >> 16;
 
+// apply the moov display matrix
+for (i = 0; i < 3; i++) {
+for (j = 0; j < 3; j++) {
+int sh = j == 2 ? 30 : 16;
+for (e = 0; e < 3; e++) {
+val += CONV_FP(display_matrix[i][e], sh) *
+   CONV_FP(c->movie_display_matrix[e][j], sh);
+}
+res_display_matrix[i][j] = CONV_DB(val, sh);
+val = 0;
+}
+}
+
 // save the matrix and add rotate metadata when it is not the default
 // identity
-if (display_matrix[0][0] != (1 << 16) ||
-display_matrix[1][1] != (1 << 16) ||
-display_matrix[2][2] != (1 << 30) ||
-display_matrix[0][1] || display_matrix[0][2] ||
-display_matrix[1][0] || display_matrix[1][2] ||
-display_matrix[2][0] || display_matrix[2][1]) {
-int i, j;
+if (IS_MATRIX_FULL(res_display_matrix)) {
 double rotate;
 
 av_freep(>display_matrix);
@@ -3871,7 +3901,7 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 
 for (i = 0; i < 3; i++)
 for (j = 0; j < 3; j++)
-sc->display_matrix[i * 3 + j] = display_matrix[i][j];
+sc->display_matrix[i * 3 + j] = res_display_matrix[i][j];
 
 rotate = av_display_rotation_get(sc->display_matrix);
 if (!isnan(rotate)) {
@@ -3890,7 +3920,8 @@ static int 

Re: [FFmpeg-devel] [PATCH] libopenjpegenc: fix out-of-bounds reads when filling the edges

2016-10-13 Thread Michael Niedermayer
On Fri, Oct 14, 2016 at 12:23:02AM +0200, Andreas Cadhalpun wrote:
> On 14.10.2016 00:00, Hendrik Leppkes wrote:
> > On Thu, Oct 13, 2016 at 10:25 PM, Andreas Cadhalpun
> >  wrote:
> >> If x is 0, 'x - 1' is in the previous line, or worse outside the buffer
> >> for the first line.
> >>
> >> If y is 0, 'x - image->comps[compno].w' is outside the buffer.
> >>
> > 
> > I'm slightly puzzled, as you say, these are for edge handling, edges
> > in this case are from the image width to buffer width, and image
> > height to buffer height, respectively
> > So for x or y to be zero, we would need an image thats zero width, or
> > zero height, so the edge starts at zero?
> > 
> > How does that happen, and wouldn't it be much simpler to catch that
> > case earlier in the chain and simply error out? A image with either
> > zero width or zero height surely is not something you can encode
> > either way.
> 
> The avctx->width/avctx->height is not zero, but libopenjpeg_copy_unpacked8
> does:

> width  = avctx->width / image->comps[compno].dx;
> height = avctx->height / image->comps[compno].dy;

this looks wrong to me
the code in mj2_create_image() looks better:
cmptparm[i].dx = sub_dx[i];
cmptparm[i].dy = sub_dy[i];
cmptparm[i].w = (avctx->width + sub_dx[i] - 1) / sub_dx[i];
cmptparm[i].h = (avctx->height + sub_dy[i] - 1) / sub_dy[i];

i assume here that the buffers are large enough and  that the encoder
encodes the full rounded up size
if it does not then it doesnt support odd sizes with subsampling


> 
> So if e.g. avctx->height is 1 and image->comps[compno].dy is 2, height
> becomes 0. I'm not sure if that's invalid.

chroma planes being 0 sized is invalid for a normal image

you can potentially get this with tiling that some tiles have no
chroma samples but i think the code doesnt do anything odd like that
of course i could also be missing somethig 

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 1
"Used only once"- "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."


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


Re: [FFmpeg-devel] [PATCH] libopenjpegenc: fix out-of-bounds reads when filling the edges

2016-10-13 Thread Andreas Cadhalpun
On 14.10.2016 00:00, Hendrik Leppkes wrote:
> On Thu, Oct 13, 2016 at 10:25 PM, Andreas Cadhalpun
>  wrote:
>> If x is 0, 'x - 1' is in the previous line, or worse outside the buffer
>> for the first line.
>>
>> If y is 0, 'x - image->comps[compno].w' is outside the buffer.
>>
> 
> I'm slightly puzzled, as you say, these are for edge handling, edges
> in this case are from the image width to buffer width, and image
> height to buffer height, respectively
> So for x or y to be zero, we would need an image thats zero width, or
> zero height, so the edge starts at zero?
> 
> How does that happen, and wouldn't it be much simpler to catch that
> case earlier in the chain and simply error out? A image with either
> zero width or zero height surely is not something you can encode
> either way.

The avctx->width/avctx->height is not zero, but libopenjpeg_copy_unpacked8
does:
width  = avctx->width / image->comps[compno].dx;
height = avctx->height / image->comps[compno].dy;

So if e.g. avctx->height is 1 and image->comps[compno].dy is 2, height
becomes 0. I'm not sure if that's invalid.

I think the other functions are currently not affected by this, but I
added the check anyway for robustness. (The cast to int is needed in
any case.)

Best regards,
Andreas

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


Re: [FFmpeg-devel] [PATCH] lavf: add ffprobe demuxer

2016-10-13 Thread Moritz Barsnick
On Thu, Oct 13, 2016 at 19:46:41 +0200, Stefano Sabatini wrote:
> +In particular, can be also used to inject data stream generated by
  ^ it can

> +Unrecognized values are discarded (this allows the demuxer to accept
> +the output generated by @command{ffprobe} without further
> +modifications.
^) (missing closing bracket)

> +the codec name (the name must be an accepted FFmpeg codec name
 ^) (missing 
closing bracket)

> +@item duration_tim
 ^duration_time
 
> +av_log(avf, AV_LOG_ERROR, "Invalid " #name_ " time 
> specification '%s' for data packet\n", \
^ Is there 
a space too much here ("duration_ time")?


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


Re: [FFmpeg-devel] [PATCH] libopenjpegenc: fix out-of-bounds reads when filling the edges

2016-10-13 Thread Hendrik Leppkes
On Thu, Oct 13, 2016 at 10:25 PM, Andreas Cadhalpun
 wrote:
> If x is 0, 'x - 1' is in the previous line, or worse outside the buffer
> for the first line.
>
> If y is 0, 'x - image->comps[compno].w' is outside the buffer.
>

I'm slightly puzzled, as you say, these are for edge handling, edges
in this case are from the image width to buffer width, and image
height to buffer height, respectively
So for x or y to be zero, we would need an image thats zero width, or
zero height, so the edge starts at zero?

How does that happen, and wouldn't it be much simpler to catch that
case earlier in the chain and simply error out? A image with either
zero width or zero height surely is not something you can encode
either way.

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


[FFmpeg-devel] [PATCH] doc: fix spelling errors

2016-10-13 Thread Andreas Cadhalpun
Thanks to Mathieu Malaterre  for reporting the
Que/Queue typo. (https://bugs.debian.org/839542)

Signed-off-by: Andreas Cadhalpun 
---
 doc/Doxyfile|  2 +-
 doc/encoders.texi   |  2 +-
 doc/ffprobe.texi|  2 +-
 doc/filters.texi| 10 +-
 doc/muxers.texi |  6 +++---
 ffmpeg.c|  2 +-
 ffmpeg_cuvid.c  |  4 ++--
 libavcodec/aaccoder_twoloop.h   |  2 +-
 libavcodec/cabac.c  |  2 +-
 libavcodec/ffjni.c  |  2 +-
 libavcodec/mediacodec_wrapper.h |  2 +-
 libavcodec/psymodel.h   |  2 +-
 libavcodec/x86/vp9lpf_16bpp.asm |  2 +-
 libavfilter/af_hdcd.c   |  2 +-
 libavfilter/f_ebur128.c |  2 +-
 libavformat/internal.h  |  2 +-
 libavutil/frame.h   |  2 +-
 libavutil/tree.h|  2 +-
 18 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/doc/Doxyfile b/doc/Doxyfile
index fb5cdd3..0891899 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -1637,7 +1637,7 @@ EXTRA_PACKAGES =
 # following commands have a special meaning inside the header: $title,
 # $datetime, $date, $doxygenversion, $projectname, $projectnumber,
 # $projectbrief, $projectlogo. Doxygen will replace $title with the empy 
string,
-# for the replacement values of the other commands the user is refered to
+# for the replacement values of the other commands the user is referred to
 # HTML_HEADER.
 # This tag requires that the tag GENERATE_LATEX is set to YES.
 
diff --git a/doc/encoders.texi b/doc/encoders.texi
index 1f4044e..375b1b6 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1773,7 +1773,7 @@ Enable CAVLC and disable CABAC. It generates the same 
effect as
 @end table
 
 @item cmp
-Set full pixel motion estimation comparation algorithm. Possible values:
+Set full pixel motion estimation comparison algorithm. Possible values:
 
 @table @samp
 @item chroma
diff --git a/doc/ffprobe.texi b/doc/ffprobe.texi
index 2024eed..1069ae3 100644
--- a/doc/ffprobe.texi
+++ b/doc/ffprobe.texi
@@ -245,7 +245,7 @@ continue reading from that.
 Each interval is specified by two optional parts, separated by "%".
 
 The first part specifies the interval start position. It is
-interpreted as an abolute position, or as a relative offset from the
+interpreted as an absolute position, or as a relative offset from the
 current position if it is preceded by the "+" character. If this first
 part is not specified, no seeking will be performed when reading this
 interval.
diff --git a/doc/filters.texi b/doc/filters.texi
index 76265e7..1f0f1f8 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -449,7 +449,7 @@ This filter is bit crusher with enhanced functionality. A 
bit crusher
 is used to audibly reduce number of bits an audio signal is sampled
 with. This doesn't change the bit depth at all, it just produces the
 effect. Material reduced in bit depth sounds more harsh and "digital".
-This filter is able to even round to continous values instead of discrete
+This filter is able to even round to continuous values instead of discrete
 bit depths.
 Additionally it has a D/C offset which results in different crushing of
 the lower and the upper half of the signal.
@@ -475,7 +475,7 @@ Set level out.
 Set bit reduction.
 
 @item mix
-Set mixing ammount.
+Set mixing amount.
 
 @item mode
 Can be linear: @code{lin} or logarithmic: @code{log}.
@@ -1203,7 +1203,7 @@ Set video stream size. Only useful if curves option is 
activated.
 
 @item mgain
 Set max gain that will be displayed. Only useful if curves option is activated.
-Setting this to reasonable value allows to display gain which is derived from
+Setting this to reasonable value allows one to display gain which is derived 
from
 neighbour bands which are too close to each other and thus produce higher gain
 when both are activated.
 
@@ -8834,7 +8834,7 @@ value.
 @section hysteresis
 
 Grow first stream into second stream by connecting components.
-This allows to build more robust edge masks.
+This allows one to build more robust edge masks.
 
 This filter accepts the following options:
 
@@ -17575,7 +17575,7 @@ magnitude across time and second represents phase 
across time.
 The filter will transform from frequency domain as displayed in videos back
 to time domain as presented in audio output.
 
-This filter is primarly created for reversing processed @ref{showspectrum}
+This filter is primarily created for reversing processed @ref{showspectrum}
 filter outputs, but can synthesize sound from other spectrograms too.
 But in such case results are going to be poor if the phase data is not
 available, because in such cases phase data need to be recreated, usually
diff --git a/doc/muxers.texi b/doc/muxers.texi
index dbe53f5..c6b8cc5 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -1513,14 +1513,14 @@ as a list of @var{key}=@var{value} pairs 

Re: [FFmpeg-devel] [PATCH] lavfi/sidedata: add filter for manipulating frame side data

2016-10-13 Thread Marton Balint


On Tue, 11 Oct 2016, Marton Balint wrote:


On Thu, 6 Oct 2016, Marton Balint wrote:


This is a similar filter to f_metadata, only it works on side data. Since
adding side data from a user provided arbitrary binary string is unsafe,
because current code assumes that a side data of a certain kind has the 

proper

size, this filter only implements selection and deletion. Also, no value
matching support is implemented yet, because there is no uniform way to 

specify

a side data textually.

Signed-off-by: Marton Balint 
---
Changelog|   1 +
doc/filters.texi |  30 
libavfilter/Makefile |   2 +
libavfilter/allfilters.c |   2 +
libavfilter/f_sidedata.c | 181 

+++

libavfilter/version.h|   2 +-
6 files changed, 217 insertions(+), 1 deletion(-)
create mode 100644 libavfilter/f_sidedata.c



I will apply this in a day or two.



Pushed.

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


Re: [FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms.

2016-10-13 Thread Zhenni Huang
Sorry about the second patch I sent.

This option is for flexibility since some apps may not want to use the
hidden atoms.

On Thu, Oct 13, 2016 at 1:44 PM, Robert Krüger 
wrote:

> On Thu, Oct 13, 2016 at 9:54 PM, Dave Rice  wrote:
>
> >
> > > On Oct 13, 2016, at 1:56 PM, Hendrik Leppkes 
> > wrote:
> > >
> > > Am 13.10.2016 19:03 schrieb "liangsi" :
> > >>
> > >> ---
> > >> libavformat/isom.h | 1 +
> > >> libavformat/mov.c  | 5 -
> > >> 2 files changed, 5 insertions(+), 1 deletion(-)
> > >>
> > >
> > > Can you elaborate on the reasons of why someone would want this?
> > Preferably
> > > in the commit message for future consideration.
> >
> > Shouldn't using the moov atom that is not detected within a free atom be
> > the default? Can you elaborate on the reasons of why someone wouldn't
> want
> > this?
> > Dave
> >
> > +1
> ___
> 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] [PATCH] avfilter/af_silenceremove: add optional tone when silence is removed

2016-10-13 Thread Greg Rowe
The attached patch adds two optional parameters to af_silenceremove for the 
purpose of inserting a tone in place of where silence was removed.  This alerts 
the user that silence has been trimmed from the original stream.  The 
parameters are tone_duration which defaults to 0.0 which disables the feature 
and tone_hz which allows you to specify the frequency of the tone.


Thanks,

Greg


--

Greg Rowe

www.shoretel.com
From 41405e90cb2fb41441a6cf29c7a0d14362fd1b1f Mon Sep 17 00:00:00 2001
From: Greg Rowe 
Date: Fri, 7 Oct 2016 13:39:58 -0400
Subject: [PATCH] avfilter/af_silenceremove: add optional tone when silence is
 removed

This commit adds two options to the af_silenceremove filter.  It adds
tone_duration and tone_hz making it possible to insert a tone when
silence is removed.  Tone insertion is disabled by default (by using a
tone_duration of 0.0 seconds).

Signed-off-by: Greg Rowe 
---
 Changelog  |   1 +
 doc/filters.texi   |  11 ++-
 libavfilter/af_silenceremove.c | 161 +++--
 libavfilter/version.h  |   2 +-
 4 files changed, 151 insertions(+), 24 deletions(-)

diff --git a/Changelog b/Changelog
index 0da009c..86e031c 100644
--- a/Changelog
+++ b/Changelog
@@ -2,6 +2,7 @@ Entries are sorted chronologically from oldest to youngest 
within each release,
 releases are sorted from youngest to oldest.
 
 version :
+- Added optional tone insertion in af_silenceremove
 - libopenmpt demuxer
 - tee protocol
 - Changed metadata print option to accept general urls
diff --git a/doc/filters.texi b/doc/filters.texi
index 4b2f7bf..e09a303 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -3340,7 +3340,8 @@ ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f 
null -
 
 @section silenceremove
 
-Remove silence from the beginning, middle or end of the audio.
+Remove silence from the beginning, middle or end of the audio while
+optionally inserting a tone where silence was removed.
 
 The filter accepts the following options:
 
@@ -3401,6 +3402,14 @@ Default value is @code{rms}.
 @item window
 Set ratio used to calculate size of window for detecting silence.
 Default value is @code{0.02}. Allowed range is from @code{0} to @code{10}.
+
+@item tone_duration
+Set the duration of the tone inserted in the stream when silence is removed.  
A value of @code{0} disables tone insertion.
+Default value is @code{0.0}.
+
+@item tone_hz
+Set the frequency of the tone inserted in the stream when silence is removed.
+Default value is @code{1000.0}.
 @end table
 
 @subsection Examples
diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c
index f156d18..07cf428 100644
--- a/libavfilter/af_silenceremove.c
+++ b/libavfilter/af_silenceremove.c
@@ -3,6 +3,7 @@
  * Copyright (c) 2001 Chris Bagwell
  * Copyright (c) 2003 Donnie Smith
  * Copyright (c) 2014 Paul B Mahol
+ * Copyright (c) 2016 Shoretel 
  *
  * This file is part of FFmpeg.
  *
@@ -31,11 +32,20 @@
 #include "internal.h"
 
 enum SilenceMode {
-SILENCE_TRIM,
+SILENCE_TRIM = 0,
 SILENCE_TRIM_FLUSH,
 SILENCE_COPY,
 SILENCE_COPY_FLUSH,
-SILENCE_STOP
+SILENCE_STOP,
+SILENCE_END_MARKER
+};
+
+static const char* SILENCE_MODE_NAMES[] = {
+NULL_IF_CONFIG_SMALL("TRIM"),
+NULL_IF_CONFIG_SMALL("TRIM_FLUSH"),
+NULL_IF_CONFIG_SMALL("COPY"),
+NULL_IF_CONFIG_SMALL("COPY_FLUSH"),
+NULL_IF_CONFIG_SMALL("STOP")
 };
 
 typedef struct SilenceRemoveContext {
@@ -75,6 +85,10 @@ typedef struct SilenceRemoveContext {
 int detection;
 void (*update)(struct SilenceRemoveContext *s, double sample);
 double(*compute)(struct SilenceRemoveContext *s, double sample);
+
+double last_pts_seconds;
+double tone_duration;
+double tone_hz;
 } SilenceRemoveContext;
 
 #define OFFSET(x) offsetof(SilenceRemoveContext, x)
@@ -91,11 +105,51 @@ static const AVOption silenceremove_options[] = {
 {   "peak",  0,0,   AV_OPT_TYPE_CONST,
{.i64=0}, 0,   0, FLAGS, "detection" },
 {   "rms",   0,0,   AV_OPT_TYPE_CONST,
{.i64=1}, 0,   0, FLAGS, "detection" },
 { "window",  NULL, OFFSET(window_ratio),AV_OPT_TYPE_DOUBLE,   
{.dbl=0.02},  0,  10, FLAGS },
-{ NULL }
+{
+.name = "tone_duration",
+.help = "length of tone inserted when silence is detected (0 to 
disable)",
+.offset = OFFSET(tone_duration),
+.type = AV_OPT_TYPE_DOUBLE,
+.default_val = {.dbl=0.0},
+.min = 0.0,
+.max = DBL_MAX,
+.flags = FLAGS,
+.unit = "tone",
+},
+{
+.name = "tone_hz",
+.help = "frequency of tone inserted when silence is removed, 1 kHz 
default",
+.offset = OFFSET(tone_hz),
+.type = AV_OPT_TYPE_DOUBLE,
+.default_val = {.dbl=1000.0},
+.min = 0.0,
+.max = 

Re: [FFmpeg-devel] [PATCH] Improved selftest coverage for libavutil/fifo.c

2016-10-13 Thread Michael Niedermayer
On Wed, Oct 12, 2016 at 11:30:19PM -0700, Thomas Turner wrote:
> Tested functions: av_fifo_generic_peek(), av_fifo_grow()
> ---
>  libavutil/tests/fifo.c | 32 +++-
>  tests/ref/fate/fifo| 43 +++
>  2 files changed, 74 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/tests/fifo.c b/libavutil/tests/fifo.c
> index e4d7edf..4d598d3 100644
> --- a/libavutil/tests/fifo.c
> +++ b/libavutil/tests/fifo.c
> @@ -24,7 +24,7 @@ int main(void)
>  {
>  /* create a FIFO buffer */
>  AVFifoBuffer *fifo = av_fifo_alloc(13 * sizeof(int));
> -int i, j, n;
> +int i, j, n, *p;
>  
>  /* fill data */
>  for (i = 0; av_fifo_space(fifo) >= sizeof(int); i++)
> @@ -46,6 +46,19 @@ int main(void)
>  }
>  printf("\n");
>  
> +/* generic peek at FIFO */
> +
> +n = av_fifo_size(fifo);
> +p = malloc(n);

missing malloc() failure test


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

Those who are best at talking, realize last or never when they are wrong.


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


Re: [FFmpeg-devel] [PATCH] avfilter/showcqt: add csp option

2016-10-13 Thread Muhammad Faiz
On Thu, Oct 13, 2016 at 10:38 PM, Michael Niedermayer
 wrote:
> On Thu, Oct 13, 2016 at 06:05:19AM +0700, Muhammad Faiz wrote:
>> from colorspace filter
>>
>> Signed-off-by: Muhammad Faiz 
>> ---
>>  doc/filters.texi  | 26 ++
>>  libavfilter/avf_showcqt.c | 56 
>> ++-
>>  libavfilter/avf_showcqt.h |  2 ++
>>  3 files changed, 79 insertions(+), 5 deletions(-)
>>
>> diff --git a/doc/filters.texi b/doc/filters.texi
>> index 76265e7..a79972b 100644
>> --- a/doc/filters.texi
>> +++ b/doc/filters.texi
>> @@ -16884,6 +16884,32 @@ Enable/disable drawing text to the axis. If it is 
>> set to @code{0}, drawing to
>>  the axis is disabled, ignoring @var{fontfile} and @var{axisfile} option.
>>  Default value is @code{1}.
>>
>> +@item csp
>> +Set colorspace. The accepted values are:
>> +@table @samp
>> +@item unspecified
>> +Unspecified (default)
>> +
>> +@item bt709
>> +BT.709
>> +
>> +@item fcc
>> +FCC
>> +
>> +@item bt470bg
>> +BT.470BG or BT.601-6 625
>> +
>> +@item smpte170m
>> +SMPTE-170M or BT.601-6 525
>> +
>> +@item smpte240m
>> +SMPTE-240M
>> +
>> +@item bt2020ncl
>> +BT.2020 with non-constant luminance
>> +
>> +@end table
>> +
>>  @end table
>>
>>  @subsection Examples
>> diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c
>> index 16bb2be..7c76b1f 100644
>> --- a/libavfilter/avf_showcqt.c
>> +++ b/libavfilter/avf_showcqt.c
>> @@ -83,6 +83,14 @@ static const AVOption showcqt_options[] = {
>>  { "axisfile", "set axis image", OFFSET(axisfile),  
>> AV_OPT_TYPE_STRING, { .str = NULL },  CHAR_MIN, CHAR_MAX, FLAGS },
>>  { "axis",  "draw axis", OFFSET(axis),
>> AV_OPT_TYPE_BOOL, { .i64 = 1 },0, 1,FLAGS },
>>  { "text",  "draw axis", OFFSET(axis),
>> AV_OPT_TYPE_BOOL, { .i64 = 1 },0, 1,FLAGS },
>> +{ "csp", "set color space", OFFSET(csp),  
>> AV_OPT_TYPE_INT, { .i64 = AVCOL_SPC_UNSPECIFIED }, 0, INT_MAX, FLAGS, "csp" 
>> },
>> +{ "unspecified", "unspecified", 0,  
>> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_UNSPECIFIED }, 0, 0, FLAGS, "csp" },
>> +{ "bt709", "bt709", 0,  
>> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_BT709 },   0, 0, FLAGS, "csp" },
>> +{ "fcc", "fcc", 0,  
>> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_FCC }, 0, 0, FLAGS, "csp" },
>> +{ "bt470bg", "bt470bg", 0,  
>> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_BT470BG }, 0, 0, FLAGS, "csp" },
>> +{ "smpte170m", "smpte170m", 0,  
>> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_SMPTE170M },   0, 0, FLAGS, "csp" },
>> +{ "smpte240m", "smpte240m", 0,  
>> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_SMPTE240M },   0, 0, FLAGS, "csp" },
>> +{ "bt2020ncl", "bt2020ncl", 0,  
>> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_BT2020_NCL },  0, 0, FLAGS, "csp" },
>>  { NULL }
>>  };
>>
>> @@ -656,7 +664,7 @@ static void rgb_from_cqt(ColorFloat *c, const FFTComplex 
>> *v, float g, int len)
>>  }
>>  }
>>
>> -static void yuv_from_cqt(ColorFloat *c, const FFTComplex *v, float gamma, 
>> int len)
>> +static void yuv_from_cqt(ColorFloat *c, const FFTComplex *v, float gamma, 
>> int len, float cm[3][3])
>>  {
>>  int x;
>>  for (x = 0; x < len; x++) {
>> @@ -664,9 +672,9 @@ static void yuv_from_cqt(ColorFloat *c, const FFTComplex 
>> *v, float gamma, int le
>>  r = calculate_gamma(FFMIN(1.0f, v[x].re), gamma);
>>  g = calculate_gamma(FFMIN(1.0f, 0.5f * (v[x].re + v[x].im)), gamma);
>>  b = calculate_gamma(FFMIN(1.0f, v[x].im), gamma);
>> -c[x].yuv.y = 65.481f * r + 128.553f * g + 24.966f * b;
>> -c[x].yuv.u = -37.797f * r - 74.203f * g + 112.0f * b;
>> -c[x].yuv.v = 112.0f * r - 93.786f * g - 18.214 * b;
>> +c[x].yuv.y = cm[0][0] * r + cm[0][1] * g + cm[0][2] * b;
>> +c[x].yuv.u = cm[1][0] * r + cm[1][1] * g + cm[1][2] * b;
>> +c[x].yuv.v = cm[2][0] * r + cm[2][1] * g + cm[2][2] * b;
>>  }
>>  }
>>
>> @@ -1036,7 +1044,7 @@ static void process_cqt(ShowCQTContext *s)
>>  if (s->format == AV_PIX_FMT_RGB24)
>>  rgb_from_cqt(s->c_buf, s->cqt_result, s->sono_g, s->width);
>>  else
>> -yuv_from_cqt(s->c_buf, s->cqt_result, s->sono_g, s->width);
>> +yuv_from_cqt(s->c_buf, s->cqt_result, s->sono_g, s->width, 
>> s->cmatrix);
>>  }
>>
>>  static int plot_cqt(AVFilterContext *ctx, AVFrame **frameout)
>> @@ -1075,6 +1083,7 @@ static int plot_cqt(AVFilterContext *ctx, AVFrame 
>> **frameout)
>>  return AVERROR(ENOMEM);
>>  out->sample_aspect_ratio = av_make_q(1, 1);
>>  av_frame_set_color_range(out, AVCOL_RANGE_MPEG);
>> +av_frame_set_colorspace(out, s->csp);
>>  

Re: [FFmpeg-devel] [PATCH] lavf/aviobuf: add ff_get_line2() variant

2016-10-13 Thread Michael Niedermayer
On Thu, Oct 13, 2016 at 07:40:59PM +0200, Stefano Sabatini wrote:
> This allows to probe if the read line was partially discarded.
> ---
>  libavformat/aviobuf.c  | 10 +-
>  libavformat/internal.h | 14 ++
>  2 files changed, 23 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
> index 134d627..28183b4 100644
> --- a/libavformat/aviobuf.c
> +++ b/libavformat/aviobuf.c
> @@ -764,18 +764,26 @@ unsigned int avio_rb32(AVIOContext *s)
>  
>  int ff_get_line(AVIOContext *s, char *buf, int maxlen)
>  {
> -int i = 0;
> +return ff_get_line2(s, buf, maxlen, NULL);
> +}
> +
> +int ff_get_line2(AVIOContext *s, char *buf, int maxlen, int *readlen)
> +{
> +int i = 0, j = 0;
>  char c;
>  
>  do {
>  c = avio_r8(s);
>  if (c && i < maxlen-1)
>  buf[i++] = c;
> +j++;
>  } while (c != '\n' && c != '\r' && c);

"\n" and "\0" would i belive both have a j=1 but they would have
differig i
is that intended ? (seems to me that this would make truncation
detection more annoying)
or am i missing something that avoids this difference?

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

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 


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


Re: [FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms.

2016-10-13 Thread Dave Rice

> On Oct 13, 2016, at 1:56 PM, Hendrik Leppkes  wrote:
> 
> Am 13.10.2016 19:03 schrieb "liangsi" :
>> 
>> ---
>> libavformat/isom.h | 1 +
>> libavformat/mov.c  | 5 -
>> 2 files changed, 5 insertions(+), 1 deletion(-)
>> 
> 
> Can you elaborate on the reasons of why someone would want this? Preferably
> in the commit message for future consideration.

Shouldn't using the moov atom that is not detected within a free atom be the 
default? Can you elaborate on the reasons of why someone wouldn't want this?
Dave
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libopenjpegenc: recreate image data buffer after encoding frame

2016-10-13 Thread Andreas Cadhalpun
On 13.10.2016 03:36, Michael Bradshaw wrote:
> Thanks for that (and the link back to the OpenJPEG source). Well dang. I
> think it would be better to change the patch to completely remove the image
> member from LibOpenJPEGContext, and instead just create a local image (and
> destroy it) for every call to libopenjpeg_encode_frame.

OK. Attached patch does that for openjpeg 2.
I didn't change the behavior for openjpeg 1, as reusing the image works there.

Best regards,
Andreas
>From 350ceab27db0346d89698070e40b1ae19ff1d559 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun 
Date: Thu, 13 Oct 2016 21:16:35 +0200
Subject: [PATCH] libopenjpegenc: stop reusing image data buffer for openjpeg 2

openjpeg 2 sets the data pointers of the image components to NULL,
causing segfaults if the image is reused.

Signed-off-by: Andreas Cadhalpun 
---
 libavcodec/libopenjpegenc.c | 41 ++---
 1 file changed, 30 insertions(+), 11 deletions(-)

diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index 5042507..857ee1a 100644
--- a/libavcodec/libopenjpegenc.c
+++ b/libavcodec/libopenjpegenc.c
@@ -52,7 +52,9 @@
 
 typedef struct LibOpenJPEGContext {
 AVClass *avclass;
+#if OPENJPEG_MAJOR_VERSION == 1
 opj_image_t *image;
+#endif // OPENJPEG_MAJOR_VERSION == 1
 opj_cparameters_t enc_params;
 #if OPENJPEG_MAJOR_VERSION == 1
 opj_event_mgr_t event_mgr;
@@ -369,18 +371,22 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
 cinema_parameters(>enc_params);
 }
 
+#if OPENJPEG_MAJOR_VERSION == 1
 ctx->image = mj2_create_image(avctx, >enc_params);
 if (!ctx->image) {
 av_log(avctx, AV_LOG_ERROR, "Error creating the mj2 image\n");
 err = AVERROR(EINVAL);
 goto fail;
 }
+#endif // OPENJPEG_MAJOR_VERSION == 1
 
 return 0;
 
 fail:
+#if OPENJPEG_MAJOR_VERSION == 1
 opj_image_destroy(ctx->image);
 ctx->image = NULL;
+#endif // OPENJPEG_MAJOR_VERSION == 1
 return err;
 }
 
@@ -591,19 +597,25 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 const AVFrame *frame, int *got_packet)
 {
 LibOpenJPEGContext *ctx = avctx->priv_data;
-opj_image_t *image  = ctx->image;
+int ret;
+AVFrame *gbrframe;
+int cpyresult = 0;
 #if OPENJPEG_MAJOR_VERSION == 1
+opj_image_t *image  = ctx->image;
 opj_cinfo_t *compress   = NULL;
 opj_cio_t *stream   = NULL;
 int len;
 #else // OPENJPEG_MAJOR_VERSION == 2
+PacketWriter writer = { 0 };
 opj_codec_t *compress   = NULL;
 opj_stream_t *stream= NULL;
-PacketWriter writer = { 0 };
+opj_image_t *image  = mj2_create_image(avctx, >enc_params);
+if (!image) {
+av_log(avctx, AV_LOG_ERROR, "Error creating the mj2 image\n");
+ret = AVERROR(EINVAL);
+goto done;
+}
 #endif // OPENJPEG_MAJOR_VERSION == 1
-int cpyresult = 0;
-int ret;
-AVFrame *gbrframe;
 
 switch (avctx->pix_fmt) {
 case AV_PIX_FMT_RGB24:
@@ -626,8 +638,10 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 case AV_PIX_FMT_GBRP14:
 case AV_PIX_FMT_GBRP16:
 gbrframe = av_frame_clone(frame);
-if (!gbrframe)
-return AVERROR(ENOMEM);
+if (!gbrframe) {
+ret = AVERROR(ENOMEM);
+goto done;
+}
 gbrframe->data[0] = frame->data[2]; // swap to be rgb
 gbrframe->data[1] = frame->data[0];
 gbrframe->data[2] = frame->data[1];
@@ -684,19 +698,21 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 av_log(avctx, AV_LOG_ERROR,
"The frame's pixel format '%s' is not supported\n",
av_get_pix_fmt_name(avctx->pix_fmt));
-return AVERROR(EINVAL);
+ret = AVERROR(EINVAL);
+goto done;
 break;
 }
 
 if (!cpyresult) {
 av_log(avctx, AV_LOG_ERROR,
"Could not copy the frame data to the internal image buffer\n");
-return -1;
+ret = -1;
+goto done;
 }
 
 #if OPENJPEG_MAJOR_VERSION == 2
 if ((ret = ff_alloc_packet2(avctx, pkt, 1024, 0)) < 0) {
-return ret;
+goto done;
 }
 #endif // OPENJPEG_MAJOR_VERSION == 2
 
@@ -763,7 +779,7 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 #error Missing call to opj_stream_set_user_data
 #endif
 
-if (!opj_start_compress(compress, ctx->image, stream) ||
+if (!opj_start_compress(compress, image, stream) ||
 !opj_encode(compress, stream) ||
 !opj_end_compress(compress, stream)) {
 av_log(avctx, AV_LOG_ERROR, "Error during the opj encode\n");
@@ -782,6 +798,7 @@ done:
 #if OPENJPEG_MAJOR_VERSION == 2
 opj_stream_destroy(stream);
 opj_destroy_codec(compress);
+

Re: [FFmpeg-devel] [PATCH] configure: fix detection of libopenjpeg

2016-10-13 Thread Andreas Cadhalpun
On 13.10.2016 03:11, Michael Bradshaw wrote:
> On Wed, Oct 12, 2016 at 8:30 AM, Andreas Cadhalpun <
> andreas.cadhal...@googlemail.com> wrote:
>>
>> Updated patch attached.
> 
> 
> New patch looks good to me (though I don't have push privileges so can't
> commit it).

I pushed it myself. Thanks for the review.

Best regards,
Andreas

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


Re: [FFmpeg-devel] [PATCH] fate: add test for firequalizer filter

2016-10-13 Thread Muhammad Faiz
On Thu, Oct 13, 2016 at 9:18 PM, Michael Niedermayer
 wrote:
> On Thu, Oct 13, 2016 at 08:53:30AM +0700, Muhammad Faiz wrote:
>> On Thu, Oct 13, 2016 at 8:19 AM, Michael Niedermayer
>>  wrote:
>> > On Thu, Oct 13, 2016 at 05:14:38AM +0700, Muhammad Faiz wrote:
>> >> Signed-off-by: Muhammad Faiz 
>> >> ---
>> >>  tests/fate/filter-audio.mak | 10 ++
>> >>  tests/filtergraphs/firequalizer | 27 +++
>> >>  2 files changed, 37 insertions(+)
>> >>  create mode 100644 tests/filtergraphs/firequalizer
>> >
>> > works on mingw liunx x86 32/64
>> > but fails on qemu arm
>> > TESTfilter-firequalizer
>> > stddev:0.68 PSNR: 99.68 MAXDIFF:1 bytes:  1058400/  1097208
>> > stddev: |0.68 - 0| >= 0.01
>> > Test filter-firequalizer failed. Look at 
>> > tests/data/fate/filter-firequalizer.err for details.
>> > make: *** [fate-filter-firequalizer] Error 1
>> >
>>
>> new patch with oneoff test
>> patch attached
>>
>> thx
>
>>  fate/filter-audio.mak |9 +
>>  filtergraphs/firequalizer |   27 +++
>>  2 files changed, 36 insertions(+)
>> c7cf3aec0f190b2c5e3eed28d9f5ce22cbbebcfa  
>> 0001-fate-add-test-for-firequalizer-filter.patch
>> From e25da07363c2126ac4642794f905678e95bf14a4 Mon Sep 17 00:00:00 2001
>> From: Muhammad Faiz 
>> Date: Thu, 13 Oct 2016 08:43:50 +0700
>> Subject: [PATCH] fate: add test for firequalizer filter
>
> works fine here
>
> LGTM
>
> please check fate.ffmpeg.org though a day or 2 after its pushed
> some clients might still have larger rounding differences
>
> thx

pushed

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


Re: [FFmpeg-devel] [PATCH] lavc/mpeg12dec.c: Read cc words field-wise, limit to cc_count and support extra field.

2016-10-13 Thread Michael Niedermayer
On Thu, Sep 15, 2016 at 11:49:58AM -0700, Jonathan Campbell wrote:
> I'm sorry if the previous posting was not recognized as a patch.
> 
> This updates the mpeg12dec.c DVD caption decoding to decode field-wise and 
> handle caption packets with an extra field. It obeys the cc_count field, 
> though still validates the count like the prior code.
> 
> I will start on a patch to mpeg12enc.c to encode A53 captions from the side 
> data.
> 
> Jonathan Campbell

>  mpeg12dec.c |   45 -
>  1 file changed, 32 insertions(+), 13 deletions(-)
> 77d60e69e6a08145f4f165c97456f92958d1d5e3  
> 0001-Read-cc-words-field-wise-limit-to-cc_count-and-suppo.patch
> From 8d64027573588a62728faebba55d67c00a3d4e3f Mon Sep 17 00:00:00 2001
> From: Jonathan Campbell 
> Date: Wed, 14 Sep 2016 10:57:04 -0700
> Subject: [PATCH] Read cc words field-wise, limit to cc_count and support extra
>  field.
> 
> This code validates the cc words the same as the prior code this
> replaced in case cc_count is too large. Field counting is used in case
> caption source does not use the LSB to signal even/odd field.
> ---
>  libavcodec/mpeg12dec.c | 45 -
>  1 file changed, 32 insertions(+), 13 deletions(-)

This patch basically rewrites the code and without any reference
I can compare it against its difficult to make heads or tails of this.
or said differently how do you know this is correct ?
or how can i verify that all this is correct ?

some testcases or specification references would be useful


> 
> diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
> index ca51c97..7c65f77 100644
> --- a/libavcodec/mpeg12dec.c
> +++ b/libavcodec/mpeg12dec.c
> @@ -2265,6 +2265,7 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
>  /* extract DVD CC data
>   *
>   * uint32_t   user_data_start_code0x01B2(big endian)
> + *  p[0] starts here -
>   * uint16_t   user_identifier 0x4343 "CC"
>   * uint8_tuser_data_type_code 0x01
>   * uint8_tcaption_block_size  0xF8
> @@ -2273,7 +2274,7 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
>   *   bit 6caption_filler  0
>   *   bit 5:1  caption_block_count number of caption blocks 
> (pairs of caption words = frames). Most DVDs use 15 per start of GOP.
>   *   bit 0caption_extra_field_added   1=one additional caption 
> word
> - *
> + *  p[5] starts here -
>   * struct caption_field_block {
>   *   uint8_t
>   * bit 7:1 caption_filler 0x7F (all 1s)
> @@ -2287,30 +2288,48 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
>   * Don't assume that the first caption word is the odd field. There 
> do exist MPEG files in the wild that start
>   * on the even field. There also exist DVDs in the wild that encode 
> an odd field count and the
>   * caption_extra_field_added/caption_odd_field_first bits change per 
> packet to allow that. */
> -int cc_count = 0;
> +int cc_count = 0; /* number of caption fields */

These are cosmetic changes, they belong in a seperate patch


> +int caption_block_count = p[4] & 0x3F; /* you can treat bits 5:0 as 
> number of fields */
>  int i;
> -// There is a caption count field in the data, but it is often
> -// incorrect.  So count the number of captions present.
> -for (i = 5; i + 6 <= buf_size && ((p[i] & 0xfe) == 0xfe); i += 6)
> +
> +for (i = 5; cc_count < caption_block_count && (i + 3) <= buf_size; i 
> += 3) {

you change the code from "scan till 0xFF/FE" to scan caption_block_count
why ?
Is there a reference or testcase ?



> +if ((p[i] & 0xfe) != 0xfe) {
> +av_log(avctx, AV_LOG_DEBUG, "cc_count is too large (%d > %d) 
> or junk data in DVD caption packet\n",caption_block_count,cc_count);

> +break;
> +}

ive the suspicioun this should not stop here but scan all, then again
thats off topic as it did this before


> +
>  cc_count++;
> +}
> +
>  // Transform the DVD format into A53 Part 4 format
>  if (cc_count > 0) {
>  av_freep(>a53_caption);
> -s1->a53_caption_size = cc_count * 6;
> +s1->a53_caption_size = cc_count * 3;
>  s1->a53_caption  = av_malloc(s1->a53_caption_size);
>  if (s1->a53_caption) {

> -uint8_t field1 = !!(p[4] & 0x80);
> +uint8_t field1 = (p[4] >> 7) & 1; /* caption_odd_field_first 
> */

belongs into cosmetic patch, also the &1 is uneeded


> +uint8_t pfield = 0xFF; /* DVDs that don't use the 
> caption_field_odd bit always seem to leave it on */
> 

[FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms.

2016-10-13 Thread liangsi
---
 libavformat/isom.h | 1 +
 libavformat/mov.c  | 5 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 2246fed..6824f7e 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -214,6 +214,7 @@ typedef struct MOVContext {
 int use_absolute_path;
 int ignore_editlist;
 int ignore_chapters;
+int ignore_moov_atom_in_free;
 int seek_individually;
 int64_t next_root_atom; ///< offset of the next root atom
 int export_all;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index a15c8d1..1d80c09 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4848,7 +4848,8 @@ static int mov_read_default(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 if (atom.size >= 8) {
 a.size = avio_rb32(pb);
 a.type = avio_rl32(pb);
-if (a.type == MKTAG('f','r','e','e') &&
+if (!c->ignore_moov_atom_in_free && 
+a.type == MKTAG('f','r','e','e') &&
 a.size >= 8 &&
 c->moov_retry) {
 uint8_t buf[8];
@@ -5926,6 +5927,8 @@ static const AVOption mov_options[] = {
 0, 1, FLAGS},
 {"ignore_chapters", "", OFFSET(ignore_chapters), AV_OPT_TYPE_BOOL, {.i64 = 
0},
 0, 1, FLAGS},
+{"ignore_moov_atom_in_free", "", OFFSET(ignore_moov_atom_in_free), 
AV_OPT_TYPE_BOOL, 
+{.i64 = 0}, 0, 1, FLAGS},
 {"use_mfra_for",
 "use mfra for fragment timestamps",
 OFFSET(use_mfra_for), AV_OPT_TYPE_INT, {.i64 = FF_MOV_FLAG_MFRA_AUTO},
-- 
2.8.0.rc3.226.g39d4020

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


Re: [FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms.

2016-10-13 Thread Hendrik Leppkes
Am 13.10.2016 19:03 schrieb "liangsi" :
>
> ---
>  libavformat/isom.h | 1 +
>  libavformat/mov.c  | 5 -
>  2 files changed, 5 insertions(+), 1 deletion(-)
>

Can you elaborate on the reasons of why someone would want this? Preferably
in the commit message for future consideration.

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


Re: [FFmpeg-devel] [PATCH] lavf: add ffprobe demuxer

2016-10-13 Thread Stefano Sabatini
On date Thursday 2016-09-29 21:55:11 +0200, wm4 encoded:
> On Thu, 29 Sep 2016 01:21:01 +0200
> Stefano Sabatini  wrote:
> 
> > On date Monday 2016-09-26 18:55:47 +0200, wm4 encoded:
> > > On Sun, 25 Sep 2016 19:32:37 +0200
> > > Stefano Sabatini  wrote:  
> > [...]
> > > > > > My use case: I need to build a data stream with scripting/manual
> > > > > > editing. Since I don't want to have to rely on a binary format 
> > > > > > (which
> > > > > > is not ideal for that use case) I needed a format simple enough to 
> > > > > > be
> > > > > > written and analysed without special tools, but with a simple text
> > > > > > editor.
> > > > > 
> > > > > I still don't get it. Your description makes me think of something 
> > > > > like
> > > > > EDL, but that doesn't seem to have anything to do with it.
> > > > 
> > > > EDL as "Edit Decision List"? No I don't think this is related at
> > > > all.
> > > > 
> > > > Suppose you want to inject a data stream, you have the data and you
> > > > know where to insert it given its PTS. With this muxer you can
> > > > handcraft a textual file in the ffprobe_default format and use ffmpeg
> > > > to inject the new data stream.  
> > >   
> > 
> > > What's a "data stream"?  
> > 
> > A stream consisting of generic data, that is a stream with type
> > AV_MEDIA_TYPE_DATA.
> > 
> > > Inject into what?  
> > 
> > Interleave the stream with other media streams (audio, video,
> > etc.). This can be done via remuxing (no need for transcoding).
> > 
> > > And why?  
> > 
> > Data stream could be used to insert custom information for
> > post-processing (e.g. they might contain advertising information).
> 
> This seems like a rather special use case. Why does it have a demuxer,
> and can't be in your own C code using libavcodec/libavformat?
> 

> In addition, I think using the ffprobe "format" is an overcomplication,
> and will justify adding even more stuff to the demuxer, until it's a
> similarily complex mess like the ffm demuxer/muxer.

I'm aware of the issue. OTOH I think the feature per-se is useful, at
least for the two mentioned use cases (debugging - especially if
coupled with a corresponding muxer), and data streams (generated by
script) injection, since it relies on a textual format easily
scriptable and editable by hand.

I thus leave the choice to the community. I guess this will require a
vote if we cannot find an agreement.

Latest patch in attachment with ffprobe demuxer disabled by default,
and extended documentation. (I'm also attaching the ff_get_line2 patch
which is used by this new patch).
-- 
FFmpeg = Fierce Frenzy Magnificient Plastic Explosive Gadget
>From 4e6a56ab7f59bc9811881c5020e005c3f2fb5b4c Mon Sep 17 00:00:00 2001
From: Stefano Sabatini 
Date: Thu, 13 Oct 2016 16:36:30 +0200
Subject: [PATCH] lavf/aviobuf: add ff_get_line2() variant

This allows to probe if the read line was partially discarded.
---
 libavformat/aviobuf.c  | 10 +-
 libavformat/internal.h | 14 ++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 134d627..28183b4 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -764,18 +764,26 @@ unsigned int avio_rb32(AVIOContext *s)
 
 int ff_get_line(AVIOContext *s, char *buf, int maxlen)
 {
-int i = 0;
+return ff_get_line2(s, buf, maxlen, NULL);
+}
+
+int ff_get_line2(AVIOContext *s, char *buf, int maxlen, int *readlen)
+{
+int i = 0, j = 0;
 char c;
 
 do {
 c = avio_r8(s);
 if (c && i < maxlen-1)
 buf[i++] = c;
+j++;
 } while (c != '\n' && c != '\r' && c);
 if (c == '\r' && avio_r8(s) != '\n' && !avio_feof(s))
 avio_skip(s, -1);
 
 buf[i] = 0;
+if (readlen)
+*readlen = j;
 return i;
 }
 
diff --git a/libavformat/internal.h b/libavformat/internal.h
index 49244fa..cffc787 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -274,6 +274,20 @@ void ff_put_v(AVIOContext *bc, uint64_t val);
  */
 int ff_get_line(AVIOContext *s, char *buf, int maxlen);
 
+/**
+ * Read a whole line of text from AVIOContext. Stop reading after reaching
+ * either a \\n, a \\0 or EOF. The returned string is always \\0-terminated,
+ * and may be truncated if the buffer is too small.
+ *
+ * @param s the read-only AVIOContext
+ * @param buf buffer to store the read line
+ * @param maxlen size of the buffer
+ * @param readlen length of the read line, including the terminating newline character
+ * @return the length of the string written in the buffer, not including the
+ * final \\0
+ */
+int ff_get_line2(AVIOContext *s, char *buf, int maxlen, int *readlen);
+
 #define SPACE_CHARS " \t\r\n"
 
 /**
-- 
1.9.1

>From 87243602a7a3775e4b2bf2c6f9f3afcd24fefdea Mon Sep 17 00:00:00 2001
From: Nicolas George 
Date: Sat, 11 Jan 2014 19:42:41 +0100
Subject: [PATCH] lavf: add ffprobe demuxer


Re: [FFmpeg-devel] [PATCH v2] avformat/matroskadec: workaround the field_order bug in the Matroska muxer

2016-10-13 Thread James Almer
On 10/13/2016 12:02 PM, Michael Niedermayer wrote:
> On Wed, Oct 12, 2016 at 09:20:06PM -0300, James Almer wrote:
>> Signed-off-by: James Almer 
>> ---
>> Now also checks for micro version.
> 
> LGTM
> 
> thx

Pushed.

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


[FFmpeg-devel] [PATCH] libavcodec/nvenc_hevc.c: Added missing option -temporal_aq

2016-10-13 Thread Sven C. Dack
The option is present in nvenc_h264.c, but was missing from nvenc_hevc.c. Please 
note that there is a bit of a mess going on in the options with regards to 
dashes and underlines. Is there a guideline available for this??


I've settled for "temporal_aq" with nvenc_hevc.c, because of the already 
existing option "spatial_aq". The same options for nvenc_h264.c do use dashes 
instead of underlines ("-spatial-aq" & "-temporal-aq"). Other options are called 
"-rc-lookahead" or "-vbr_2pass" for example, making this somewhat 
user-unfriendly to memorize.



 libavcodec/nvenc_hevc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
index 4edc741..d14e55f 100644
--- a/libavcodec/nvenc_hevc.c
+++ b/libavcodec/nvenc_hevc.c
@@ -91,6 +91,7 @@ static const AVOption options[] = {
 { "no-scenecut",  "When lookahead is enabled, set this to 1 to disable adaptive I-frame insertion at scene cuts",
 OFFSET(no_scenecut),  AV_OPT_TYPE_BOOL,  { .i64 = 0 }, 0, 1, VE },
 { "spatial_aq",   "set to 1 to enable Spatial AQ",  OFFSET(aq),   AV_OPT_TYPE_BOOL,  { .i64 = 0 }, 0, 1, VE },
+{ "temporal_aq",  "set to 1 to enable Temporal AQ", OFFSET(temporal_aq),  AV_OPT_TYPE_BOOL,  { .i64 = 0 }, 0,  1, VE },
 { "zerolatency",  "Set 1 to indicate zero latency operation (no reordering delay)",
 OFFSET(zerolatency),  AV_OPT_TYPE_BOOL,  { .i64 = 0 }, 0, 1, VE },
 { "nonref_p", "Set this to 1 to enable automatic insertion of non-reference P-frames",
-- 
2.9.3

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


Re: [FFmpeg-devel] [PATCH] libavcodec/mips/h264dsp_msa.c: fix type in some function parameters

2016-10-13 Thread Michael Niedermayer
On Wed, Oct 12, 2016 at 04:09:40PM +0100, Vicente Olivert Riera wrote:
> This fixes a build problem for MIPS architecture that looks like this:
> 
> libavcodec/mips/h264dsp_msa.c:2498:6: error: conflicting types for
> ‘ff_weight_h264_pixels16_8_msa’
>  void ff_weight_h264_pixels16_8_msa(uint8_t *src, int stride,
> 
> This bug was introduced by commit bc26fe89275c267d169b468356c82ee59874407d:
> 
>   avcodec/h264: Use ptrdiff_t for (bi)weight functions
> 
> That commit changed the data type of some function parameters in some
> function definitions. However, the implementation of those functions in
> libavcodec/mips/h264dsp_msa.c wasn't changed accordingly.
> 
> Signed-off-by: Vicente Olivert Riera 
> ---
>  libavcodec/mips/h264dsp_msa.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)

applied

thx

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

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.


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


[FFmpeg-devel] [PATCH] Improved selftest coverage for libavutil/fifo.c

2016-10-13 Thread Thomas Turner
Tested functions: av_fifo_generic_peek(), av_fifo_grow()
---
 libavutil/tests/fifo.c | 32 +++-
 tests/ref/fate/fifo| 43 +++
 2 files changed, 74 insertions(+), 1 deletion(-)

diff --git a/libavutil/tests/fifo.c b/libavutil/tests/fifo.c
index e4d7edf..4d598d3 100644
--- a/libavutil/tests/fifo.c
+++ b/libavutil/tests/fifo.c
@@ -24,7 +24,7 @@ int main(void)
 {
 /* create a FIFO buffer */
 AVFifoBuffer *fifo = av_fifo_alloc(13 * sizeof(int));
-int i, j, n;
+int i, j, n, *p;
 
 /* fill data */
 for (i = 0; av_fifo_space(fifo) >= sizeof(int); i++)
@@ -46,6 +46,19 @@ int main(void)
 }
 printf("\n");
 
+/* generic peek at FIFO */
+
+n = av_fifo_size(fifo);
+p = malloc(n);
+(void) av_fifo_generic_peek(fifo, p, n, NULL);
+
+/* read data at p */
+n /= sizeof(int);
+for(i = 0; i < n; ++i)
+printf("%d: %d\n", i, p[i]);
+
+putchar('\n');
+
 /* read data */
 for (i = 0; av_fifo_size(fifo) >= sizeof(int); i++) {
 av_fifo_generic_read(fifo, , sizeof(int), NULL);
@@ -67,8 +80,25 @@ int main(void)
 av_fifo_generic_peek_at(fifo, , i * sizeof(int), sizeof(j), NULL);
 printf("%d: %d\n", i, j);
 }
+putchar('\n');
+
+/* test fifo_grow */
+(void) av_fifo_grow(fifo, 15 * sizeof(int));
+
+/* fill data */
+n = av_fifo_size(fifo) / sizeof(int);
+for (i = n; av_fifo_space(fifo) >= sizeof(int); ++i)
+av_fifo_generic_write(fifo, , sizeof(int), NULL);
+
+/* peek_at at FIFO */
+n = av_fifo_size(fifo) / sizeof(int);
+for (i = 0; i < n; i++) {
+av_fifo_generic_peek_at(fifo, , i * sizeof(int), sizeof(j), NULL);
+printf("%d: %d\n", i, j);
+}
 
 av_fifo_free(fifo);
+free(p);
 
 return 0;
 }
diff --git a/tests/ref/fate/fifo b/tests/ref/fate/fifo
index 162d754..2b18ed5 100644
--- a/tests/ref/fate/fifo
+++ b/tests/ref/fate/fifo
@@ -38,6 +38,20 @@
 11: 11
 12: 12
 
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+10: 10
+11: 11
+12: 12
+
 0 1 2 3 4 5 6 7 8 9 10 11 12
 0: 0
 1: 1
@@ -52,3 +66,32 @@
 10: 10
 11: 11
 12: 12
+
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+10: 10
+11: 11
+12: 12
+13: 13
+14: 14
+15: 15
+16: 16
+17: 17
+18: 18
+19: 19
+20: 20
+21: 21
+22: 22
+23: 23
+24: 24
+25: 25
+26: 26
+27: 27
-- 
1.9.1

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


[FFmpeg-devel] [PATCH] mov: add option to ignore moov atoms which are detected in free atoms.

2016-10-13 Thread liangsi
---
 libavformat/isom.h | 1 +
 libavformat/mov.c  | 5 -
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 2246fed..6824f7e 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -214,6 +214,7 @@ typedef struct MOVContext {
 int use_absolute_path;
 int ignore_editlist;
 int ignore_chapters;
+int ignore_moov_atom_in_free;
 int seek_individually;
 int64_t next_root_atom; ///< offset of the next root atom
 int export_all;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index a15c8d1..1d80c09 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4848,7 +4848,8 @@ static int mov_read_default(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 if (atom.size >= 8) {
 a.size = avio_rb32(pb);
 a.type = avio_rl32(pb);
-if (a.type == MKTAG('f','r','e','e') &&
+if (!c->ignore_moov_atom_in_free && 
+a.type == MKTAG('f','r','e','e') &&
 a.size >= 8 &&
 c->moov_retry) {
 uint8_t buf[8];
@@ -5926,6 +5927,8 @@ static const AVOption mov_options[] = {
 0, 1, FLAGS},
 {"ignore_chapters", "", OFFSET(ignore_chapters), AV_OPT_TYPE_BOOL, {.i64 = 
0},
 0, 1, FLAGS},
+{"ignore_moov_atom_in_free", "", OFFSET(ignore_moov_atom_in_free), 
AV_OPT_TYPE_BOOL, 
+{.i64 = 0}, 0, 1, FLAGS},
 {"use_mfra_for",
 "use mfra for fragment timestamps",
 OFFSET(use_mfra_for), AV_OPT_TYPE_INT, {.i64 = FF_MOV_FLAG_MFRA_AUTO},
-- 
2.8.0.rc3.226.g39d4020

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


Re: [FFmpeg-devel] [PATCH] lavc/mpeg12dec.c: Read cc words field-wise, limit to cc_count and support extra field.

2016-10-13 Thread Jonathan Campbell
True.

It just occurred to me that VLC player probably is using it's own CC user 
packet reader.

However it still helps to read the user packet properly instead of counting by 
full frames. Also this code shows how to read cc_count properly. It's not 
incorrect by any means, it was just mis-interpreted by the original code.

The original code would return an extra 0x in the side data because of the 
way it counts the words, the extra 0x likely coming from the next start 
code following the CC packet. I'd rather the side data contain only the CC 
data, then downstream code has less filtering to worry about.

As a bonus the code will tell you at the debug log level if the number of 
caption words is wrong given the cc_count. If you're writing code to generate 
this packet it helps to have the library tell you your cc_count is wrong.

On 10/13/2016 02:50 AM, Carl Eugen Hoyos wrote:
> 2016-10-13 8:29 GMT+02:00 Jonathan Campbell :
>> I just realized this has been sitting in my inbox for awhile.
>>
>> Here's the clip in question.
>>
>> If you play it in VLC player with "Closed Captions 1" selected, you'll 
>> notice that some of the text in the captions is missing.
>>
>> https://www.dropbox.com/s/orrzn9vfcjmk7vb/bighero6.evenoddfieldcc.vob?dl=0
> 
> I tested the following command line with and without your patch:
> $ ffmpeg -f lavfi -i movie=bighero6.evenoddfieldcc.vob[out0+subcc] out.ass
> 
> Output is identical, what do I miss?
> 
> Thank you, Carl Eugen
> ___
> 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


Re: [FFmpeg-devel] [PATCH] avfilter/showcqt: add csp option

2016-10-13 Thread Michael Niedermayer
On Thu, Oct 13, 2016 at 06:05:19AM +0700, Muhammad Faiz wrote:
> from colorspace filter
> 
> Signed-off-by: Muhammad Faiz 
> ---
>  doc/filters.texi  | 26 ++
>  libavfilter/avf_showcqt.c | 56 
> ++-
>  libavfilter/avf_showcqt.h |  2 ++
>  3 files changed, 79 insertions(+), 5 deletions(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 76265e7..a79972b 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -16884,6 +16884,32 @@ Enable/disable drawing text to the axis. If it is 
> set to @code{0}, drawing to
>  the axis is disabled, ignoring @var{fontfile} and @var{axisfile} option.
>  Default value is @code{1}.
>  
> +@item csp
> +Set colorspace. The accepted values are:
> +@table @samp
> +@item unspecified
> +Unspecified (default)
> +
> +@item bt709
> +BT.709
> +
> +@item fcc
> +FCC
> +
> +@item bt470bg
> +BT.470BG or BT.601-6 625
> +
> +@item smpte170m
> +SMPTE-170M or BT.601-6 525
> +
> +@item smpte240m
> +SMPTE-240M
> +
> +@item bt2020ncl
> +BT.2020 with non-constant luminance
> +
> +@end table
> +
>  @end table
>  
>  @subsection Examples
> diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c
> index 16bb2be..7c76b1f 100644
> --- a/libavfilter/avf_showcqt.c
> +++ b/libavfilter/avf_showcqt.c
> @@ -83,6 +83,14 @@ static const AVOption showcqt_options[] = {
>  { "axisfile", "set axis image", OFFSET(axisfile),  
> AV_OPT_TYPE_STRING, { .str = NULL },  CHAR_MIN, CHAR_MAX, FLAGS },
>  { "axis",  "draw axis", OFFSET(axis),
> AV_OPT_TYPE_BOOL, { .i64 = 1 },0, 1,FLAGS },
>  { "text",  "draw axis", OFFSET(axis),
> AV_OPT_TYPE_BOOL, { .i64 = 1 },0, 1,FLAGS },
> +{ "csp", "set color space", OFFSET(csp),  
> AV_OPT_TYPE_INT, { .i64 = AVCOL_SPC_UNSPECIFIED }, 0, INT_MAX, FLAGS, "csp" },
> +{ "unspecified", "unspecified", 0,  
> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_UNSPECIFIED }, 0, 0, FLAGS, "csp" },
> +{ "bt709", "bt709", 0,  
> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_BT709 },   0, 0, FLAGS, "csp" },
> +{ "fcc", "fcc", 0,  
> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_FCC }, 0, 0, FLAGS, "csp" },
> +{ "bt470bg", "bt470bg", 0,  
> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_BT470BG }, 0, 0, FLAGS, "csp" },
> +{ "smpte170m", "smpte170m", 0,  
> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_SMPTE170M },   0, 0, FLAGS, "csp" },
> +{ "smpte240m", "smpte240m", 0,  
> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_SMPTE240M },   0, 0, FLAGS, "csp" },
> +{ "bt2020ncl", "bt2020ncl", 0,  
> AV_OPT_TYPE_CONST, { .i64 = AVCOL_SPC_BT2020_NCL },  0, 0, FLAGS, "csp" },
>  { NULL }
>  };
>  
> @@ -656,7 +664,7 @@ static void rgb_from_cqt(ColorFloat *c, const FFTComplex 
> *v, float g, int len)
>  }
>  }
>  
> -static void yuv_from_cqt(ColorFloat *c, const FFTComplex *v, float gamma, 
> int len)
> +static void yuv_from_cqt(ColorFloat *c, const FFTComplex *v, float gamma, 
> int len, float cm[3][3])
>  {
>  int x;
>  for (x = 0; x < len; x++) {
> @@ -664,9 +672,9 @@ static void yuv_from_cqt(ColorFloat *c, const FFTComplex 
> *v, float gamma, int le
>  r = calculate_gamma(FFMIN(1.0f, v[x].re), gamma);
>  g = calculate_gamma(FFMIN(1.0f, 0.5f * (v[x].re + v[x].im)), gamma);
>  b = calculate_gamma(FFMIN(1.0f, v[x].im), gamma);
> -c[x].yuv.y = 65.481f * r + 128.553f * g + 24.966f * b;
> -c[x].yuv.u = -37.797f * r - 74.203f * g + 112.0f * b;
> -c[x].yuv.v = 112.0f * r - 93.786f * g - 18.214 * b;
> +c[x].yuv.y = cm[0][0] * r + cm[0][1] * g + cm[0][2] * b;
> +c[x].yuv.u = cm[1][0] * r + cm[1][1] * g + cm[1][2] * b;
> +c[x].yuv.v = cm[2][0] * r + cm[2][1] * g + cm[2][2] * b;
>  }
>  }
>  
> @@ -1036,7 +1044,7 @@ static void process_cqt(ShowCQTContext *s)
>  if (s->format == AV_PIX_FMT_RGB24)
>  rgb_from_cqt(s->c_buf, s->cqt_result, s->sono_g, s->width);
>  else
> -yuv_from_cqt(s->c_buf, s->cqt_result, s->sono_g, s->width);
> +yuv_from_cqt(s->c_buf, s->cqt_result, s->sono_g, s->width, 
> s->cmatrix);
>  }
>  
>  static int plot_cqt(AVFilterContext *ctx, AVFrame **frameout)
> @@ -1075,6 +1083,7 @@ static int plot_cqt(AVFilterContext *ctx, AVFrame 
> **frameout)
>  return AVERROR(ENOMEM);
>  out->sample_aspect_ratio = av_make_q(1, 1);
>  av_frame_set_color_range(out, AVCOL_RANGE_MPEG);
> +av_frame_set_colorspace(out, s->csp);
>  UPDATE_TIME(s->alloc_time);
>  
>  if (s->bar_h) {

> @@ -1100,6 +1109,41 @@ static int plot_cqt(AVFilterContext *ctx, AVFrame 
**frameout)
>  return 0;
>  }
>  
> +static void 

Re: [FFmpeg-devel] [PATCH] avcodec/libx264: fix forced_idr logic

2016-10-13 Thread Michael Niedermayer
On Wed, Oct 12, 2016 at 09:57:16PM +0200, Timo Rothenpieler wrote:
> Currently, it forces IDR frames for both true and false.
> Not entirely sure what the original idea behind the tri-state bool
> option is.
> ---
>  libavcodec/libx264.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

there is X264_TYPE_IDR, X264_TYPE_KEYFRAME and X264_TYPE_I

so there are 3 possibilities, no idea if that was the original idea


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

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle


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


Re: [FFmpeg-devel] [PATCH 2/4] lavc: add vp8/vp9 mediacodec decoders

2016-10-13 Thread Matthieu Bouron
On Wed, Oct 12, 2016 at 8:09 PM, James Zern 
wrote:

> On Wed, Oct 12, 2016 at 6:22 AM, Matthieu Bouron <
> matthieu.bou...@gmail.com>
> wrote:
>
> > From: Matthieu Bouron 
> >
> > ---
> >  configure|  4 +++
> >  libavcodec/Makefile  |  2 ++
> >  libavcodec/allcodecs.c   |  4 +++
> >  libavcodec/mediacodecdec.c   | 14 
> >  libavcodec/mediacodecdec_h2645.c | 73 ++
> > +-
> >  libavcodec/version.h |  2 +-
> >  6 files changed, 97 insertions(+), 2 deletions(-)
> >
> >
> Exoplayer [1] and probably others have some blacklists for vp8/9, not sure
> if you want to pick them up here.
>
> [1]
> https://github.com/google/ExoPlayer/blob/7d991cef305e95cae5cd2a9feadf4a
> f8858b284b/library/src/main/java/com/google/android/exoplayer2/mediacodec/
> MediaCodecUtil.java#L214


Thanks for the reference. This is something I will add in a separate patch
I think.

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


Re: [FFmpeg-devel] [PATCH v2] avformat/matroskadec: workaround the field_order bug in the Matroska muxer

2016-10-13 Thread Michael Niedermayer
On Wed, Oct 12, 2016 at 09:20:06PM -0300, James Almer wrote:
> Signed-off-by: James Almer 
> ---
> Now also checks for micro version.

LGTM

thx

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

Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.


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


Re: [FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts

2016-10-13 Thread Ståle Kristoffersen
On 2016-10-12 at 13:57, Carl Eugen Hoyos wrote:
> 2016-10-11 16:27 GMT+02:00 Michael Niedermayer :
> 
> > also the img2 demuxer for mjpeg2000 from img2dec.c does not work
> > for this ?
> 
> We separated the jpg from the mjpeg probe, jpg makes sure that the
> sample starts like a jpg image and contains an end marker and can
> be decoded, mjpeg probe is less strict but requires more than one
> frame.
> Same could be argued for j2k or was our reasoning bad?

Since nobody chimed in on this, I have created two new patches, one
containing a separate mjpeg 2000 probe
(0001-libavf-Auto-detect-mjpeg-2000-in-mpeg-ts2.patch), and one that
incorporates it into the img2dec jpeg 2000 probe
(0001-libavf-Make-jpeg-2000-probe-work-for-mjpeg-2000.patch).

I think it is best to have them separated, as that matches the mjpeg
behaviour.

-- 
Ståle Kristoffersen
>From 21b7c5850ce2bd9198b61557ba657ad66288b17a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A5le=20Kristoffersen?= 
Date: Tue, 11 Oct 2016 15:36:40 +0200
Subject: [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This makes it possible to decode motion jpeg 2000
encoded in a transport stream without a correct PMT/PAT.

Signed-off-by: Ståle Kristoffersen 
---
 libavformat/Makefile |  1 +
 libavformat/allformats.c |  1 +
 libavformat/mj2kdec.c| 55 
 libavformat/utils.c  |  1 +
 libavformat/version.h|  4 ++--
 5 files changed, 60 insertions(+), 2 deletions(-)
 create mode 100644 libavformat/mj2kdec.c

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 5d827d31..4020b8d 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -273,6 +273,7 @@ OBJS-$(CONFIG_MD5_MUXER) += hashenc.o
 OBJS-$(CONFIG_MGSTS_DEMUXER) += mgsts.o
 OBJS-$(CONFIG_MICRODVD_DEMUXER)  += microdvddec.o subtitles.o
 OBJS-$(CONFIG_MICRODVD_MUXER)+= microdvdenc.o
+OBJS-$(CONFIG_MJPEG_2000_DEMUXER)+= rawdec.o mj2kdec.o
 OBJS-$(CONFIG_MJPEG_DEMUXER) += rawdec.o
 OBJS-$(CONFIG_MJPEG_MUXER)   += rawenc.o
 OBJS-$(CONFIG_MLP_DEMUXER)   += rawdec.o mlpdec.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 6a216ef..7db6c52 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -183,6 +183,7 @@ void av_register_all(void)
 REGISTER_DEMUXER (MGSTS,mgsts);
 REGISTER_MUXDEMUX(MICRODVD, microdvd);
 REGISTER_MUXDEMUX(MJPEG,mjpeg);
+REGISTER_DEMUXER (MJPEG_2000,   mjpeg_2000);
 REGISTER_MUXDEMUX(MLP,  mlp);
 REGISTER_DEMUXER (MLV,  mlv);
 REGISTER_DEMUXER (MM,   mm);
diff --git a/libavformat/mj2kdec.c b/libavformat/mj2kdec.c
new file mode 100644
index 000..50f0e33
--- /dev/null
+++ b/libavformat/mj2kdec.c
@@ -0,0 +1,55 @@
+/*
+ * MJPEG 2000 Demuxer
+ * Copyright (c) 2016 Ståle Kristoffersen
+ *
+ * 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/intreadwrite.h"
+#include "avformat.h"
+#include "rawdec.h"
+
+#if CONFIG_MJPEG_2000_DEMUXER
+static int mjpeg2000_probe(AVProbeData *p)
+{
+const uint8_t *b = p->buf;
+int i, marker, marker_size;
+int frames = 0, invalid = 0;
+
+for (i = 0; i < p->buf_size - 5; i++) {
+if (AV_RB32(b) == 0xff4fff51){
+marker_size = AV_RB16(b+4);
+if (marker_size + i < p->buf_size - 4) {
+marker = AV_RB8(b+4+marker_size);
+if (marker == 0xff)
+frames++;
+else
+invalid++;
+}
+}
+b += 1;
+}
+if (invalid*4 + 1 < frames) {
+if (invalid == 0 && frames > 2)
+return AVPROBE_SCORE_EXTENSION / 2;
+return AVPROBE_SCORE_EXTENSION / 4;
+}
+return 0;
+}
+FF_DEF_RAWVIDEO_DEMUXER2(mjpeg_2000, "raw MJPEG 2000 video", mjpeg2000_probe, "j2k", AV_CODEC_ID_JPEG2000, AVFMT_GENERIC_INDEX|AVFMT_NOTIMESTAMPS)
+#endif
+
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 8a51aea..9e9a052 100644
--- 

Re: [FFmpeg-devel] [PATCH] fate: add test for firequalizer filter

2016-10-13 Thread Michael Niedermayer
On Thu, Oct 13, 2016 at 08:53:30AM +0700, Muhammad Faiz wrote:
> On Thu, Oct 13, 2016 at 8:19 AM, Michael Niedermayer
>  wrote:
> > On Thu, Oct 13, 2016 at 05:14:38AM +0700, Muhammad Faiz wrote:
> >> Signed-off-by: Muhammad Faiz 
> >> ---
> >>  tests/fate/filter-audio.mak | 10 ++
> >>  tests/filtergraphs/firequalizer | 27 +++
> >>  2 files changed, 37 insertions(+)
> >>  create mode 100644 tests/filtergraphs/firequalizer
> >
> > works on mingw liunx x86 32/64
> > but fails on qemu arm
> > TESTfilter-firequalizer
> > stddev:0.68 PSNR: 99.68 MAXDIFF:1 bytes:  1058400/  1097208
> > stddev: |0.68 - 0| >= 0.01
> > Test filter-firequalizer failed. Look at 
> > tests/data/fate/filter-firequalizer.err for details.
> > make: *** [fate-filter-firequalizer] Error 1
> >
> 
> new patch with oneoff test
> patch attached
> 
> thx

>  fate/filter-audio.mak |9 +
>  filtergraphs/firequalizer |   27 +++
>  2 files changed, 36 insertions(+)
> c7cf3aec0f190b2c5e3eed28d9f5ce22cbbebcfa  
> 0001-fate-add-test-for-firequalizer-filter.patch
> From e25da07363c2126ac4642794f905678e95bf14a4 Mon Sep 17 00:00:00 2001
> From: Muhammad Faiz 
> Date: Thu, 13 Oct 2016 08:43:50 +0700
> Subject: [PATCH] fate: add test for firequalizer filter

works fine here

LGTM

please check fate.ffmpeg.org though a day or 2 after its pushed
some clients might still have larger rounding differences

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange


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


Re: [FFmpeg-devel] [PATCH] add hds demuxer

2016-10-13 Thread Steven Liu
2016-10-13 17:41 GMT+08:00 Carl Eugen Hoyos :

> 2016-10-13 8:51 GMT+02:00 Steven Liu :
> > patch update.
> >
> > xml2 disabled by default
>
> Before reading Nicolas' mail, I wanted to suggest that you fix
> autodetection instead...
>
> Carl Eugen
>

Hi Carl,

  I need your help,
  I have search all the history mail, keywords 'autodetection' , i saw
your patch have autodetection context is like this:

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 5d827d3..e2b4dd4 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -202,6 +202,7 @@ OBJS-$(CONFIG_H264_DEMUXER)  += h264dec.o
rawdec.o
 OBJS-$(CONFIG_H264_MUXER)+= rawenc.o
 OBJS-$(CONFIG_HASH_MUXER)+= hashenc.o
 OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
+OBJS-$(CONFIG_HDS_DEMUXER)   += hdsdec.o amfmetadata.o
f4mmanifest.o f4fbox.o flvtag.o
 OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
 OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o
 OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 6a216ef..39505c3 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -146,9 +146,9 @@ void av_register_all(void)
 REGISTER_MUXDEMUX(H263, h263);
 REGISTER_MUXDEMUX(H264, h264);
 REGISTER_MUXER   (HASH, hash);
-REGISTER_MUXER   (HDS,  hds);
 REGISTER_MUXDEMUX(HEVC, hevc);
 REGISTER_MUXDEMUX(HLS,  hls);
+REGISTER_MUXDEMUX(HDS,  hds);
 REGISTER_DEMUXER (HNM,  hnm);
 REGISTER_MUXDEMUX(ICO,  ico);
 REGISTER_DEMUXER (IDCIN,idcin);


Is this right? Or can you give me a doc link to learn this.

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


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-13 Thread Steven Liu
ping

2016-10-12 14:21 GMT+08:00 Steven Liu :

>
> Signed-off-by: Steven Liu 
> ---
>  doc/protocols.texi|3 +++
>  libavformat/udp.c |   19 ++-
>  libavformat/version.h |3 +++
>  3 files changed, 24 insertions(+), 1 deletions(-)
>
> diff --git a/doc/protocols.texi b/doc/protocols.texi
> index 3abc5f3..85a3f56 100644
> --- a/doc/protocols.texi
> +++ b/doc/protocols.texi
> @@ -1304,6 +1304,9 @@ input has enough packets to sustain it.
>  When using @var{bitrate} this specifies the maximum number of bits in
>  packet bursts.
>
> +@item local_port=@var{port}
> +This is a deprecated option, you can use localport instead it.
> +
>  @item localport=@var{port}
>  Override the local UDP port to bind with.
>
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 3835f98..af06b89 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -86,6 +86,9 @@ typedef struct UDPContext {
>  int pkt_size;
>  int is_multicast;
>  int is_broadcast;
> +#if FF_API_UDP_LOCAL_PORT
> +int local_port_deprecated;
> +#endif
>  int local_port;
>  int reuse_socket;
>  int overrun_nonfatal;
> @@ -123,7 +126,9 @@ static const AVOption options[] = {
>  { "bitrate","Bits to send per second",
>  OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "burst_bits", "Max length of bursts in bits (when using
> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "localport",  "Local port",
>   OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, D|E },
> -{ "local_port", "Local port",
>   OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, .flags = D|E },
> +#if FF_API_UDP_LOCAL_PORT
> +{ "local_port", "Local port",
>   OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },
> -1, INT_MAX, .flags = D|E },
> +#endif
>  { "localaddr",  "Local address",
>  OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
>  .flags = D|E },
>  { "udplite_coverage", "choose UDPLite head size which should be
> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
> 0}, 0, INT_MAX, D|E },
>  { "pkt_size",   "Maximum UDP packet size",
>  OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1, INT_MAX,
> .flags = D|E },
> @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
> sockaddr_storage *addr,
>
>  if (((struct sockaddr *) >dest_addr)->sa_family)
>  family = ((struct sockaddr *) >dest_addr)->sa_family;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr :
> NULL,
>  s->local_port,
>  SOCK_DGRAM, family, AI_PASSIVE);
> @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char
> *uri)
>  int ff_udp_get_local_port(URLContext *h)
>  {
>  UDPContext *s = h->priv_data;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  return s->local_port;
>  }
>
> diff --git a/libavformat/version.h b/libavformat/version.h
> index 92801b4..71c03ef 100644
> --- a/libavformat/version.h
> +++ b/libavformat/version.h
> @@ -85,6 +85,9 @@
>  #ifndef FF_API_HTTP_USER_AGENT
>  #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
>  #endif
> +#ifndef FF_API_UDP_LOCAL_PORT
> +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 59)
> +#endif
>
>  #ifndef FF_API_R_FRAME_RATE
>  #define FF_API_R_FRAME_RATE1
> --
> 1.7.1
>
>
>
> ___
> 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


Re: [FFmpeg-devel] [PATCH] avcodec/vda: define av_vda_default_init2 when CONFIG_H264_VDA_HWACCEL equ 0

2016-10-13 Thread Steven Liu
ping

2016-10-12 17:36 GMT+08:00 Steven Liu :

> on OSX:
> ../configure --disable-everything --enable-demuxer=hls make
> error message: Undefined symbols for architecture x86_64:
> "_av_vda_default_init2", referenced from:_videotoolbox_init in
> ffmpeg_videotoolbox.o
> so add av_vda_default_init2 when CONFIG_H264_VDA_HWACCEL=0
>
> Signed-off-by: Steven Liu 
> ---
>  libavcodec/vda.c |5 +
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/libavcodec/vda.c b/libavcodec/vda.c
> index 4670140..819ae03 100644
> --- a/libavcodec/vda.c
> +++ b/libavcodec/vda.c
> @@ -73,6 +73,11 @@ int av_vda_default_init(AVCodecContext *avctx)
>  return AVERROR(ENOSYS);
>  }
>
> +int av_vda_default_init2(AVCodecContext *avctx, AVVDAContext *vdactx)
> +{
> +return AVERROR(ENOSYS);
> +}
> +
>  void av_vda_default_free(AVCodecContext *ctx)
>  {
>  }
> --
> 1.7.1
>
>
>
> ___
> 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


Re: [FFmpeg-devel] [PATCH] add hds demuxer

2016-10-13 Thread Michael Niedermayer
On Thu, Oct 13, 2016 at 02:49:57PM +0800, Steven Liu wrote:
> init add hds demuxer
> 
> Based-on: patch by CORY MCCARTHY 
> Based-on: patch by Gorilla Maguila 
> Signed-off-by: Steven Liu 
> ---
>  configure |4 +
>  libavformat/Makefile  |1 +
>  libavformat/allformats.c  |2 +-
>  libavformat/amfmetadata.c |  219 +
>  libavformat/amfmetadata.h |   39 +++
>  libavformat/f4fbox.c  |  381 +++
>  libavformat/f4fbox.h  |   95 ++
>  libavformat/f4mmanifest.c |  324 +++
>  libavformat/f4mmanifest.h |   59 
>  libavformat/flvtag.c  |  370 ++
>  libavformat/flvtag.h  |   32 ++
>  libavformat/hdsdec.c  |  759 
> +
>  12 files changed, 2284 insertions(+), 1 deletions(-)
>  create mode 100644 libavformat/amfmetadata.c
>  create mode 100644 libavformat/amfmetadata.h
>  create mode 100644 libavformat/f4fbox.c
>  create mode 100644 libavformat/f4fbox.h
>  create mode 100644 libavformat/f4mmanifest.c
>  create mode 100644 libavformat/f4mmanifest.h
>  create mode 100644 libavformat/flvtag.c
>  create mode 100644 libavformat/flvtag.h
>  create mode 100644 libavformat/hdsdec.c

fails build here: (linux x86-64)

make distclean ; ./configure && make -j12
...
libavformat/f4mmanifest.c:22:27: fatal error: libxml/parser.h: No such file or 
directory
compilation terminated.
make: *** [libavformat/f4mmanifest.o] Error 1
make: *** Waiting for unfinished jobs


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

Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.


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


Re: [FFmpeg-devel] [PATCH] lavc/mpeg12dec.c: Read cc words field-wise, limit to cc_count and support extra field.

2016-10-13 Thread Carl Eugen Hoyos
2016-10-13 8:29 GMT+02:00 Jonathan Campbell :
> I just realized this has been sitting in my inbox for awhile.
>
> Here's the clip in question.
>
> If you play it in VLC player with "Closed Captions 1" selected, you'll notice 
> that some of the text in the captions is missing.
>
> https://www.dropbox.com/s/orrzn9vfcjmk7vb/bighero6.evenoddfieldcc.vob?dl=0

I tested the following command line with and without your patch:
$ ffmpeg -f lavfi -i movie=bighero6.evenoddfieldcc.vob[out0+subcc] out.ass

Output is identical, what do I miss?

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


Re: [FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts

2016-10-13 Thread Ståle Kristoffersen
On 2016-10-12 at 23:05, Carl Eugen Hoyos wrote:


> Perhaps you can provide ffmpeg -i output for a file with PMT and PAT
> if you cannot share a sample?

Okay, here are three samples i have:

$ ffmpeg -i sample1.ts 
ffmpeg version N-80172-g79b6c9a Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: 
  libavutil  55. 24.100 / 55. 24.100
  libavcodec 57. 44.100 / 57. 44.100
  libavformat57. 37.101 / 57. 37.101
  libavdevice57.  0.101 / 57.  0.101
  libavfilter 6. 46.100 /  6. 46.100
  libswscale  4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
[mpegts @ 0x306c2a0] PES packet size mismatch
Last message repeated 1 times
Input #0, mpegts, from 'sample1.ts':
  Duration: 00:00:05.21, start: 16724.490189, bitrate: 153721 kb/s
  Program 1 
Stream #0:0[0x40]: Video: jpeg2000 ([33][0][0][0] / 0x0021), yuv422p10le, 
1920x540, 29.97 fps, 29.97 tbr, 90k tbn
Stream #0:1[0x41]: Audio: s302m (BSSD / 0x44535342), 48000 Hz, stereo, s32 
(20 bit), 2304 kb/s
Stream #0:2[0x42]: Audio: s302m (BSSD / 0x44535342), 48000 Hz, stereo, s32 
(20 bit), 2304 kb/s
At least one output file must be specified

$ ffmpeg -i sample2.ts 
ffmpeg version N-80172-g79b6c9a Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: 
  libavutil  55. 24.100 / 55. 24.100
  libavcodec 57. 44.100 / 57. 44.100
  libavformat57. 37.101 / 57. 37.101
  libavdevice57.  0.101 / 57.  0.101
  libavfilter 6. 46.100 /  6. 46.100
  libswscale  4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
[mpegts @ 0x29d72a0] Stream #0: not enough frames to estimate rate; consider 
increasing probesize
[mpegts @ 0x29d72a0] start time for stream 0 is not set in 
estimate_timings_from_pts
[mpegts @ 0x29d72a0] PES packet size mismatch
Last message repeated 7 times
[mpegts @ 0x29d72a0] Could not find codec parameters for stream 0 (Video: 
jpeg2000 ([33][0][0][0] / 0x0021), none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'sample2.ts':
  Duration: 00:00:08.00, start: 71738.433044, bitrate: 100054 kb/s
  Program 1 
Stream #0:0[0x5f]: Video: jpeg2000 ([33][0][0][0] / 0x0021), none, 90k tbr, 
90k tbn
Stream #0:1[0xc8](ENG): Audio: s302m (BSSD / 0x44535342), 48000 Hz, stereo, 
s32 (24 bit), 2696 kb/s
Stream #0:2[0xc9](ENG): Audio: s302m (BSSD / 0x44535342), 48000 Hz, stereo, 
s32 (24 bit), 2696 kb/s
Stream #0:3[0xca](ENG): Audio: s302m (BSSD / 0x44535342), 48000 Hz, stereo, 
s32 (24 bit), 2696 kb/s
Stream #0:4[0xcb](ENG): Audio: s302m (BSSD / 0x44535342), 48000 Hz, stereo, 
s32 (24 bit), 2696 kb/s
At least one output file must be specified

$ ffmpeg -i sample3.ts 
ffmpeg version N-80172-g79b6c9a Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: 
  libavutil  55. 24.100 / 55. 24.100
  libavcodec 57. 44.100 / 57. 44.100
  libavformat57. 37.101 / 57. 37.101
  libavdevice57.  0.101 / 57.  0.101
  libavfilter 6. 46.100 /  6. 46.100
  libswscale  4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
[jpeg2000 @ 0x2ce3dc0] Psot 285327 too big
[jpeg2000 @ 0x2ce3dc0] error during processing marker segment ff90
[s302m @ 0x2ce4f80] frame has invalid header
Input #0, mpegts, from 'sample3.ts':
  Duration: 00:00:03.64, start: 13435.189700, bitrate: 219998 kb/s
  Program 1 
Stream #0:0[0x40]: Video: jpeg2000 (JPEG 2000 codestream restriction 0) 
([33][0][0][0] / 0x0021), yuv422p10le, 1920x540, 29.97 fps, 29.97 tbr, 90k tbn
Stream #0:1[0x41]: Audio: s302m (BSSD / 0x44535342), 48000 Hz, quad, s32 
(24 bit), 5376 kb/s
Stream #0:2[0x48]: Data: bin_data (VANC / 0x434E4156)
At least one output file must be specified


-- 
Ståle Kristoffersen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] add hds demuxer

2016-10-13 Thread Carl Eugen Hoyos
2016-10-13 8:51 GMT+02:00 Steven Liu :
> patch update.
>
> xml2 disabled by default

Before reading Nicolas' mail, I wanted to suggest that you fix
autodetection instead...

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


Re: [FFmpeg-devel] [PATCH] add hds demuxer

2016-10-13 Thread Steven Liu
2016-10-13 17:27 GMT+08:00 Nicolas George :

> Le duodi 22 vendémiaire, an CCXXV, Steven Liu a écrit :
> > init add hds demuxer
> >
> > Based-on: patch by CORY MCCARTHY 
> > Based-on: patch by Gorilla Maguila 
> > Signed-off-by: Steven Liu 
>
> Thanks for the update.
>
> I think I already said it when it was first submitted: I am not really
> happy
> about the use of libxml2. I remember a time when libxml2 was a "security
> advisory of the week" kind of library, and looking at the changelog, it
> does
> not seem to have progressed a lot since.
>
> To be fair, implementing a full-featured XML parser is very hard work and
> time-consuming.
>
> But really, almost nobody needs that, and especially not FFmpeg. What we
> need is a parser capable of reading elements, attributes, text in three
> standard encodings, and that is all. Implementing this should be reasonably
> short work for a decent developer.
>
> Of course, since I can not volunteer to do it myself soon, I will not
> consider it grounds for rejecting the patch. But please consider it. If
> libxml2 is enabled by default, that makes it a security concern; if it is
> not, that gives this code much less usefulness and testing.
>
> Regards,
>
> --
>   Nicolas George
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
Hi Nicolas George,


  I cannot sure if i misunderstand your mean. But i think your suggest
is very useful, maybe this can do at TODO.  Is your mean i need add a
simple parser for f4m manifest?

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


Re: [FFmpeg-devel] [PATCH] lavfi/pan: allow negative gain parameters also for other inputs than the first named

2016-10-13 Thread Nicolas George
Le decadi 20 vendémiaire, an CCXXV, Moritz Barsnick a écrit :
> Expands the parser to also accept the separator '-' in addition to
> '+', and take the negative sign into consideration.
> 
> Signed-off-by: Moritz Barsnick 
> ---
>  doc/filters.texi |  2 +-
>  libavfilter/af_pan.c | 11 ---
>  2 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 4b2f7bf..fb4756e 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -3001,7 +3001,7 @@ output channel layout or number of channels
>  
>  @item outdef
>  output channel specification, of the form:
> -"@var{out_name}=[@var{gain}*]@var{in_name}[+[@var{gain}*]@var{in_name}...]"
> +"@var{out_name}=[@var{gain}*]@var{in_name}[(+-)[@var{gain}*]@var{in_name}...]"
>  
>  @item out_name
>  output channel to define, either a channel name (FL, FR, etc.) or a channel
> diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c
> index fbd79a5..161097a 100644
> --- a/libavfilter/af_pan.c
> +++ b/libavfilter/af_pan.c
> @@ -102,7 +102,7 @@ static av_cold int init(AVFilterContext *ctx)
>  {
>  PanContext *const pan = ctx->priv;
>  char *arg, *arg0, *tokenizer, *args = av_strdup(pan->args);
> -int out_ch_id, in_ch_id, len, named, ret;
> +int out_ch_id, in_ch_id, len, named, ret, sign = 1;
>  int nb_in_channels[2] = { 0, 0 }; // number of unnamed and named input 
> channels
>  double gain;
>  
> @@ -178,15 +178,20 @@ static av_cold int init(AVFilterContext *ctx)
>  ret = AVERROR(EINVAL);
>  goto fail;
>  }
> -pan->gain[out_ch_id][in_ch_id] = gain;
> +pan->gain[out_ch_id][in_ch_id] = sign * gain;
>  skip_spaces();
>  if (!*arg)
>  break;
> -if (*arg != '+') {
> +if (*arg == '-') {
> +sign = -1;
> +} else if (*arg != '+') {
>  av_log(ctx, AV_LOG_ERROR, "Syntax error near \"%.8s\"\n", 
> arg);
>  ret = AVERROR(EINVAL);
>  goto fail;

>  }
> +else {

Nit: inconsistent placement of the else clause. Not blocking.

> +sign = 1;
> +}
>  arg++;
>  }
>  }

I would have put the "sign = 1" unconditionally before the test for the
delimiter, but this version works too, so LGTM.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] add hds demuxer

2016-10-13 Thread Nicolas George
Le duodi 22 vendémiaire, an CCXXV, Steven Liu a écrit :
> init add hds demuxer
> 
> Based-on: patch by CORY MCCARTHY 
> Based-on: patch by Gorilla Maguila 
> Signed-off-by: Steven Liu 

Thanks for the update.

I think I already said it when it was first submitted: I am not really happy
about the use of libxml2. I remember a time when libxml2 was a "security
advisory of the week" kind of library, and looking at the changelog, it does
not seem to have progressed a lot since.

To be fair, implementing a full-featured XML parser is very hard work and
time-consuming.

But really, almost nobody needs that, and especially not FFmpeg. What we
need is a parser capable of reading elements, attributes, text in three
standard encodings, and that is all. Implementing this should be reasonably
short work for a decent developer.

Of course, since I can not volunteer to do it myself soon, I will not
consider it grounds for rejecting the patch. But please consider it. If
libxml2 is enabled by default, that makes it a security concern; if it is
not, that gives this code much less usefulness and testing.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] add hds demuxer

2016-10-13 Thread Steven Liu
patch update.

xml2 disabled by default


test passed:

../configure --cc='ccache x86_64-w64-mingw32-gcc'   --arch=x86_64
--target-os=mingw32 --cross-prefix=x86_64-w64-mingw32- --disable-yasm

2016-10-13 14:49 GMT+08:00 Steven Liu :

> init add hds demuxer
>
> Based-on: patch by CORY MCCARTHY 
> Based-on: patch by Gorilla Maguila 
> Signed-off-by: Steven Liu 
> ---
>  configure |4 +
>  libavformat/Makefile  |1 +
>  libavformat/allformats.c  |2 +-
>  libavformat/amfmetadata.c |  219 +
>  libavformat/amfmetadata.h |   39 +++
>  libavformat/f4fbox.c  |  381 +++
>  libavformat/f4fbox.h  |   95 ++
>  libavformat/f4mmanifest.c |  324 +++
>  libavformat/f4mmanifest.h |   59 
>  libavformat/flvtag.c  |  370 ++
>  libavformat/flvtag.h  |   32 ++
>  libavformat/hdsdec.c  |  759 ++
> +++
>  12 files changed, 2284 insertions(+), 1 deletions(-)
>  create mode 100644 libavformat/amfmetadata.c
>  create mode 100644 libavformat/amfmetadata.h
>  create mode 100644 libavformat/f4fbox.c
>  create mode 100644 libavformat/f4fbox.h
>  create mode 100644 libavformat/f4mmanifest.c
>  create mode 100644 libavformat/f4mmanifest.h
>  create mode 100644 libavformat/flvtag.c
>  create mode 100644 libavformat/flvtag.h
>  create mode 100644 libavformat/hdsdec.c
>
> diff --git a/configure b/configure
> index 8d9b21b..9f844ea 100755
> --- a/configure
> +++ b/configure
> @@ -295,6 +295,7 @@ External library support:
> on OSX if openssl and gnutls are not used
> [autodetect]
>--enable-x11grab enable X11 grabbing (legacy) [no]
>--disable-xlib   disable xlib [autodetect]
> +  --disable-xml2   disable XML parsing using the C library
> libxml2 [autodetect]
>--disable-zlib   disable zlib [autodetect]
>
>The following libraries provide various hardware acceleration features:
> @@ -1552,6 +1553,7 @@ EXTERNAL_LIBRARY_LIST="
>  videotoolbox
>  x11grab
>  xlib
> +xml2
>  zlib
>  "
>
> @@ -2854,6 +2856,7 @@ eac3_demuxer_select="ac3_parser"
>  f4v_muxer_select="mov_muxer"
>  fifo_muxer_deps="threads"
>  flac_demuxer_select="flac_parser"
> +hds_demuxer_select="xml2"
>  hds_muxer_select="flv_muxer"
>  hls_muxer_select="mpegts_muxer"
>  image2_alias_pix_demuxer_select="image2_demuxer"
> @@ -5675,6 +5678,7 @@ enabled jni   && { [ $target_os =
> "android" ] && check_header jni.h
> check_lib2 "dlfcn.h" dlopen -ldl; }
>  enabled ladspa&& { check_header ladspa.h || die "ERROR:
> ladspa.h header not found"; }
>  enabled libiec61883   && require libiec61883 libiec61883/iec61883.h
> iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
> +disabled xml2 && require_pkg_config libxml-2.0
> libxml2/libxml/xmlversion.h xmlCheckVersion
>  enabled libass&& require_pkg_config libass ass/ass.h
> ass_library_init
>  enabled libbluray && require_pkg_config libbluray
> libbluray/bluray.h bd_open
>  enabled libbs2b   && require_pkg_config libbs2b bs2b.h bs2b_open
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index 5d827d3..e2b4dd4 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -202,6 +202,7 @@ OBJS-$(CONFIG_H264_DEMUXER)  += h264dec.o
> rawdec.o
>  OBJS-$(CONFIG_H264_MUXER)+= rawenc.o
>  OBJS-$(CONFIG_HASH_MUXER)+= hashenc.o
>  OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
> +OBJS-$(CONFIG_HDS_DEMUXER)   += hdsdec.o amfmetadata.o
> f4mmanifest.o f4fbox.o flvtag.o
>  OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
>  OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o
>  OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o
> diff --git a/libavformat/allformats.c b/libavformat/allformats.c
> index 6a216ef..39505c3 100644
> --- a/libavformat/allformats.c
> +++ b/libavformat/allformats.c
> @@ -146,9 +146,9 @@ void av_register_all(void)
>  REGISTER_MUXDEMUX(H263, h263);
>  REGISTER_MUXDEMUX(H264, h264);
>  REGISTER_MUXER   (HASH, hash);
> -REGISTER_MUXER   (HDS,  hds);
>  REGISTER_MUXDEMUX(HEVC, hevc);
>  REGISTER_MUXDEMUX(HLS,  hls);
> +REGISTER_MUXDEMUX(HDS,  hds);
>  REGISTER_DEMUXER (HNM,  hnm);
>  REGISTER_MUXDEMUX(ICO,  ico);
>  REGISTER_DEMUXER (IDCIN,idcin);
> diff --git a/libavformat/amfmetadata.c b/libavformat/amfmetadata.c
> new file mode 100644
> index 000..0e7a2ea
> --- /dev/null
> +++ b/libavformat/amfmetadata.c
> @@ -0,0 +1,219 @@
> +/*
> + * Adobe Action Message Format Parser
> + * Copyright (c) 2013 Cory McCarthy
> + *
> + * This 

[FFmpeg-devel] [PATCH] add hds demuxer

2016-10-13 Thread Steven Liu
init add hds demuxer

Based-on: patch by CORY MCCARTHY 
Based-on: patch by Gorilla Maguila 
Signed-off-by: Steven Liu 
---
 configure |4 +
 libavformat/Makefile  |1 +
 libavformat/allformats.c  |2 +-
 libavformat/amfmetadata.c |  219 +
 libavformat/amfmetadata.h |   39 +++
 libavformat/f4fbox.c  |  381 +++
 libavformat/f4fbox.h  |   95 ++
 libavformat/f4mmanifest.c |  324 +++
 libavformat/f4mmanifest.h |   59 
 libavformat/flvtag.c  |  370 ++
 libavformat/flvtag.h  |   32 ++
 libavformat/hdsdec.c  |  759 +
 12 files changed, 2284 insertions(+), 1 deletions(-)
 create mode 100644 libavformat/amfmetadata.c
 create mode 100644 libavformat/amfmetadata.h
 create mode 100644 libavformat/f4fbox.c
 create mode 100644 libavformat/f4fbox.h
 create mode 100644 libavformat/f4mmanifest.c
 create mode 100644 libavformat/f4mmanifest.h
 create mode 100644 libavformat/flvtag.c
 create mode 100644 libavformat/flvtag.h
 create mode 100644 libavformat/hdsdec.c

diff --git a/configure b/configure
index 8d9b21b..9f844ea 100755
--- a/configure
+++ b/configure
@@ -295,6 +295,7 @@ External library support:
on OSX if openssl and gnutls are not used 
[autodetect]
   --enable-x11grab enable X11 grabbing (legacy) [no]
   --disable-xlib   disable xlib [autodetect]
+  --disable-xml2   disable XML parsing using the C library libxml2 
[autodetect]
   --disable-zlib   disable zlib [autodetect]
 
   The following libraries provide various hardware acceleration features:
@@ -1552,6 +1553,7 @@ EXTERNAL_LIBRARY_LIST="
 videotoolbox
 x11grab
 xlib
+xml2
 zlib
 "
 
@@ -2854,6 +2856,7 @@ eac3_demuxer_select="ac3_parser"
 f4v_muxer_select="mov_muxer"
 fifo_muxer_deps="threads"
 flac_demuxer_select="flac_parser"
+hds_demuxer_select="xml2"
 hds_muxer_select="flv_muxer"
 hls_muxer_select="mpegts_muxer"
 image2_alias_pix_demuxer_select="image2_demuxer"
@@ -5675,6 +5678,7 @@ enabled jni   && { [ $target_os = "android" ] 
&& check_header jni.h
check_lib2 "dlfcn.h" dlopen -ldl; }
 enabled ladspa&& { check_header ladspa.h || die "ERROR: ladspa.h 
header not found"; }
 enabled libiec61883   && require libiec61883 libiec61883/iec61883.h 
iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
+disabled xml2 && require_pkg_config libxml-2.0 
libxml2/libxml/xmlversion.h xmlCheckVersion
 enabled libass&& require_pkg_config libass ass/ass.h 
ass_library_init
 enabled libbluray && require_pkg_config libbluray libbluray/bluray.h 
bd_open
 enabled libbs2b   && require_pkg_config libbs2b bs2b.h bs2b_open
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 5d827d3..e2b4dd4 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -202,6 +202,7 @@ OBJS-$(CONFIG_H264_DEMUXER)  += h264dec.o 
rawdec.o
 OBJS-$(CONFIG_H264_MUXER)+= rawenc.o
 OBJS-$(CONFIG_HASH_MUXER)+= hashenc.o
 OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
+OBJS-$(CONFIG_HDS_DEMUXER)   += hdsdec.o amfmetadata.o 
f4mmanifest.o f4fbox.o flvtag.o
 OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
 OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o
 OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 6a216ef..39505c3 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -146,9 +146,9 @@ void av_register_all(void)
 REGISTER_MUXDEMUX(H263, h263);
 REGISTER_MUXDEMUX(H264, h264);
 REGISTER_MUXER   (HASH, hash);
-REGISTER_MUXER   (HDS,  hds);
 REGISTER_MUXDEMUX(HEVC, hevc);
 REGISTER_MUXDEMUX(HLS,  hls);
+REGISTER_MUXDEMUX(HDS,  hds);
 REGISTER_DEMUXER (HNM,  hnm);
 REGISTER_MUXDEMUX(ICO,  ico);
 REGISTER_DEMUXER (IDCIN,idcin);
diff --git a/libavformat/amfmetadata.c b/libavformat/amfmetadata.c
new file mode 100644
index 000..0e7a2ea
--- /dev/null
+++ b/libavformat/amfmetadata.c
@@ -0,0 +1,219 @@
+/*
+ * Adobe Action Message Format Parser
+ * Copyright (c) 2013 Cory McCarthy
+ *
+ * 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 

Re: [FFmpeg-devel] [PATCH 4/4] ffprobe: report field order for video streams

2016-10-13 Thread Tobias Rapp

On 04.10.2016 08:15, Clément Bœsch wrote:

On Mon, Oct 03, 2016 at 11:49:39PM -0500, Rodger Combs wrote:

---
 ffprobe.c   | 13 +
 tests/ref/fate/concat-demuxer-extended-lavf-mxf |  2 +-
 tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 |  2 +-
 tests/ref/fate/concat-demuxer-simple1-lavf-mxf  |  2 +-
 tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10  |  2 +-
 tests/ref/fate/concat-demuxer-simple2-lavf-ts   |  2 +-
 tests/ref/fate/ffprobe_compact  |  4 ++--
 tests/ref/fate/ffprobe_csv  |  4 ++--
 tests/ref/fate/ffprobe_default  |  2 ++
 tests/ref/fate/ffprobe_flat |  2 ++
 tests/ref/fate/ffprobe_ini  |  2 ++
 11 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/ffprobe.c b/ffprobe.c
index bb3979c..3118e80 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -2268,6 +2268,19 @@ static int show_stream(WriterContext *w, AVFormatContext 
*fmt_ctx, int stream_id
 else
 print_str_opt("chroma_location", 
av_chroma_location_name(par->chroma_location));

+if (par->field_order == AV_FIELD_PROGRESSIVE)
+print_str("field_order", "progressive");
+else if (par->field_order == AV_FIELD_TT)
+print_str("field_order", "tt");
+else if (par->field_order == AV_FIELD_BB)
+print_str("field_order", "bb");
+else if (par->field_order == AV_FIELD_TB)
+print_str("field_order", "tb");
+else if (par->field_order == AV_FIELD_BT)
+print_str("field_order", "bt");
+else
+print_str_opt("field_order", "unknown");
+


This probably needs an update of doc/ffprobe.xsd


@Rodger: I guess the XSD update will look like:

diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
index 757de12..ac0347f 100644
--- a/doc/ffprobe.xsd
+++ b/doc/ffprobe.xsd
@@ -201,6 +201,7 @@
   
   
   
+  
   
   

I'd love to see the patch included in FFmpeg 3.2.

Regards,
Tobias

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