Re: [FFmpeg-devel] [PATCH 2/6] avcodec/v4l2_m2m: fix cant typo

2018-12-29 Thread Michael Niedermayer
On Fri, Dec 28, 2018 at 11:35:52PM +0100, Moritz Barsnick wrote:
> On Fri, Dec 28, 2018 at 22:22:53 +0100, Michael Niedermayer wrote:
> > - * Reinitializes the V4L2m2mContext when the driver cant continue 
> > processing
> > + * Reinitializes the V4L2m2mContext when the driver cannot continue 
> > processing
> >   * with the  any of the current V4L2Contexts (ie, changes in output and 
> > capture).
> 
> The line below is also wrong. "with the any of" does not make any
> sense, and "ie," is very ugly.
> 
> Suggestion:
> 
>   Reinitializes the V4L2m2mContext when the driver cannot continue processing
>   with any of the current V4L2Contexts (i.e. changes in output and capture).
> 
> Even with "i.e.", the text in the parantheses doesn't make sense to me.
> My guess is "ie" meant to be "e.g.".
> 
> So:
> 
>   Reinitializes the V4L2m2mContext when the driver cannot continue processing
>   with any of the current V4L2Contexts (e.g. changes in output and capture).

I agree but this seems unrelated to the typo fix and its your change
its better if you commit this instead of it being added into the same
commit as the typo fix. 
also feel free to push trivial changes like mine if you want to work on
top of them so they dont hold you up

thx

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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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


Re: [FFmpeg-devel] [PATCH] delogo filter: new "uglarm" interpolation mode added

2018-12-29 Thread Uwe Freese

Hello,

here's a new version of the patch.

Changes since the last version of the patch (mail from 27.12. 13:00), 
according the comments from Moritz and Carl Eugen:



- using av_assert0 instead of throwing an error if planes > MAX_PLANES
- using av_freep with the reference operator in uninit
- copyright year 2019 -> 2018
- add MODE_NB value in "mode" enum and limit mode parameter in 
delogo_options to MODE_NB-1
- changed commit message style: "avfilter/vf_delogo: add uglarm 
interpolation mode"

- bracket style, line 360
- changed documentation, using @var{...}, @code{...}, @table @option 
etc., explaining "uglarm" and using the term "raised to the power of" 
(see https://en.wikipedia.org/wiki/Exponentiation). I hope the use of 
the macros is correct as I used them... (@var referencing a parameter 
and @code referencing a value)

- changed parameter "power" (int) to "exponent" (float)


Some considerations about the parameter name "power" / "exponent":

I noticed that for the specific calculation of the weight in the new 
mode, the wording should be better named "exponent" instead of "power".

Wikipedia (https://en.wikipedia.org/wiki/Exponentiation) writes:

base ^ exponent = power

So I changed the value type to float and the calculation to

weight = distance ^ exponent
(float value exponent).

That is IMHO more consistent and easier to explain.

The downside is that the term "power" (or "strength") would be more 
generic and would probably be better reusable for other modes.


What do you think? Is "exponent" now ok, or should I change it back to 
"power", "strength" or something alike?



Again, I would be glad about comments and reviews. - Let me know what 
should be changed and I'll create a new patch in some days.


Regards,
Uwe


Am 28.12.18 um 00:08 schrieb Carl Eugen Hoyos:

2018-12-27 22:02 GMT+01:00, Uwe Freese :


Am 27.12.18 um 20:25 schrieb Carl Eugen Hoyos:

I have now added as error handling:

av_log(inlink->src, AV_LOG_ERROR, "More planes in frame than
expected.\n");
return AVERROR(ENOMEM);

Is this ok, or how should this be implemented instead?

Not sure I understand: How can plane get >= MAX_PLANES?
If this is impossible (as I believe), please use av_assert0().

I meant the use of "ENOMEM" and if there's a better error
constant to use here.

At this line, the error is not about memory, but that the video input
format is unexpected.

Is there a format with too many planes?
If not, please use an assert, do not return an error.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>From 83e79abb3311eb2dd92c63e8e15e0476af2f2891 Mon Sep 17 00:00:00 2001
From: breaker27 
Date: Wed, 26 Dec 2018 18:16:48 +0100
Subject: [PATCH] avfilter/vf_delogo: add uglarm interpolation mode

---
 doc/filters.texi|  28 +++
 libavfilter/vf_delogo.c | 189 +---
 2 files changed, 208 insertions(+), 9 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 65ce25bc18..792560ad79 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -7952,6 +7952,34 @@ Specify the thickness of the fuzzy edge of the rectangle (added to
 deprecated, setting higher values should no longer be necessary and
 is not recommended.
 
+@item mode
+Specify the interpolation mode used to remove the logo.
+It accepts the following values:
+@table @option
+@item xy
+Only the border pixels in straight x and y direction are considered
+to replace any logo pixel. This mode tends to flicker and to show
+horizontal and vertical lines.
+@item uglarm
+Consider the whole border for every logo pixel to replace. This mode
+uses the distance raised to the power of the given @var{exponent} as
+weight that decides to which amount every border pixel is taken into
+account. This results in a more blurred area, which tends to be less
+distracting. The uglarm mode was first implemented in VirtualDub's
+LogoAway filter and is also known from ffdshow and is the
+abbreviation for "Uwe's Great LogoAway Remove Mode".
+@end table
+The default value is @code{xy}.
+
+@item exponent
+Specify the exponent used to calculate the weight out of the
+distance in @code{uglarm} mode (weight = distance ^ @var{exponent}).
+The value @code{0} results in a logo area which has
+the same average color everywhere. The higher the value, the more
+relevant a near border pixel will get, meaning that the borders of
+the logo area are more similar to the surrounding pixels. The default
+value is @code{3}.
+
 @item show
 When set to 1, a green rectangle is drawn on the screen to simplify
 finding the right @var{x}, @var{y}, @var{w}, and @var{h} parameters.
diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
index 065d093641..dcb0366e63 100644
--- a/libavfilter/vf_delogo.c
+++ b/libavfilter/vf_delogo.c
@@ -2,6 +2,7 @@
  * Copyright (c) 2002 Jindrich Makovicka 
  * Copyright (c) 2011 Stefano Sabatini
  * 

Re: [FFmpeg-devel] [PATCH 1/2] tools/target_dec_fate.sh: print some statistics

2018-12-29 Thread Carl Eugen Hoyos


> Am 29.12.2018 um 17:40 schrieb Derek Buitenhuis :
> 
>> On 29/12/2018 09:47, Moritz Barsnick wrote:
>> I believe this is the sort of math that won't work on old, non-POSIX
>> Bourne shells. (I'm thinking Solaris /bin/sh here.) In case that
>> even matters.
> 
> I don't think we care about those, e.g.:
> 
>~/ffmpeg$ grep '+1)' configure
>eval ${pvar}_level=$(($level+1))

configure automatically chooses a (gnu) bash-compatible Shell on Solaris (this 
is impossible to avoid), all other FFmpeg scripts use another shell at least on 
some systems, this for example affects the versioning of shared libraries.

I find this difficult to test though.

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


Re: [FFmpeg-devel] [Compiled Failed] Trying to compile FFmpeg with mysofa and it failed at af_sofalizer.c:164:32

2018-12-29 Thread James Almer
On 12/29/2018 8:09 AM, Paul B Mahol wrote:
> On 12/29/18, Ysy  wrote:
>> I was trying to compile FFmpeg with `--enable-libmysofa`, and it failed with
>> this message below:
>>
>> src/libavfilter/af_sofalizer.c:164:32: error: implicit declaration of
>> function 'mysofa_neighborhood_init_withstepdefine' is invalid in C99
>>   [-Werror,-Wimplicit-function-declaration]
>> s->sofa.neighborhood =
>> mysofa_neighborhood_init_withstepdefine(s->sofa.hrtf,
>>^
>> src/libavfilter/af_sofalizer.c:164:32: warning: this function declaration is
>> not a prototype [-Wstrict-prototypes]
>> src/libavfilter/af_sofalizer.c:164:30: warning: incompatible integer to
>> pointer conversion assigning to 'struct MYSOFA_NEIGHBORHOOD *' from 'int'
>>   [-Wint-conversion]
>> s->sofa.neighborhood =
>> mysofa_neighborhood_init_withstepdefine(s->sofa.hrtf,
>>  ^
>> ~
>> 2 warnings and 1 error generated.
>>
>> Device:
>> macOS Mojave (10.14.2)
>> Apple LLVM version 10.0.0 (clang-1000.11.45.5)
>> Target: x86_64-apple-darwin18.2.0
>> Thread model: posix
>>
>> The code was committed 6 days ago with comment `stop using easy API` in
>> master branch.
>>
>> I’ve noticed that this function (`mysofa_neighborhood_init_withstepdefine `)
>> is really not yet exist on this project. Maybe it is not completed yet?
>>
>> Thank you for watching this.
> 
> Update libmysofa lib.

What's the first version that works? The configure check should be
updated to bail out if it's too old.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] tools/target_dec_fate.sh: print some statistics

2018-12-29 Thread Derek Buitenhuis
On 29/12/2018 09:47, Moritz Barsnick wrote:
> I believe this is the sort of math that won't work on old, non-POSIX
> Bourne shells. (I'm thinking Solaris /bin/sh here.) In case that
> even matters.

I don't think we care about those, e.g.:

~/ffmpeg$ grep '+1)' configure
eval ${pvar}_level=$(($level+1))
- Derek
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/prores_ks: fixed luma quantize if q >= MAX_STORED_Q

2018-12-29 Thread Derek Buitenhuis
On 28/12/2018 20:30, Alex Mogurenko wrote:
> ---
>  libavcodec/proresenc_kostya.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)

I think it's OK.

I'll push it in 24 hours if noone else objects.

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


Re: [FFmpeg-devel] [PATCH v2] mov: Remove duration-of-last-frame heuristic hack

2018-12-29 Thread Derek Buitenhuis
On 29/12/2018 10:36, Carl Eugen Hoyos wrote:
> Please provide a sample.

I mean, the hack being removing is *obviously* wrong and against the
QTFF and ISOBMFF specs, to ignore values based on a heuristic.

However, since you insist:
http://chromashift.org/ffmpegsamps/valid_file.mp4

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


Re: [FFmpeg-devel] [PATCH] libavcodec: Remove dynamic relocs from aarch64/h264idct_neon.S

2018-12-29 Thread Manoj Gupta
On Sat, Dec 29, 2018 at 2:32 AM Carl Eugen Hoyos  wrote:
>
> 2018-12-29 0:12 GMT+01:00, Manoj Gupta :
>
> > I recently had a problem building ffmpeg for AArch64 where lld
> > linker complained about text relocations in readonly segment.
> > The following patch fixes the linker complains by referring to a
> > local label instead of function name.
>
> Do you know why this issue wasn't found when the previously
> fixed occurrences were seen?
>
This fixes the linking issues on AArch64. The previous fix I found was
for ARM32/Thumb whereas this file is AArch64 specific.

Thanks,
Manoj

> 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] Install from Source on CentOS 7

2018-12-29 Thread Helmut K. C. Tessarek
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 2018-12-28 19:21, Moritz Barsnick wrote:
> x265 messed it up, with a commit created 15 days ago: 
> http://ffmpeg.org/pipermail/ffmpeg-user/2018-December/042609.html

Hmm, ok. It must have been authored 15 days ago, but commited after
Dec 24th. Anyway, thanks for the info.

I believe to remember that x265 broke pretty much the same thing
several months ago.

> AFAIU, fate doesn't use external libraries. (Not even just build
> tests, apparently.)

I see.

Cheers,
  K. C.

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

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

iQIzBAEBCgAdFiEE191csiqpm8f5Ln9WvgmFNJ1E3QAFAlwnYpwACgkQvgmFNJ1E
3QCOHg/9GXfeSGOND0f4xg45yP9jrn8MLWEKqCK68i4mAtvtLbJyXFY7xSV08L8Y
A6+xDJSPvAoRLX/fHGGNQ24DQwLJogpHPAg2ktlMvcGaJP1qh5sHD5aOw/eSsWi4
H5QBmCkCQ1ZTVCBxVfvEWbzQCLF6cpx0OoAX+zl0i9yUcgbV+4JwNmu4C5Pa4rwt
E3QkFmQ8J8cizvWdPUyNjjUN7k5oV8mOssOfledzHTGbZtMrQ+KaaNLrBP72If73
u1c75piDggxn7/sJLMzLsrspwyqkTl5wj9fBbV7iQtToBfI3CxGec8CktSj/8P+2
2S1o/AlA1xbnFkmYujNTd3/Tk0WtJ/f+PQ615YlJZtQAfDt3FvbPdHfGZF2cMtOm
7gTjCbyoEkk2CFXxkq/iFoYSQ/3FphiHiC4AjuOwVWPaET+BmHweQmU9Vu2F2TIm
jnaJBjnuCzxmNGMTrhhiCJvT7UPbFgo84sGtwhwoPED/0CMVfa06fr2CrHakYqAm
g6MqcxPzev0C1940aLBgk7+sVzsCIkjYe1PHge9jEjtanGzRMQOeyjXhWGaVccQD
hR/QniittRkIMnJmISM0+na6ap6E7qJ31waMN80ATb5t46U9QvzQ/6gXIzVhDJCB
+7xQVdYsNxxy980qBQruQjeFwj0pyKEsM31NAQTfQ1ZZQn4Ux4Y=
=7Ohr
-END PGP SIGNATURE-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/dxva2_mpeg2.c: don't try to get surface index for absent frame

2018-12-29 Thread Hendrik Leppkes
On Wed, Dec 26, 2018 at 8:55 PM Anton Fedchin  wrote:
>
> From: Anton Fedchin 
>
> after 153b36f there is a possibility to crash when trying to get index of
> a surface which points to nirvana. it may occurs when a mpeg2 stream starts
> with non i-frame.
> ---
>  libavcodec/dxva2_mpeg2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c
> index 8cc21bf199..c862e6e5e4 100644
> --- a/libavcodec/dxva2_mpeg2.c
> +++ b/libavcodec/dxva2_mpeg2.c
> @@ -48,11 +48,11 @@ static void fill_picture_parameters(AVCodecContext *avctx,
>  memset(pp, 0, sizeof(*pp));
>  pp->wDecodedPictureIndex = ff_dxva2_get_surface_index(avctx, 
> ctx, current_picture->f);
>  pp->wDeblockedPictureIndex   = 0;
> -if (s->pict_type != AV_PICTURE_TYPE_I)
> +if (s->pict_type != AV_PICTURE_TYPE_I && s->last_picture_ptr)
>  pp->wForwardRefPictureIndex  = ff_dxva2_get_surface_index(avctx, 
> ctx, s->last_picture.f);
>  else
>  pp->wForwardRefPictureIndex  = 0x;
> -if (s->pict_type == AV_PICTURE_TYPE_B)
> +if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture_ptr)
>  pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, 
> ctx, s->next_picture.f);
>  else
>  pp->wBackwardRefPictureIndex = 0x;

I think it would be better to fix ff_dxva2_get_surface_index to not
crash when fed an empty frame. That ensures safety for all codecs and
future codecs as well.

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


Re: [FFmpeg-devel] [Compiled Failed] Trying to compile FFmpeg with mysofa and it failed at af_sofalizer.c:164:32

2018-12-29 Thread Ysy
Oh I forget that. 
Thanks.
Feel that I was a fool 

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


[FFmpeg-devel] [PATCH 2/2] ffmpeg: allow disabling streams by type for inputs

2018-12-29 Thread Gyan

-vn/-an/-sn/-dn now work for inputs

Gyan.

From b6efe47010cda7b9d53d7464d68f5c63d0df7ff7 Mon Sep 17 00:00:00 2001
From: Gyan Doshi 
Date: Sat, 29 Dec 2018 16:19:09 +0530
Subject: [PATCH 2/2] ffmpeg: allow disabling streams by type for inputs

-vn/-an/-sn/-dn now works for input. Streams are still registered in
input_streams but they can't be automatically selected or mapped or
filtered.
---
 fftools/ffmpeg_opt.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 4ee7dbbe01..5350aaa4cb 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -760,6 +760,13 @@ static void add_input_streams(OptionsContext *o, 
AVFormatContext *ic)
 
 MATCH_PER_STREAM_OPT(discard, str, discard_str, ic, st);
 ist->user_set_discard = AVDISCARD_NONE;
+
+if ((o->video_disable && ist->st->codecpar->codec_type == 
AVMEDIA_TYPE_VIDEO) ||
+(o->audio_disable && ist->st->codecpar->codec_type == 
AVMEDIA_TYPE_AUDIO) ||
+(o->subtitle_disable && ist->st->codecpar->codec_type == 
AVMEDIA_TYPE_SUBTITLE) ||
+(o->data_disable && ist->st->codecpar->codec_type == 
AVMEDIA_TYPE_DATA))
+ist->user_set_discard = AVDISCARD_ALL;
+
 if (discard_str && av_opt_eval_int(, discard_opt, discard_str, 
>user_set_discard) < 0) {
 av_log(NULL, AV_LOG_ERROR, "Error parsing discard %s.\n",
 discard_str);
-- 
2.19.2___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [Compiled Failed] Trying to compile FFmpeg with mysofa and it failed at af_sofalizer.c:164:32

2018-12-29 Thread Paul B Mahol
On 12/29/18, Ysy  wrote:
> I was trying to compile FFmpeg with `--enable-libmysofa`, and it failed with
> this message below:
>
> src/libavfilter/af_sofalizer.c:164:32: error: implicit declaration of
> function 'mysofa_neighborhood_init_withstepdefine' is invalid in C99
>   [-Werror,-Wimplicit-function-declaration]
> s->sofa.neighborhood =
> mysofa_neighborhood_init_withstepdefine(s->sofa.hrtf,
>^
> src/libavfilter/af_sofalizer.c:164:32: warning: this function declaration is
> not a prototype [-Wstrict-prototypes]
> src/libavfilter/af_sofalizer.c:164:30: warning: incompatible integer to
> pointer conversion assigning to 'struct MYSOFA_NEIGHBORHOOD *' from 'int'
>   [-Wint-conversion]
> s->sofa.neighborhood =
> mysofa_neighborhood_init_withstepdefine(s->sofa.hrtf,
>  ^
> ~
> 2 warnings and 1 error generated.
>
> Device:
> macOS Mojave (10.14.2)
> Apple LLVM version 10.0.0 (clang-1000.11.45.5)
> Target: x86_64-apple-darwin18.2.0
> Thread model: posix
>
> The code was committed 6 days ago with comment `stop using easy API` in
> master branch.
>
> I’ve noticed that this function (`mysofa_neighborhood_init_withstepdefine `)
> is really not yet exist on this project. Maybe it is not completed yet?
>
> Thank you for watching this.

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


[FFmpeg-devel] [PATCH 1/2] ffmpeg: skip disabled streams

2018-12-29 Thread Gyan
At Michael's suggestion, earlier patch broken into two. This one stops 
discarded streams from being processed. A few more checks added.


Gyan

From fef4f27c42058b40547181e45073517abc9a57ea Mon Sep 17 00:00:00 2001
From: Gyan Doshi 
Date: Sat, 29 Dec 2018 16:17:05 +0530
Subject: [PATCH 1/2] ffmpeg: skip disabled streams

Fully discarded streams can't be selected for output or mapped or filtered.
Previously, a few packets from such streams, probably buffered for
stream probing, would get smuggled into output files.
---
 fftools/ffmpeg_filter.c |  7 +++
 fftools/ffmpeg_opt.c| 31 +--
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 6518d50870..8c0ff99dd9 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -293,10 +293,17 @@ static void init_input_filter(FilterGraph *fg, 
AVFilterInOut *in)
 exit_program(1);
 }
 ist = input_streams[input_files[file_idx]->ist_index + st->index];
+if (ist->user_set_discard == AVDISCARD_ALL) {
+av_log(NULL, AV_LOG_FATAL, "Stream specifier '%s' in filtergraph 
description %s "
+   "matches a disabled input stream.\n", p, fg->graph_desc);
+exit_program(1);
+}
 } else {
 /* find the first unused stream of corresponding type */
 for (i = 0; i < nb_input_streams; i++) {
 ist = input_streams[i];
+if (ist->user_set_discard == AVDISCARD_ALL)
+continue;
 if (ist->dec_ctx->codec_type == type && ist->discard)
 break;
 }
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index d4851a2cd8..4ee7dbbe01 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -268,7 +268,7 @@ static int opt_map(void *optctx, const char *opt, const 
char *arg)
 {
 OptionsContext *o = optctx;
 StreamMap *m = NULL;
-int i, negative = 0, file_idx;
+int i, negative = 0, file_idx, disabled;
 int sync_file_idx = -1, sync_stream_idx = 0;
 char *p, *sync;
 char *map;
@@ -303,6 +303,11 @@ static int opt_map(void *optctx, const char *opt, const 
char *arg)
"match any streams.\n", arg);
 exit_program(1);
 }
+if (input_streams[input_files[sync_file_idx]->ist_index + 
sync_stream_idx]->user_set_discard == AVDISCARD_ALL) {
+av_log(NULL, AV_LOG_FATAL, "Sync stream specification in map %s 
matches a disabled input "
+   "stream.\n", arg);
+exit_program(1);
+}
 }
 
 
@@ -339,6 +344,10 @@ static int opt_map(void *optctx, const char *opt, const 
char *arg)
 if (check_stream_specifier(input_files[file_idx]->ctx, 
input_files[file_idx]->ctx->streams[i],
 *p == ':' ? p + 1 : p) <= 0)
 continue;
+if (input_streams[input_files[file_idx]->ist_index + 
i]->user_set_discard == AVDISCARD_ALL) {
+disabled = 1;
+continue;
+}
 GROW_ARRAY(o->stream_maps, o->nb_stream_maps);
 m = >stream_maps[o->nb_stream_maps - 1];
 
@@ -358,6 +367,10 @@ static int opt_map(void *optctx, const char *opt, const 
char *arg)
 if (!m) {
 if (allow_unused) {
 av_log(NULL, AV_LOG_VERBOSE, "Stream map '%s' matches no streams; 
ignoring.\n", arg);
+} else if (disabled) {
+av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches disabled 
streams.\n"
+   "To ignore this, add a trailing '?' to 
the map.\n", arg);
+exit_program(1);
 } else {
 av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches no streams.\n"
"To ignore this, add a trailing '?' to 
the map.\n", arg);
@@ -437,7 +450,8 @@ static int opt_map_channel(void *optctx, const char *opt, 
const char *arg)
 /* allow trailing ? to map_channel */
 if (allow_unused = strchr(mapchan, '?'))
 *allow_unused = 0;
-if (m->channel_idx < 0 || m->channel_idx >= st->codecpar->channels) {
+if (m->channel_idx < 0 || m->channel_idx >= st->codecpar->channels ||
+input_streams[input_files[m->file_idx]->ist_index + 
m->stream_idx]->user_set_discard == AVDISCARD_ALL) {
 if (allow_unused) {
 av_log(NULL, AV_LOG_VERBOSE, "mapchan: invalid audio channel 
#%d.%d.%d\n",
 m->file_idx, m->stream_idx, m->channel_idx);
@@ -2174,6 +2188,8 @@ static int open_output_file(OptionsContext *o, const char 
*filename)
 int new_area;
 ist = input_streams[i];
 new_area = ist->st->codecpar->width * 
ist->st->codecpar->height + 1*!!ist->st->codec_info_nb_frames;
+if (ist->user_set_discard == AVDISCARD_ALL)
+

Re: [FFmpeg-devel] [PATCH] avcodec/dxva2_mpeg2.c: don't try to get surface index for absent frame

2018-12-29 Thread Carl Eugen Hoyos
2018-12-22 14:12 GMT+01:00, Anton Fedchin :
> From: Anton Fedchin 
>
> after 153b36f there is a possibility to crash when trying to get index of
> a surface which points to nirvana. it may occurs when a mpeg2 stream starts
> with non i-frame.
> ---
>  libavcodec/dxva2_mpeg2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c
> index 8cc21bf199..c862e6e5e4 100644
> --- a/libavcodec/dxva2_mpeg2.c
> +++ b/libavcodec/dxva2_mpeg2.c
> @@ -48,11 +48,11 @@ static void fill_picture_parameters(AVCodecContext
> *avctx,
>  memset(pp, 0, sizeof(*pp));
>  pp->wDecodedPictureIndex = ff_dxva2_get_surface_index(avctx,
> ctx, current_picture->f);
>  pp->wDeblockedPictureIndex   = 0;
> -if (s->pict_type != AV_PICTURE_TYPE_I)
> +if (s->pict_type != AV_PICTURE_TYPE_I && s->last_picture_ptr)
>  pp->wForwardRefPictureIndex  = ff_dxva2_get_surface_index(avctx,
> ctx, s->last_picture.f);
>  else
>  pp->wForwardRefPictureIndex  = 0x;
> -if (s->pict_type == AV_PICTURE_TYPE_B)
> +if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture_ptr)
>  pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx,
> ctx, s->next_picture.f);

Hendrik?

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


Re: [FFmpeg-devel] possible bug

2018-12-29 Thread Carl Eugen Hoyos
2018-12-28 16:25 GMT+01:00, Bogárdi Mátyás :
> Hello, I have got this warning in StaxRip: "encoder : Lavc58.35.100 flac
> [dca @ 023cd4738e40] 10 XLL channels is not implemented. Update your
> FFmpeg version to the newest one from Git. If the problem still occurs, it
> means that your file has a feature which has not been implemented.
> [dca @ 023cd4738e40] If you want to help, upload a sample of this file

Please upload your input file to a filehoster of your choice or
https://streams.videolan.org/upload/ and report back.

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


Re: [FFmpeg-devel] [PATCH v2] mov: Remove duration-of-last-frame heuristic hack

2018-12-29 Thread Carl Eugen Hoyos
2018-12-28 17:07 GMT+01:00, Derek Buitenhuis :
> On 24/12/2018 19:55, Derek Buitenhuis wrote:
>> This breaks totally valid files that get caught in its heuristic.
>>
>> This, according to the commit message, is my own doing, having asked
>> Michael to implement this check and providing a sample that was
>> "wrong". I am now atoning for my sins, and removing this hack, having
>> seen the light (aka that this was silly to do in the first place).
>>
>> Resotores correct behavior on valid files.
>>
>> This reverts commit 8e5e84c2a2a21a979b48e80c5a8dd44754ab3f21.
>>
>> Signed-off-by: Derek Buitenhuis 
>> ---
>> v1 had accidentally removed a cast. Woops.
>>  libavformat/mov.c | 6 --
>>  1 file changed, 6 deletions(-)
>
> Ping.

Please provide a sample.

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


[FFmpeg-devel] [Compiled Failed] Trying to compile FFmpeg with mysofa and it failed at af_sofalizer.c:164:32

2018-12-29 Thread Ysy
I was trying to compile FFmpeg with `--enable-libmysofa`, and it failed with 
this message below:

src/libavfilter/af_sofalizer.c:164:32: error: implicit declaration of function 
'mysofa_neighborhood_init_withstepdefine' is invalid in C99
  [-Werror,-Wimplicit-function-declaration]
s->sofa.neighborhood = 
mysofa_neighborhood_init_withstepdefine(s->sofa.hrtf,
   ^
src/libavfilter/af_sofalizer.c:164:32: warning: this function declaration is 
not a prototype [-Wstrict-prototypes]
src/libavfilter/af_sofalizer.c:164:30: warning: incompatible integer to pointer 
conversion assigning to 'struct MYSOFA_NEIGHBORHOOD *' from 'int'
  [-Wint-conversion]
s->sofa.neighborhood = 
mysofa_neighborhood_init_withstepdefine(s->sofa.hrtf,
 ^ 
~
2 warnings and 1 error generated.

Device:
macOS Mojave (10.14.2)
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix

The code was committed 6 days ago with comment `stop using easy API` in master 
branch. 

I’ve noticed that this function (`mysofa_neighborhood_init_withstepdefine `) is 
really not yet exist on this project. Maybe it is not completed yet? 

Thank you for watching this. 

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


Re: [FFmpeg-devel] [PATCH] libavcodec: Remove dynamic relocs from aarch64/h264idct_neon.S

2018-12-29 Thread Carl Eugen Hoyos
2018-12-29 0:12 GMT+01:00, Manoj Gupta :

> I recently had a problem building ffmpeg for AArch64 where lld
> linker complained about text relocations in readonly segment.
> The following patch fixes the linker complains by referring to a
> local label instead of function name.

Do you know why this issue wasn't found when the previously
fixed occurrences were seen?

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


Re: [FFmpeg-devel] [PATCH 1/2] tools/target_dec_fate.sh: print some statistics

2018-12-29 Thread Moritz Barsnick
On Sat, Dec 29, 2018 at 02:35:18 +0100, Michael Niedermayer wrote:
> +CACHED=$((CACHED+1))

I believe this is the sort of math that won't work on old, non-POSIX
Bourne shells. (I'm thinking Solaris /bin/sh here.) In case that
even matters.

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