Re: [FFmpeg-devel] [PATCH] vf_colorspace: fix range order.

2016-05-09 Thread Paul B Mahol
On 5/6/16, Ronald S. Bultje  wrote:
> ---
>  libavfilter/vf_colorspace.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
> index dd66a4e..7776a61 100644
> --- a/libavfilter/vf_colorspace.c
> +++ b/libavfilter/vf_colorspace.c
> @@ -805,8 +805,8 @@ static int create_filtergraph(AVFilterContext *ctx,
>  s->yuv_offset[1][n] = off;
>  fill_rgb2yuv_table(s->out_lumacoef, rgb2yuv);
>  bits = 1 << (29 - out_desc->comp[0].depth);
> -for (n = 0; n < 3; n++) {
> -for (out_rng = s->out_y_rng, m = 0; m < 3; m++, out_rng =
> s->out_uv_rng) {
> +for (out_rng = s->out_y_rng, n = 0; n < 3; n++, out_rng =
> s->out_uv_rng) {
> +for (m = 0; m < 3; m++) {
>  s->rgb2yuv_coeffs[n][m][0] = lrint(bits * out_rng *
> rgb2yuv[n][m] / 28672);
>  for (o = 1; o < 8; o++)
>  s->rgb2yuv_coeffs[n][m][o] =
> s->rgb2yuv_coeffs[n][m][0];
> --
> 2.8.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

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


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread wm4
On Sun, 8 May 2016 17:33:32 +0200
Michael Niedermayer  wrote:

> On Sun, May 08, 2016 at 04:10:01PM +0200, wm4 wrote:
> > On Sun,  8 May 2016 12:10:07 +0200
> > Michael Niedermayer  wrote:
> >   
> > > Fixes Ticket5467
> > > 
> > > Signed-off-by: Michael Niedermayer 
> > > ---
> > >  libavcodec/avcodec.h |4 
> > >  libavcodec/utils.c   |2 ++
> > >  2 files changed, 6 insertions(+)
> > > 
> > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> > > index 3813a0a..1db2e0f 100644
> > > --- a/libavcodec/avcodec.h
> > > +++ b/libavcodec/avcodec.h
> > > @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters {
> > >   * Audio only. Number of samples to skip after a discontinuity.
> > >   */
> > >  int seek_preroll;
> > > +
> > > +/** Properties, like FF_CODEC_PROPERTY_LOSSLESS.
> > > + */
> > > +int properties;
> > >  } AVCodecParameters;
> > >  
> > >  /**
> > > diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> > > index e6609ef..8638bc2 100644
> > > --- a/libavcodec/utils.c
> > > +++ b/libavcodec/utils.c
> > > @@ -4076,6 +4076,7 @@ int 
> > > avcodec_parameters_from_context(AVCodecParameters *par,
> > >  par->bits_per_raw_sample   = codec->bits_per_raw_sample;
> > >  par->profile   = codec->profile;
> > >  par->level = codec->level;
> > > +par->properties= codec->properties;
> > >  
> > >  switch (par->codec_type) {
> > >  case AVMEDIA_TYPE_VIDEO:
> > > @@ -4130,6 +4131,7 @@ int avcodec_parameters_to_context(AVCodecContext 
> > > *codec,
> > >  codec->bits_per_raw_sample   = par->bits_per_raw_sample;
> > >  codec->profile   = par->profile;
> > >  codec->level = par->level;
> > > +codec->properties= par->properties;
> > >  
> > >  switch (par->codec_type) {
> > >  case AVMEDIA_TYPE_VIDEO:  
> > 
> > Can you explain what exactly this is needed for?  
> 
> User apps can with this identify which streams are lossless without
> them needing to open decoders for each stream and explicitly decode
> some frames for each stream.

I'd argue that AVCodecParameters should contain only container
properties, or we'd end up with duplicating most of AVCodecContext in
it.

> it fixes a regression where this information is incorrectly printed
> by av_dump_format()
> 
> it fixes a regression where the existing lossless flag as documented by
> the current documentation is set incorrectly
> 
> [...]
> 

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


[FFmpeg-devel] [PATCH] avfilter/vf_fps: set fps value boundaries

2016-05-09 Thread Przemysław Sobala
---
 libavfilter/vf_fps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index 0500e97..20ccd79 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -62,7 +62,7 @@ typedef struct FPSContext {
 #define V AV_OPT_FLAG_VIDEO_PARAM
 #define F AV_OPT_FLAG_FILTERING_PARAM
 static const AVOption fps_options[] = {
-{ "fps", "A string describing desired output framerate", 
OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, .flags = V|F },
+{ "fps", "A string describing desired output framerate", 
OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 0, INT_MAX, V|F },
 { "start_time", "Assume the first PTS should be this value.", 
OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX}, -DBL_MAX, DBL_MAX, V 
},
 { "round", "set rounding method for timestamps", OFFSET(rounding), 
AV_OPT_TYPE_INT, { .i64 = AV_ROUND_NEAR_INF }, 0, 5, V|F, "round" },
 { "zero", "round towards 0",  OFFSET(rounding), AV_OPT_TYPE_CONST, { 
.i64 = AV_ROUND_ZERO }, 0, 5, V|F, "round" },
-- 
1.8.3.1

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


[FFmpeg-devel] [PATCH] libavutil/opt: add writing AV_OPT_TYPE_VIDEO_RATE AVOption

2016-05-09 Thread Przemysław Sobala
---
 libavutil/opt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 70a68d9..e63bd8a 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -136,6 +136,7 @@ static int write_number(void *obj, const AVOption *o, void 
*dst, double num, int
 *(double*)dst = num * intnum / den;
 break;
 case AV_OPT_TYPE_RATIONAL:
+case AV_OPT_TYPE_VIDEO_RATE:
 if ((int) num == num)
 *(AVRational *)dst = (AVRational) { num *intnum, den };
 else
-- 
1.8.3.1

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


[FFmpeg-devel] [PATCH 2/2] avfilter/f_metadata: update print output header line format

2016-05-09 Thread Tobias Rapp
Update print mode output header line format to be more consistent with
other log output of FFmpeg. The printf-modifiers have been inspired by
the showinfo filter.

Signed-off-by: Tobias Rapp 
---
 libavfilter/f_metadata.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c
index ee631c5..ab07ccf 100644
--- a/libavfilter/f_metadata.c
+++ b/libavfilter/f_metadata.c
@@ -306,15 +306,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 break;
 case METADATA_PRINT:
 if (!s->key && e) {
-s->print(ctx, "frame %"PRId64" pts %"PRId64" pts_time %s\n",
- inlink->frame_count, frame->pts, 
av_ts2timestr(frame->pts, &inlink->time_base));
+s->print(ctx, "frame:%-4"PRId64" pts:%-7s pts_time:%-7s\n",
+ inlink->frame_count, av_ts2str(frame->pts), 
av_ts2timestr(frame->pts, &inlink->time_base));
 s->print(ctx, "%s=%s\n", e->key, e->value);
 while ((e = av_dict_get(metadata, "", e, AV_DICT_IGNORE_SUFFIX)) 
!= NULL) {
 s->print(ctx, "%s=%s\n", e->key, e->value);
 }
 } else if (e && e->value && (!s->value || (e->value && s->compare(s, 
e->value, s->value {
-s->print(ctx, "frame %"PRId64" pts %"PRId64" pts_time %s\n",
- inlink->frame_count, frame->pts, 
av_ts2timestr(frame->pts, &inlink->time_base));
+s->print(ctx, "frame:%-4"PRId64" pts:%-7s pts_time:%-7s\n",
+ inlink->frame_count, av_ts2str(frame->pts), 
av_ts2timestr(frame->pts, &inlink->time_base));
 s->print(ctx, "%s=%s\n", s->key, e->value);
 }
 return ff_filter_frame(outlink, frame);
-- 
1.9.1


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


[FFmpeg-devel] [PATCH 1/2] avfilter/f_metadata: add pts_time to print output

2016-05-09 Thread Tobias Rapp
This allows e.g. to correlate signalstats metadata to time position
without having to find out the filter chain timebase first.

Signed-off-by: Tobias Rapp 
---
 libavfilter/f_metadata.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c
index fa6b9d3..ee631c5 100644
--- a/libavfilter/f_metadata.c
+++ b/libavfilter/f_metadata.c
@@ -30,6 +30,7 @@
 #include "libavutil/eval.h"
 #include "libavutil/internal.h"
 #include "libavutil/opt.h"
+#include "libavutil/timestamp.h"
 #include "avfilter.h"
 #include "audio.h"
 #include "formats.h"
@@ -305,13 +306,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 break;
 case METADATA_PRINT:
 if (!s->key && e) {
-s->print(ctx, "frame %"PRId64" pts %"PRId64"\n", 
inlink->frame_count, frame->pts);
+s->print(ctx, "frame %"PRId64" pts %"PRId64" pts_time %s\n",
+ inlink->frame_count, frame->pts, 
av_ts2timestr(frame->pts, &inlink->time_base));
 s->print(ctx, "%s=%s\n", e->key, e->value);
 while ((e = av_dict_get(metadata, "", e, AV_DICT_IGNORE_SUFFIX)) 
!= NULL) {
 s->print(ctx, "%s=%s\n", e->key, e->value);
 }
 } else if (e && e->value && (!s->value || (e->value && s->compare(s, 
e->value, s->value {
-s->print(ctx, "frame %"PRId64" pts %"PRId64"\n", 
inlink->frame_count, frame->pts);
+s->print(ctx, "frame %"PRId64" pts %"PRId64" pts_time %s\n",
+ inlink->frame_count, frame->pts, 
av_ts2timestr(frame->pts, &inlink->time_base));
 s->print(ctx, "%s=%s\n", s->key, e->value);
 }
 return ff_filter_frame(outlink, frame);
-- 
1.9.1


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


[FFmpeg-devel] av_image_get_buffer_size

2016-05-09 Thread Paolo Delle Piane
Hi at all,

 

Please, can you tell me how to solve this compilation or linker error using
gcc: undefined reference to `av_image_get_buffer_size`

Which header file must be used with the function av_image_get_buffer_size ?

I included libavutil/avutil.h, libavutil/imgutils.h, libavutil/parseutils.h
but nothing to do. If I remove this function from my source code, gcc
compile it fine.

Thanks to all for your support.

 

Paolo

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


Re: [FFmpeg-devel] [PATCH 2/2] configure: Enable GCC vectorization on ≥4.9

2016-05-09 Thread Clément Bœsch
On Sun, May 08, 2016 at 11:15:22PM -0300, James Almer wrote:
[...]
> >>> there where failures with some gcc versions recetly on fate that
> >>> disappesred when the gcc version used on these clients changed.
> >>> I dont know if anyone identified what was the cause of these issues
> >>
> >> Do you know what clients? You can look at the history to see what the 
> >> failed test
> >> was and the compiler version used.
> > 
> > i think they where some clients from ubitux IIRC
> 
> Ubitux's clients haven't changed the gcc version for some months now. Afaik 
> the
> current one is the same as it was before tree vectorization was enabled.

> His clients also every now and then fail for some weird reason unrelated to 
> gcc or
> even the latest ffmpeg snapshot. They seem to make changes to the source 
> files,
> adding random characters that generate errors. See
> 
> http://fate.ffmpeg.org/log.cgi?time=20160503100201&log=compile&slot=x86_64-archlinux-gcc-threads
> http://fate.ffmpeg.org/log.cgi?time=20160424045346&log=compile&slot=x86_64-archlinux-gcc-threads

Yeah, I got all kind of freaking random bitflip everywhere, like 2 or 3x a
week (and that's only accounting the one i detected). I recently disabled
a disk from the raid and it doesn't seem to happen anymore so I'm guessing
it's a bug in the HD firmware or something. I'll try to swap the disk in
use for the raid to see if the bit rot happens again starting next week or
so.

Anyway, sorry about that.

And yeah, I haven't updated GCC for a while now, but will do when I figure
out the bitrot shitstorm properly.

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH 1/2] avfilter/f_metadata: add pts_time to print output

2016-05-09 Thread Paul B Mahol
On 5/9/16, Tobias Rapp  wrote:
> This allows e.g. to correlate signalstats metadata to time position
> without having to find out the filter chain timebase first.
>
> Signed-off-by: Tobias Rapp 
> ---
>  libavfilter/f_metadata.c | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>

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


Re: [FFmpeg-devel] [PATCH 2/2] avfilter/f_metadata: update print output header line format

2016-05-09 Thread Paul B Mahol
On 5/9/16, Tobias Rapp  wrote:
> Update print mode output header line format to be more consistent with
> other log output of FFmpeg. The printf-modifiers have been inspired by
> the showinfo filter.
>
> Signed-off-by: Tobias Rapp 
> ---
>  libavfilter/f_metadata.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

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


Re: [FFmpeg-devel] av_image_get_buffer_size

2016-05-09 Thread Moritz Barsnick
Hi Paolo,

On Mon, May 09, 2016 at 12:10:07 +0200, Paolo Delle Piane wrote:
> Please, can you tell me how to solve this compilation or linker error using
> gcc: undefined reference to `av_image_get_buffer_size`

Questions regarding the use of/programming with the ffmpeg libraries
belong into the libav-user list.

That said:
> Which header file must be used with the function av_image_get_buffer_size ?
> 
> I included libavutil/avutil.h, libavutil/imgutils.h, libavutil/parseutils.h
> but nothing to do.

In my source, it is available in libavutil/imgutils.h, see here:
https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/imgutils.h#L159

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


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Michael Niedermayer
On Sun, May 08, 2016 at 05:42:13PM +0200, Hendrik Leppkes wrote:
> On Sun, May 8, 2016 at 5:33 PM, Michael Niedermayer
>  wrote:
> > On Sun, May 08, 2016 at 04:10:01PM +0200, wm4 wrote:
> >> On Sun,  8 May 2016 12:10:07 +0200
> >> Michael Niedermayer  wrote:
> >>
> >> > Fixes Ticket5467
> >> >
> >> > Signed-off-by: Michael Niedermayer 
> >> > ---
> >> >  libavcodec/avcodec.h |4 
> >> >  libavcodec/utils.c   |2 ++
> >> >  2 files changed, 6 insertions(+)
> >> >
> >> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> >> > index 3813a0a..1db2e0f 100644
> >> > --- a/libavcodec/avcodec.h
> >> > +++ b/libavcodec/avcodec.h
> >> > @@ -4050,6 +4050,10 @@ typedef struct AVCodecParameters {
> >> >   * Audio only. Number of samples to skip after a discontinuity.
> >> >   */
> >> >  int seek_preroll;
> >> > +
> >> > +/** Properties, like FF_CODEC_PROPERTY_LOSSLESS.
> >> > + */
> >> > +int properties;
> >> >  } AVCodecParameters;
> >> >
> >> >  /**
> >> > diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> >> > index e6609ef..8638bc2 100644
> >> > --- a/libavcodec/utils.c
> >> > +++ b/libavcodec/utils.c
> >> > @@ -4076,6 +4076,7 @@ int 
> >> > avcodec_parameters_from_context(AVCodecParameters *par,
> >> >  par->bits_per_raw_sample   = codec->bits_per_raw_sample;
> >> >  par->profile   = codec->profile;
> >> >  par->level = codec->level;
> >> > +par->properties= codec->properties;
> >> >
> >> >  switch (par->codec_type) {
> >> >  case AVMEDIA_TYPE_VIDEO:
> >> > @@ -4130,6 +4131,7 @@ int avcodec_parameters_to_context(AVCodecContext 
> >> > *codec,
> >> >  codec->bits_per_raw_sample   = par->bits_per_raw_sample;
> >> >  codec->profile   = par->profile;
> >> >  codec->level = par->level;
> >> > +codec->properties= par->properties;
> >> >
> >> >  switch (par->codec_type) {
> >> >  case AVMEDIA_TYPE_VIDEO:
> >>
> >> Can you explain what exactly this is needed for?
> >
> > User apps can with this identify which streams are lossless without
> > them needing to open decoders for each stream and explicitly decode
> > some frames for each stream.
> >
> > it fixes a regression where this information is incorrectly printed
> > by av_dump_format()
> >
> > it fixes a regression where the existing lossless flag as documented by
> > the current documentation is set incorrectly
> >
> 
> We can copy it to the deprecated st->codec to keep the existing things
> working, but it still remains not a container flag, and the purpose of
> this structure is not to export every single piece of information a
> decoder might output.

this can be done but then dump_stream_format() would also need to move
back to using the deprecated struct (for that field at least) instead
of just codec par, not sure thats the only function thats affected ...

Also theres a deeper problem,
User want, benefit from and sometimes need, "every single piece of
information a decoder might output.", well not "every" of course
but its hard to draw lines what may be needed and what not.

Having an API that provides this information without user apps needing
to implement full data collection using low level APIs dealing with
errors and unseekable protocols, ...
should be quite useful


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

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates


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


Re: [FFmpeg-devel] [PATCH] vf_colorspace: make whitepoint adaptation mode configurable.

2016-05-09 Thread Ronald S. Bultje
Hi,

On Fri, May 6, 2016 at 9:40 AM, Ronald S. Bultje  wrote:

> Also add von kries whitepoint adaptation, and add 'identity' to turn
> whitepoint adaptation off.
> ---
>  doc/filters.texi| 15 +++
>  libavfilter/vf_colorspace.c | 39 ---
>  2 files changed, 47 insertions(+), 7 deletions(-)


Ping.

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


[FFmpeg-devel] [PATCH]lavc/mjpegdec: Read polarity field from AVI1 chunk

2016-05-09 Thread Carl Eugen Hoyos

Hi!

Attached aptch fixes ticket #5523 for me, I only tested the files attached 
there.


Please comment, Carl EugenFrom 389009e064e9e2b4a1a35d1add0efe1b643c1a62 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Mon, 9 May 2016 14:40:22 +0200
Subject: [PATCH] lavc/mjpegdec: Read polarity field from AVI1 chunk.

Fixes ticket #5523.
---
 libavcodec/mjpegdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 7d38fc2..74884f1 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1655,7 +1655,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
 4bytes  field_size_less_padding
 */
 s->buggy_avid = 1;
-i = get_bits(&s->gb, 8); len--;
+s->interlace_polarity = get_bits(&s->gb, 8); len--;
 av_log(s->avctx, AV_LOG_DEBUG, "polarity %d\n", i);
 #if 0
 skip_bits(&s->gb, 8);
-- 
1.8.4.5

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


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Derek Buitenhuis
On 5/9/2016 1:29 PM, Michael Niedermayer wrote:
> Also theres a deeper problem,
> User want, benefit from and sometimes need, "every single piece of
> information a decoder might output.", well not "every" of course
> but its hard to draw lines what may be needed and what not.

They can decode a frame like the rest of us. This does not belong
in a demuxing library IMO.

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


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Derek Buitenhuis
On 5/9/2016 8:36 AM, wm4 wrote:
> I'd argue that AVCodecParameters should contain only container
> properties, or we'd end up with duplicating most of AVCodecContext in
> it.

Agreed. IMO the correct solution for user applications is to decode a frame.

It's not reasonable to expect a *demuxer* to provide decoder info.

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


Re: [FFmpeg-devel] [PATCH]lavc/mjpegdec: Read polarity field from AVI1 chunk

2016-05-09 Thread Thilo Borgmann
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 7d38fc2..74884f1 100644
[...]
 s->buggy_avid = 1;
-i = get_bits(&s->gb, 8); len--;
+s->interlace_polarity = get_bits(&s->gb, 8); len--;
 av_log(s->avctx, AV_LOG_DEBUG, "polarity %d\n", i);

I assume the av_log() should also be updated.

-Thilo

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


[FFmpeg-devel] [PATCH] mjpegdec: Properly fail on malloc failure

2016-05-09 Thread Derek Buitenhuis
Signed-off-by: Derek Buitenhuis 
---
 libavcodec/mjpegdec.c | 56 +++
 1 file changed, 30 insertions(+), 26 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 7d38fc2..32e8cee 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1876,34 +1876,35 @@ static int mjpeg_decode_com(MJpegDecodeContext *s)
 {
 int len = get_bits(&s->gb, 16);
 if (len >= 2 && 8 * len - 16 <= get_bits_left(&s->gb)) {
+int i;
 char *cbuf = av_malloc(len - 1);
-if (cbuf) {
-int i;
-for (i = 0; i < len - 2; i++)
-cbuf[i] = get_bits(&s->gb, 8);
-if (i > 0 && cbuf[i - 1] == '\n')
-cbuf[i - 1] = 0;
-else
-cbuf[i] = 0;
+if (!cbuf)
+return AVERROR(ENOMEM);
 
-if (s->avctx->debug & FF_DEBUG_PICT_INFO)
-av_log(s->avctx, AV_LOG_INFO, "comment: '%s'\n", cbuf);
-
-/* buggy avid, it puts EOI only at every 10th frame */
-if (!strncmp(cbuf, "AVID", 4)) {
-parse_avid(s, cbuf, len);
-} else if (!strcmp(cbuf, "CS=ITU601"))
-s->cs_itu601 = 1;
-else if ((!strncmp(cbuf, "Intel(R) JPEG Library, version 1", 32) 
&& s->avctx->codec_tag) ||
- (!strncmp(cbuf, "Metasoft MJPEG Codec", 20)))
-s->flipped = 1;
-else if (!strcmp(cbuf, "MULTISCOPE II")) {
-s->avctx->sample_aspect_ratio = (AVRational) { 1, 2 };
-s->multiscope = 2;
-}
+for (i = 0; i < len - 2; i++)
+cbuf[i] = get_bits(&s->gb, 8);
+if (i > 0 && cbuf[i - 1] == '\n')
+cbuf[i - 1] = 0;
+else
+cbuf[i] = 0;
 
-av_free(cbuf);
+if (s->avctx->debug & FF_DEBUG_PICT_INFO)
+av_log(s->avctx, AV_LOG_INFO, "comment: '%s'\n", cbuf);
+
+/* buggy avid, it puts EOI only at every 10th frame */
+if (!strncmp(cbuf, "AVID", 4)) {
+parse_avid(s, cbuf, len);
+} else if (!strcmp(cbuf, "CS=ITU601"))
+s->cs_itu601 = 1;
+else if ((!strncmp(cbuf, "Intel(R) JPEG Library, version 1", 32) && 
s->avctx->codec_tag) ||
+ (!strncmp(cbuf, "Metasoft MJPEG Codec", 20)))
+s->flipped = 1;
+else if (!strcmp(cbuf, "MULTISCOPE II")) {
+s->avctx->sample_aspect_ratio = (AVRational) { 1, 2 };
+s->multiscope = 2;
 }
+
+av_free(cbuf);
 }
 
 return 0;
@@ -2114,8 +2115,11 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame,
 else if (start_code >= APP0 && start_code <= APP15)
 mjpeg_decode_app(s);
 /* Comment */
-else if (start_code == COM)
-mjpeg_decode_com(s);
+else if (start_code == COM) {
+ret = mjpeg_decode_com(s);
+if (ret < 0)
+return ret;
+}
 
 ret = -1;
 
-- 
2.8.1

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_fps: set fps value boundaries

2016-05-09 Thread Michael Niedermayer
On Mon, May 09, 2016 at 11:17:23AM +0200, Przemysław Sobala wrote:
> ---
>  libavfilter/vf_fps.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied

but there are many more that have AV_OPT_TYPE_VIDEO_RATE with 0,0

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- 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] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Carl Eugen Hoyos
Michael Niedermayer  niedermayer.cc> writes:

> Fixes Ticket5467

This should get applied asap imo.

Arguing that the frame should be decoded a second time to 
get the information seems like a good argument in favour 
of this patch.

Thank you for trying to help, Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Carl Eugen Hoyos
Derek Buitenhuis  gmail.com> writes:

> It's not reasonable to expect a *demuxer* to provide decoder info.

So can you answer why the codec aspect ratio is provided but 
other information is not?
Do you agree that the answer is that decoders need this 
information?

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Derek Buitenhuis
On 5/9/2016 1:48 PM, Carl Eugen Hoyos wrote:
> This should get applied asap imo.

NAK!

This patch has at least 3 people dissenting and it doesn't actually
"fix" anything except cosmetic output on the console, which is NOT
meant to be parsed not even stable.

> Arguing that the frame should be decoded a second time to 
> get the information seems like a good argument in favour 
> of this patch.

No. This is an API and ABI level change, to fix cosmetic output
of a CLI tool.

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


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Derek Buitenhuis
On 5/9/2016 1:52 PM, Carl Eugen Hoyos wrote:
> So can you answer why the codec aspect ratio is provided but 
> other information is not?

Most because e.g. some *conatiners* need this info. No containers, to my
knowledge, need this 'lossless' info.

> Do you agree that the answer is that decoders need this 
> information?

The decoders definitely *do not* need this lossless info. It's workaround
for a purely cosmetic problem with assumptions a CLI tool used to make.

IMO the correct 'fix' is to add it back to st->codec like others suggested,
for the time being.

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_fps: set fps value boundaries

2016-05-09 Thread Przemysław Sobala

W dniu 09.05.2016 o 15:00, Michael Niedermayer pisze:

On Mon, May 09, 2016 at 11:17:23AM +0200, Przemysław Sobala wrote:

---
  libavfilter/vf_fps.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)


applied

but there are many more that have AV_OPT_TYPE_VIDEO_RATE with 0,0

thx



Yes, I've noticed that.
It turns out that setting video rate by string via 'av_opt_set' does not
validate value boundaries while setting by AVRational via
av_opt_set_video_rate does.

--
Regards
Przemysław Sobala


Spółki Grupy Wirtualna Polska:

Wirtualna Polska Holding Spółka Akcyjna z siedzibą w Warszawie, ul. Jutrzenki 
137A, 02-231 Warszawa, wpisana do Krajowego Rejestru Sądowego - Rejestru 
Przedsiębiorców prowadzonego przez Sąd Rejonowy dla m.st. Warszawy w Warszawie 
pod nr KRS: 407130, kapitał zakładowy: 1 245 651,90 zł (w całości 
wpłacony), Numer Identyfikacji Podatkowej (NIP): 521-31-11-513

Grupa Wirtualna Polska Spółka Akcyjna z siedzibą w Warszawie, ul. Jutrzenki 
137A, 02-231 Warszawa, wpisana do Krajowego Rejestru Sądowego - Rejestru 
Przedsiębiorców prowadzonego przez Sąd Rejonowy dla m.st. Warszawy w Warszawie 
pod nr KRS: 580004, kapitał zakładowy: 317 957 850,00 zł (w całości 
wpłacony), Numer Identyfikacji Podatkowej (NIP): 527-26-45-593

WP Shopping Spółka z ograniczoną odpowiedzialnością z siedzibą w Warszawie, ul. 
Jutrzenki 137A, 02-231 Warszawa, wpisana do Krajowego Rejestru Sądowego - 
Rejestru Przedsiębiorców prowadzonego przez Sąd Rejonowy Gdańsk - Północ w 
Gdańsku pod nr KRS: 546914, kapitał zakładowy: 170.000,00 złotych (w 
całości wpłacony), Numer Identyfikacji Podatkowej (NIP): 957-07-51-216
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Paul B Mahol
On 5/9/16, Derek Buitenhuis  wrote:
> On 5/9/2016 1:52 PM, Carl Eugen Hoyos wrote:
>> So can you answer why the codec aspect ratio is provided but
>> other information is not?
>
> Most because e.g. some *conatiners* need this info. No containers, to my
> knowledge, need this 'lossless' info.
>
>> Do you agree that the answer is that decoders need this
>> information?
>
> The decoders definitely *do not* need this lossless info. It's workaround
> for a purely cosmetic problem with assumptions a CLI tool used to make.
>
> IMO the correct 'fix' is to add it back to st->codec like others suggested,
> for the time being.

Isn't st->codec deprecated?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Derek Buitenhuis
On 5/9/2016 2:19 PM, Paul B Mahol wrote:
> Isn't st->codec deprecated?

It is, but the old behavior should be maintained for the duration
of its deprecation period. It's a bug not to add it back to st->codec
in my opinion.

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


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Paul B Mahol
On 5/9/16, Derek Buitenhuis  wrote:
> On 5/9/2016 2:19 PM, Paul B Mahol wrote:
>> Isn't st->codec deprecated?
>
> It is, but the old behavior should be maintained for the duration
> of its deprecation period. It's a bug not to add it back to st->codec
> in my opinion.

Once st->codec is gone, how would this lossless info be gathered back?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavutil/opt: add writing AV_OPT_TYPE_VIDEO_RATE AVOption

2016-05-09 Thread Michael Niedermayer
On Mon, May 09, 2016 at 11:27:09AM +0200, Przemysław Sobala wrote:
> ---
>  libavutil/opt.c | 1 +
>  1 file changed, 1 insertion(+)

applied

thx

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

There will always be a question for which you do not know the correct answer.


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


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Derek Buitenhuis
On 5/9/2016 2:22 PM, Paul B Mahol wrote:
> Once st->codec is gone, how would this lossless info be gathered back?

As myself and others have said above: decode a frame.

It is not a demuxer's job to provide info gleaned from decoding.

Either avformat should be properly separate as it (kind of) is now, and provide
info required for demuxing and muxing the containers it supports, or it should
be merged into libavcodec like Nicholas wants, and it can provide both. Doing a
little of both for random fields, and keeping them as separate libraries is just
awful, though.

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


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Hendrik Leppkes
On Mon, May 9, 2016 at 3:26 PM, Derek Buitenhuis
 wrote:
> On 5/9/2016 2:22 PM, Paul B Mahol wrote:
>> Once st->codec is gone, how would this lossless info be gathered back?
>
> As myself and others have said above: decode a frame.

And before people argue that avformat does this anyway today - one of
the hopes is to make it stop doing that for many "simple" codecs where
this is just not necessary, and say a parser could extract all the
important information with much less overhead.

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


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Derek Buitenhuis
On 5/9/2016 2:28 PM, Hendrik Leppkes wrote:
> And before people argue that avformat does this anyway today - one of
> the hopes is to make it stop doing that for many "simple" codecs where
> this is just not necessary, and say a parser could extract all the
> important information with much less overhead.

I wasn't actually aware of that, but it would be really nice to have
faster init because of this. Cool.

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


Re: [FFmpeg-devel] [PATCH] added support for hardware assist H264 video encoding for the Raspberry Pi

2016-05-09 Thread Amancio Hasty
Hi,

So what is the next step?

If you want testers I suggest posting to ccrisan’s motionpie mailing list.
Cheers
Amancio


> On Mar 31, 2016, at 7:27 PM, Amancio Hasty  wrote:
> 
> I am not a lawyer…
> 
> 
> I updated the patch.  vc264.c now has a the copyright notice embedded in 
> a volatile global so if a binary is compiled against vc264.o , the copyright 
> notice
> can be displayed by:
> strings ffmpeg | grep -i copyright
> 
> LICENSE.md has been updated to include Broadcom’s copyright notice.
> 
> A distribution of a  binary that includes vc264.o should include LICENSE.md 
> and if 
> that is missing,  the copyright notice can be displayed via the shell
> command ‘strings’ .
> 
> Amancio
> 
>> On Mar 22, 2016, at 12:12 PM, Lou Logan  wrote:
>> 
>> On Mon, 21 Mar 2016 20:07:01 -0700, Amancio Hasty wrote:
>> 
>>> From 874a72eec2a78f4935fea091003e534b5f8d5413 Mon Sep 17 00:00:00 2001
>>> From: Amancio Hasty 
>>> Date: Mon, 21 Mar 2016 18:56:05 -0700
>>> Subject: [PATCH] added support for hardware assist H264  video encoding for
>>> the Raspberry Pi
>>> 
>>> ---
>>> configure  |  12 ++
>>> libavcodec/Makefile|   1 +
>>> libavcodec/allcodecs.c |   2 +
>>> libavcodec/vc264.c | 387 
>>> +
>>> 4 files changed, 402 insertions(+)
>>> create mode 100644 libavcodec/vc264.c
>>> 
>> [...]
>>> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
>>> index 2a25d66..3c7bd9b 100644
>>> --- a/libavcodec/allcodecs.c
>>> +++ b/libavcodec/allcodecs.c
>>> @@ -74,6 +74,7 @@ void avcodec_register_all(void)
>>>initialized = 1;
>>> 
>> 
>> Nit: Whitespace on the line above should be removed.
>> 
>> [...]
>>> --- /dev/null
>>> +++ b/libavcodec/vc264.c
>>> @@ -0,0 +1,387 @@
>>> +/*  H.264 hardware assist video encoding code taken from
>>> + * raspberry's os :
>>> + *   /opt/vc/src/hello_pi/hello_encode/encode.c
>>> + */
>>> +
>>> +/*
>>> +Copyright (c) 2012, Broadcom Europe Ltd
>>> +Copyright (c) 2012, Kalle Vahlman 
>>> +Tuomas Kulve 
>>> +All rights reserved.
>>> +
>>> +Redistribution and use in source and binary forms, with or without
>>> +modification, are permitted provided that the following conditions are met:
>>> +* Redistributions of source code must retain the above copyright
>>> +  notice, this list of conditions and the following disclaimer.
>>> +  * Redistributions in binary form must reproduce the above copyright
>>> +  notice, this list of conditions and the following disclaimer in the
>>> +  documentation and/or other materials provided with the distribution.
>>> +  * Neither the name of the copyright holder nor the
>>> +  names of its contributors may be used to endorse or promote products
>>> +  derived from this software without specific prior written permission.
>>> +
>>> +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 
>>> IS" AND
>>> +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
>>> IMPLIED
>>> +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
>>> +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
>>> LIABLE FOR ANY
>>> +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
>>> +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
>>> SERVICES;
>>> +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
>>> +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
>>> +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 
>>> THIS
>>> +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>> 
>> I wonder if any of the above legalese is compatible. Granted, I see a
>> similar paragraph in "libavformat/aadec.c".
>> 
>>> + * ffmpeg driver for hardware assist video H.264 encoding using Broadcom's 
>>> GPU
>>> + * Copyright (C) 2016 Amancio Hasty aha...@gmail.com
>>> + *
>>> + *
>>> + * 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
>>> + *
>>> + */
>>> +
>>> +
>>> +/**
>>> + * @ file vc264.c
>>> + * Broadcom bm2865's Visual Core hardware assist h264 using
>>> +   openMax interface to the GPU.
>>> +
>>> +*/
>>> +
>>> +#include 

Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread wm4
On Mon, 9 May 2016 15:28:11 +0200
Hendrik Leppkes  wrote:

> On Mon, May 9, 2016 at 3:26 PM, Derek Buitenhuis
>  wrote:
> > On 5/9/2016 2:22 PM, Paul B Mahol wrote:  
> >> Once st->codec is gone, how would this lossless info be gathered back?  
> >
> > As myself and others have said above: decode a frame.  
> 
> And before people argue that avformat does this anyway today - one of
> the hopes is to make it stop doing that for many "simple" codecs where
> this is just not necessary, and say a parser could extract all the
> important information with much less overhead.

+1, that would be nice.

I think there should perhaps be a better solution to what libavformat
traditionally tried to do. On the command line, ffprobe could be used
to dump exact and detailed information about decoded frames. On the
ffmpeg.c level, it actually should decode a frame, which would solve a
bunch of problems, including those that can't be solved by the
traditional libavformat model. (Such as changing parameters due to
hardware decoding.)

av_dump_format() should be constrained to demuxer information. (Just
change its output.)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] Push hls_ts_options to every chunks (fix #5525)

2016-05-09 Thread Jack
Signed-off-by: jack 
---
 libavformat/hlsenc.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index a9fa5d8..77712d0 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -624,6 +624,11 @@ static int hls_start(AVFormatContext *s)
 err = avformat_write_header(vtt_oc,NULL);
 if (err < 0)
 return err;
+} else {
+HLSContext *hls = s->priv_data;
+av_dict_copy(&options, hls->format_options, 0);
+avformat_write_header(hls->avf, &options);
+av_dict_free(&options);
 }
 
 return 0;
-- 
2.8.1

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


Re: [FFmpeg-devel] [PATCH] avcodec: add properties for lossless to AVCodecParameters

2016-05-09 Thread Michael Niedermayer
On Mon, May 09, 2016 at 01:44:54PM +0100, Derek Buitenhuis wrote:
> On 5/9/2016 1:29 PM, Michael Niedermayer wrote:
> > Also theres a deeper problem,
> > User want, benefit from and sometimes need, "every single piece of
> > information a decoder might output.", well not "every" of course
> > but its hard to draw lines what may be needed and what not.
> 
> They can decode a frame like the rest of us. This does not belong
> in a demuxing library IMO.

The problem (or rather one problem, there might be more) that this
is about is a user application selecting which stream to play
like users might prefer higher quality streams or lossless streams

For width/height/sample rate the information is straight available
for quality a user app has to setup a array of packet buffers decode
frames until the quality parameter is filled in
and have logic to detect containers and codecs which do never fill it
thresholds to stop, also to recover from error conditions liek EOF and
still be able to play a stream which at the same time maybe isnt
seekable
and on top of that user apps would have to do that even though
libavformat does exactly the same already to fill other information
in cases where it is needed

basically in the past user apps had the full set of information
available to select which stream to present to the user or to present
the user with a list of choices.
after codec par
user apps only have a subset of this information available and if they
want more they need to more or less reimplement av_find_stream_info()

Its that reimplementation need that really feels wrong to me.
There should be some API in some lib that does this so not every app
needs to reimplement it for obtaining information like losslessness

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

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates


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


Re: [FFmpeg-devel] [PATCH v2 0/3] DTS Express (LBR) decoder

2016-05-09 Thread foo86
On Sun, May 01, 2016 at 03:30:27PM -0300, James Almer wrote:
> With the samples you shared and with a random lbr-in-wav mono sample i found
> in the wild i get the following when i try to do a codec copy.
> Core and every other DTS extension in contrast seem to set timestamps just
> fine.
> 
> #tb 0: 1/9
> #media_type 0: audio
> #codec_id 0: dts
> #sample_rate 0: 48000
> #channel_layout 0: 60f
> Output #0, framecrc, to 'pipe:':
> Stream #0:0: Audio: dts (DTS Express), 48000 Hz, 5.1(side), 505 kb/s
> Stream mapping:
>   Stream #0:0 -> #0:0 (copy)
> Press [q] to stop, [?] for help
> [framecrc @ 00670100] Timestamps are unset in a packet for stream 0. 
> This is deprecated and will stop working in the future. Fix your code to set 
> the timestamps properly
> 0,  0,  0,0, 5440, 0xdc73e46d
> 0,  0,  0,0, 5440, 0x7f66bd99
> 0,  0,  0,0, 5440, 0x116f2d31
> 0,  0,  0,0, 5440, 0x37a82646
> 0,  0,  0,0, 5440, 0xcc294e39
> 0,  0,  0,0, 5440, 0x2293455d
> 0,  0,  0,0, 5440, 0xbd9b25d3
> 0,  0,  0,0, 5440, 0xf9331333
> 0,  0,  0,0, 5440, 0xb96d5581
> 0,  0,  0,0, 5440, 0x56f55088
> 0,  0,  0,0, 5440, 0x32f81f50
> 0,  0,  0,0, 5440, 0x8a0c986d
> 0,  0,  0,0, 5440, 0x21615dea
> 0,  0,  0,0, 5440, 0x5adc77e9
> 0,  0,  0,0, 5440, 0x228e5088
> 0,  0,  0,0, 5440, 0xd0029e27
> 0,  0,  0,0, 5440, 0x472d4f33
> 0,  0,  0,0, 5440, 0xdaff4ac1
> size=   1kB time=00:00:00.00 bitrate=N/A speed=   0x
> video:0kB audio:96kB subtitle:0kB other streams:0kB global headers:0kB muxing 
> overhead: unknown

Attached patch fixes timestamps for core-less DTS for me.
commit 49f02f6422e84cf381eb100b510680ecf46f7a76
Author: foo86 
Date:   Mon May 9 20:08:21 2016 +0300

avcodec/dca_parser: set duration for core-less streams

diff --git a/libavcodec/dca_exss.c b/libavcodec/dca_exss.c
index 87b2f42..8d0b63f 100644
--- a/libavcodec/dca_exss.c
+++ b/libavcodec/dca_exss.c
@@ -375,7 +375,7 @@ static int set_exss_offsets(DCAExssAsset *asset)
 return 0;
 }
 
-int ff_dca_exss_parse(DCAExssParser *s, uint8_t *data, int size)
+int ff_dca_exss_parse(DCAExssParser *s, const uint8_t *data, int size)
 {
 int i, ret, offset, wide_hdr, header_size;
 
diff --git a/libavcodec/dca_exss.h b/libavcodec/dca_exss.h
index 323063a..208fae1 100644
--- a/libavcodec/dca_exss.h
+++ b/libavcodec/dca_exss.h
@@ -87,6 +87,6 @@ typedef struct DCAExssParser {
 DCAExssAsset   assets[1];///< Audio asset descriptors
 } DCAExssParser;
 
-int ff_dca_exss_parse(DCAExssParser *s, uint8_t *data, int size);
+int ff_dca_exss_parse(DCAExssParser *s, const uint8_t *data, int size);
 
 #endif
diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c
index bde7dfe..83e011c 100644
--- a/libavcodec/dca_parser.c
+++ b/libavcodec/dca_parser.c
@@ -23,6 +23,8 @@
  */
 
 #include "dca.h"
+#include "dcadata.h"
+#include "dca_exss.h"
 #include "dca_syncwords.h"
 #include "get_bits.h"
 #include "parser.h"
@@ -32,6 +34,8 @@ typedef struct DCAParseContext {
 uint32_t lastmarker;
 int size;
 int framesize;
+DCAExssParser exss;
+unsigned int sr_code;
 } DCAParseContext;
 
 #define IS_CORE_MARKER(state) \
@@ -106,11 +110,12 @@ static av_cold int dca_parse_init(AVCodecParserContext *s)
 DCAParseContext *pc1 = s->priv_data;
 
 pc1->lastmarker = 0;
+pc1->sr_code = -1;
 return 0;
 }
 
 static int dca_parse_params(const uint8_t *buf, int buf_size, int *duration,
-int *sample_rate, int *framesize)
+int *sample_rate, DCAParseContext *pc)
 {
 GetBitContext gb;
 uint8_t hdr[12 + AV_INPUT_BUFFER_PADDING_SIZE] = { 0 };
@@ -119,6 +124,65 @@ static int dca_parse_params(const uint8_t *buf, int buf_size, int *duration,
 if (buf_size < 12)
 return AVERROR_INVALIDDATA;
 
+if (AV_RB32(buf) == DCA_SYNCWORD_SUBSTREAM) {
+DCAExssAsset *asset = &pc->exss.assets[0];
+
+if ((ret = ff_dca_exss_parse(&pc->exss, buf, buf_size)) < 0)
+return ret;
+
+pc->framesize = 0;
+
+if (asset->extension_mask & DCA_EXSS_LBR) {
+if ((ret = init_get_bits8(&gb, buf + asset->lbr_offset, asset->lbr_size)) < 0)
+return ret;
+
+if (get_bits_long(&gb, 32) != DCA_SYNCWORD_LBR)
+return AVERROR_INVALIDDATA;
+
+switch (get_bits(&gb, 8)) {
+case 2:
+pc->sr_code = get_bits(&gb, 8);
+case 1:
+break;
+default:
+return AVER

Re: [FFmpeg-devel] [PATCH]lavc/mjpegdec: Read polarity field from AVI1 chunk

2016-05-09 Thread Michael Niedermayer
On Mon, May 09, 2016 at 02:44:23PM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached aptch fixes ticket #5523 for me, I only tested the files
> attached there.

breaks:
https://trac.ffmpeg.org/raw-attachment/ticket/362/test.avi

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH] mjpegdec: Properly fail on malloc failure

2016-05-09 Thread Michael Niedermayer
On Mon, May 09, 2016 at 01:58:57PM +0100, Derek Buitenhuis wrote:
> Signed-off-by: Derek Buitenhuis 
> ---
>  libavcodec/mjpegdec.c | 56 
> +++
>  1 file changed, 30 insertions(+), 26 deletions(-)
> 
> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> index 7d38fc2..32e8cee 100644
> --- a/libavcodec/mjpegdec.c
> +++ b/libavcodec/mjpegdec.c
> @@ -1876,34 +1876,35 @@ static int mjpeg_decode_com(MJpegDecodeContext *s)
>  {
>  int len = get_bits(&s->gb, 16);
>  if (len >= 2 && 8 * len - 16 <= get_bits_left(&s->gb)) {
> +int i;
>  char *cbuf = av_malloc(len - 1);
> -if (cbuf) {
> -int i;
> -for (i = 0; i < len - 2; i++)
> -cbuf[i] = get_bits(&s->gb, 8);
> -if (i > 0 && cbuf[i - 1] == '\n')
> -cbuf[i - 1] = 0;
> -else
> -cbuf[i] = 0;
> +if (!cbuf)
> +return AVERROR(ENOMEM);
>  
> -if (s->avctx->debug & FF_DEBUG_PICT_INFO)
> -av_log(s->avctx, AV_LOG_INFO, "comment: '%s'\n", cbuf);
> -
> -/* buggy avid, it puts EOI only at every 10th frame */
> -if (!strncmp(cbuf, "AVID", 4)) {
> -parse_avid(s, cbuf, len);
> -} else if (!strcmp(cbuf, "CS=ITU601"))
> -s->cs_itu601 = 1;
> -else if ((!strncmp(cbuf, "Intel(R) JPEG Library, version 1", 32) 
> && s->avctx->codec_tag) ||
> - (!strncmp(cbuf, "Metasoft MJPEG Codec", 20)))
> -s->flipped = 1;
> -else if (!strcmp(cbuf, "MULTISCOPE II")) {
> -s->avctx->sample_aspect_ratio = (AVRational) { 1, 2 };
> -s->multiscope = 2;
> -}
> +for (i = 0; i < len - 2; i++)
> +cbuf[i] = get_bits(&s->gb, 8);
> +if (i > 0 && cbuf[i - 1] == '\n')
> +cbuf[i - 1] = 0;
> +else
> +cbuf[i] = 0;
>  
> -av_free(cbuf);
> +if (s->avctx->debug & FF_DEBUG_PICT_INFO)
> +av_log(s->avctx, AV_LOG_INFO, "comment: '%s'\n", cbuf);
> +
> +/* buggy avid, it puts EOI only at every 10th frame */
> +if (!strncmp(cbuf, "AVID", 4)) {
> +parse_avid(s, cbuf, len);
> +} else if (!strcmp(cbuf, "CS=ITU601"))
> +s->cs_itu601 = 1;
> +else if ((!strncmp(cbuf, "Intel(R) JPEG Library, version 1", 32) && 
> s->avctx->codec_tag) ||
> + (!strncmp(cbuf, "Metasoft MJPEG Codec", 20)))
> +s->flipped = 1;
> +else if (!strcmp(cbuf, "MULTISCOPE II")) {
> +s->avctx->sample_aspect_ratio = (AVRational) { 1, 2 };
> +s->multiscope = 2;
>  }
> +
> +av_free(cbuf);
>  }
>  
>  return 0;
> @@ -2114,8 +2115,11 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void 
> *data, int *got_frame,
>  else if (start_code >= APP0 && start_code <= APP15)
>  mjpeg_decode_app(s);
>  /* Comment */
> -else if (start_code == COM)
> -mjpeg_decode_com(s);
> +else if (start_code == COM) {
> +ret = mjpeg_decode_com(s);
> +if (ret < 0)
> +return ret;

this possibly should be goto fail like most other failure cases
either way LGTM

thx

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

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus


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 DST decoder

2016-05-09 Thread Piotr Bandurski
> Sorry, this one should work.

this eating up memory:

https://www.datafilehost.com/d/3226dd07





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


Re: [FFmpeg-devel] [PATCH]: add DST decoder

2016-05-09 Thread Paul B Mahol
On 5/9/16, Piotr Bandurski  wrote:
>> Sorry, this one should work.
>
> this eating up memory:

Another one attached.


0001-avcodec-add-Direct-Stream-Transfer-DST-decoder.patch.bz2
Description: BZip2 compressed data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add loudnorm

2016-05-09 Thread Kyle Swanson
On Tue, Apr 5, 2016 at 7:01 PM, Kyle Swanson  wrote:
>
> Here's another audio filter. I hinted at this a few months ago, but I found 
> out that
> finishing the last 5% took almost as long as the first 95%. This is an EBU 
> R128
> dynamic loudness normalization filter. This filter uses libebur128 v1.1.0[1] 
> and must be
> configured with `--enable-libebur128'. Please also see the accompanying blog 
> post[2]
> which has an algorithm description, as well as some usage instructions.
>
> [1] https://github.com/jiixyj/libebur128
> [2] http://k.ylo.ph/2016/04/04/loudnorm.html
>
> Thanks!
> Kyle

Hi,

I think there was a little bit of confusion about what this filter
does, and why exactly it links libebur128. I'm not sure if anyone
actually reviewed the patch, since all of the discussion was about
libebur128. I didn't quite provide it the first time, so here's some
background information and rationale for linking libebur128.

Most broadcasters are now specifying mandatory loudness targets for
source material, which is usually supplied as a target integrated
loudness value and a target maximum true peak. Loudness normalization
is easy for files with sufficient headroom for linear gain
adjustments, difficult for files with not enough headroom, and even
more difficult for live streams – this filter handles all these
situations. The loudnorm algo is basically a loudness-tuned AGC which
was designed to honor local dynamics, followed by a look-ahead true
peak limiter. Using normal parameters the result is usually
imperceptible, even with very dynamic source material such as
classical music. This filter should be a major boon to broadcasters
and digital distribution people, since the only software currently
available that does this kind of thing is commercial, and for the most
part very expensive (Minnetonka, Skylark, Nugen, etc.)

FFmpeg has a native ebur128 filter which already has all the EBU R128
logic baked in, but I chose to link libebur128 with the loudnorm
filter for a couple of reasons. If all it needed was an input
measurement, it would certainly be easy to just export the frame meta
from the ebur128 filter, but the loudnorm algorithm needs loudness
measurements from a couple of different places in the signal chain
making this solution impossible. I thought about extracting the FFmpeg
ebur128 functions so they could be reused elsewhere in FFmpeg, but the
R128 logic from the ebur128 filter is quite tangled, tied to filter
functions, internal states are spread out between several structs, and
is not easily extracted into a reusable API. Ideally, someone could
take a crack at extracting the FFmpeg ebur128 logic, but in the
meantime I chose to link libebur128 with the loudnorm filter.
libebur128 is well known and used R128 library.

True this adds a dependency and seems a little redundant, but this is
a filter and not a core part of FFmpeg. Many filters link special
libraries, users can choose to either configure and compile with the
library or not, and if they don't then the filter won't be enabled on
their builds. Maybe I'm wrong, but I don't see it as a huge issue. If
I or someone else gets the time to rewrite FFmpeg's ebur128 filter
down the road, it should be easy to update this filter to use FFmpeg's
ebur128 measurements.

Updated and rebased patch is attached, please review.

Thanks!
Kyle


0001-avfilter-add-loudnorm.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]: add DST decoder

2016-05-09 Thread Piotr Bandurski
> > this eating up memory:
> 
> Another one attached.

similar issue with this file:

https://www.datafilehost.com/d/798e9109

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


[FFmpeg-devel] AAC decoder handles start of audio stream differently (2.6.2 vs. current git)

2016-05-09 Thread Gregory J Wolfe
I am in the process of upgrading our FFmpeg from 2.6.2 to the latest
git.  One test I ran extracts audio from an AAC stream to a WAV file.
When I examine the audio using Audacity, the stream extracted using
the latest git is 1600 samples shorter, with the missing samples being
from the beginning of the audio stream. Coincidentally, the first
audio time stamp in the original audio stream is -1600 samples.  So
does 2.6.2 have a bug that is fixed in the latest git, or was a bug
introduced into the latest git since 2.6.2?

Below is the console output from the two test runs (built using MinGW,
running on Windows 7).  Note that our actual usage is by direct calls
to the FFmpeg libraries (I get the same result):



% ffmpeg.exe -i F:\VideoTestFiles\StillMation\Ironman2.mov 
C:\Temp\Ironman2_2.6.2.wav
ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8.1 (GCC)
  configuration: --enable-shared --disable-static --enable-memalign-hack 
--enable-libmp3lame --enable-libopenh264 --extra-ldflags=-static-libgcc 
--disable-iconv --enable-nvenc --enable-nonfree
  libavutil  54. 20.100 / 54. 20.100
  libavcodec 56. 26.100 / 56. 26.100
  libavformat56. 25.101 / 56. 25.101
  libavdevice56.  4.100 / 56.  4.100
  libavfilter 5. 11.102 /  5. 11.102
  libswscale  3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 
'F:\VideoTestFiles\StillMation\Ironman2.mov':
  Metadata:
major_brand : qt
minor_version   : 512
compatible_brands: qt
encoder : Lavf55.50.100
  Duration: 00:00:20.21, start: 0.03, bitrate: 146801 kb/s
Stream #0:0(eng): Video: qtrle (rle  / 0x20656C72), bgra, 1920x1080, 146673 
kb/s, 24 fps, 24 tbr, 12288 tbn, 12288 tbc (default)
Metadata:
  handler_name: DataHandler
  encoder : Lavc55.71.100 qtrle
  timecode: 00:00:00:00
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, 
fltp, 128 kb/s (default)
Metadata:
  handler_name: DataHandler
Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s
Metadata:
  handler_name: DataHandler
  timecode: 00:00:00:00
Output #0, wav, to 'C:\Temp\Ironman2_2.6.2.wav':
  Metadata:
major_brand : qt
minor_version   : 512
compatible_brands: qt
ISFT: Lavf56.25.101
Stream #0:0(eng): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 
stereo, s16, 1536 kb/s (default)
Metadata:
  handler_name: DataHandler
  encoder : Lavc56.26.100 pcm_s16le
Stream mapping:
  Stream #0:1 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
size=3776kB time=00:00:20.13 bitrate=1536.0kbits/s
video:0kB audio:3776kB subtitle:0kB other streams:0kB global headers:0kB muxing 
overhead: 0.002017%



% ffmpeg.exe -i F:\VideoTestFiles\StillMation\Ironman2.mov 
C:\Temp\Ironman2_Latest.wav
ffmpeg version 3.0.git Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8.1 (GCC)
  configuration: --enable-shared --disable-static --enable-memalign-hack 
--enable-libmp3lame --enable-libopenh264 --extra-ldflags=-static-libgcc 
--disable-iconv --enable-nvenc --enable-nonfree
  libavutil  55. 20.100 / 55. 20.100
  libavcodec 57. 34.101 / 57. 34.101
  libavformat57. 34.100 / 57. 34.100
  libavdevice57.  0.101 / 57.  0.101
  libavfilter 6. 41.101 /  6. 41.101
  libswscale  4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 
'F:\VideoTestFiles\StillMation\Ironman2.mov':
  Metadata:
major_brand : qt
minor_version   : 512
compatible_brands: qt
encoder : Lavf55.50.100
  Duration: 00:00:20.21, start: 0.00, bitrate: 146801 kb/s
Stream #0:0(eng): Video: qtrle (rle  / 0x20656C72), bgra, 1920x1080, 146673 
kb/s, 24 fps, 24 tbr, 12288 tbn (default)
Metadata:
  handler_name: DataHandler
  encoder : Lavc55.71.100 qtrle
  timecode: 00:00:00:00
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, 
fltp, 128 kb/s (default)
Metadata:
  handler_name: DataHandler
Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s
Metadata:
  handler_name: DataHandler
  timecode: 00:00:00:00
[wav @ 00492420] Using AVStream.codec to pass codec parameters to muxers is 
deprecated, use AVStream.codecpar instead.
Output #0, wav, to 'C:\Temp\Ironman2_Latest.wav':
  Metadata:
major_brand : qt
minor_version   : 512
compatible_brands: qt
ISFT: Lavf57.34.100
Stream #0:0(eng): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 
stereo, s16, 1536 kb/s (default)
Metadata:
  handler_name: DataHandler
  encoder : Lavc57.34.101 pcm_s16le
Stream mapping:
  Stream #0:1 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
size=3770kB time=00:00:

Re: [FFmpeg-devel] AAC decoder handles start of audio stream differently (2.6.2 vs. current git)

2016-05-09 Thread Hendrik Leppkes
On Mon, May 9, 2016 at 11:20 PM, Gregory J Wolfe
 wrote:
> I am in the process of upgrading our FFmpeg from 2.6.2 to the latest
> git.  One test I ran extracts audio from an AAC stream to a WAV file.
> When I examine the audio using Audacity, the stream extracted using
> the latest git is 1600 samples shorter, with the missing samples being
> from the beginning of the audio stream. Coincidentally, the first
> audio time stamp in the original audio stream is -1600 samples.  So
> does 2.6.2 have a bug that is fixed in the latest git, or was a bug
> introduced into the latest git since 2.6.2?
>

It is common for AAC to have padding at the beginning of the stream to
prime the decoder, those samples being dropped is the proper way to do
this.
And your timestamp seems to confirm this.

So sounds like latest ffmpeg is doing it right to me.

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


Re: [FFmpeg-devel] AAC decoder handles start of audio stream differently (2.6.2 vs. current git)

2016-05-09 Thread Gregory J Wolfe
> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Hendrik Leppkes
> Sent: Monday, May 09, 2016 5:27 PM
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] AAC decoder handles start of audio stream
> differently (2.6.2 vs. current git)
> 
> On Mon, May 9, 2016 at 11:20 PM, Gregory J Wolfe
>  wrote:
> > I am in the process of upgrading our FFmpeg from 2.6.2 to the latest
> > git.  One test I ran extracts audio from an AAC stream to a WAV file.
> > When I examine the audio using Audacity, the stream extracted using
> > the latest git is 1600 samples shorter, with the missing samples being
> > from the beginning of the audio stream. Coincidentally, the first
> > audio time stamp in the original audio stream is -1600 samples.  So
> > does 2.6.2 have a bug that is fixed in the latest git, or was a bug
> > introduced into the latest git since 2.6.2?
> >
> 
> It is common for AAC to have padding at the beginning of the stream to
> prime the decoder, those samples being dropped is the proper way to do
> this.
> And your timestamp seems to confirm this.
> 
> So sounds like latest ffmpeg is doing it right to me.
> 
> - Hendrik

OK, thanks, that makes sense.  The codec info says that the audio sample
delay is 1024 samples.  So maybe that's the minimum amount, and in this
case  the author/original software that created the audio stream used 1600
samples because it works out to exactly 1/30 second.

Greg Wolfe, Kodak Alaris
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avfilter/f_metadata: add pts_time to print output

2016-05-09 Thread Michael Niedermayer
On Mon, May 09, 2016 at 01:52:05PM +0200, Paul B Mahol wrote:
> On 5/9/16, Tobias Rapp  wrote:
> > This allows e.g. to correlate signalstats metadata to time position
> > without having to find out the filter chain timebase first.
> >
> > Signed-off-by: Tobias Rapp 
> > ---
> >  libavfilter/f_metadata.c | 7 +--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> >
> 
> lgtm

applied

thx

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

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates


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


Re: [FFmpeg-devel] Refund request for FFmpeg at CLT 2016

2016-05-09 Thread Michael Niedermayer
On Fri, Apr 29, 2016 at 11:30:26AM +0200, Thomas Volkert wrote:
> 
> On 27.04.2016 16:08, Michael Niedermayer wrote:
> >On Tue, Apr 26, 2016 at 08:10:25PM +0200, Thomas Volkert wrote:
> >>Hi,
> >>,
> >>On 21.03.2016 21:49, Thilo Borgmann wrote:
> >>>Am 21.03.16 um 20:42 schrieb Michael Niedermayer:
> On Mon, Mar 21, 2016 at 12:14:40PM +0100, Thilo Borgmann wrote:
> >Hi,
> >
> >last weekend, the Chemnitzer Linux Tage in Germany took place and we had 
> >quite a
> >good experience and contacts to our end-users.
> >
> >Here is my refund request for gas taking Carl Eugen and myself to the 
> >venue.
> >
> >I'll send the invoice to Stefano. It is 64,43€.
> please provide some more details like the distance driven or from
> what city to which city
> >>>We went from Berlin to Chemnitz on Friday, back from Chemnitz to Berlin
> >>>on Sunday - overall around 550km. Also Hotel<->Venue transfer.
> >>>
> >>>Thomas made some pictures, he payed for the hotel around 160€. I think
> >>>he'll request refunds for that, too.
> >>My expenses consist of:
> >>- 1 x hotel: 154 €
> >please provide the approximate duration (number of nights, whatever)
> We booked the suite for 2 nights, 77 Euro each night. The 154 Euro
> are the overall hotel costs for Thilo, Carl and me.
> 
> >>- 1 x traveling: 147 €
> >please provide either the approximate distance traveled or name of
> >cities of start / end)
> The distance was: 2 * ~520km by car.
> 
> We used the tablecloth, t-shirts and PR material from last year - no
> further costs.

LGTM

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

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.


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/2] avfilter/f_metadata: update print output header line format

2016-05-09 Thread Michael Niedermayer
On Mon, May 09, 2016 at 01:52:24PM +0200, Paul B Mahol wrote:
> On 5/9/16, Tobias Rapp  wrote:
> > Update print mode output header line format to be more consistent with
> > other log output of FFmpeg. The printf-modifiers have been inspired by
> > the showinfo filter.
> >
> > Signed-off-by: Tobias Rapp 
> > ---
> >  libavfilter/f_metadata.c | 8 
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> lgtm

applied

thx

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

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


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


[FFmpeg-devel] [PATCH] libavformat/oggdec: Free stream private when header parsing fails.

2016-05-09 Thread Chris Cunningham
Leaking this private structure opens up the possibility that it may
be re-used when parsing later packets in the stream. This is
problematic if the later packets are not the same codec type (e.g.
private allocated during Vorbis parsing, but later packets are Opus
and the private is assumed to be the oggopus_private type in
opus_header()).
---
 libavformat/oggdec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 528d8db..47a0cba 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -701,6 +701,7 @@ static int ogg_read_header(AVFormatContext *s)
 if (ogg->streams[i].header < 0) {
 av_log(s, AV_LOG_ERROR, "Header parsing failed for stream %d\n", 
i);
 ogg->streams[i].codec = NULL;
+av_freep(&ogg->streams[i].private);
 } else if (os->codec && os->nb_header < os->codec->nb_header) {
 av_log(s, AV_LOG_WARNING,
"Headers mismatch for stream %d: "
-- 
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] avfilter: add loudnorm

2016-05-09 Thread Kyle Swanson
Hi,

Updated patch attached. Thanks!


0001-avfilter-add-loudnorm.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavc/mjpegdec: Read polarity field fromAVI1 chunk

2016-05-09 Thread Piotr Bandurski
> > On Mon, May 09, 2016 at 02:44:23PM +0200, Carl Eugen Hoyos wrote:
> > Hi!
> > 
> > Attached aptch fixes ticket #5523 for me, I only tested the files
> > attached there.
> 
> breaks:
> https://trac.ffmpeg.org/raw-attachment/ticket/362/test.avi
> 

I installed Morgan MJPEG codec here and by default "test.avi" file decodes with 
inverted fileld order - to decode this file correctly
one must enable "invert field order" option under "Decompression" and after 
that "test.avi" file decodes correctly, so it  looks like
this codec does not check automaticly if fields are in the correct order or not.

Here are two Morgan samples - one encoded with default options and one with 
enabled "invert field order" option:

https://www.datafilehost.com/d/8258326e




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


[FFmpeg-devel] [PATCH] avcodec: Add AVClass to AVCodecParameters

2016-05-09 Thread Michael Niedermayer
Allow enumeration, read and write of fields without requiring #if on versions
All other public structures can be accessed through AVOptions

TODO: add all fields to AVOption table
TODO: bump version
TODO: update APIChanges

Signed-off-by: Michael Niedermayer 
---
 libavcodec/avcodec.h |   12 
 libavcodec/utils.c   |   26 ++
 2 files changed, 38 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 3813a0a..71e7694 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3903,6 +3903,10 @@ typedef struct AVSubtitle {
  */
 typedef struct AVCodecParameters {
 /**
+ * A class for logging and AVOptions
+ */
+AVClass *av_class;
+/**
  * General type of the encoded data.
  */
 enum AVMediaType codec_type;
@@ -4154,6 +4158,14 @@ const AVClass *avcodec_get_frame_class(void);
 const AVClass *avcodec_get_subtitle_rect_class(void);
 
 /**
+ * Get the AVClass for AVCodecParameters. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *avcodec_get_parameters_class(void);
+
+/**
  * Copy the settings of the source AVCodecContext into the destination
  * AVCodecContext. The resulting destination codec context will be
  * unopened, i.e. you are required to call avcodec_open2() before you
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index e6609ef..38b6330 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -4003,12 +4003,33 @@ AVCPBProperties *ff_add_cpb_side_data(AVCodecContext 
*avctx)
 return props;
 }
 
+#define OFFSET(x) offsetof(AVCodecParameters,x)
+#define V AV_OPT_FLAG_VIDEO_PARAM
+#define A AV_OPT_FLAG_AUDIO_PARAM
+#define S AV_OPT_FLAG_SUBTITLE_PARAM
+#define E AV_OPT_FLAG_ENCODING_PARAM
+#define D AV_OPT_FLAG_DECODING_PARAM
+static const AVOption avcodec_parameters_options[] = {
+{"b", "bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT64, {.i64 = 
0 }, 0, INT64_MAX, A|V|E|D },
+{"pixel_format", "set pixel format", OFFSET(format), 
AV_OPT_TYPE_PIXEL_FMT, {.i64=AV_PIX_FMT_NONE}, -1, INT_MAX, V|E|D },
+{"sample_fmt", "sample format", OFFSET(format), AV_OPT_TYPE_SAMPLE_FMT, 
{.i64=AV_SAMPLE_FMT_NONE}, -1, INT_MAX, A|E|D },
+{"video_size", "video size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, 
{.str=NULL}, 0, INT_MAX, V|E|D },
+NULL
+};
+
+static const AVClass av_codec_parameters_class = {
+.class_name  = "AVCodecParameters",
+.option  = avcodec_parameters_options,
+.version = LIBAVUTIL_VERSION_INT,
+};
+
 static void codec_parameters_reset(AVCodecParameters *par)
 {
 av_freep(&par->extradata);
 
 memset(par, 0, sizeof(*par));
 
+par->av_class= &av_codec_parameters_class;
 par->codec_type  = AVMEDIA_TYPE_UNKNOWN;
 par->codec_id= AV_CODEC_ID_NONE;
 par->format  = -1;
@@ -4023,6 +4044,11 @@ static void codec_parameters_reset(AVCodecParameters 
*par)
 par->level   = FF_LEVEL_UNKNOWN;
 }
 
+const AVClass *avcodec_get_parameters_class(void)
+{
+return &av_codec_parameters_class;
+}
+
 AVCodecParameters *avcodec_parameters_alloc(void)
 {
 AVCodecParameters *par = av_mallocz(sizeof(*par));
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH] lavfi/drawutils: support NV12 and NV21

2016-05-09 Thread Rodger Combs
---
 libavfilter/drawutils.c   | 33 -
 tests/ref/fate/filter-pixfmts-pad |  2 ++
 2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index d37c83e..3146bfa 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -205,8 +205,6 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat 
format, unsigned flags)
 return AVERROR(ENOSYS);
 nb_planes = FFMAX(nb_planes, c->plane + 1);
 }
-if ((desc->log2_chroma_w || desc->log2_chroma_h) && nb_planes < 3)
-return AVERROR(ENOSYS); /* exclude NV12 and NV21 */
 memset(draw, 0, sizeof(*draw));
 draw->desc  = desc;
 draw->format= format;
@@ -214,7 +212,7 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat 
format, unsigned flags)
 memcpy(draw->pixelstep, pixelstep, sizeof(draw->pixelstep));
 draw->hsub[1] = draw->hsub[2] = draw->hsub_max = desc->log2_chroma_w;
 draw->vsub[1] = draw->vsub[2] = draw->vsub_max = desc->log2_chroma_h;
-for (i = 0; i < ((desc->nb_components - 1) | 1); i++)
+for (i = 0; i < (desc->nb_components - !!(desc->flags & 
AV_PIX_FMT_FLAG_ALPHA)); i++)
 draw->comp_mask[desc->comp[i].plane] |=
 1 << desc->comp[i].offset;
 return 0;
@@ -243,20 +241,21 @@ void ff_draw_color(FFDrawContext *draw, FFDrawColor 
*color, const uint8_t rgba[4
 color->comp[rgba_map[i]].u16[0] = 
color->comp[rgba_map[i]].u8[0] << (draw->desc->comp[rgba_map[i]].depth - 8);
 }
 }
-} else if (draw->nb_planes == 3 || draw->nb_planes == 4) {
+} else if (draw->nb_planes >= 2) {
 /* assume YUV */
-color->comp[0].u8[0] = RGB_TO_Y_CCIR(rgba[0], rgba[1], rgba[2]);
-color->comp[1].u8[0] = RGB_TO_U_CCIR(rgba[0], rgba[1], rgba[2], 0);
-color->comp[2].u8[0] = RGB_TO_V_CCIR(rgba[0], rgba[1], rgba[2], 0);
+const AVPixFmtDescriptor *desc = draw->desc;
+color->comp[desc->comp[0].plane].u8[desc->comp[0].offset] = 
RGB_TO_Y_CCIR(rgba[0], rgba[1], rgba[2]);
+color->comp[desc->comp[1].plane].u8[desc->comp[1].offset] = 
RGB_TO_U_CCIR(rgba[0], rgba[1], rgba[2], 0);
+color->comp[desc->comp[2].plane].u8[desc->comp[2].offset] = 
RGB_TO_V_CCIR(rgba[0], rgba[1], rgba[2], 0);
 color->comp[3].u8[0] = rgba[3];
-if (draw->desc->comp[0].depth > 8)
-color->comp[0].u16[0] = color->comp[0].u8[0] << 
(draw->desc->comp[0].depth - 8);
-if (draw->desc->comp[1].depth > 8)
-color->comp[1].u16[0] = color->comp[1].u8[0] << 
(draw->desc->comp[1].depth - 8);
-if (draw->desc->comp[2].depth > 8)
-color->comp[2].u16[0] = color->comp[2].u8[0] << 
(draw->desc->comp[2].depth - 8);
-if (draw->desc->comp[3].depth > 8)
-color->comp[3].u16[0] = color->comp[3].u8[0] << 
(draw->desc->comp[3].depth - 8);
+#define EXPAND(compn) \
+if (desc->comp[compn].depth > 8) \
+color->comp[desc->comp[compn].plane].u16[desc->comp[compn].offset] 
= \
+color->comp[desc->comp[compn].plane].u8[desc->comp[compn].offset] 
<< (draw->desc->comp[compn].depth - 8)
+EXPAND(3);
+EXPAND(2);
+EXPAND(1);
+EXPAND(0);
 } else if (draw->format == AV_PIX_FMT_GRAY8 || draw->format == 
AV_PIX_FMT_GRAY8A) {
 color->comp[0].u8[0] = RGB_TO_Y_CCIR(rgba[0], rgba[1], rgba[2]);
 color->comp[1].u8[0] = rgba[3];
@@ -450,7 +449,7 @@ void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor 
*color,
 /* 0x101 * alpha is in the [ 2 ; 0x1001] range */
 alpha = 0x101 * color->rgba[3] + 0x2;
 }
-nb_planes = (draw->nb_planes - 1) | 1; /* eliminate alpha */
+nb_planes = draw->nb_planes - !!(draw->desc->flags & 
AV_PIX_FMT_FLAG_ALPHA);
 for (plane = 0; plane < nb_planes; plane++) {
 nb_comp = draw->pixelstep[plane];
 p0 = pointer_at(draw, dst, dst_linesize, plane, x0, y0);
@@ -627,7 +626,7 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color,
 } else {
 alpha = (0x101 * color->rgba[3] + 0x2) >> 8;
 }
-nb_planes = (draw->nb_planes - 1) | 1; /* eliminate alpha */
+nb_planes = draw->nb_planes - !!(draw->desc->flags & 
AV_PIX_FMT_FLAG_ALPHA);
 for (plane = 0; plane < nb_planes; plane++) {
 nb_comp = draw->pixelstep[plane];
 p0 = pointer_at(draw, dst, dst_linesize, plane, x0, y0);
diff --git a/tests/ref/fate/filter-pixfmts-pad 
b/tests/ref/fate/filter-pixfmts-pad
index a734d31..e94db4f 100644
--- a/tests/ref/fate/filter-pixfmts-pad
+++ b/tests/ref/fate/filter-pixfmts-pad
@@ -13,6 +13,8 @@ gbrp14le9ae804cf217bec0a737c36c20573cbe5
 gbrp9le 9a86dab5661c213ce2b7e00ae48b4d1f
 grayddc663a0491df3959d9c5795dceaa72e
 gray16le468bda6155bdc7a7a20c34d6e599fd16
+nv12381574979cb04be10c9168540310afad
+nv210fdeb2cdd56cf5a7147dc273

[FFmpeg-devel] libavdevice/decklink: advanced options for selecting an input connection

2016-05-09 Thread Felipe Astroza
This patch add additional input options: video input connection (vinput), audio 
input connection (ainput).

Usage:
ffmpeg -f decklink -i 'Card name'@fmt :vinput:ainput
Where fmt, vinput and ainput are optional

Also it adds list_vinputs and list_ainputs
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec: Add AVClass to AVCodecParameters

2016-05-09 Thread Hendrik Leppkes
On Tue, May 10, 2016 at 2:07 AM, Michael Niedermayer
 wrote:
> Allow enumeration, read and write of fields without requiring #if on versions
> All other public structures can be accessed through AVOptions
>
> TODO: add all fields to AVOption table
> TODO: bump version
> TODO: update APIChanges


I don't like this, the struct is pretty cleanly defined and unlikely
to be extended much over time.
Most other structs have AVOptions so the CLI can interact with it, but
this struct is not meant to be modified by users, its just a direct
line of communication between demuxer->decoder or encoder->muxer.

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