[FFmpeg-devel] [PATCH] tools: update normalize script example to use loudnorm

2016-06-12 Thread Kyle Swanson
Signed-off-by: Kyle Swanson 
---
 tools/normalize.py | 33 --
 tools/normalize.rb | 60 ++
 2 files changed, 60 insertions(+), 33 deletions(-)
 delete mode 100755 tools/normalize.py
 create mode 100644 tools/normalize.rb

diff --git a/tools/normalize.py b/tools/normalize.py
deleted file mode 100755
index 7d87c5e..000
--- a/tools/normalize.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python2
-
-import sys, subprocess
-
-if len(sys.argv) > 2:
-ifile  = sys.argv[1]
-encopt = sys.argv[2:-1]
-ofile  = sys.argv[-1]
-else:
-print 'usage: %s  [encode_options] ' % sys.argv[0]
-sys.exit(1)
-
-analysis_cmd  = 'ffprobe -v error -of compact=p=0:nk=1 '
-analysis_cmd += '-show_entries frame_tags=lavfi.r128.I -f lavfi '
-analysis_cmd += "amovie='%s',ebur128=metadata=1" % ifile
-try:
-probe_out = subprocess.check_output(analysis_cmd, shell=True)
-except subprocess.CalledProcessError, e:
-sys.exit(e.returncode)
-loudness = ref = -23
-for line in probe_out.splitlines():
-sline = line.rstrip()
-if sline:
-loudness = sline
-adjust = ref - float(loudness)
-if abs(adjust) < 0.0001:
-print 'No normalization needed for ' + ifile
-else:
-print "Adjust %s by %.1fdB" % (ifile, adjust)
-norm_cmd  = ['ffmpeg', '-i', ifile, '-af', 'volume=%fdB' % adjust]
-norm_cmd += encopt + [ofile]
-print ' => %s' % ' '.join(norm_cmd)
-subprocess.call(norm_cmd)
diff --git a/tools/normalize.rb b/tools/normalize.rb
new file mode 100644
index 000..53ea058
--- /dev/null
+++ b/tools/normalize.rb
@@ -0,0 +1,60 @@
+#!/usr/bin/env ruby
+
+require 'open3'
+require 'json'
+
+ffmpeg_bin = '/usr/local/bin/ffmpeg'
+target_il  = -24.0
+target_lra = +11.0
+target_tp  = -2.0
+samplerate = '48k'
+
+if ARGF.argv.count != 2
+  puts "Usage: #{$PROGRAM_NAME} input.wav output.wav"
+  exit 1
+end
+
+ff_string  = "#{ffmpeg_bin} -hide_banner "
+ff_string += "-i #{ARGF.argv[0]} "
+ff_string += '-af loudnorm='
+ff_string += "I=#{target_il}:"
+ff_string += "LRA=#{target_lra}:"
+ff_string += "tp=#{target_tp}:"
+ff_string += 'print_format=json '
+ff_string += '-f null -'
+
+_stdin, _stdout, stderr, wait_thr = Open3.popen3(ff_string)
+
+if wait_thr.value.success?
+  stats = JSON.parse(stderr.read.lines[-12, 12].join)
+  loudnorm_string  = '-af loudnorm='
+  loudnorm_string += 'print_format=summary:'
+  loudnorm_string += 'linear=true:'
+  loudnorm_string += "I=#{target_il}:"
+  loudnorm_string += "LRA=#{target_lra}:"
+  loudnorm_string += "tp=#{target_tp}:"
+  loudnorm_string += "measured_I=#{stats['input_i']}:"
+  loudnorm_string += "measured_LRA=#{stats['input_lra']}:"
+  loudnorm_string += "measured_tp=#{stats['input_tp']}:"
+  loudnorm_string += "measured_thresh=#{stats['input_thresh']}:"
+  loudnorm_string += "offset=#{stats['target_offset']}"
+else
+  puts stderr.read
+  exit 1
+end
+
+ff_string  = "#{ffmpeg_bin} -y -hide_banner "
+ff_string += "-i #{ARGF.argv[0]} "
+ff_string += "#{loudnorm_string} "
+ff_string += "-ar #{samplerate} "
+ff_string += ARGF.argv[1].to_s
+
+_stdin, _stdout, stderr, wait_thr = Open3.popen3(ff_string)
+
+if wait_thr.value.success?
+  puts stderr.read.lines[-12, 12].join
+  exit 0
+else
+  puts stderr.read
+  exit 1
+end
-- 
2.5.4 (Apple Git-61)

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


Re: [FFmpeg-devel] [PATCH][WIP] avfilter: add libebur128 port

2016-06-12 Thread Kyle Swanson
On Sun, Jun 12, 2016 at 4:32 PM, Rostislav Pehlivanov
 wrote:
> On 12 June 2016 at 22:14, Kyle Swanson  wrote:
>
>> Hi all,
>>
>> Here's three patches. These are still WIP and not ready to be pushed.
>>
>> 0001-avfilter-add-libebur128-port.patch
>> This first patch ports libebur128 to ffmpeg. I haven't re-indented
>> these yet, so please diff `ebur128.c' and `ebur128.h' with the
>> original libebur128 files[1][2] to see what has changed. Also included
>> is `queue.h' which comes from BSD, which AFAIK should be distributable
>> if we decide to go this route. All these files still need their
>> license header, as libebur128 is MIT licensed and needs its own
>> copyright message. One other thing to take a look at is the section
>> with the sse2 optimizations - does FFmpeg already have a macro we
>> could use for this?
>>
>>
>> 0002-avfilter-af_loudnorm-use-internal-ebur128-api.patch
>> This patch removes the libebur128 dependency for the loudnorm and uses
>> the new internal ebur128 API.
>>
>>
>> 0003-avfilter-af_astats-add-ebur128-stats.patch
>> This patch adds ebur128 stats to the astats filter. Because of the
>> extra computation required to calculate ebur128 stats, I decided that
>> these modes should be explicitly specified via a few new filter
>> parameters. From my perspective, it makes more sense for this to live
>> in the astats filter instead of a completely separate filter
>> (f_ebur128). I'd vote for removing the current ebur128 filter, but if
>> we wanted to keep it it should be ported to use the new ebur128 code.
>>
>> Thanks,
>> Kyle
>>
>> [1]
>> https://raw.githubusercontent.com/jiixyj/libebur128/master/ebur128/ebur128.h
>> [2]
>> https://raw.githubusercontent.com/jiixyj/libebur128/master/ebur128/ebur128.c
>>
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>>
> Hi,
>
>>+#include 
> Intrinsics aren't allowed in the codebase. Looking at the patch it's only
> used in a single place and I can't see how it would improve the
> performance, so it should be safe to remove it.

That's what I figured. I'll remove this part.

>
>>+#if CONFIG_SWRESAMPLE
> What would happen if CONFIG_SWRESAMPLE wasn't enabled?
>

Good point, the only exported function that needs this is
`ff_ebur128_true_peak'. Calls to this function should also include an
`#if CONFIG_SWRESAMPLE.' I'll fix this for the next patch.

>>+/* Those will be calculated when initializing the library */ >+static
> double relative_gate_factor; >+static double minus_twenty_decibels;
>>+static double histogram_energies[1000]; >+static double
> histogram_energy_boundaries[1001];
>
> Do you think it would be easy to put those inside the context?
> Also you should probably define the big double arrays using DECLARE_ALIGNED.

I'll take a look at this.

>
>>libebur128 is MIT licensed and needs its own copyright message
> Had this discussion half a year ago, the correct thing to do in this case
> is to use FFmpeg's license at the top, put a message saying "This file uses
> code from 's codebase which has the following license", and
> then paste libebur128's license beneath indented one level.
>
> So far apart from those things it looks good, will have time to look at
> this a bit better later this week.
>
> Thanks
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] lavf/mp3dec: pass Xing gapless metadata to AVCodecParameters

2016-06-12 Thread Michael Niedermayer
On Wed, Jun 08, 2016 at 10:46:49AM -0700, Jon Toohill wrote:
> Michael et al., is this good to merge as-is? I just tested and a round trip
> with ffmpeg from wav -> mp3 -> wav retains the correct number of samples.

There seems to be a inconsistency 

try the patch below with your patch, and write a mp3 file with ffmpeg
and the read it the initial_padding is not what was written

or try this:
/ffmpeg -i test.mp3 -codec copy test2.mp3
read padding 576
written padding 576

./ffmpeg -i test2.mp3 -codec copy test3.mp3
read padding 47
written padding 47


diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 345fa88..b063ad9 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -240,6 +240,7 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream 
*st,
 mp3->start_pad = v>>12;
 mp3->  end_pad = v&4095;
 st->codecpar->initial_padding = mp3->start_pad;
+av_log(0,0, "read padding %d\n", st->codecpar->initial_padding );
 st->codecpar->trailing_padding = mp3->end_pad;
 st->start_skip_samples = mp3->start_pad + 528 + 1;
 if (mp3->frames) {
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index de63401..a971136 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -253,7 +253,7 @@ static int mp3_write_xing(AVFormatContext *s)
 av_log(s, AV_LOG_WARNING, "Too many samples of initial padding.\n");
 }
 avio_wb24(dyn_ctx, FFMAX(par->initial_padding - 528 - 1, 0)<<12);
-
+av_log(0,0, "written padding %d\n", par->initial_padding );
 avio_w8(dyn_ctx,   0); // misc
 avio_w8(dyn_ctx,   0); // mp3gain
 avio_wb16(dyn_ctx, 0); // preset

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

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell


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


Re: [FFmpeg-devel] [VOTE] Ban Carl Eugen Hoyos

2016-06-12 Thread Ivan Kalvachev
On 6/13/16, Paul B Mahol  wrote:
> On 6/13/16, Ivan Kalvachev  wrote:
>> On 6/12/16, Paul B Mahol  wrote:
>>> Hi,
>>>
>>> As requested in the IRC meeting I hereby request for the
>>> voting committee to begin voting on whatever to ban Carl
>>> Eugen Hoyos from mailing list, trac and IRC for 4 months,
>>> starting after the voting has finished.
>>
>> I don't remember such thing to have been requested on the IRC meeting.
>> Would you kindly quote the relevant parts of the logs?
>
> It was requested to act because of Carl misbehaviour.
> Logs are available on net.

I was on the meeting and I checked the published logs
before sending my first mail.
That's why I requested that you QUOTE the relevant part.

Let me be blunt. Nobody have requested Carl to be banned,
and definitely not from ML, trac, IRC for 4 months.

Feel free to prove me wrong, by providing the quotes I requested.

>> Also, I would like to know on what grounds and
>> on what charges you request that punishment.
>
> On grounds that he was badmouthing others.

That's way too vague...

1. I'd like to see links and quotes of him doing the things you accuse him of.

2. I'd like to know why we have to ban him for 4 months exactly? Why
ban him from ML, IRC, Trac, but not git?
How did you determined that this punishment is the one that is most
fitting the crimes he has done?

I can give you a lot of repeated incidents where people have badmouthed Carl.
Should we ban them all in a similar way? Months and years after the fact?

Also, If we are going to punish somebody, there should be a due
process before that.
Witch hunts are nasty things.

> Many devs requested punishment.
Did they?

Many people wanted breaking CoC to have consequences.
But I do not remember anybody requesting Carl to be banned for 4 months.
Feel free to prove me wrong, with quotes.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH][WIP] avfilter: add libebur128 port

2016-06-12 Thread Rostislav Pehlivanov
On 13 June 2016 at 01:57, Michael Niedermayer 
wrote:

> On Sun, Jun 12, 2016 at 04:14:56PM -0500, Kyle Swanson wrote:
> > Hi all,
> >
> > Here's three patches. These are still WIP and not ready to be pushed.
> >
> > 0001-avfilter-add-libebur128-port.patch
> > This first patch ports libebur128 to ffmpeg. I haven't re-indented
> > these yet, so please diff `ebur128.c' and `ebur128.h' with the
> > original libebur128 files[1][2] to see what has changed. Also included
> > is `queue.h' which comes from BSD, which AFAIK should be distributable
> > if we decide to go this route. All these files still need their
> > license header, as libebur128 is MIT licensed and needs its own
> > copyright message. One other thing to take a look at is the section
> > with the sse2 optimizations - does FFmpeg already have a macro we
> > could use for this?
> >
> >
> > 0002-avfilter-af_loudnorm-use-internal-ebur128-api.patch
> > This patch removes the libebur128 dependency for the loudnorm and uses
> > the new internal ebur128 API.
> >
> >
> > 0003-avfilter-af_astats-add-ebur128-stats.patch
> > This patch adds ebur128 stats to the astats filter. Because of the
> > extra computation required to calculate ebur128 stats, I decided that
> > these modes should be explicitly specified via a few new filter
> > parameters. From my perspective, it makes more sense for this to live
> > in the astats filter instead of a completely separate filter
> > (f_ebur128). I'd vote for removing the current ebur128 filter, but if
> > we wanted to keep it it should be ported to use the new ebur128 code.
> >
> > Thanks,
> > Kyle
> >
> > [1]
> https://raw.githubusercontent.com/jiixyj/libebur128/master/ebur128/ebur128.h
> > [2]
> https://raw.githubusercontent.com/jiixyj/libebur128/master/ebur128/ebur128.c
>
> something needs to be updated to make fate-source pass:
>
> --- ./tests/ref/fate/source 2016-06-12 20:29:44.811132775 +0200
> +++ tests/data/fate/source  2016-06-13 02:30:48.715589174 +0200
> @@ -7,7 +7,10 @@
>  libavcodec/log2_tab.c
>  libavcodec/reverse.c
>  libavdevice/file_open.c
> +libavfilter/ebur128.c
> +libavfilter/ebur128.h
>  libavfilter/log2_tab.c
> +libavfilter/queue.h
>  libavformat/file_open.c
>  libavformat/golomb_tab.c
>  libavformat/log2_tab.c
> @@ -26,3 +29,5 @@
>  compat/avisynth/windowsPorts/windows2linux.h
>  compat/float/float.h
>  compat/float/limits.h
> +libavfilter/ebur128.h
> +libavfilter/queue.h
> Test source failed. Look at tests/data/fate/source.err for details.
>
> [...]
>
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Complexity theory is the science of finding the exact solution to an
> approximation. Benchmarking OTOH is finding an approximation of the exact
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
>something needs to be updated to make fate-source pass:

It won't have to be once what I said in my first reply is done - just
append libebur128's license with a note.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] swresample: add exact_rational option

2016-06-12 Thread Muhammad Faiz
On Mon, Jun 13, 2016 at 2:19 AM, Michael Niedermayer
 wrote:
> On Sun, Jun 12, 2016 at 07:56:31AM +0700, Muhammad Faiz wrote:
>> give high quality resampling
>> as good as with linear_interp=on
>> as fast as without linear_interp=on
>> tested visually with ffplay
>> ffplay -f lavfi "aevalsrc='sin(1*t*t)', aresample=osr=48000,
>> showcqt=gamma=5"
>> ffplay -f lavfi "aevalsrc='sin(1*t*t)',
>> aresample=osr=48000:linear_interp=on, showcqt=gamma=5"
>> ffplay -f lavfi "aevalsrc='sin(1*t*t)',
>> aresample=osr=48000:exact_rational=on, showcqt=gamma=5"
>>
>> slightly speed improvement
>> for fair comparison with -cpuflags 0
>> audio.wav is ~ 1 hour 44100 stereo 16bit wav file
>> ffmpeg -i audio.wav -af aresample=osr=48000 -f null -
>> old new
>> real13.498s 13.121s
>> user13.364s 12.987s
>> sys  0.131s  0.129s
>>
>> linear_interp=on
>> old new
>> real23.035s 23.050s
>> user22.907s 22.917s
>> sys  0.119s 0.125s
>>
>> exact_rational=on
>> real12.418s
>> user12.298s
>> sys  0.114s
>>
>> possibility to decrease memory usage if soft compensation is ignored
>
> interresting
>
> can you add some fate tests ?
> (that way this also could be easily tested for platform specific bugs)
>
patch attached

thanks
From bddd8cff10cff568dcec8cb953168b6aedc2d5a2 Mon Sep 17 00:00:00 2001
From: Muhammad Faiz 
Date: Mon, 13 Jun 2016 07:35:40 +0700
Subject: [PATCH] fate: add libswresample exact_rational test

Signed-off-by: Muhammad Faiz 
---
 tests/fate/libswresample.mak | 256 +++
 1 file changed, 256 insertions(+)

diff --git a/tests/fate/libswresample.mak b/tests/fate/libswresample.mak
index 064c0f6..4e76405 100644
--- a/tests/fate/libswresample.mak
+++ b/tests/fate/libswresample.mak
@@ -378,6 +378,257 @@ fate-swr-resample_async-s16p-44100-8000: SIZE_TOLERANCE = 529200 - 20310
 fate-swr-resample_async-s16p-8000-44100: CMP_TARGET = 11187.01
 fate-swr-resample_async-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20344
 
+define ARESAMPLE_EXACT
+FATE_SWR_RESAMPLE += fate-swr-resample_exact-$(3)-$(1)-$(2)
+fate-swr-resample_exact-$(3)-$(1)-$(2): tests/data/asynth-$(1)-1.wav
+fate-swr-resample_exact-$(3)-$(1)-$(2): CMD = ffmpeg -i $(TARGET_PATH)/tests/data/asynth-$(1)-1.wav -af atrim=end_sample=10240,aresample=$(2):internal_sample_fmt=$(3):exact_rational=on,aformat=$(3),aresample=$(1):internal_sample_fmt=$(3):exact_rational=on -f wav -acodec pcm_s16le -
+
+fate-swr-resample_exact-$(3)-$(1)-$(2): CMP = stddev
+fate-swr-resample_exact-$(3)-$(1)-$(2): CMP_UNIT = $(5)
+fate-swr-resample_exact-$(3)-$(1)-$(2): FUZZ = 0.1
+fate-swr-resample_exact-$(3)-$(1)-$(2): REF = tests/data/asynth-$(1)-1.wav
+endef
+
+fate-swr-resample_exact-dblp-2626-44100: CMP_TARGET = 1352.68
+fate-swr-resample_exact-dblp-2626-44100: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-dblp-2626-48000: CMP_TARGET = 1352.65
+fate-swr-resample_exact-dblp-2626-48000: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-dblp-2626-8000: CMP_TARGET = 1353.08
+fate-swr-resample_exact-dblp-2626-8000: SIZE_TOLERANCE = 31512 - 20482
+
+fate-swr-resample_exact-dblp-2626-96000: CMP_TARGET = 1352.67
+fate-swr-resample_exact-dblp-2626-96000: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-dblp-44100-2626: CMP_TARGET = 185.82
+fate-swr-resample_exact-dblp-44100-2626: SIZE_TOLERANCE = 529200 - 20490
+
+fate-swr-resample_exact-dblp-44100-48000: CMP_TARGET = 9.65
+fate-swr-resample_exact-dblp-44100-48000: SIZE_TOLERANCE = 529200 - 20482
+
+fate-swr-resample_exact-dblp-44100-8000: CMP_TARGET = 75.38
+fate-swr-resample_exact-dblp-44100-8000: SIZE_TOLERANCE = 529200 - 20486
+
+fate-swr-resample_exact-dblp-44100-96000: CMP_TARGET = 11.45
+fate-swr-resample_exact-dblp-44100-96000: SIZE_TOLERANCE = 529200 - 20482
+
+fate-swr-resample_exact-dblp-48000-2626: CMP_TARGET = 456.51
+fate-swr-resample_exact-dblp-48000-2626: SIZE_TOLERANCE = 576000 - 20510
+
+fate-swr-resample_exact-dblp-48000-44100: CMP_TARGET = 0.26
+fate-swr-resample_exact-dblp-48000-44100: SIZE_TOLERANCE = 576000 - 20480
+
+fate-swr-resample_exact-dblp-48000-8000: CMP_TARGET = 62.36
+fate-swr-resample_exact-dblp-48000-8000: SIZE_TOLERANCE = 576000 - 20484
+
+fate-swr-resample_exact-dblp-48000-96000: CMP_TARGET = 0.47
+fate-swr-resample_exact-dblp-48000-96000: SIZE_TOLERANCE = 576000 - 20480
+
+fate-swr-resample_exact-dblp-8000-2626: CMP_TARGET = 2506.02
+fate-swr-resample_exact-dblp-8000-2626: SIZE_TOLERANCE = 96000 - 20486
+
+fate-swr-resample_exact-dblp-8000-44100: CMP_TARGET = 14.59
+fate-swr-resample_exact-dblp-8000-44100: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-dblp-8000-48000: CMP_TARGET = 14.50
+fate-swr-resample_exact-dblp-8000-48000: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-dblp-8000-96000: CMP_TARGET = 13.62
+fate-swr-resample_exact-dblp-8000-96000: SIZE_TOLERANCE = 96000 

Re: [FFmpeg-devel] [VOTE] Ban Carl Eugen Hoyos

2016-06-12 Thread Paul B Mahol
On 6/13/16, Ivan Kalvachev  wrote:
> On 6/12/16, Paul B Mahol  wrote:
>> Hi,
>>
>> As requested in the IRC meeting I hereby request for the
>> voting committee to begin voting on whatever to ban Carl
>> Eugen Hoyos from mailing list, trac and IRC for 4 months,
>> starting after the voting has finished.
>
> I don't remember such thing to have been requested on the IRC meeting.
> Would you kindly quote the relevant parts of the logs?

It was requested to act because of Carl misbehaviour.
Logs are available on net.

>
> Also, I would like to know on what grounds and
> on what charges you request that punishment.

On grounds that he was badmouthing others.

Many devs requested punishment.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 12/13] fate/aac: add automatic bsf test

2016-06-12 Thread Michael Niedermayer
On Sun, Jun 12, 2016 at 04:31:00PM -0500, Rodger Combs wrote:
> ---
>  tests/fate/aac.mak | 10 --
>  1 file changed, 8 insertions(+), 2 deletions(-)

tested on linux32/64 mingw32/64 mips & arm

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

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus


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


Re: [FFmpeg-devel] [PATCH 11/13] fate/h264: add automatic bsf test

2016-06-12 Thread Michael Niedermayer
On Sun, Jun 12, 2016 at 04:30:59PM -0500, Rodger Combs wrote:
> ---
>  tests/fate/h264.mak | 2 ++
>  tests/ref/fate/h264-autobsf-mp4toannexb | 1 +
>  2 files changed, 3 insertions(+)
>  create mode 100644 tests/ref/fate/h264-autobsf-mp4toannexb

tested on linux32/64 mingw32/64 mips & arm

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

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato


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


Re: [FFmpeg-devel] [PATCH 13/14] fate/vp9: add automatic bsf test

2016-06-12 Thread Ronald S. Bultje
Hi,

On Sun, Jun 12, 2016 at 4:34 PM, Rodger Combs 
wrote:

> ---
>  tests/fate/vpx.mak | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/tests/fate/vpx.mak b/tests/fate/vpx.mak
> index f0bcfac..29cd2a7 100644
> --- a/tests/fate/vpx.mak
> +++ b/tests/fate/vpx.mak
> @@ -133,5 +133,10 @@ FATE_VP9-$(CONFIG_IVF_DEMUXER) += fate-vp9-05-resize
>  fate-vp9-05-resize: CMD = framemd5 -i
> $(TARGET_SAMPLES)/vp9-test-vectors/vp90-2-05-resize.ivf -s 352x288
> -sws_flags bitexact+bilinear
>  fate-vp9-05-resize: REF = $(SRC_PATH)/tests/ref/fate/vp9-05-resize
>
> +FATE_VP9-$(call ALLYES, MATROSKA_DEMUXER VP9_SUPERFRAME_BSF
> MATROSKA_MUXER) += fate-vp9-autobsf-superframe
> +fate-vp9-autobsf-superframe: CMD = md5 -i
> $(TARGET_SAMPLES)/vp9-test-vectors/vp90-2-2pass-akiyo.webm -vcodec copy
> -fflags +bitexact -f matroska
> +fate-vp9-autobsf-superframe: CMP = oneline
> +fate-vp9-autobsf-superframe: REF = 2044e71879a6ea0386f2183f209b8048
> +
>  FATE_SAMPLES_AVCONV-$(CONFIG_VP9_DECODER) += $(FATE_VP9-yes)
>  fate-vp9: $(FATE_VP9-yes)


As discussed on IRC, I believe this is identical to fate-matroska-remux.

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


Re: [FFmpeg-devel] [PATCH 05/13] lavf/mux: add avformat_init_output

2016-06-12 Thread Marton Balint



On Sun, 12 Jun 2016, Rodger Combs wrote:


This allows a consumer to run the muxer's init function without actually
writing the header, which is useful in chained muxers that support
automatic bitstream filtering.
---
libavformat/avformat.h | 34 +--
libavformat/internal.h | 10 
libavformat/mux.c  | 64 +++---
libavformat/version.h  |  4 ++--
4 files changed, 94 insertions(+), 18 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index d659ee4..d6b0b26 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -616,6 +616,8 @@ typedef struct AVOutputFormat {
 * AVStream parameters that need to be set before packets are sent.
 * This method must not write output.
 *
+ * Return 0 if streams were fully configured, 1 if not, negative AVERROR 
on failure
+ *
 * Any allocations made here must be freed in deinit().
 */
int (*init)(struct AVFormatContext *);
@@ -2363,6 +2365,10 @@ void avformat_close_input(AVFormatContext **s);
 * @addtogroup lavf_encoding
 * @{
 */
+
+#define AVSTREAM_INIT_IN_WRITE_HEADER 0 ///< stream parameters initialized in 
avformat_write_header
+#define AVSTREAM_INIT_IN_INIT_OUTPUT  1 ///< stream parameters initialized in 
avformat_init_output
+
/**
 * Allocate the stream private data and write the stream header to
 * an output media file.
@@ -2374,14 +2380,38 @@ void avformat_close_input(AVFormatContext **s);
 * On return this parameter will be destroyed and replaced with 
a dict containing
 * options that were not found. May be NULL.
 *
- * @return 0 on success, negative AVERROR on failure.
+ * @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec had not 
already been fully initialized in avformat_init,
+ * AVSTREAM_INIT_IN_INIT_OUTPUT  on success if the codec had already 
been fully initialized in avformat_init,
+ * negative AVERROR on failure.
 *
- * @see av_opt_find, av_dict_set, avio_open, av_oformat_next.
+ * @see av_opt_find, av_dict_set, avio_open, av_oformat_next, 
avformat_init_output.
 */
av_warn_unused_result
int avformat_write_header(AVFormatContext *s, AVDictionary **options);


I don't see why you want to change avformat_write_header API. After a 
successful call to avformat_write_header, codecs/streams are always 
initialzied, aren't they? Who cares anymore if it was done in init or 
write_header?


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


Re: [FFmpeg-devel] [PATCH 2/2] avformat/udp: replace packet_gap with bitrate option

2016-06-12 Thread Michael Niedermayer
On Sun, Jun 12, 2016 at 09:30:18PM +0200, Marton Balint wrote:
> We haven't had a stable release since the packet_gap addition, so probably it
> is worth reworking the option to something that makes more sense to the end
> user. Also add burst_bits option to specify maximum length of bit bursts.
> 
> Signed-off-by: Marton Balint 
> ---
>  doc/protocols.texi|  9 +++--
>  libavformat/udp.c | 51 
> +--
>  libavformat/version.h |  2 +-
>  3 files changed, 41 insertions(+), 21 deletions(-)

iam in favor of both patches

[...]
-- 
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 02/13] lavf: update auto-bsf to new BSF API

2016-06-12 Thread Nicolas George
Le quintidi 25 prairial, an CCXXIV, Marton Balint a écrit :
> So you probably don't have to
> support multiple filters, it is enough if you support a single one.

This is not settled. I still think a specific API is better than a container
filter.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH 02/13] lavf: update auto-bsf to new BSF API

2016-06-12 Thread Marton Balint


On Sun, 12 Jun 2016, Rodger Combs wrote:


---
libavformat/internal.h |  5 +++--
libavformat/mux.c  | 45 +-
libavformat/segment.c  |  6 +++--
libavformat/utils.c| 59 +-
4 files changed, 91 insertions(+), 24 deletions(-)

diff --git a/libavformat/internal.h b/libavformat/internal.h
index 40ba089..52f9eb6 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -134,11 +134,12 @@ struct AVStreamInternal {
int reorder;

/**
- * bitstream filter to run on stream
+ * bitstream filters to run on stream
 * - encoding: Set by muxer using ff_stream_add_bitstream_filter
 * - decoding: unused
 */
-AVBitStreamFilterContext *bsfc;
+AVBSFContext **bsfcs;
+int nb_bsfcs;


There was an RFC on the mailing list for a chain BSF filter which is able 
pump the packets through a list of filters. So you probably don't have to 
support multiple filters, it is enough if you support a single one.


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


Re: [FFmpeg-devel] [PATCH 04/14] lavf/mux: run AVCodec::deinit if write_header fails

2016-06-12 Thread Rodger Combs

> On Jun 12, 2016, at 16:24, Marton Balint  wrote:
> 
> 
> On Sun, 12 Jun 2016, Rodger Combs wrote:
> 
>> ---
>> libavformat/mux.c | 5 -
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>> 
>> diff --git a/libavformat/mux.c b/libavformat/mux.c
>> index dd3de24..071eac1 100644
>> --- a/libavformat/mux.c
>> +++ b/libavformat/mux.c
>> @@ -484,8 +484,11 @@ int avformat_write_header(AVFormatContext *s, 
>> AVDictionary **options)
>>ret = s->oformat->write_header(s);
>>if (ret >= 0 && s->pb && s->pb->error < 0)
>>ret = s->pb->error;
>> -if (ret < 0)
>> +if (ret < 0) {
>> +if (s->oformat->deinit)
>> +s->oformat->deinit(s);
>>return ret;
>> +}
>>if (s->flush_packets && s->pb && s->pb->error >= 0 && s->flags & 
>> AVFMT_FLAG_FLUSH_PACKETS)
>>avio_flush(s->pb);
>>s->internal->header_written = 1;
>> --
> 
> I already have a patch for this, and also a few other mux fixes, I'd like 
> apply those first if that is OK.

Fine with me.

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


smime.p7s
Description: S/MIME cryptographic signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH][WIP] avfilter: add libebur128 port

2016-06-12 Thread Rostislav Pehlivanov
On 12 June 2016 at 22:14, Kyle Swanson  wrote:

> Hi all,
>
> Here's three patches. These are still WIP and not ready to be pushed.
>
> 0001-avfilter-add-libebur128-port.patch
> This first patch ports libebur128 to ffmpeg. I haven't re-indented
> these yet, so please diff `ebur128.c' and `ebur128.h' with the
> original libebur128 files[1][2] to see what has changed. Also included
> is `queue.h' which comes from BSD, which AFAIK should be distributable
> if we decide to go this route. All these files still need their
> license header, as libebur128 is MIT licensed and needs its own
> copyright message. One other thing to take a look at is the section
> with the sse2 optimizations - does FFmpeg already have a macro we
> could use for this?
>
>
> 0002-avfilter-af_loudnorm-use-internal-ebur128-api.patch
> This patch removes the libebur128 dependency for the loudnorm and uses
> the new internal ebur128 API.
>
>
> 0003-avfilter-af_astats-add-ebur128-stats.patch
> This patch adds ebur128 stats to the astats filter. Because of the
> extra computation required to calculate ebur128 stats, I decided that
> these modes should be explicitly specified via a few new filter
> parameters. From my perspective, it makes more sense for this to live
> in the astats filter instead of a completely separate filter
> (f_ebur128). I'd vote for removing the current ebur128 filter, but if
> we wanted to keep it it should be ported to use the new ebur128 code.
>
> Thanks,
> Kyle
>
> [1]
> https://raw.githubusercontent.com/jiixyj/libebur128/master/ebur128/ebur128.h
> [2]
> https://raw.githubusercontent.com/jiixyj/libebur128/master/ebur128/ebur128.c
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
Hi,

>+#include 
Intrinsics aren't allowed in the codebase. Looking at the patch it's only
used in a single place and I can't see how it would improve the
performance, so it should be safe to remove it.

>+#if CONFIG_SWRESAMPLE
What would happen if CONFIG_SWRESAMPLE wasn't enabled?

>+/* Those will be calculated when initializing the library */ >+static
double relative_gate_factor; >+static double minus_twenty_decibels;
>+static double histogram_energies[1000]; >+static double
histogram_energy_boundaries[1001];

Do you think it would be easy to put those inside the context?
Also you should probably define the big double arrays using DECLARE_ALIGNED.

>libebur128 is MIT licensed and needs its own copyright message
Had this discussion half a year ago, the correct thing to do in this case
is to use FFmpeg's license at the top, put a message saying "This file uses
code from 's codebase which has the following license", and
then paste libebur128's license beneath indented one level.

So far apart from those things it looks good, will have time to look at
this a bit better later this week.

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


[FFmpeg-devel] [PATCH 13/13] fate/hevc: add automatic bsf test

2016-06-12 Thread Rodger Combs
---
 tests/fate/hevc.mak | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/tests/fate/hevc.mak b/tests/fate/hevc.mak
index 05266cd..5ae5d3d 100644
--- a/tests/fate/hevc.mak
+++ b/tests/fate/hevc.mak
@@ -225,6 +225,17 @@ $(foreach N,$(HEVC_SAMPLES_444_12BIT),$(eval $(call 
FATE_HEVC_TEST_444_12BIT,$(N
 fate-hevc-paramchange-yuv420p-yuv420p10: CMD = framecrc -vsync 0 -i 
$(TARGET_SAMPLES)/hevc/paramchange_yuv420p_yuv420p10.hevc -sws_flags 
area+accurate_rnd+bitexact
 FATE_HEVC += fate-hevc-paramchange-yuv420p-yuv420p10
 
+tests/data/hevc-mp4.mov: TAG = GEN
+tests/data/hevc-mp4.mov: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
+   $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
+   -i $(TARGET_SAMPLES)/hevc-conformance/WPP_A_ericsson_MAIN10_2.bit -c 
copy -flags +bitexact $(TARGET_PATH)/$@ -y 2>/dev/null
+
+FATE_HEVC-$(call ALLYES, HEVC_DEMUXER MOV_DEMUXER HEVC_MP4TOANNEXB_BSF 
MOV_MUXER MPEGTS_MUXER) += fate-hevc-autobsf-mp4toannexb
+fate-hevc-autobsf-mp4toannexb: tests/data/hevc-mp4.mov
+fate-hevc-autobsf-mp4toannexb: CMD = md5 -i 
$(TARGET_PATH)/tests/data/hevc-mp4.mov -vcodec copy -fflags +bitexact -f mpegts
+fate-hevc-autobsf-mp4toannexb: CMP = oneline
+fate-hevc-autobsf-mp4toannexb: REF = efaea0723865e9838ac0ec96fd7f568f
+
 FATE_HEVC-$(call DEMDEC, HEVC, HEVC) += $(FATE_HEVC)
 
 FATE_SAMPLES_AVCONV += $(FATE_HEVC-yes)
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 11/13] fate/h264: add automatic bsf test

2016-06-12 Thread Rodger Combs
---
 tests/fate/h264.mak | 2 ++
 tests/ref/fate/h264-autobsf-mp4toannexb | 1 +
 2 files changed, 3 insertions(+)
 create mode 100644 tests/ref/fate/h264-autobsf-mp4toannexb

diff --git a/tests/fate/h264.mak b/tests/fate/h264.mak
index e12263c..5307a29 100644
--- a/tests/fate/h264.mak
+++ b/tests/fate/h264.mak
@@ -205,6 +205,7 @@ FATE_H264-$(call DEMDEC,  MOV, H264) += 
fate-h264-invalid-ref-mod
 FATE_H264-$(call DEMDEC,  MOV, H264) += fate-h264-unescaped-extradata
 
 FATE_H264-$(call ALLYES, MOV_DEMUXER H264_MP4TOANNEXB_BSF) += 
fate-h264-bsf-mp4toannexb
+FATE_H264-$(call ALLYES, MOV_DEMUXER H264_MP4TOANNEXB_BSF MPEGTS_MUXER) += 
fate-h264-autobsf-mp4toannexb
 FATE_H264-$(call DEMDEC, MATROSKA, H264) += fate-h264-direct-bff
 FATE_H264-$(call DEMDEC, FLV, H264) += fate-h264-brokensps-2580
 FATE_H264-$(call DEMDEC, MXF, H264) += fate-h264-xavc-4389
@@ -403,6 +404,7 @@ fate-h264-conformance-sva_nl1_b:  CMD = 
framecrc -vsync drop -i
 fate-h264-conformance-sva_nl2_e:  CMD = framecrc -vsync drop 
-i $(TARGET_SAMPLES)/h264-conformance/SVA_NL2_E.264
 
 fate-h264-bsf-mp4toannexb:CMD = md5 -i 
$(TARGET_SAMPLES)/h264/interlaced_crop.mp4 -vcodec copy -bsf h264_mp4toannexb 
-f h264
+fate-h264-autobsf-mp4toannexb:CMD = md5 -i 
$(TARGET_SAMPLES)/h264/interlaced_crop.mp4 -vcodec copy -fflags +bitexact -f 
mpegts
 fate-h264-crop-to-container:  CMD = framemd5 -i 
$(TARGET_SAMPLES)/h264/crop-to-container-dims-canon.mov
 fate-h264-extreme-plane-pred: CMD = framemd5 -i 
$(TARGET_SAMPLES)/h264/extreme-plane-pred.h264
 fate-h264-interlace-crop: CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/interlaced_crop.mp4 -vframes 3
diff --git a/tests/ref/fate/h264-autobsf-mp4toannexb 
b/tests/ref/fate/h264-autobsf-mp4toannexb
new file mode 100644
index 000..f2009d5
--- /dev/null
+++ b/tests/ref/fate/h264-autobsf-mp4toannexb
@@ -0,0 +1 @@
+9828dd0076b3f08da917fd92b4ca14ff
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 12/13] fate/aac: add automatic bsf test

2016-06-12 Thread Rodger Combs
---
 tests/fate/aac.mak | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/fate/aac.mak b/tests/fate/aac.mak
index 3d64031..b02b768 100644
--- a/tests/fate/aac.mak
+++ b/tests/fate/aac.mak
@@ -241,6 +241,10 @@ FATE_AAC_LATM += fate-aac-latm_stereo_to_51
 fate-aac-latm_stereo_to_51: CMD = pcm -i 
$(TARGET_SAMPLES)/aac/latm_stereo_to_51.ts -channel_layout 5.1
 fate-aac-latm_stereo_to_51: REF = $(SAMPLES)/aac/latm_stereo_to_51_ref.s16
 
+fate-aac-autobsf-adtstoasc: CMD = md5 -i 
$(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_mono_aac_lc.adts -acodec 
copy -fflags +bitexact -f matroska
+fate-aac-autobsf-adtstoasc: CMP = oneline
+fate-aac-autobsf-adtstoasc: REF = b25ed78285f5c9004e2b027b347d33b7
+
 FATE_AAC-$(call  DEMDEC, AAC,AAC)  += $(FATE_AAC_CT_RAW)
 FATE_AAC-$(call  DEMDEC, MOV,AAC)  += $(FATE_AAC)
 FATE_AAC_LATM-$(call DEMDEC, MPEGTS, AAC_LATM) += $(FATE_AAC_LATM)
@@ -253,7 +257,9 @@ $(FATE_AAC_ALL): FUZZ = 2
 
 FATE_AAC_ENCODE-$(call ENCMUX, AAC, ADTS) += $(FATE_AAC_ENCODE)
 
-FATE_SAMPLES_FFMPEG += $(FATE_AAC_ALL) $(FATE_AAC_ENCODE-yes)
+FATE_AAC_BSF-$(call ALLYES, AAC_DEMUXER AAC_ADTSTOASC_BSF MATROSKA_MUXER) += 
fate-aac-autobsf-adtstoasc
+
+FATE_SAMPLES_FFMPEG += $(FATE_AAC_ALL) $(FATE_AAC_ENCODE-yes) 
$(FATE_AAC_BSF-yes)
 
-fate-aac: $(FATE_AAC_ALL) $(FATE_AAC_ENCODE)
+fate-aac: $(FATE_AAC_ALL) $(FATE_AAC_ENCODE) $(FATE_AAC_BSF-yes)
 fate-aac-latm: $(FATE_AAC_LATM-yes)
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 08/13] lavf/movenc: add deinit function

2016-06-12 Thread Rodger Combs
---
 libavformat/movenc.c | 67 +++-
 1 file changed, 29 insertions(+), 38 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 2f00091..2f6f8bf 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5284,21 +5284,18 @@ static int mov_write_header(AVFormatContext *s)
 if (mov->encryption_key_len != AES_CTR_KEY_SIZE) {
 av_log(s, AV_LOG_ERROR, "Invalid encryption key len %d 
expected %d\n",
 mov->encryption_key_len, AES_CTR_KEY_SIZE);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 
 if (mov->encryption_kid_len != CENC_KID_SIZE) {
 av_log(s, AV_LOG_ERROR, "Invalid encryption kid len %d 
expected %d\n",
 mov->encryption_kid_len, CENC_KID_SIZE);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 } else {
 av_log(s, AV_LOG_ERROR, "unsupported encryption scheme %s\n",
 mov->encryption_scheme_str);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 }
 
@@ -5318,8 +5315,7 @@ static int mov_write_header(AVFormatContext *s)
 av_log(s, AV_LOG_ERROR, "Could not find tag for codec %s in stream 
#%d, "
"codec not currently supported in container\n",
avcodec_get_name(st->codecpar->codec_id), i);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 /* If hinting of this track is enabled by a later hint track,
  * this is updated. */
@@ -5333,8 +5329,7 @@ static int mov_write_header(AVFormatContext *s)
 track->tag == MKTAG('m','x','5','p') || track->tag == 
MKTAG('m','x','5','n')) {
 if (st->codecpar->width != 720 || (st->codecpar->height != 608 
&& st->codecpar->height != 512)) {
 av_log(s, AV_LOG_ERROR, "D-10/IMX must use 720x608 or 
720x512 video resolution\n");
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 track->height = track->tag >> 24 == 'n' ? 486 : 576;
 }
@@ -5347,8 +5342,7 @@ static int mov_write_header(AVFormatContext *s)
 }
 if (st->codecpar->width > 65535 || st->codecpar->height > 65535) {
 av_log(s, AV_LOG_ERROR, "Resolution %dx%d too large for 
mov/mp4\n", st->codecpar->width, st->codecpar->height);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 if (track->mode == MODE_MOV && track->timescale > 10)
 av_log(s, AV_LOG_WARNING,
@@ -5379,8 +5373,7 @@ static int mov_write_header(AVFormatContext *s)
  st->codecpar->codec_id == AV_CODEC_ID_ILBC){
 if (!st->codecpar->block_align) {
 av_log(s, AV_LOG_ERROR, "track %d: codec block align is 
not set for adpcm\n", i);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 track->sample_size = st->codecpar->block_align;
 }else if (st->codecpar->frame_size > 1){ /* assume compressed 
audio */
@@ -5397,8 +5390,7 @@ static int mov_write_header(AVFormatContext *s)
 if (s->strict_std_compliance >= FF_COMPLIANCE_NORMAL) {
 av_log(s, AV_LOG_ERROR, "track %d: muxing mp3 at %dhz is 
not standard, to mux anyway set strict to -1\n",
 i, track->par->sample_rate);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 } else {
 av_log(s, AV_LOG_WARNING, "track %d: muxing mp3 at %dhz is 
not standard in MP4\n",
i, track->par->sample_rate);
@@ -5428,8 +5420,7 @@ static int mov_write_header(AVFormatContext *s)
 track->vos_len  = st->codecpar->extradata_size;
 track->vos_data = av_malloc(track->vos_len);
 if (!track->vos_data) {
-ret = AVERROR(ENOMEM);
-goto error;
+return AVERROR(ENOMEM);
 }
 memcpy(track->vos_data, st->codecpar->extradata, 
track->vos_len);
 }
@@ -5438,9 +5429,8 @@ static int mov_write_header(AVFormatContext *s)
 if (mov->encryption_scheme == MOV_ENC_CENC_AES_CTR) {
 ret = ff_mov_cenc_init(>cenc, mov->encryption_key,
 track->par->codec_id == AV_CODEC_ID_H264, s->flags & 
AVFMT_FLAG_BITEXACT);
-if (ret) {
-goto error;
-}
+  

[FFmpeg-devel] [PATCH 10/13] lavf/movenc+dashenc: add automatic bitstream filtering

2016-06-12 Thread Rodger Combs
This is disabled by default when the empty_moov flag is enabled
---
 libavformat/dashenc.c |  43 +++-
 libavformat/movenc.c  | 107 +++---
 2 files changed, 124 insertions(+), 26 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 0848052..534fa75 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -551,7 +551,7 @@ static int write_manifest(AVFormatContext *s, int final)
 return avpriv_io_move(temp_filename, s->filename);
 }
 
-static int dash_write_header(AVFormatContext *s)
+static int dash_init(AVFormatContext *s)
 {
 DASHContext *c = s->priv_data;
 int ret = 0, i;
@@ -643,7 +643,7 @@ static int dash_write_header(AVFormatContext *s)
 os->init_start_pos = 0;
 
 av_dict_set(, "movflags", "frag_custom+dash+delay_moov", 0);
-if ((ret = avformat_write_header(ctx, )) < 0)
+if ((ret = avformat_init_output(ctx, )) < 0)
 return ret;
 os->ctx_inited = 1;
 avio_flush(ctx->pb);
@@ -682,6 +682,20 @@ static int dash_write_header(AVFormatContext *s)
 av_log(s, AV_LOG_WARNING, "no video stream and no min seg duration 
set\n");
 return AVERROR(EINVAL);
 }
+return 0;
+}
+
+static int dash_write_header(AVFormatContext *s)
+{
+DASHContext *c = s->priv_data;
+int i, ret;
+for (i = 0; i < s->nb_streams; i++) {
+OutputStream *os = >streams[i];
+if ((ret = avformat_write_header(os->ctx, NULL)) < 0) {
+dash_free(s);
+return ret;
+}
+}
 ret = write_manifest(s, 0);
 if (!ret)
 av_log(s, AV_LOG_VERBOSE, "Manifest written to: %s\n", s->filename);
@@ -978,6 +992,29 @@ static int dash_write_trailer(AVFormatContext *s)
 return 0;
 }
 
+static int dash_check_bitstream(struct AVFormatContext *s, const AVPacket 
*avpkt)
+{
+DASHContext *c = s->priv_data;
+OutputStream *os = >streams[avpkt->stream_index];
+AVFormatContext *oc = os->ctx;
+if (oc->oformat->check_bitstream) {
+int ret;
+AVPacket pkt = *avpkt;
+pkt.stream_index = 0;
+ret = oc->oformat->check_bitstream(oc, );
+if (ret == 1) {
+AVStream *st = s->streams[avpkt->stream_index];
+AVStream *ost = oc->streams[0];
+st->internal->bsfcs = ost->internal->bsfcs;
+st->internal->nb_bsfcs = ost->internal->nb_bsfcs;
+ost->internal->bsfcs = NULL;
+ost->internal->nb_bsfcs = 0;
+}
+return ret;
+}
+return 1;
+}
+
 #define OFFSET(x) offsetof(DASHContext, x)
 #define E AV_OPT_FLAG_ENCODING_PARAM
 static const AVOption options[] = {
@@ -1008,10 +1045,12 @@ AVOutputFormat ff_dash_muxer = {
 .audio_codec= AV_CODEC_ID_AAC,
 .video_codec= AV_CODEC_ID_H264,
 .flags  = AVFMT_GLOBALHEADER | AVFMT_NOFILE | AVFMT_TS_NEGATIVE,
+.init   = dash_init,
 .write_header   = dash_write_header,
 .write_packet   = dash_write_packet,
 .write_trailer  = dash_write_trailer,
 .deinit = dash_free,
 .codec_tag  = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 },
+.check_bitstream = dash_check_bitstream,
 .priv_class = _class,
 };
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 2f6f8bf..dd95221 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5132,11 +5132,10 @@ static int 
mov_create_dvd_sub_decoder_specific_info(MOVTrack *track,
 return 0;
 }
 
-static int mov_write_header(AVFormatContext *s)
+static int mov_init(AVFormatContext *s)
 {
-AVIOContext *pb = s->pb;
 MOVMuxContext *mov = s->priv_data;
-AVDictionaryEntry *t, *global_tcr = av_dict_get(s->metadata, "timecode", 
NULL, 0);
+AVDictionaryEntry *global_tcr = av_dict_get(s->metadata, "timecode", NULL, 
0);
 int i, ret, hint_track = 0, tmcd_track = 0;
 
 mov->fc = s;
@@ -5173,6 +5172,11 @@ static int mov_write_header(AVFormatContext *s)
 mov->flags |= FF_MOV_FLAG_FRAGMENT | FF_MOV_FLAG_EMPTY_MOOV |
   FF_MOV_FLAG_DEFAULT_BASE_MOOF;
 
+if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV && s->flags & AVFMT_FLAG_AUTO_BSF) 
{
+av_log(s, AV_LOG_VERBOSE, "Empty MOOV enabled; disabling automatic 
bitstream filtering\n");
+s->flags &= ~AVFMT_FLAG_AUTO_BSF;
+}
+
 if (mov->flags & FF_MOV_FLAG_FASTSTART) {
 mov->reserved_moov_size = -1;
 }
@@ -5219,11 +5223,6 @@ static int mov_write_header(AVFormatContext *s)
 return AVERROR(EINVAL);
 }
 
-if (!(mov->flags & FF_MOV_FLAG_DELAY_MOOV)) {
-if ((ret = mov_write_identification(pb, s)) < 0)
-return ret;
-}
-
 mov->nb_streams = s->nb_streams;
 if (mov->mode & (MODE_MP4|MODE_MOV|MODE_IPOD) && s->nb_chapters)
 mov->chapter_track = mov->nb_streams++;
@@ -5246,7 +5245,7 @@ static int mov_write_header(AVFormatContext *s)
 /* +1 tmcd track for each video stream 

[FFmpeg-devel] [PATCH 09/13] lavf/dashenc: add deinit function

2016-06-12 Thread Rodger Combs
---
 libavformat/dashenc.c | 51 +--
 1 file changed, 17 insertions(+), 34 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 519f9c4..0848052 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -580,16 +580,12 @@ static int dash_write_header(AVFormatContext *s)
 *ptr = '\0';
 
 oformat = av_guess_format("mp4", NULL, NULL);
-if (!oformat) {
-ret = AVERROR_MUXER_NOT_FOUND;
-goto fail;
-}
+if (!oformat)
+return AVERROR_MUXER_NOT_FOUND;
 
 c->streams = av_mallocz(sizeof(*c->streams) * s->nb_streams);
-if (!c->streams) {
-ret = AVERROR(ENOMEM);
-goto fail;
-}
+if (!c->streams)
+return AVERROR(ENOMEM);
 
 for (i = 0; i < s->nb_streams; i++) {
 OutputStream *os = >streams[i];
@@ -606,17 +602,13 @@ static int dash_write_header(AVFormatContext *s)
 int level = s->strict_std_compliance >= FF_COMPLIANCE_STRICT ?
 AV_LOG_ERROR : AV_LOG_WARNING;
 av_log(s, level, "No bit rate set for stream %d\n", i);
-if (s->strict_std_compliance >= FF_COMPLIANCE_STRICT) {
-ret = AVERROR(EINVAL);
-goto fail;
-}
+if (s->strict_std_compliance >= FF_COMPLIANCE_STRICT)
+return AVERROR(EINVAL);
 }
 
 ctx = avformat_alloc_context();
-if (!ctx) {
-ret = AVERROR(ENOMEM);
-goto fail;
-}
+if (!ctx)
+return AVERROR(ENOMEM);
 os->ctx = ctx;
 ctx->oformat = oformat;
 ctx->interrupt_callback = s->interrupt_callback;
@@ -624,10 +616,8 @@ static int dash_write_header(AVFormatContext *s)
 ctx->io_close   = s->io_close;
 ctx->io_open= s->io_open;
 
-if (!(st = avformat_new_stream(ctx, NULL))) {
-ret = AVERROR(ENOMEM);
-goto fail;
-}
+if (!(st = avformat_new_stream(ctx, NULL)))
+return AVERROR(ENOMEM);
 avcodec_parameters_copy(st->codecpar, s->streams[i]->codecpar);
 st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
 st->time_base = s->streams[i]->time_base;
@@ -635,10 +625,8 @@ static int dash_write_header(AVFormatContext *s)
 ctx->flags = s->flags;
 
 ctx->pb = avio_alloc_context(os->iobuf, sizeof(os->iobuf), 
AVIO_FLAG_WRITE, os, NULL, dash_write, NULL);
-if (!ctx->pb) {
-ret = AVERROR(ENOMEM);
-goto fail;
-}
+if (!ctx->pb)
+return AVERROR(ENOMEM);
 
 if (c->single_file) {
 if (c->single_file_name)
@@ -651,13 +639,12 @@ static int dash_write_header(AVFormatContext *s)
 snprintf(filename, sizeof(filename), "%s%s", c->dirname, os->initfile);
 ret = s->io_open(s, >out, filename, AVIO_FLAG_WRITE, NULL);
 if (ret < 0)
-goto fail;
+return ret;
 os->init_start_pos = 0;
 
 av_dict_set(, "movflags", "frag_custom+dash+delay_moov", 0);
-if ((ret = avformat_write_header(ctx, )) < 0) {
- goto fail;
-}
+if ((ret = avformat_write_header(ctx, )) < 0)
+return ret;
 os->ctx_inited = 1;
 avio_flush(ctx->pb);
 av_dict_free();
@@ -693,15 +680,11 @@ static int dash_write_header(AVFormatContext *s)
 
 if (!c->has_video && c->min_seg_duration <= 0) {
 av_log(s, AV_LOG_WARNING, "no video stream and no min seg duration 
set\n");
-ret = AVERROR(EINVAL);
+return AVERROR(EINVAL);
 }
 ret = write_manifest(s, 0);
 if (!ret)
 av_log(s, AV_LOG_VERBOSE, "Manifest written to: %s\n", s->filename);
-
-fail:
-if (ret)
-dash_free(s);
 return ret;
 }
 
@@ -992,7 +975,6 @@ static int dash_write_trailer(AVFormatContext *s)
 unlink(s->filename);
 }
 
-dash_free(s);
 return 0;
 }
 
@@ -1029,6 +1011,7 @@ AVOutputFormat ff_dash_muxer = {
 .write_header   = dash_write_header,
 .write_packet   = dash_write_packet,
 .write_trailer  = dash_write_trailer,
+.deinit = dash_free,
 .codec_tag  = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 },
 .priv_class = _class,
 };
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 07/13] lavf/segment: fix writing separate header with auto BSF

2016-06-12 Thread Rodger Combs
---
 libavformat/segment.c | 29 -
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index d22d550..d8877f0 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -89,6 +89,7 @@ typedef struct SegmentContext {
 int64_t last_val;  ///< remember last time for wrap around detection
 int64_t last_cut;  ///< remember last cut
 int cut_pending;
+int header_written;///< whether we've already called 
avformat_write_header
 
 char *entry_prefix;///< prefix to add to list entry filenames
 int list_type; ///< set the list type
@@ -260,6 +261,7 @@ static int segment_start(AVFormatContext *s, int 
write_header)
 if (write_header) {
 AVDictionary *options = NULL;
 av_dict_copy(, seg->format_options, 0);
+av_dict_set(, "fflags", "-autobsf", 0);
 err = avformat_write_header(oc, );
 av_dict_free();
 if (err < 0)
@@ -751,7 +753,8 @@ static int seg_init(AVFormatContext *s)
 }
 
 av_dict_copy(, seg->format_options, 0);
-ret = avformat_write_header(oc, );
+av_dict_set(, "fflags", "-autobsf", 0);
+ret = avformat_init_output(oc, );
 if (av_dict_count(options)) {
 av_log(s, AV_LOG_ERROR,
"Some of the provided format options in '%s' are not 
recognized\n", seg->format_options_str);
@@ -767,6 +770,13 @@ static int seg_init(AVFormatContext *s)
 seg->segment_frame_count = 0;
 
 av_assert0(s->nb_streams == oc->nb_streams);
+if (ret == AVSTREAM_INIT_IN_WRITE_HEADER) {
+ret = avformat_write_header(oc, NULL);
+if (ret < 0)
+return ret;
+seg->header_written = 1;
+}
+
 for (i = 0; i < s->nb_streams; i++) {
 AVStream *inner_st  = oc->streams[i];
 AVStream *outer_st = s->streams[i];
@@ -776,6 +786,21 @@ static int seg_init(AVFormatContext *s)
 if (oc->avoid_negative_ts > 0 && s->avoid_negative_ts < 0)
 s->avoid_negative_ts = 1;
 
+return ret;
+}
+
+static int seg_write_header(AVFormatContext *s)
+{
+SegmentContext *seg = s->priv_data;
+AVFormatContext *oc = seg->avf;
+int ret;
+
+if (!seg->header_written) {
+ret = avformat_write_header(oc, NULL);
+if (ret < 0)
+return ret;
+}
+
 if (!seg->write_header_trailer || seg->header_filename) {
 if (seg->header_filename) {
 av_write_frame(oc, NULL);
@@ -1026,6 +1051,7 @@ AVOutputFormat ff_segment_muxer = {
 .priv_data_size = sizeof(SegmentContext),
 .flags  = AVFMT_NOFILE|AVFMT_GLOBALHEADER,
 .init   = seg_init,
+.write_header   = seg_write_header,
 .write_packet   = seg_write_packet,
 .write_trailer  = seg_write_trailer,
 .deinit = seg_free,
@@ -1046,6 +1072,7 @@ AVOutputFormat ff_stream_segment_muxer = {
 .priv_data_size = sizeof(SegmentContext),
 .flags  = AVFMT_NOFILE,
 .init   = seg_init,
+.write_header   = seg_write_header,
 .write_packet   = seg_write_packet,
 .write_trailer  = seg_write_trailer,
 .deinit = seg_free,
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 06/13] lavf/segment: add deinit function

2016-06-12 Thread Rodger Combs
---
 libavformat/segment.c | 47 ---
 1 file changed, 20 insertions(+), 27 deletions(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index 4c6c6d4..d22d550 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -627,8 +627,9 @@ static int select_reference_stream(AVFormatContext *s)
 return 0;
 }
 
-static void seg_free_context(SegmentContext *seg)
+static void seg_free(AVFormatContext *s)
 {
+SegmentContext *seg = s->priv_data;
 ff_format_io_close(seg->avf, >list_pb);
 avformat_free_context(seg->avf);
 seg->avf = NULL;
@@ -688,7 +689,7 @@ static int seg_init(AVFormatContext *s)
 if (ret < 0) {
 av_log(s, AV_LOG_ERROR, "Could not parse format options list 
'%s'\n",
seg->format_options_str);
-goto fail;
+return ret;
 }
 }
 
@@ -702,7 +703,7 @@ static int seg_init(AVFormatContext *s)
 }
 if (!seg->list_size && seg->list_type != LIST_TYPE_M3U8) {
 if ((ret = segment_list_open(s)) < 0)
-goto fail;
+return ret;
 } else {
 const char *proto = avio_find_protocol_name(s->filename);
 seg->use_rename = proto && !strcmp(proto, "file");
@@ -713,29 +714,26 @@ static int seg_init(AVFormatContext *s)
 av_log(s, AV_LOG_WARNING, "'ext' list type option is deprecated in 
favor of 'csv'\n");
 
 if ((ret = select_reference_stream(s)) < 0)
-goto fail;
+return ret;
 av_log(s, AV_LOG_VERBOSE, "Selected stream id:%d type:%s\n",
seg->reference_stream_index,

av_get_media_type_string(s->streams[seg->reference_stream_index]->codecpar->codec_type));
 
 seg->oformat = av_guess_format(seg->format, s->filename, NULL);
 
-if (!seg->oformat) {
-ret = AVERROR_MUXER_NOT_FOUND;
-goto fail;
-}
+if (!seg->oformat)
+return AVERROR_MUXER_NOT_FOUND;
 if (seg->oformat->flags & AVFMT_NOFILE) {
 av_log(s, AV_LOG_ERROR, "format %s not supported.\n",
seg->oformat->name);
-ret = AVERROR(EINVAL);
-goto fail;
+return AVERROR(EINVAL);
 }
 
 if ((ret = segment_mux_init(s)) < 0)
-goto fail;
+return ret;
 
 if ((ret = set_segment_filename(s)) < 0)
-goto fail;
+return ret;
 oc = seg->avf;
 
 if (seg->write_header_trailer) {
@@ -743,13 +741,13 @@ static int seg_init(AVFormatContext *s)
   seg->header_filename ? seg->header_filename : 
oc->filename,
   AVIO_FLAG_WRITE, NULL)) < 0) {
 av_log(s, AV_LOG_ERROR, "Failed to open segment '%s'\n", 
oc->filename);
-goto fail;
+return ret;
 }
 if (!seg->individual_header_trailer)
 oc->pb->seekable = 0;
 } else {
 if ((ret = open_null_ctx(>pb)) < 0)
-goto fail;
+return ret;
 }
 
 av_dict_copy(, seg->format_options, 0);
@@ -757,13 +755,14 @@ static int seg_init(AVFormatContext *s)
 if (av_dict_count(options)) {
 av_log(s, AV_LOG_ERROR,
"Some of the provided format options in '%s' are not 
recognized\n", seg->format_options_str);
-ret = AVERROR(EINVAL);
-goto fail;
+av_dict_free();
+return AVERROR(EINVAL);
 }
+av_dict_free();
 
 if (ret < 0) {
 ff_format_io_close(oc, >pb);
-goto fail;
+return ret;
 }
 seg->segment_frame_count = 0;
 
@@ -785,17 +784,12 @@ static int seg_init(AVFormatContext *s)
 close_null_ctxp(>pb);
 }
 if ((ret = oc->io_open(oc, >pb, oc->filename, AVIO_FLAG_WRITE, 
NULL)) < 0)
-goto fail;
+return ret;
 if (!seg->individual_header_trailer)
 oc->pb->seekable = 0;
 }
 
-fail:
-av_dict_free();
-if (ret < 0)
-seg_free_context(seg);
-
-return ret;
+return 0;
 }
 
 static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
@@ -908,9 +902,6 @@ fail:
 seg->segment_frame_count++;
 }
 
-if (ret < 0)
-seg_free_context(seg);
-
 return ret;
 }
 
@@ -1037,6 +1028,7 @@ AVOutputFormat ff_segment_muxer = {
 .init   = seg_init,
 .write_packet   = seg_write_packet,
 .write_trailer  = seg_write_trailer,
+.deinit = seg_free,
 .check_bitstream = seg_check_bitstream,
 .priv_class = _class,
 };
@@ -1056,6 +1048,7 @@ AVOutputFormat ff_stream_segment_muxer = {
 .init   = seg_init,
 .write_packet   = seg_write_packet,
 .write_trailer  = seg_write_trailer,
+.deinit = seg_free,
 .check_bitstream = seg_check_bitstream,
 .priv_class = _class,
 };
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 04/13] lavf/mux: run AVCodec::deinit if write_header fails

2016-06-12 Thread Rodger Combs
---
 libavformat/mux.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index dd3de24..071eac1 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -484,8 +484,11 @@ int avformat_write_header(AVFormatContext *s, AVDictionary 
**options)
 ret = s->oformat->write_header(s);
 if (ret >= 0 && s->pb && s->pb->error < 0)
 ret = s->pb->error;
-if (ret < 0)
+if (ret < 0) {
+if (s->oformat->deinit)
+s->oformat->deinit(s);
 return ret;
+}
 if (s->flush_packets && s->pb && s->pb->error >= 0 && s->flags & 
AVFMT_FLAG_FLUSH_PACKETS)
 avio_flush(s->pb);
 s->internal->header_written = 1;
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 03/13] lavf: add a flag to enable/disable automatic bitstream filtering

2016-06-12 Thread Rodger Combs
This is mostly useful for muxers that wrap other muxers, such as dashenc
and segment. The actual duplicated bitstream filtering is largely harmless,
but delaying the header can cause problems when the muxer intended the header
to be written to a separate file.
---
 libavformat/avformat.h  | 1 +
 libavformat/mux.c   | 4 ++--
 libavformat/options_table.h | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index b4fe626..d659ee4 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1446,6 +1446,7 @@ typedef struct AVFormatContext {
 #define AVFMT_FLAG_PRIV_OPT0x2 ///< Enable use of private options by 
delaying codec open (this could be made default once all code is converted)
 #define AVFMT_FLAG_KEEP_SIDE_DATA 0x4 ///< Don't merge side data but keep 
it separate.
 #define AVFMT_FLAG_FAST_SEEK   0x8 ///< Enable fast, but inaccurate seeks 
for some formats
+#define AVFMT_FLAG_AUTO_BSF0x10 ///< Wait for packet data before 
writing a header, and add bitstream filters as requested by the muxer
 
 /**
  * Maximum size of the data read from input for determining
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 7ea57e1..dd3de24 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -480,7 +480,7 @@ int avformat_write_header(AVFormatContext *s, AVDictionary 
**options)
 if ((ret = init_muxer(s, options)) < 0)
 return ret;
 
-if (s->oformat->write_header && !s->oformat->check_bitstream) {
+if (s->oformat->write_header && !(s->oformat->check_bitstream && s->flags 
& AVFMT_FLAG_AUTO_BSF)) {
 ret = s->oformat->write_header(s);
 if (ret >= 0 && s->pb && s->pb->error < 0)
 ret = s->pb->error;
@@ -1052,7 +1052,7 @@ int av_interleaved_write_frame(AVFormatContext *s, 
AVPacket *pkt)
 if (pkt) {
 AVStream *st = s->streams[pkt->stream_index];
 
-if (s->oformat->check_bitstream) {
+if (s->oformat->check_bitstream && s->flags & AVFMT_FLAG_AUTO_BSF) {
 if (!st->internal->bitstream_checked) {
 if ((ret = s->oformat->check_bitstream(s, pkt)) < 0)
 goto fail;
diff --git a/libavformat/options_table.h b/libavformat/options_table.h
index 3b74d1b..227c379 100644
--- a/libavformat/options_table.h
+++ b/libavformat/options_table.h
@@ -39,7 +39,7 @@ static const AVOption avformat_options[] = {
 {"probesize", "set probing size", OFFSET(probesize), AV_OPT_TYPE_INT64, {.i64 
= 500 }, 32, INT64_MAX, D},
 {"formatprobesize", "number of bytes to probe file format", 
OFFSET(format_probesize), AV_OPT_TYPE_INT, {.i64 = PROBE_BUF_MAX}, 0, 
INT_MAX-1, D},
 {"packetsize", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64 
= DEFAULT }, 0, INT_MAX, E},
-{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 
AVFMT_FLAG_FLUSH_PACKETS }, INT_MIN, INT_MAX, D|E, "fflags"},
+{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 
AVFMT_FLAG_FLUSH_PACKETS | AVFMT_FLAG_AUTO_BSF }, INT_MIN, INT_MAX, D|E, 
"fflags"},
 {"flush_packets", "reduce the latency by flushing out packets immediately", 0, 
AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_FLUSH_PACKETS }, INT_MIN, INT_MAX, E, 
"fflags"},
 {"ignidx", "ignore index", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_IGNIDX }, 
INT_MIN, INT_MAX, D, "fflags"},
 {"genpts", "generate pts", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_GENPTS }, 
INT_MIN, INT_MAX, D, "fflags"},
@@ -54,6 +54,7 @@ static const AVOption avformat_options[] = {
 {"nobuffer", "reduce the latency introduced by optional buffering", 0, 
AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_NOBUFFER }, 0, INT_MAX, D, "fflags"},
 {"seek2any", "allow seeking to non-keyframes on demuxer level when supported", 
OFFSET(seek2any), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, D},
 {"bitexact", "do not write random/volatile data", 0, AV_OPT_TYPE_CONST, { .i64 
= AVFMT_FLAG_BITEXACT }, 0, 0, E, "fflags" },
+{"autobsf", "add needed bsfs automatically (delays header until each stream's 
first packet is written)", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_AUTO_BSF 
}, 0, 0, E, "fflags" },
 {"analyzeduration", "specify how many microseconds are analyzed to probe the 
input", OFFSET(max_analyze_duration), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, 
INT64_MAX, D},
 {"cryptokey", "decryption key", OFFSET(key), AV_OPT_TYPE_BINARY, {.dbl = 0}, 
0, 0, D},
 {"indexmem", "max memory used for timestamp index (per stream)", 
OFFSET(max_index_size), AV_OPT_TYPE_INT, {.i64 = 1<<20 }, 0, INT_MAX, D},
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 01/13] lavf: deprecate av_apply_bitstream_filters

2016-06-12 Thread Rodger Combs
---
 libavformat/avformat.h | 3 +++
 libavformat/utils.c| 4 
 2 files changed, 7 insertions(+)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index f66c39b..b4fe626 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2869,8 +2869,11 @@ int avformat_queue_attached_pictures(AVFormatContext *s);
  * @return  >=0 on success;
  *  AVERROR code on failure
  */
+#if FF_API_OLD_BSF
+attribute_deprecated
 int av_apply_bitstream_filters(AVCodecContext *codec, AVPacket *pkt,
AVBitStreamFilterContext *bsfc);
+#endif
 
 /**
  * @}
diff --git a/libavformat/utils.c b/libavformat/utils.c
index cb8d910..268e490 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -5004,6 +5004,8 @@ int ff_stream_add_bitstream_filter(AVStream *st, const 
char *name, const char *a
 return 1;
 }
 
+#if FF_API_OLD_BSF
+FF_DISABLE_DEPRECATION_WARNINGS
 int av_apply_bitstream_filters(AVCodecContext *codec, AVPacket *pkt,
AVBitStreamFilterContext *bsfc)
 {
@@ -5057,6 +5059,8 @@ int av_apply_bitstream_filters(AVCodecContext *codec, 
AVPacket *pkt,
 }
 return ret;
 }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
 void ff_format_io_close(AVFormatContext *s, AVIOContext **pb)
 {
-- 
2.8.3

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


Re: [FFmpeg-devel] [PATCH 04/14] lavf/mux: run AVCodec::deinit if write_header fails

2016-06-12 Thread Marton Balint


On Sun, 12 Jun 2016, Rodger Combs wrote:


---
libavformat/mux.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index dd3de24..071eac1 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -484,8 +484,11 @@ int avformat_write_header(AVFormatContext *s, AVDictionary 
**options)
ret = s->oformat->write_header(s);
if (ret >= 0 && s->pb && s->pb->error < 0)
ret = s->pb->error;
-if (ret < 0)
+if (ret < 0) {
+if (s->oformat->deinit)
+s->oformat->deinit(s);
return ret;
+}
if (s->flush_packets && s->pb && s->pb->error >= 0 && s->flags & 
AVFMT_FLAG_FLUSH_PACKETS)
avio_flush(s->pb);
s->internal->header_written = 1;
--


I already have a patch for this, and also a few other mux fixes, I'd 
like apply those first if that is OK.


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


[FFmpeg-devel] [PATCH][WIP] avfilter: add libebur128 port

2016-06-12 Thread Kyle Swanson
Hi all,

Here's three patches. These are still WIP and not ready to be pushed.

0001-avfilter-add-libebur128-port.patch
This first patch ports libebur128 to ffmpeg. I haven't re-indented
these yet, so please diff `ebur128.c' and `ebur128.h' with the
original libebur128 files[1][2] to see what has changed. Also included
is `queue.h' which comes from BSD, which AFAIK should be distributable
if we decide to go this route. All these files still need their
license header, as libebur128 is MIT licensed and needs its own
copyright message. One other thing to take a look at is the section
with the sse2 optimizations - does FFmpeg already have a macro we
could use for this?


0002-avfilter-af_loudnorm-use-internal-ebur128-api.patch
This patch removes the libebur128 dependency for the loudnorm and uses
the new internal ebur128 API.


0003-avfilter-af_astats-add-ebur128-stats.patch
This patch adds ebur128 stats to the astats filter. Because of the
extra computation required to calculate ebur128 stats, I decided that
these modes should be explicitly specified via a few new filter
parameters. From my perspective, it makes more sense for this to live
in the astats filter instead of a completely separate filter
(f_ebur128). I'd vote for removing the current ebur128 filter, but if
we wanted to keep it it should be ported to use the new ebur128 code.

Thanks,
Kyle

[1] https://raw.githubusercontent.com/jiixyj/libebur128/master/ebur128/ebur128.h
[2] https://raw.githubusercontent.com/jiixyj/libebur128/master/ebur128/ebur128.c


0001-avfilter-add-libebur128-port.patch
Description: Binary data


0002-avfilter-af_loudnorm-use-internal-ebur128-api.patch
Description: Binary data


0003-avfilter-af_astats-add-ebur128-stats.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [VOTE] Ban Carl Eugen Hoyos

2016-06-12 Thread Paul B Mahol
Hi,

As requested in the IRC meeting I hereby request for the
voting committee to begin voting on whatever to ban Carl
Eugen Hoyos from mailing list, trac and IRC for 4 months,
starting after the voting has finished.

Voting will last 7 days from now.
In order for the vote to pass, at least 50% of all votes
from committee need to agree to do so.

All developers and users are welcome to write about their
experiences with Carl.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 06/14] lavf/segment: add deinit function

2016-06-12 Thread Rodger Combs
---
 libavformat/segment.c | 47 ---
 1 file changed, 20 insertions(+), 27 deletions(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index 4c6c6d4..d22d550 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -627,8 +627,9 @@ static int select_reference_stream(AVFormatContext *s)
 return 0;
 }
 
-static void seg_free_context(SegmentContext *seg)
+static void seg_free(AVFormatContext *s)
 {
+SegmentContext *seg = s->priv_data;
 ff_format_io_close(seg->avf, >list_pb);
 avformat_free_context(seg->avf);
 seg->avf = NULL;
@@ -688,7 +689,7 @@ static int seg_init(AVFormatContext *s)
 if (ret < 0) {
 av_log(s, AV_LOG_ERROR, "Could not parse format options list 
'%s'\n",
seg->format_options_str);
-goto fail;
+return ret;
 }
 }
 
@@ -702,7 +703,7 @@ static int seg_init(AVFormatContext *s)
 }
 if (!seg->list_size && seg->list_type != LIST_TYPE_M3U8) {
 if ((ret = segment_list_open(s)) < 0)
-goto fail;
+return ret;
 } else {
 const char *proto = avio_find_protocol_name(s->filename);
 seg->use_rename = proto && !strcmp(proto, "file");
@@ -713,29 +714,26 @@ static int seg_init(AVFormatContext *s)
 av_log(s, AV_LOG_WARNING, "'ext' list type option is deprecated in 
favor of 'csv'\n");
 
 if ((ret = select_reference_stream(s)) < 0)
-goto fail;
+return ret;
 av_log(s, AV_LOG_VERBOSE, "Selected stream id:%d type:%s\n",
seg->reference_stream_index,

av_get_media_type_string(s->streams[seg->reference_stream_index]->codecpar->codec_type));
 
 seg->oformat = av_guess_format(seg->format, s->filename, NULL);
 
-if (!seg->oformat) {
-ret = AVERROR_MUXER_NOT_FOUND;
-goto fail;
-}
+if (!seg->oformat)
+return AVERROR_MUXER_NOT_FOUND;
 if (seg->oformat->flags & AVFMT_NOFILE) {
 av_log(s, AV_LOG_ERROR, "format %s not supported.\n",
seg->oformat->name);
-ret = AVERROR(EINVAL);
-goto fail;
+return AVERROR(EINVAL);
 }
 
 if ((ret = segment_mux_init(s)) < 0)
-goto fail;
+return ret;
 
 if ((ret = set_segment_filename(s)) < 0)
-goto fail;
+return ret;
 oc = seg->avf;
 
 if (seg->write_header_trailer) {
@@ -743,13 +741,13 @@ static int seg_init(AVFormatContext *s)
   seg->header_filename ? seg->header_filename : 
oc->filename,
   AVIO_FLAG_WRITE, NULL)) < 0) {
 av_log(s, AV_LOG_ERROR, "Failed to open segment '%s'\n", 
oc->filename);
-goto fail;
+return ret;
 }
 if (!seg->individual_header_trailer)
 oc->pb->seekable = 0;
 } else {
 if ((ret = open_null_ctx(>pb)) < 0)
-goto fail;
+return ret;
 }
 
 av_dict_copy(, seg->format_options, 0);
@@ -757,13 +755,14 @@ static int seg_init(AVFormatContext *s)
 if (av_dict_count(options)) {
 av_log(s, AV_LOG_ERROR,
"Some of the provided format options in '%s' are not 
recognized\n", seg->format_options_str);
-ret = AVERROR(EINVAL);
-goto fail;
+av_dict_free();
+return AVERROR(EINVAL);
 }
+av_dict_free();
 
 if (ret < 0) {
 ff_format_io_close(oc, >pb);
-goto fail;
+return ret;
 }
 seg->segment_frame_count = 0;
 
@@ -785,17 +784,12 @@ static int seg_init(AVFormatContext *s)
 close_null_ctxp(>pb);
 }
 if ((ret = oc->io_open(oc, >pb, oc->filename, AVIO_FLAG_WRITE, 
NULL)) < 0)
-goto fail;
+return ret;
 if (!seg->individual_header_trailer)
 oc->pb->seekable = 0;
 }
 
-fail:
-av_dict_free();
-if (ret < 0)
-seg_free_context(seg);
-
-return ret;
+return 0;
 }
 
 static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
@@ -908,9 +902,6 @@ fail:
 seg->segment_frame_count++;
 }
 
-if (ret < 0)
-seg_free_context(seg);
-
 return ret;
 }
 
@@ -1037,6 +1028,7 @@ AVOutputFormat ff_segment_muxer = {
 .init   = seg_init,
 .write_packet   = seg_write_packet,
 .write_trailer  = seg_write_trailer,
+.deinit = seg_free,
 .check_bitstream = seg_check_bitstream,
 .priv_class = _class,
 };
@@ -1056,6 +1048,7 @@ AVOutputFormat ff_stream_segment_muxer = {
 .init   = seg_init,
 .write_packet   = seg_write_packet,
 .write_trailer  = seg_write_trailer,
+.deinit = seg_free,
 .check_bitstream = seg_check_bitstream,
 .priv_class = _class,
 };
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 01/14] lavf: deprecate av_apply_bitstream_filters

2016-06-12 Thread Rodger Combs
---
 libavformat/avformat.h | 3 +++
 libavformat/utils.c| 4 
 2 files changed, 7 insertions(+)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index f66c39b..b4fe626 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2869,8 +2869,11 @@ int avformat_queue_attached_pictures(AVFormatContext *s);
  * @return  >=0 on success;
  *  AVERROR code on failure
  */
+#if FF_API_OLD_BSF
+attribute_deprecated
 int av_apply_bitstream_filters(AVCodecContext *codec, AVPacket *pkt,
AVBitStreamFilterContext *bsfc);
+#endif
 
 /**
  * @}
diff --git a/libavformat/utils.c b/libavformat/utils.c
index cb8d910..268e490 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -5004,6 +5004,8 @@ int ff_stream_add_bitstream_filter(AVStream *st, const 
char *name, const char *a
 return 1;
 }
 
+#if FF_API_OLD_BSF
+FF_DISABLE_DEPRECATION_WARNINGS
 int av_apply_bitstream_filters(AVCodecContext *codec, AVPacket *pkt,
AVBitStreamFilterContext *bsfc)
 {
@@ -5057,6 +5059,8 @@ int av_apply_bitstream_filters(AVCodecContext *codec, 
AVPacket *pkt,
 }
 return ret;
 }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
 void ff_format_io_close(AVFormatContext *s, AVIOContext **pb)
 {
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 02/14] lavf: update auto-bsf to new BSF API

2016-06-12 Thread Rodger Combs
---
 libavformat/internal.h |  5 +++--
 libavformat/mux.c  | 45 +-
 libavformat/segment.c  |  6 +++--
 libavformat/utils.c| 59 +-
 4 files changed, 91 insertions(+), 24 deletions(-)

diff --git a/libavformat/internal.h b/libavformat/internal.h
index 40ba089..52f9eb6 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -134,11 +134,12 @@ struct AVStreamInternal {
 int reorder;
 
 /**
- * bitstream filter to run on stream
+ * bitstream filters to run on stream
  * - encoding: Set by muxer using ff_stream_add_bitstream_filter
  * - decoding: unused
  */
-AVBitStreamFilterContext *bsfc;
+AVBSFContext **bsfcs;
+int nb_bsfcs;
 
 /**
  * Whether or not check_bitstream should still be run on each packet
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 91388e3..7ea57e1 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1043,7 +1043,7 @@ static int interleave_packet(AVFormatContext *s, AVPacket 
*out, AVPacket *in, in
 
 int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
 {
-int ret, flush = 0;
+int ret, flush = 0, i;
 
 ret = prepare_input_packet(s, pkt);
 if (ret < 0)
@@ -1061,15 +1061,40 @@ int av_interleaved_write_frame(AVFormatContext *s, 
AVPacket *pkt)
 }
 }
 
-av_apply_bitstream_filters(st->internal->avctx, pkt, 
st->internal->bsfc);
-if (pkt->size == 0 && pkt->side_data_elems == 0)
-return 0;
-if (!st->codecpar->extradata && st->internal->avctx->extradata) {
-int eret = ff_alloc_extradata(st->codecpar, 
st->internal->avctx->extradata_size);
-if (eret < 0)
-return AVERROR(ENOMEM);
-st->codecpar->extradata_size = st->internal->avctx->extradata_size;
-memcpy(st->codecpar->extradata, st->internal->avctx->extradata, 
st->internal->avctx->extradata_size);
+for (i = 0; i < st->internal->nb_bsfcs; i++) {
+AVBSFContext *ctx = st->internal->bsfcs[i];
+if (i > 0) {
+AVBSFContext* prev_ctx = st->internal->bsfcs[i - 1];
+if (prev_ctx->par_out->extradata_size != 
ctx->par_in->extradata_size) {
+if ((ret = avcodec_parameters_copy(ctx->par_in, 
prev_ctx->par_out)) < 0)
+goto fail;
+}
+}
+// TODO: when any bitstream filter requires flushing at EOF, we'll 
need to
+// flush each stream's BSF chain on write_trailer.
+if ((ret = av_bsf_send_packet(ctx, pkt)) < 0) {
+av_log(ctx, AV_LOG_ERROR,
+   "Failed to send packet to filter %s for stream %d",
+   ctx->filter->name, pkt->stream_index);
+goto fail;
+}
+// TODO: when any automatically-added bitstream filter is 
generating multiple
+// output packets for a single input one, we'll need to call this 
in a loop
+// and write each output packet.
+if ((ret = av_bsf_receive_packet(ctx, pkt)) < 0) {
+if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
+return 0;
+av_log(ctx, AV_LOG_ERROR,
+   "Failed to send packet to filter %s for stream %d",
+   ctx->filter->name, pkt->stream_index);
+goto fail;
+}
+if (i == st->internal->nb_bsfcs - 1) {
+if (ctx->par_out->extradata_size != 
st->codecpar->extradata_size) {
+if ((ret = avcodec_parameters_copy(st->codecpar, 
ctx->par_out)) < 0)
+goto fail;
+}
+}
 }
 
 if (s->debug & FF_FDEBUG_TS)
diff --git a/libavformat/segment.c b/libavformat/segment.c
index df6f4b5..4c6c6d4 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -966,8 +966,10 @@ static int seg_check_bitstream(struct AVFormatContext *s, 
const AVPacket *pkt)
 if (ret == 1) {
 AVStream *st = s->streams[pkt->stream_index];
 AVStream *ost = oc->streams[pkt->stream_index];
-st->internal->bsfc = ost->internal->bsfc;
-ost->internal->bsfc = NULL;
+st->internal->bsfcs = ost->internal->bsfcs;
+st->internal->nb_bsfcs = ost->internal->nb_bsfcs;
+ost->internal->bsfcs = NULL;
+ost->internal->nb_bsfcs = 0;
 }
 return ret;
 }
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 268e490..9d04e4d 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3960,6 +3960,10 @@ static void free_stream(AVStream **pst)
 
 if (st->internal) {
 avcodec_free_context(>internal->avctx);
+for (i = 0; i < st->internal->nb_bsfcs; i++) {
+av_bsf_free(>internal->bsfcs[i]);
+

[FFmpeg-devel] [PATCH 09/14] lavf/dashenc: add deinit function

2016-06-12 Thread Rodger Combs
---
 libavformat/dashenc.c | 51 +--
 1 file changed, 17 insertions(+), 34 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 519f9c4..0848052 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -580,16 +580,12 @@ static int dash_write_header(AVFormatContext *s)
 *ptr = '\0';
 
 oformat = av_guess_format("mp4", NULL, NULL);
-if (!oformat) {
-ret = AVERROR_MUXER_NOT_FOUND;
-goto fail;
-}
+if (!oformat)
+return AVERROR_MUXER_NOT_FOUND;
 
 c->streams = av_mallocz(sizeof(*c->streams) * s->nb_streams);
-if (!c->streams) {
-ret = AVERROR(ENOMEM);
-goto fail;
-}
+if (!c->streams)
+return AVERROR(ENOMEM);
 
 for (i = 0; i < s->nb_streams; i++) {
 OutputStream *os = >streams[i];
@@ -606,17 +602,13 @@ static int dash_write_header(AVFormatContext *s)
 int level = s->strict_std_compliance >= FF_COMPLIANCE_STRICT ?
 AV_LOG_ERROR : AV_LOG_WARNING;
 av_log(s, level, "No bit rate set for stream %d\n", i);
-if (s->strict_std_compliance >= FF_COMPLIANCE_STRICT) {
-ret = AVERROR(EINVAL);
-goto fail;
-}
+if (s->strict_std_compliance >= FF_COMPLIANCE_STRICT)
+return AVERROR(EINVAL);
 }
 
 ctx = avformat_alloc_context();
-if (!ctx) {
-ret = AVERROR(ENOMEM);
-goto fail;
-}
+if (!ctx)
+return AVERROR(ENOMEM);
 os->ctx = ctx;
 ctx->oformat = oformat;
 ctx->interrupt_callback = s->interrupt_callback;
@@ -624,10 +616,8 @@ static int dash_write_header(AVFormatContext *s)
 ctx->io_close   = s->io_close;
 ctx->io_open= s->io_open;
 
-if (!(st = avformat_new_stream(ctx, NULL))) {
-ret = AVERROR(ENOMEM);
-goto fail;
-}
+if (!(st = avformat_new_stream(ctx, NULL)))
+return AVERROR(ENOMEM);
 avcodec_parameters_copy(st->codecpar, s->streams[i]->codecpar);
 st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
 st->time_base = s->streams[i]->time_base;
@@ -635,10 +625,8 @@ static int dash_write_header(AVFormatContext *s)
 ctx->flags = s->flags;
 
 ctx->pb = avio_alloc_context(os->iobuf, sizeof(os->iobuf), 
AVIO_FLAG_WRITE, os, NULL, dash_write, NULL);
-if (!ctx->pb) {
-ret = AVERROR(ENOMEM);
-goto fail;
-}
+if (!ctx->pb)
+return AVERROR(ENOMEM);
 
 if (c->single_file) {
 if (c->single_file_name)
@@ -651,13 +639,12 @@ static int dash_write_header(AVFormatContext *s)
 snprintf(filename, sizeof(filename), "%s%s", c->dirname, os->initfile);
 ret = s->io_open(s, >out, filename, AVIO_FLAG_WRITE, NULL);
 if (ret < 0)
-goto fail;
+return ret;
 os->init_start_pos = 0;
 
 av_dict_set(, "movflags", "frag_custom+dash+delay_moov", 0);
-if ((ret = avformat_write_header(ctx, )) < 0) {
- goto fail;
-}
+if ((ret = avformat_write_header(ctx, )) < 0)
+return ret;
 os->ctx_inited = 1;
 avio_flush(ctx->pb);
 av_dict_free();
@@ -693,15 +680,11 @@ static int dash_write_header(AVFormatContext *s)
 
 if (!c->has_video && c->min_seg_duration <= 0) {
 av_log(s, AV_LOG_WARNING, "no video stream and no min seg duration 
set\n");
-ret = AVERROR(EINVAL);
+return AVERROR(EINVAL);
 }
 ret = write_manifest(s, 0);
 if (!ret)
 av_log(s, AV_LOG_VERBOSE, "Manifest written to: %s\n", s->filename);
-
-fail:
-if (ret)
-dash_free(s);
 return ret;
 }
 
@@ -992,7 +975,6 @@ static int dash_write_trailer(AVFormatContext *s)
 unlink(s->filename);
 }
 
-dash_free(s);
 return 0;
 }
 
@@ -1029,6 +1011,7 @@ AVOutputFormat ff_dash_muxer = {
 .write_header   = dash_write_header,
 .write_packet   = dash_write_packet,
 .write_trailer  = dash_write_trailer,
+.deinit = dash_free,
 .codec_tag  = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 },
 .priv_class = _class,
 };
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 08/14] lavf/movenc: add deinit function

2016-06-12 Thread Rodger Combs
---
 libavformat/movenc.c | 65 ++--
 1 file changed, 28 insertions(+), 37 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 2f00091..acb0e25 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5284,21 +5284,18 @@ static int mov_write_header(AVFormatContext *s)
 if (mov->encryption_key_len != AES_CTR_KEY_SIZE) {
 av_log(s, AV_LOG_ERROR, "Invalid encryption key len %d 
expected %d\n",
 mov->encryption_key_len, AES_CTR_KEY_SIZE);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 
 if (mov->encryption_kid_len != CENC_KID_SIZE) {
 av_log(s, AV_LOG_ERROR, "Invalid encryption kid len %d 
expected %d\n",
 mov->encryption_kid_len, CENC_KID_SIZE);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 } else {
 av_log(s, AV_LOG_ERROR, "unsupported encryption scheme %s\n",
 mov->encryption_scheme_str);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 }
 
@@ -5318,8 +5315,7 @@ static int mov_write_header(AVFormatContext *s)
 av_log(s, AV_LOG_ERROR, "Could not find tag for codec %s in stream 
#%d, "
"codec not currently supported in container\n",
avcodec_get_name(st->codecpar->codec_id), i);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 /* If hinting of this track is enabled by a later hint track,
  * this is updated. */
@@ -5333,8 +5329,7 @@ static int mov_write_header(AVFormatContext *s)
 track->tag == MKTAG('m','x','5','p') || track->tag == 
MKTAG('m','x','5','n')) {
 if (st->codecpar->width != 720 || (st->codecpar->height != 608 
&& st->codecpar->height != 512)) {
 av_log(s, AV_LOG_ERROR, "D-10/IMX must use 720x608 or 
720x512 video resolution\n");
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 track->height = track->tag >> 24 == 'n' ? 486 : 576;
 }
@@ -5347,8 +5342,7 @@ static int mov_write_header(AVFormatContext *s)
 }
 if (st->codecpar->width > 65535 || st->codecpar->height > 65535) {
 av_log(s, AV_LOG_ERROR, "Resolution %dx%d too large for 
mov/mp4\n", st->codecpar->width, st->codecpar->height);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 if (track->mode == MODE_MOV && track->timescale > 10)
 av_log(s, AV_LOG_WARNING,
@@ -5379,8 +5373,7 @@ static int mov_write_header(AVFormatContext *s)
  st->codecpar->codec_id == AV_CODEC_ID_ILBC){
 if (!st->codecpar->block_align) {
 av_log(s, AV_LOG_ERROR, "track %d: codec block align is 
not set for adpcm\n", i);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 }
 track->sample_size = st->codecpar->block_align;
 }else if (st->codecpar->frame_size > 1){ /* assume compressed 
audio */
@@ -5397,8 +5390,7 @@ static int mov_write_header(AVFormatContext *s)
 if (s->strict_std_compliance >= FF_COMPLIANCE_NORMAL) {
 av_log(s, AV_LOG_ERROR, "track %d: muxing mp3 at %dhz is 
not standard, to mux anyway set strict to -1\n",
 i, track->par->sample_rate);
-ret = AVERROR(EINVAL);
-goto error;
+return AVERROR(EINVAL);
 } else {
 av_log(s, AV_LOG_WARNING, "track %d: muxing mp3 at %dhz is 
not standard in MP4\n",
i, track->par->sample_rate);
@@ -5428,8 +5420,7 @@ static int mov_write_header(AVFormatContext *s)
 track->vos_len  = st->codecpar->extradata_size;
 track->vos_data = av_malloc(track->vos_len);
 if (!track->vos_data) {
-ret = AVERROR(ENOMEM);
-goto error;
+return AVERROR(ENOMEM);
 }
 memcpy(track->vos_data, st->codecpar->extradata, 
track->vos_len);
 }
@@ -5438,9 +5429,8 @@ static int mov_write_header(AVFormatContext *s)
 if (mov->encryption_scheme == MOV_ENC_CENC_AES_CTR) {
 ret = ff_mov_cenc_init(>cenc, mov->encryption_key,
 track->par->codec_id == AV_CODEC_ID_H264, s->flags & 
AVFMT_FLAG_BITEXACT);
-if (ret) {
-goto error;
-}
+  

[FFmpeg-devel] [PATCH 03/14] lavf: add a flag to enable/disable automatic bitstream filtering

2016-06-12 Thread Rodger Combs
This is mostly useful for muxers that wrap other muxers, such as dashenc
and segment. The actual duplicated bitstream filtering is largely harmless,
but delaying the header can cause problems when the muxer intended the header
to be written to a separate file.
---
 libavformat/avformat.h  | 1 +
 libavformat/mux.c   | 4 ++--
 libavformat/options_table.h | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index b4fe626..d659ee4 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1446,6 +1446,7 @@ typedef struct AVFormatContext {
 #define AVFMT_FLAG_PRIV_OPT0x2 ///< Enable use of private options by 
delaying codec open (this could be made default once all code is converted)
 #define AVFMT_FLAG_KEEP_SIDE_DATA 0x4 ///< Don't merge side data but keep 
it separate.
 #define AVFMT_FLAG_FAST_SEEK   0x8 ///< Enable fast, but inaccurate seeks 
for some formats
+#define AVFMT_FLAG_AUTO_BSF0x10 ///< Wait for packet data before 
writing a header, and add bitstream filters as requested by the muxer
 
 /**
  * Maximum size of the data read from input for determining
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 7ea57e1..dd3de24 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -480,7 +480,7 @@ int avformat_write_header(AVFormatContext *s, AVDictionary 
**options)
 if ((ret = init_muxer(s, options)) < 0)
 return ret;
 
-if (s->oformat->write_header && !s->oformat->check_bitstream) {
+if (s->oformat->write_header && !(s->oformat->check_bitstream && s->flags 
& AVFMT_FLAG_AUTO_BSF)) {
 ret = s->oformat->write_header(s);
 if (ret >= 0 && s->pb && s->pb->error < 0)
 ret = s->pb->error;
@@ -1052,7 +1052,7 @@ int av_interleaved_write_frame(AVFormatContext *s, 
AVPacket *pkt)
 if (pkt) {
 AVStream *st = s->streams[pkt->stream_index];
 
-if (s->oformat->check_bitstream) {
+if (s->oformat->check_bitstream && s->flags & AVFMT_FLAG_AUTO_BSF) {
 if (!st->internal->bitstream_checked) {
 if ((ret = s->oformat->check_bitstream(s, pkt)) < 0)
 goto fail;
diff --git a/libavformat/options_table.h b/libavformat/options_table.h
index 3b74d1b..227c379 100644
--- a/libavformat/options_table.h
+++ b/libavformat/options_table.h
@@ -39,7 +39,7 @@ static const AVOption avformat_options[] = {
 {"probesize", "set probing size", OFFSET(probesize), AV_OPT_TYPE_INT64, {.i64 
= 500 }, 32, INT64_MAX, D},
 {"formatprobesize", "number of bytes to probe file format", 
OFFSET(format_probesize), AV_OPT_TYPE_INT, {.i64 = PROBE_BUF_MAX}, 0, 
INT_MAX-1, D},
 {"packetsize", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64 
= DEFAULT }, 0, INT_MAX, E},
-{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 
AVFMT_FLAG_FLUSH_PACKETS }, INT_MIN, INT_MAX, D|E, "fflags"},
+{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 
AVFMT_FLAG_FLUSH_PACKETS | AVFMT_FLAG_AUTO_BSF }, INT_MIN, INT_MAX, D|E, 
"fflags"},
 {"flush_packets", "reduce the latency by flushing out packets immediately", 0, 
AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_FLUSH_PACKETS }, INT_MIN, INT_MAX, E, 
"fflags"},
 {"ignidx", "ignore index", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_IGNIDX }, 
INT_MIN, INT_MAX, D, "fflags"},
 {"genpts", "generate pts", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_GENPTS }, 
INT_MIN, INT_MAX, D, "fflags"},
@@ -54,6 +54,7 @@ static const AVOption avformat_options[] = {
 {"nobuffer", "reduce the latency introduced by optional buffering", 0, 
AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_NOBUFFER }, 0, INT_MAX, D, "fflags"},
 {"seek2any", "allow seeking to non-keyframes on demuxer level when supported", 
OFFSET(seek2any), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, D},
 {"bitexact", "do not write random/volatile data", 0, AV_OPT_TYPE_CONST, { .i64 
= AVFMT_FLAG_BITEXACT }, 0, 0, E, "fflags" },
+{"autobsf", "add needed bsfs automatically (delays header until each stream's 
first packet is written)", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_AUTO_BSF 
}, 0, 0, E, "fflags" },
 {"analyzeduration", "specify how many microseconds are analyzed to probe the 
input", OFFSET(max_analyze_duration), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, 
INT64_MAX, D},
 {"cryptokey", "decryption key", OFFSET(key), AV_OPT_TYPE_BINARY, {.dbl = 0}, 
0, 0, D},
 {"indexmem", "max memory used for timestamp index (per stream)", 
OFFSET(max_index_size), AV_OPT_TYPE_INT, {.i64 = 1<<20 }, 0, INT_MAX, D},
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 05/14] lavf/mux: add avformat_init_output

2016-06-12 Thread Rodger Combs
This allows a consumer to run the muxer's init function without actually
writing the header, which is useful in chained muxers that support
automatic bitstream filtering.
---
 libavformat/avformat.h | 34 +--
 libavformat/internal.h | 10 
 libavformat/mux.c  | 64 +++---
 libavformat/version.h  |  4 ++--
 4 files changed, 94 insertions(+), 18 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index d659ee4..d6b0b26 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -616,6 +616,8 @@ typedef struct AVOutputFormat {
  * AVStream parameters that need to be set before packets are sent.
  * This method must not write output.
  *
+ * Return 0 if streams were fully configured, 1 if not, negative AVERROR 
on failure
+ *
  * Any allocations made here must be freed in deinit().
  */
 int (*init)(struct AVFormatContext *);
@@ -2363,6 +2365,10 @@ void avformat_close_input(AVFormatContext **s);
  * @addtogroup lavf_encoding
  * @{
  */
+
+#define AVSTREAM_INIT_IN_WRITE_HEADER 0 ///< stream parameters initialized in 
avformat_write_header
+#define AVSTREAM_INIT_IN_INIT_OUTPUT  1 ///< stream parameters initialized in 
avformat_init_output
+
 /**
  * Allocate the stream private data and write the stream header to
  * an output media file.
@@ -2374,14 +2380,38 @@ void avformat_close_input(AVFormatContext **s);
  * On return this parameter will be destroyed and replaced 
with a dict containing
  * options that were not found. May be NULL.
  *
- * @return 0 on success, negative AVERROR on failure.
+ * @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec had not 
already been fully initialized in avformat_init,
+ * AVSTREAM_INIT_IN_INIT_OUTPUT  on success if the codec had already 
been fully initialized in avformat_init,
+ * negative AVERROR on failure.
  *
- * @see av_opt_find, av_dict_set, avio_open, av_oformat_next.
+ * @see av_opt_find, av_dict_set, avio_open, av_oformat_next, 
avformat_init_output.
  */
 av_warn_unused_result
 int avformat_write_header(AVFormatContext *s, AVDictionary **options);
 
 /**
+ * Allocate the stream private data and initialize the codec, but do not write 
the header.
+ * May optionally be used before avformat_write_header to initialize stream 
parameters
+ * before actually writing the header.
+ * If using this function, do not pass the same options to 
avformat_write_header.
+ *
+ * @param s Media file handle, must be allocated with avformat_alloc_context().
+ *  Its oformat field must be set to the desired output format;
+ *  Its pb field must be set to an already opened AVIOContext.
+ * @param options  An AVDictionary filled with AVFormatContext and 
muxer-private options.
+ * On return this parameter will be destroyed and replaced 
with a dict containing
+ * options that were not found. May be NULL.
+ *
+ * @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec requires 
avformat_write_header to fully initialize,
+ * AVSTREAM_INIT_IN_INIT_OUTPUT  on success if the codec has been 
fully initialized,
+ * negative AVERROR on failure.
+ *
+ * @see av_opt_find, av_dict_set, avio_open, av_oformat_next, 
avformat_write_header.
+ */
+av_warn_unused_result
+int avformat_init_output(AVFormatContext *s, AVDictionary **options);
+
+/**
  * Write a packet to an output media file.
  *
  * This function passes the packet directly to the muxer, without any buffering
diff --git a/libavformat/internal.h b/libavformat/internal.h
index 52f9eb6..b5966ff 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -124,6 +124,16 @@ struct AVFormatInternal {
  * Whether or not a header has already been written
  */
 int header_written;
+
+/**
+ * Whether or not avformat_init_output has already been called
+ */
+int initialized;
+
+/**
+ * Whether or not avformat_init_output fully initialized streams
+ */
+int streams_initialized;
 };
 
 struct AVStreamInternal {
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 071eac1..3d618d8 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -423,10 +423,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
  *options = tmp;
 }
 
-if (s->oformat->init && (ret = s->oformat->init(s)) < 0) {
-if (s->oformat->deinit)
-s->oformat->deinit(s);
-goto fail;
+if (s->oformat->init) {
+if ((ret = s->oformat->init(s)) < 0) {
+if (s->oformat->deinit)
+s->oformat->deinit(s);
+return ret;
+}
+return ret == 0;
 }
 
 return 0;
@@ -473,13 +476,44 @@ static int init_pts(AVFormatContext *s)
 return 0;
 }
 
-int avformat_write_header(AVFormatContext *s, AVDictionary **options)
+int avformat_init_output(AVFormatContext *s, AVDictionary **options)
 {
 

[FFmpeg-devel] [PATCH 04/14] lavf/mux: run AVCodec::deinit if write_header fails

2016-06-12 Thread Rodger Combs
---
 libavformat/mux.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index dd3de24..071eac1 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -484,8 +484,11 @@ int avformat_write_header(AVFormatContext *s, AVDictionary 
**options)
 ret = s->oformat->write_header(s);
 if (ret >= 0 && s->pb && s->pb->error < 0)
 ret = s->pb->error;
-if (ret < 0)
+if (ret < 0) {
+if (s->oformat->deinit)
+s->oformat->deinit(s);
 return ret;
+}
 if (s->flush_packets && s->pb && s->pb->error >= 0 && s->flags & 
AVFMT_FLAG_FLUSH_PACKETS)
 avio_flush(s->pb);
 s->internal->header_written = 1;
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 11/14] fate/h264: add automatic bsf test

2016-06-12 Thread Rodger Combs
---
 tests/fate/h264.mak | 2 ++
 tests/ref/fate/h264-autobsf-mp4toannexb | 1 +
 2 files changed, 3 insertions(+)
 create mode 100644 tests/ref/fate/h264-autobsf-mp4toannexb

diff --git a/tests/fate/h264.mak b/tests/fate/h264.mak
index e12263c..5307a29 100644
--- a/tests/fate/h264.mak
+++ b/tests/fate/h264.mak
@@ -205,6 +205,7 @@ FATE_H264-$(call DEMDEC,  MOV, H264) += 
fate-h264-invalid-ref-mod
 FATE_H264-$(call DEMDEC,  MOV, H264) += fate-h264-unescaped-extradata
 
 FATE_H264-$(call ALLYES, MOV_DEMUXER H264_MP4TOANNEXB_BSF) += 
fate-h264-bsf-mp4toannexb
+FATE_H264-$(call ALLYES, MOV_DEMUXER H264_MP4TOANNEXB_BSF MPEGTS_MUXER) += 
fate-h264-autobsf-mp4toannexb
 FATE_H264-$(call DEMDEC, MATROSKA, H264) += fate-h264-direct-bff
 FATE_H264-$(call DEMDEC, FLV, H264) += fate-h264-brokensps-2580
 FATE_H264-$(call DEMDEC, MXF, H264) += fate-h264-xavc-4389
@@ -403,6 +404,7 @@ fate-h264-conformance-sva_nl1_b:  CMD = 
framecrc -vsync drop -i
 fate-h264-conformance-sva_nl2_e:  CMD = framecrc -vsync drop 
-i $(TARGET_SAMPLES)/h264-conformance/SVA_NL2_E.264
 
 fate-h264-bsf-mp4toannexb:CMD = md5 -i 
$(TARGET_SAMPLES)/h264/interlaced_crop.mp4 -vcodec copy -bsf h264_mp4toannexb 
-f h264
+fate-h264-autobsf-mp4toannexb:CMD = md5 -i 
$(TARGET_SAMPLES)/h264/interlaced_crop.mp4 -vcodec copy -fflags +bitexact -f 
mpegts
 fate-h264-crop-to-container:  CMD = framemd5 -i 
$(TARGET_SAMPLES)/h264/crop-to-container-dims-canon.mov
 fate-h264-extreme-plane-pred: CMD = framemd5 -i 
$(TARGET_SAMPLES)/h264/extreme-plane-pred.h264
 fate-h264-interlace-crop: CMD = framecrc -i 
$(TARGET_SAMPLES)/h264/interlaced_crop.mp4 -vframes 3
diff --git a/tests/ref/fate/h264-autobsf-mp4toannexb 
b/tests/ref/fate/h264-autobsf-mp4toannexb
new file mode 100644
index 000..f2009d5
--- /dev/null
+++ b/tests/ref/fate/h264-autobsf-mp4toannexb
@@ -0,0 +1 @@
+9828dd0076b3f08da917fd92b4ca14ff
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 14/14] fate/hevc: add automatic bsf test

2016-06-12 Thread Rodger Combs
---
 tests/fate/hevc.mak | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/tests/fate/hevc.mak b/tests/fate/hevc.mak
index 05266cd..5ae5d3d 100644
--- a/tests/fate/hevc.mak
+++ b/tests/fate/hevc.mak
@@ -225,6 +225,17 @@ $(foreach N,$(HEVC_SAMPLES_444_12BIT),$(eval $(call 
FATE_HEVC_TEST_444_12BIT,$(N
 fate-hevc-paramchange-yuv420p-yuv420p10: CMD = framecrc -vsync 0 -i 
$(TARGET_SAMPLES)/hevc/paramchange_yuv420p_yuv420p10.hevc -sws_flags 
area+accurate_rnd+bitexact
 FATE_HEVC += fate-hevc-paramchange-yuv420p-yuv420p10
 
+tests/data/hevc-mp4.mov: TAG = GEN
+tests/data/hevc-mp4.mov: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
+   $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
+   -i $(TARGET_SAMPLES)/hevc-conformance/WPP_A_ericsson_MAIN10_2.bit -c 
copy -flags +bitexact $(TARGET_PATH)/$@ -y 2>/dev/null
+
+FATE_HEVC-$(call ALLYES, HEVC_DEMUXER MOV_DEMUXER HEVC_MP4TOANNEXB_BSF 
MOV_MUXER MPEGTS_MUXER) += fate-hevc-autobsf-mp4toannexb
+fate-hevc-autobsf-mp4toannexb: tests/data/hevc-mp4.mov
+fate-hevc-autobsf-mp4toannexb: CMD = md5 -i 
$(TARGET_PATH)/tests/data/hevc-mp4.mov -vcodec copy -fflags +bitexact -f mpegts
+fate-hevc-autobsf-mp4toannexb: CMP = oneline
+fate-hevc-autobsf-mp4toannexb: REF = efaea0723865e9838ac0ec96fd7f568f
+
 FATE_HEVC-$(call DEMDEC, HEVC, HEVC) += $(FATE_HEVC)
 
 FATE_SAMPLES_AVCONV += $(FATE_HEVC-yes)
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 12/14] fate/aac: add automatic bsf test

2016-06-12 Thread Rodger Combs
---
 tests/fate/aac.mak | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/fate/aac.mak b/tests/fate/aac.mak
index 3d64031..b02b768 100644
--- a/tests/fate/aac.mak
+++ b/tests/fate/aac.mak
@@ -241,6 +241,10 @@ FATE_AAC_LATM += fate-aac-latm_stereo_to_51
 fate-aac-latm_stereo_to_51: CMD = pcm -i 
$(TARGET_SAMPLES)/aac/latm_stereo_to_51.ts -channel_layout 5.1
 fate-aac-latm_stereo_to_51: REF = $(SAMPLES)/aac/latm_stereo_to_51_ref.s16
 
+fate-aac-autobsf-adtstoasc: CMD = md5 -i 
$(TARGET_SAMPLES)/audiomatch/tones_afconvert_16000_mono_aac_lc.adts -acodec 
copy -fflags +bitexact -f matroska
+fate-aac-autobsf-adtstoasc: CMP = oneline
+fate-aac-autobsf-adtstoasc: REF = b25ed78285f5c9004e2b027b347d33b7
+
 FATE_AAC-$(call  DEMDEC, AAC,AAC)  += $(FATE_AAC_CT_RAW)
 FATE_AAC-$(call  DEMDEC, MOV,AAC)  += $(FATE_AAC)
 FATE_AAC_LATM-$(call DEMDEC, MPEGTS, AAC_LATM) += $(FATE_AAC_LATM)
@@ -253,7 +257,9 @@ $(FATE_AAC_ALL): FUZZ = 2
 
 FATE_AAC_ENCODE-$(call ENCMUX, AAC, ADTS) += $(FATE_AAC_ENCODE)
 
-FATE_SAMPLES_FFMPEG += $(FATE_AAC_ALL) $(FATE_AAC_ENCODE-yes)
+FATE_AAC_BSF-$(call ALLYES, AAC_DEMUXER AAC_ADTSTOASC_BSF MATROSKA_MUXER) += 
fate-aac-autobsf-adtstoasc
+
+FATE_SAMPLES_FFMPEG += $(FATE_AAC_ALL) $(FATE_AAC_ENCODE-yes) 
$(FATE_AAC_BSF-yes)
 
-fate-aac: $(FATE_AAC_ALL) $(FATE_AAC_ENCODE)
+fate-aac: $(FATE_AAC_ALL) $(FATE_AAC_ENCODE) $(FATE_AAC_BSF-yes)
 fate-aac-latm: $(FATE_AAC_LATM-yes)
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 13/14] fate/vp9: add automatic bsf test

2016-06-12 Thread Rodger Combs
---
 tests/fate/vpx.mak | 5 +
 1 file changed, 5 insertions(+)

diff --git a/tests/fate/vpx.mak b/tests/fate/vpx.mak
index f0bcfac..29cd2a7 100644
--- a/tests/fate/vpx.mak
+++ b/tests/fate/vpx.mak
@@ -133,5 +133,10 @@ FATE_VP9-$(CONFIG_IVF_DEMUXER) += fate-vp9-05-resize
 fate-vp9-05-resize: CMD = framemd5 -i 
$(TARGET_SAMPLES)/vp9-test-vectors/vp90-2-05-resize.ivf -s 352x288 -sws_flags 
bitexact+bilinear
 fate-vp9-05-resize: REF = $(SRC_PATH)/tests/ref/fate/vp9-05-resize
 
+FATE_VP9-$(call ALLYES, MATROSKA_DEMUXER VP9_SUPERFRAME_BSF MATROSKA_MUXER) += 
fate-vp9-autobsf-superframe
+fate-vp9-autobsf-superframe: CMD = md5 -i 
$(TARGET_SAMPLES)/vp9-test-vectors/vp90-2-2pass-akiyo.webm -vcodec copy -fflags 
+bitexact -f matroska
+fate-vp9-autobsf-superframe: CMP = oneline
+fate-vp9-autobsf-superframe: REF = 2044e71879a6ea0386f2183f209b8048
+
 FATE_SAMPLES_AVCONV-$(CONFIG_VP9_DECODER) += $(FATE_VP9-yes)
 fate-vp9: $(FATE_VP9-yes)
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 07/14] lavf/segment: fix writing separate header with auto BSF

2016-06-12 Thread Rodger Combs
---
 libavformat/segment.c | 29 -
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index d22d550..d8877f0 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -89,6 +89,7 @@ typedef struct SegmentContext {
 int64_t last_val;  ///< remember last time for wrap around detection
 int64_t last_cut;  ///< remember last cut
 int cut_pending;
+int header_written;///< whether we've already called 
avformat_write_header
 
 char *entry_prefix;///< prefix to add to list entry filenames
 int list_type; ///< set the list type
@@ -260,6 +261,7 @@ static int segment_start(AVFormatContext *s, int 
write_header)
 if (write_header) {
 AVDictionary *options = NULL;
 av_dict_copy(, seg->format_options, 0);
+av_dict_set(, "fflags", "-autobsf", 0);
 err = avformat_write_header(oc, );
 av_dict_free();
 if (err < 0)
@@ -751,7 +753,8 @@ static int seg_init(AVFormatContext *s)
 }
 
 av_dict_copy(, seg->format_options, 0);
-ret = avformat_write_header(oc, );
+av_dict_set(, "fflags", "-autobsf", 0);
+ret = avformat_init_output(oc, );
 if (av_dict_count(options)) {
 av_log(s, AV_LOG_ERROR,
"Some of the provided format options in '%s' are not 
recognized\n", seg->format_options_str);
@@ -767,6 +770,13 @@ static int seg_init(AVFormatContext *s)
 seg->segment_frame_count = 0;
 
 av_assert0(s->nb_streams == oc->nb_streams);
+if (ret == AVSTREAM_INIT_IN_WRITE_HEADER) {
+ret = avformat_write_header(oc, NULL);
+if (ret < 0)
+return ret;
+seg->header_written = 1;
+}
+
 for (i = 0; i < s->nb_streams; i++) {
 AVStream *inner_st  = oc->streams[i];
 AVStream *outer_st = s->streams[i];
@@ -776,6 +786,21 @@ static int seg_init(AVFormatContext *s)
 if (oc->avoid_negative_ts > 0 && s->avoid_negative_ts < 0)
 s->avoid_negative_ts = 1;
 
+return ret;
+}
+
+static int seg_write_header(AVFormatContext *s)
+{
+SegmentContext *seg = s->priv_data;
+AVFormatContext *oc = seg->avf;
+int ret;
+
+if (!seg->header_written) {
+ret = avformat_write_header(oc, NULL);
+if (ret < 0)
+return ret;
+}
+
 if (!seg->write_header_trailer || seg->header_filename) {
 if (seg->header_filename) {
 av_write_frame(oc, NULL);
@@ -1026,6 +1051,7 @@ AVOutputFormat ff_segment_muxer = {
 .priv_data_size = sizeof(SegmentContext),
 .flags  = AVFMT_NOFILE|AVFMT_GLOBALHEADER,
 .init   = seg_init,
+.write_header   = seg_write_header,
 .write_packet   = seg_write_packet,
 .write_trailer  = seg_write_trailer,
 .deinit = seg_free,
@@ -1046,6 +1072,7 @@ AVOutputFormat ff_stream_segment_muxer = {
 .priv_data_size = sizeof(SegmentContext),
 .flags  = AVFMT_NOFILE,
 .init   = seg_init,
+.write_header   = seg_write_header,
 .write_packet   = seg_write_packet,
 .write_trailer  = seg_write_trailer,
 .deinit = seg_free,
-- 
2.8.3

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


[FFmpeg-devel] [PATCH 10/14] lavf/movenc+dashenc: add automatic bitstream filtering

2016-06-12 Thread Rodger Combs
This is disabled by default when the empty_moov flag is enabled
---
 libavformat/dashenc.c |  43 -
 libavformat/movenc.c  | 105 +++---
 2 files changed, 123 insertions(+), 25 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 0848052..534fa75 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -551,7 +551,7 @@ static int write_manifest(AVFormatContext *s, int final)
 return avpriv_io_move(temp_filename, s->filename);
 }
 
-static int dash_write_header(AVFormatContext *s)
+static int dash_init(AVFormatContext *s)
 {
 DASHContext *c = s->priv_data;
 int ret = 0, i;
@@ -643,7 +643,7 @@ static int dash_write_header(AVFormatContext *s)
 os->init_start_pos = 0;
 
 av_dict_set(, "movflags", "frag_custom+dash+delay_moov", 0);
-if ((ret = avformat_write_header(ctx, )) < 0)
+if ((ret = avformat_init_output(ctx, )) < 0)
 return ret;
 os->ctx_inited = 1;
 avio_flush(ctx->pb);
@@ -682,6 +682,20 @@ static int dash_write_header(AVFormatContext *s)
 av_log(s, AV_LOG_WARNING, "no video stream and no min seg duration 
set\n");
 return AVERROR(EINVAL);
 }
+return 0;
+}
+
+static int dash_write_header(AVFormatContext *s)
+{
+DASHContext *c = s->priv_data;
+int i, ret;
+for (i = 0; i < s->nb_streams; i++) {
+OutputStream *os = >streams[i];
+if ((ret = avformat_write_header(os->ctx, NULL)) < 0) {
+dash_free(s);
+return ret;
+}
+}
 ret = write_manifest(s, 0);
 if (!ret)
 av_log(s, AV_LOG_VERBOSE, "Manifest written to: %s\n", s->filename);
@@ -978,6 +992,29 @@ static int dash_write_trailer(AVFormatContext *s)
 return 0;
 }
 
+static int dash_check_bitstream(struct AVFormatContext *s, const AVPacket 
*avpkt)
+{
+DASHContext *c = s->priv_data;
+OutputStream *os = >streams[avpkt->stream_index];
+AVFormatContext *oc = os->ctx;
+if (oc->oformat->check_bitstream) {
+int ret;
+AVPacket pkt = *avpkt;
+pkt.stream_index = 0;
+ret = oc->oformat->check_bitstream(oc, );
+if (ret == 1) {
+AVStream *st = s->streams[avpkt->stream_index];
+AVStream *ost = oc->streams[0];
+st->internal->bsfcs = ost->internal->bsfcs;
+st->internal->nb_bsfcs = ost->internal->nb_bsfcs;
+ost->internal->bsfcs = NULL;
+ost->internal->nb_bsfcs = 0;
+}
+return ret;
+}
+return 1;
+}
+
 #define OFFSET(x) offsetof(DASHContext, x)
 #define E AV_OPT_FLAG_ENCODING_PARAM
 static const AVOption options[] = {
@@ -1008,10 +1045,12 @@ AVOutputFormat ff_dash_muxer = {
 .audio_codec= AV_CODEC_ID_AAC,
 .video_codec= AV_CODEC_ID_H264,
 .flags  = AVFMT_GLOBALHEADER | AVFMT_NOFILE | AVFMT_TS_NEGATIVE,
+.init   = dash_init,
 .write_header   = dash_write_header,
 .write_packet   = dash_write_packet,
 .write_trailer  = dash_write_trailer,
 .deinit = dash_free,
 .codec_tag  = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 },
+.check_bitstream = dash_check_bitstream,
 .priv_class = _class,
 };
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index acb0e25..a0bbaf3 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5132,11 +5132,10 @@ static int 
mov_create_dvd_sub_decoder_specific_info(MOVTrack *track,
 return 0;
 }
 
-static int mov_write_header(AVFormatContext *s)
+static int mov_init(AVFormatContext *s)
 {
-AVIOContext *pb = s->pb;
 MOVMuxContext *mov = s->priv_data;
-AVDictionaryEntry *t, *global_tcr = av_dict_get(s->metadata, "timecode", 
NULL, 0);
+AVDictionaryEntry *global_tcr = av_dict_get(s->metadata, "timecode", NULL, 
0);
 int i, ret, hint_track = 0, tmcd_track = 0;
 
 mov->fc = s;
@@ -5173,6 +5172,11 @@ static int mov_write_header(AVFormatContext *s)
 mov->flags |= FF_MOV_FLAG_FRAGMENT | FF_MOV_FLAG_EMPTY_MOOV |
   FF_MOV_FLAG_DEFAULT_BASE_MOOF;
 
+if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV && s->flags & AVFMT_FLAG_AUTO_BSF) 
{
+av_log(s, AV_LOG_VERBOSE, "Empty MOOV enabled; disabling automatic 
bitstream filtering\n");
+s->flags &= ~AVFMT_FLAG_AUTO_BSF;
+}
+
 if (mov->flags & FF_MOV_FLAG_FASTSTART) {
 mov->reserved_moov_size = -1;
 }
@@ -5219,11 +5223,6 @@ static int mov_write_header(AVFormatContext *s)
 return AVERROR(EINVAL);
 }
 
-if (!(mov->flags & FF_MOV_FLAG_DELAY_MOOV)) {
-if ((ret = mov_write_identification(pb, s)) < 0)
-return ret;
-}
-
 mov->nb_streams = s->nb_streams;
 if (mov->mode & (MODE_MP4|MODE_MOV|MODE_IPOD) && s->nb_chapters)
 mov->chapter_track = mov->nb_streams++;
@@ -5412,6 +5411,48 @@ static int mov_write_header(AVFormatContext *s)
 
 avpriv_set_pts_info(st, 64, 1, 

Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread Michael Niedermayer
On Sun, Jun 12, 2016 at 02:59:14PM -0400, DeHackEd wrote:
> On 06/12/2016 02:31 PM, Carl Eugen Hoyos wrote:
> > DeHackEd  dehacked.net> writes:
> > 
> >> The effects vary a bit. One guy in IRC basically had ffmpeg 
> >> crash for him every 26.5 hours when he was saving to HLS
> > 
> > And when I asked him how I can reproduce this issue he 
> > unfortunately couldn't answer;-(
> 
> I pasted output from ffmpeg way back at the start of this thread.
> 
> If you're not using libav (or you are and your application doesn't correct 
> for the timestamp wrap itself) then you can
> get the API experience with -copyts in the ffmpeg command.
> 

> $ ffmpeg -i longvideo.ts -c copy -f mpegts -copyts output.ts
> [mpegts @ 0x245f460] Invalid timestamps stream=0, pts=43408, dts=8589888000, 
> size=535
> [mpegts @ 0x245f460] Invalid timestamps stream=0, pts=7408, dts=8589906000, 
> size=157
> [null @ 0x2465180] Application provided invalid, non monotonically increasing 
> dts to muxer in stream 0: 8589924000 >= 7408
> [null @ 0x2465180] Application provided invalid, non monotonically increasing 
> dts to muxer in stream 0: 8589924000 >= 25408
> [null @ 0x2465180] Application provided invalid, non monotonically increasing 
> dts to muxer in stream 0: 8589924000 >= 43408
> ...

copyts is not possible with timestamp discontnuities, the muxers need
clean timestamps for all kinds of buffer and compliance stuff


> 
> In libav calling av_write_frame() with non-monontonic timestamps will return 
> an error. In ffmpeg the video will be cut
> off or otherwise damaged at 26.5 hours.
> 
> 
> 
> The guy in IRC had this convoluted command-line where he piped from ffmpeg to 
> NvTranscoder (sample app in the nvenc SDK)
> and back through ffmpeg. The commend-line pasted was:
> 
> /home/ffmpeg-3.0.1/ffmpeg -i - -codec copy -f mpegts - 
> 2>/var/log/channels/${CHN}/input.txt < "$fifo" &
> encode+=($!)|NvTranscoder -size 1280 720 -i /dev/stdin -o /dev/stdout 
> -bitrate 180 -vbvMaxBitrate 250  -vbvSize
> 100 -deviceID $2 $NVENC_OPTS |/home/ffmpeg-3.0.1/ffmpeg -fflags +genpts 
> -i - -c:v copy -c:a aac -b:a 128k -ac 2
> -timestamp now -f hls -hls_time 6 -hls_flags delete_segments -hls_list_size 5 
> ${HLS_PATH}/${CHN}/${CHN}2M.m3u8
> 2>/var/log/channels/${CHN}/720p.txt
> 
> ... and as for the outputs, all his pastebin records have expired.

there is a issue in hls, you can reproduce it with

./ffmpeg -f lavfi -i testsrc=s=80x60:r=2  -t 30:00:00  -f hls -hls_list_size 
100 delthshls2/file-hls.m3u8
./ffmpeg -i delthshls2/file-hls.m3u8 -f null -

The problem here is that the hls demuxer does not support timestamp
wraps. It could remove the wraps relatively easily as it has a
"playlist" but it doesnt do that and just passes them on while at
the same time declaring to the outside that it doesnt have
discontnuities

if you add
.flags  = AVFMT_TS_DISCONT,
to the hls demuxer then sequential demuxing will be fine and ffmpeg
will remove the discontnuities, but seeking will cause problems
i think for hls it might be best to use the available "playlist"
and associate the needed wrap to the segments so they can be
corrected when demuxing packets and seek has a full and stable
timeline
do you want to try to work on implementing this ?

using hls with some generic discontnuity correction in the core if
one is written may be harder as that would depend on seeking per
byte position which hls doesnt really support

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

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


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


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

2016-06-12 Thread Clément Bœsch
On Sun, Jun 12, 2016 at 02:43:10AM +0100, Josh de Kock wrote:
> ---
>  configure|   4 +
>  libavformat/Makefile |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/libopenmpt.c | 185 
> +++
>  4 files changed, 191 insertions(+)
>  create mode 100644 libavformat/libopenmpt.c
> 
> diff --git a/configure b/configure
> index 7c463a5..a74aaab 100755
> --- a/configure
> +++ b/configure
> @@ -248,6 +248,7 @@ External library support:
>--enable-libopencv   enable video filtering via libopencv [no]
>--enable-libopenh264 enable H.264 encoding via OpenH264 [no]
>--enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]

> +  --enable-libopenmpt  enable decoding tracked mod files via libopenmpt 
> [no]

libopenmpt is supposed to replace libmodplug support all kind of trackers,
not only MOD.

>--enable-libopus enable Opus de/encoding via libopus [no]
>--enable-libpulseenable Pulseaudio input via libpulse [no]
>--enable-librubberband   enable rubberband needed for rubberband filter 
> [no]
> @@ -1495,6 +1496,7 @@ EXTERNAL_LIBRARY_LIST="
>  libopencv
>  libopenh264
>  libopenjpeg
> +libopenmpt
>  libopus
>  libpulse
>  librtmp
> @@ -2741,6 +2743,7 @@ libopencore_amrwb_decoder_deps="libopencore_amrwb"
>  libopenh264_encoder_deps="libopenh264"
>  libopenjpeg_decoder_deps="libopenjpeg"
>  libopenjpeg_encoder_deps="libopenjpeg"
> +libopenmpt_demuxer_deps="libopenmpt"
>  libopus_decoder_deps="libopus"
>  libopus_encoder_deps="libopus"
>  libopus_encoder_select="audio_frame_queue"
> @@ -5633,6 +5636,7 @@ enabled libopenjpeg   && { check_lib 
> openjpeg-2.1/openjpeg.h opj_version -lo
> check_lib openjpeg-1.5/openjpeg.h opj_version 
> -lopenjpeg -DOPJ_STATIC ||
> check_lib openjpeg.h opj_version -lopenjpeg 
> -DOPJ_STATIC ||
> die "ERROR: libopenjpeg not found"; }

> +enabled libopenmpt&& require libopenmpt libopenmpt/libopenmpt.h 
> openmpt_module_create -lopenmpt -lstdc++

openmpt is distributed with pkg-config so please use require_pkg_config.
And then you shouldn't need -lstdc++ if the .pc is properly done.

[...]
> +/**
> +* @file
> +* libopenmpt demuxer
> +*/

not really useful

> +
> +#include 
> +#include "libavutil/avstring.h"

> +#include "libavutil/eval.h"

doesn't look necessary (maybe check the other includes)

> +#include "libavutil/opt.h"
> +#include "avformat.h"
> +#include "internal.h"
> +
> +typedef struct OpenMPTContext {
> +const AVClass *class;
> +openmpt_module *module;
> +
> +int channels;

> +double length;

better call this duration for consistency

> +/* options */
> +int sample_rate;
> +} OpenMPTContext;
> +
> +#define OFFSET(x) offsetof(OpenMPTContext, x)
> +#define A AV_OPT_FLAG_AUDIO_PARAM
> +#define D AV_OPT_FLAG_DECODING_PARAM
> +static const AVOption options[] = {

> +{"sample_rate", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, 
> {.i64 = 44100}, 1000, 99, A|D},

INT_MAX instead of 99?

> +{NULL}
> +};
> +
> +static int probe_openmpt(AVProbeData *p)
> +{
> +if (p->buf_size < 1084)
> +return 0;
> +
> +if (p->buf[1080] == 'M' && p->buf[1081] == '.' &&
> +p->buf[1082] == 'K' && p->buf[1083] == '.')
> +return AVPROBE_SCORE_MAX;
> +

So this is going to probe only one kind of tracker? It would be nice to
detect all the tracker files the library supports. With modplug we rely on
extension (bad); does openmpt support something better (something better
than trying to decode, which will be slow and slow down every other
probing)?

> +return 0;
> +}
> +
> +static void openmpt_logfunc(const char *message, void *userdata)
> +{

> +av_log((AVFormatContext*)userdata, AV_LOG_INFO, "%s\n", message);

The cast is not necessary. No loglevel to differenciate error from
warnings from info? That's a shame.

> +}
> +
> +#define add_meta(s, name, value)  \
> +if (value && value[0])\
> +   av_dict_set(>metadata, name, value, 0); \
> +

nit: scope this in a do { ... } while (0) form

> +static int read_header_openmpt(AVFormatContext *s)
> +{
> +AVStream *st;
> +OpenMPTContext *openmpt = s->priv_data;
> +int64_t size = avio_size(s->pb);
> +char *buf = av_malloc(size);
> +
> +if (!buf)
> +return AVERROR(ENOMEM);
> +size = avio_read(s->pb, buf, size);
> +

> +if (!(openmpt->module = openmpt_module_create_from_memory(buf, size, 
> openmpt_logfunc, s, NULL))) {
> +av_free(buf);
> +return AVERROR_INVALIDDATA;
> +}
> +av_free(buf);

openmpt->module = openmpt_module_create_from_memory(buf, size, 
openmpt_logfunc, s, NULL);
av_freep();
if (!openmpt->module)
return AVERROR_EXTERNAL;

(or maybe AVERROR(ENOMEM)?)

> +openmpt->channels = 

[FFmpeg-devel] [PATCH 1/2] avformat/udp: do not accumulate packet_gap delay errors

2016-06-12 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavformat/udp.c | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index 531e254..f2446c6 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -552,6 +552,7 @@ static void *circular_buffer_task_tx( void *_URLContext)
 URLContext *h = _URLContext;
 UDPContext *s = h->priv_data;
 int old_cancelstate;
+int64_t target_timestamp = 0;
 
 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, _cancelstate);
 pthread_mutex_lock(>mutex);
@@ -566,6 +567,7 @@ static void *circular_buffer_task_tx( void *_URLContext)
 int len;
 const uint8_t *p;
 uint8_t tmp[4];
+int64_t timestamp;
 
 len=av_fifo_size(s->fifo);
 
@@ -589,6 +591,17 @@ static void *circular_buffer_task_tx( void *_URLContext)
 pthread_mutex_unlock(>mutex);
 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, _cancelstate);
 
+if (s->packet_gap) {
+timestamp = av_gettime_relative();
+if (timestamp < target_timestamp) {
+target_timestamp = FFMIN(target_timestamp, timestamp + 
s->packet_gap);
+av_usleep(target_timestamp - timestamp);
+} else {
+target_timestamp = timestamp;
+}
+target_timestamp += s->packet_gap;
+}
+
 p = s->tmp;
 while (len) {
 int ret;
@@ -613,8 +626,6 @@ static void *circular_buffer_task_tx( void *_URLContext)
 }
 }
 
-av_usleep(s->packet_gap);
-
 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, _cancelstate);
 pthread_mutex_lock(>mutex);
 }
-- 
2.6.6

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


[FFmpeg-devel] [PATCH 2/2] avformat/udp: replace packet_gap with bitrate option

2016-06-12 Thread Marton Balint
We haven't had a stable release since the packet_gap addition, so probably it
is worth reworking the option to something that makes more sense to the end
user. Also add burst_bits option to specify maximum length of bit bursts.

Signed-off-by: Marton Balint 
---
 doc/protocols.texi|  9 +++--
 libavformat/udp.c | 51 +--
 libavformat/version.h |  2 +-
 3 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index a9c9d0c..72b3914 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -1285,8 +1285,13 @@ Set the UDP maximum socket buffer size in bytes. This is 
used to set either
 the receive or send buffer size, depending on what the socket is used for.
 Default is 64KB.  See also @var{fifo_size}.
 
-@item packet_gap=@var{seconds}
-Delay between packets
+@item bitrate=@var{bitrate}
+If set to nonzero, the output will have the specified constant bitrate if the
+input has enough packets to sustain it.
+
+@item burst_bits=@var{bits}
+When using @var{bitrate} this specifies the maximum number of bits in
+packet bursts.
 
 @item localport=@var{port}
 Override the local UDP port to bind with.
diff --git a/libavformat/udp.c b/libavformat/udp.c
index f2446c6..8699c1c 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -93,7 +93,8 @@ typedef struct UDPContext {
 int circular_buffer_size;
 AVFifoBuffer *fifo;
 int circular_buffer_error;
-int64_t packet_gap; /* delay between transmitted packets */
+int64_t bitrate; /* number of bits to send per second */
+int64_t burst_bits;
 int close_req;
 #if HAVE_PTHREAD_CANCEL
 pthread_t circular_buffer_thread;
@@ -115,7 +116,8 @@ typedef struct UDPContext {
 #define E AV_OPT_FLAG_ENCODING_PARAM
 static const AVOption options[] = {
 { "buffer_size","System data size (in bytes)", 
OFFSET(buffer_size),AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, 
.flags = D|E },
-{ "packet_gap", "Delay between packets",   
OFFSET(packet_gap), AV_OPT_TYPE_DURATION,{ .i64 = 0  }, 0, INT_MAX, 
.flags = E },
+{ "bitrate","Bits to send per second", 
OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0, INT64_MAX, 
.flags = E },
+{ "burst_bits", "Max length of bursts in bits (when using bitrate)", 
OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0, INT64_MAX, 
.flags = E },
 { "localport",  "Local port",  
OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, D|E 
},
 { "local_port", "Local port",  
OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, 
.flags = D|E },
 { "localaddr",  "Local address",   
OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },   
.flags = D|E },
@@ -552,7 +554,11 @@ static void *circular_buffer_task_tx( void *_URLContext)
 URLContext *h = _URLContext;
 UDPContext *s = h->priv_data;
 int old_cancelstate;
-int64_t target_timestamp = 0;
+int64_t target_timestamp = av_gettime_relative();
+int64_t start_timestamp = av_gettime_relative();
+int64_t sent_bits = 0;
+int64_t burst_interval = s->bitrate ? (s->burst_bits * 100 / 
s->bitrate) : 0;
+int64_t max_delay = s->bitrate ?  ((int64_t)h->max_packet_size * 8 * 
100 / s->bitrate + 1) : 0;
 
 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, _cancelstate);
 pthread_mutex_lock(>mutex);
@@ -591,15 +597,24 @@ static void *circular_buffer_task_tx( void *_URLContext)
 pthread_mutex_unlock(>mutex);
 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, _cancelstate);
 
-if (s->packet_gap) {
+if (s->bitrate) {
 timestamp = av_gettime_relative();
 if (timestamp < target_timestamp) {
-target_timestamp = FFMIN(target_timestamp, timestamp + 
s->packet_gap);
-av_usleep(target_timestamp - timestamp);
+int64_t delay = target_timestamp - timestamp;
+if (delay > max_delay) {
+delay = max_delay;
+start_timestamp = timestamp + delay;
+sent_bits = 0;
+}
+av_usleep(delay);
 } else {
-target_timestamp = timestamp;
+if (timestamp - burst_interval > target_timestamp) {
+start_timestamp = timestamp - burst_interval;
+sent_bits = 0;
+}
 }
-target_timestamp += s->packet_gap;
+sent_bits += len * 8;
+target_timestamp = start_timestamp + sent_bits * 100 / 
s->bitrate;
 }
 
 p = s->tmp;
@@ -744,16 +759,16 @@ static int udp_open(URLContext *h, const 

Re: [FFmpeg-devel] [PATCH] swresample: add exact_rational option

2016-06-12 Thread Michael Niedermayer
On Sun, Jun 12, 2016 at 07:56:31AM +0700, Muhammad Faiz wrote:
> give high quality resampling
> as good as with linear_interp=on
> as fast as without linear_interp=on
> tested visually with ffplay
> ffplay -f lavfi "aevalsrc='sin(1*t*t)', aresample=osr=48000,
> showcqt=gamma=5"
> ffplay -f lavfi "aevalsrc='sin(1*t*t)',
> aresample=osr=48000:linear_interp=on, showcqt=gamma=5"
> ffplay -f lavfi "aevalsrc='sin(1*t*t)',
> aresample=osr=48000:exact_rational=on, showcqt=gamma=5"
> 
> slightly speed improvement
> for fair comparison with -cpuflags 0
> audio.wav is ~ 1 hour 44100 stereo 16bit wav file
> ffmpeg -i audio.wav -af aresample=osr=48000 -f null -
> old new
> real13.498s 13.121s
> user13.364s 12.987s
> sys  0.131s  0.129s
> 
> linear_interp=on
> old new
> real23.035s 23.050s
> user22.907s 22.917s
> sys  0.119s 0.125s
> 
> exact_rational=on
> real12.418s
> user12.298s
> sys  0.114s
> 
> possibility to decrease memory usage if soft compensation is ignored

interresting

can you add some fate tests ?
(that way this also could be easily tested for platform specific bugs)

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread Carl Eugen Hoyos
DeHackEd  dehacked.net> writes:

> $ ffmpeg -i longvideo.ts -c copy -f mpegts -copyts output.ts

Why are you using -copyts and what is wrong with the output file?

If the crash report is really unreproducible (which seems 
inexplicable to me), then at least backtrace, disassembly 
and register dump are required.

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread DeHackEd
On 06/12/2016 02:31 PM, Carl Eugen Hoyos wrote:
> DeHackEd  dehacked.net> writes:
> 
>> The effects vary a bit. One guy in IRC basically had ffmpeg 
>> crash for him every 26.5 hours when he was saving to HLS
> 
> And when I asked him how I can reproduce this issue he 
> unfortunately couldn't answer;-(

I pasted output from ffmpeg way back at the start of this thread.

If you're not using libav (or you are and your application doesn't correct for 
the timestamp wrap itself) then you can
get the API experience with -copyts in the ffmpeg command.

$ ffmpeg -i longvideo.ts -c copy -f mpegts -copyts output.ts
[mpegts @ 0x245f460] Invalid timestamps stream=0, pts=43408, dts=8589888000, 
size=535
[mpegts @ 0x245f460] Invalid timestamps stream=0, pts=7408, dts=8589906000, 
size=157
[null @ 0x2465180] Application provided invalid, non monotonically increasing 
dts to muxer in stream 0: 8589924000 >= 7408
[null @ 0x2465180] Application provided invalid, non monotonically increasing 
dts to muxer in stream 0: 8589924000 >= 25408
[null @ 0x2465180] Application provided invalid, non monotonically increasing 
dts to muxer in stream 0: 8589924000 >= 43408
...

In libav calling av_write_frame() with non-monontonic timestamps will return an 
error. In ffmpeg the video will be cut
off or otherwise damaged at 26.5 hours.



The guy in IRC had this convoluted command-line where he piped from ffmpeg to 
NvTranscoder (sample app in the nvenc SDK)
and back through ffmpeg. The commend-line pasted was:

/home/ffmpeg-3.0.1/ffmpeg -i - -codec copy -f mpegts - 
2>/var/log/channels/${CHN}/input.txt < "$fifo" &
encode+=($!)|NvTranscoder -size 1280 720 -i /dev/stdin -o /dev/stdout -bitrate 
180 -vbvMaxBitrate 250  -vbvSize
100 -deviceID $2 $NVENC_OPTS |/home/ffmpeg-3.0.1/ffmpeg -fflags +genpts -i 
- -c:v copy -c:a aac -b:a 128k -ac 2
-timestamp now -f hls -hls_time 6 -hls_flags delete_segments -hls_list_size 5 
${HLS_PATH}/${CHN}/${CHN}2M.m3u8
2>/var/log/channels/${CHN}/720p.txt

... and as for the outputs, all his pastebin records have expired.


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

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


Re: [FFmpeg-devel] [PATCH] lavc/vda_h264: fixes compilation after 1534ef87

2016-06-12 Thread Clément Bœsch
On Sun, Jun 12, 2016 at 08:12:33PM +0200, Clément Bœsch wrote:
> ---
> untested
> ---
>  libavcodec/vda_h264_dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/vda_h264_dec.c b/libavcodec/vda_h264_dec.c
> index a092693..a196eb7 100644
> --- a/libavcodec/vda_h264_dec.c
> +++ b/libavcodec/vda_h264_dec.c
> @@ -226,7 +226,7 @@ static av_cold int vdadec_init(AVCodecContext *avctx)
>  ctx->h264_initialized = 1;
>  
>  for (i = 0; i < MAX_SPS_COUNT; i++) {
> -SPS *sps = ctx->h264ctx.sps_buffers[i];
> +const SPS *sps = (const SPS*)ctx->h264ctx.ps.sps_list[i]->data;
>  if (sps && (sps->bit_depth_luma != 8 ||
>  sps->chroma_format_idc == 2 ||
>  sps->chroma_format_idc == 3)) {

Tested by a user on IRC (maru @ #mpv-devel) and applied

-- 
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] lavc/videotoolbox: fixes compilation after 1534ef87

2016-06-12 Thread Clément Bœsch
On Sun, Jun 12, 2016 at 08:38:12PM +0200, Clément Bœsch wrote:
> ---
> untested
> ---
>  libavcodec/videotoolbox.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
> index 4dc843d..4d86251 100644
> --- a/libavcodec/videotoolbox.c
> +++ b/libavcodec/videotoolbox.c
> @@ -102,11 +102,11 @@ CFDataRef 
> ff_videotoolbox_avcc_extradata_create(AVCodecContext *avctx)
>  memcpy(p + 9, h->ps.sps->data, h->ps.sps->data_size);
>  p += 9 + h->ps.sps->data_size;
>  AV_W8(p + 0, 1); /* number of pps */
> -AV_WB16(p + 1, h->pps.data_size + 1);
> +AV_WB16(p + 1, h->ps.pps->data_size + 1);
>  AV_W8(p + 3, NAL_PPS | (3 << 5)); // NAL unit header
> -memcpy(p + 4, h->pps.data, h->pps.data_size);
> +memcpy(p + 4, h->ps.pps->data, h->ps.pps->data_size);
>  
> -p += 4 + h->pps.data_size;
> +p += 4 + h->ps.pps->data_size;
>  av_assert0(p - vt_extradata == vt_extradata_size);
>  
>  data = CFDataCreate(kCFAllocatorDefault, vt_extradata, 
> vt_extradata_size);

Tested by a user on IRC (maru @ #mpv-devel) and applied with another
runtime fix

-- 
Clément B.


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


[FFmpeg-devel] [PATCH] lavc/videotoolbox: fixes compilation after 1534ef87

2016-06-12 Thread Clément Bœsch
---
untested
---
 libavcodec/videotoolbox.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 4dc843d..4d86251 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -102,11 +102,11 @@ CFDataRef 
ff_videotoolbox_avcc_extradata_create(AVCodecContext *avctx)
 memcpy(p + 9, h->ps.sps->data, h->ps.sps->data_size);
 p += 9 + h->ps.sps->data_size;
 AV_W8(p + 0, 1); /* number of pps */
-AV_WB16(p + 1, h->pps.data_size + 1);
+AV_WB16(p + 1, h->ps.pps->data_size + 1);
 AV_W8(p + 3, NAL_PPS | (3 << 5)); // NAL unit header
-memcpy(p + 4, h->pps.data, h->pps.data_size);
+memcpy(p + 4, h->ps.pps->data, h->ps.pps->data_size);
 
-p += 4 + h->pps.data_size;
+p += 4 + h->ps.pps->data_size;
 av_assert0(p - vt_extradata == vt_extradata_size);
 
 data = CFDataCreate(kCFAllocatorDefault, vt_extradata, vt_extradata_size);
-- 
2.8.3

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


Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread Carl Eugen Hoyos
DeHackEd  dehacked.net> writes:

> The effects vary a bit. One guy in IRC basically had ffmpeg 
> crash for him every 26.5 hours when he was saving to HLS

And when I asked him how I can reproduce this issue he 
unfortunately couldn't answer;-(

Carl Eugen

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


[FFmpeg-devel] [PATCH v2] avformat/tee: Support arbitrary number of slaves

2016-06-12 Thread sebechlebskyjan
From: Jan Sebechlebsky 

Signed-off-by: Jan Sebechlebsky 
---
 libavformat/tee.c | 24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/libavformat/tee.c b/libavformat/tee.c
index 806beaa..bf7438c 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -27,8 +27,6 @@
 #include "avformat.h"
 #include "avio_internal.h"
 
-#define MAX_SLAVES 16
-
 typedef enum {
 ON_SLAVE_FAILURE_ABORT  = 1,
 ON_SLAVE_FAILURE_IGNORE = 2
@@ -52,7 +50,7 @@ typedef struct TeeContext {
 const AVClass *class;
 unsigned nb_slaves;
 unsigned nb_alive;
-TeeSlave slaves[MAX_SLAVES];
+TeeSlave *slaves;
 } TeeContext;
 
 static const char *const slave_delim = "|";
@@ -203,6 +201,7 @@ static void close_slaves(AVFormatContext *avf)
 for (i = 0; i < tee->nb_slaves; i++) {
 close_slave(>slaves[i]);
 }
+av_freep(>slaves);
 }
 
 static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave)
@@ -443,17 +442,17 @@ static int tee_write_header(AVFormatContext *avf)
 TeeContext *tee = avf->priv_data;
 unsigned nb_slaves = 0, i;
 const char *filename = avf->filename;
-char *slaves[MAX_SLAVES];
+char **slaves = NULL;
 int ret;
 
 while (*filename) {
-if (nb_slaves == MAX_SLAVES) {
-av_log(avf, AV_LOG_ERROR, "Maximum %d slave muxers reached.\n",
-   MAX_SLAVES);
-ret = AVERROR_PATCHWELCOME;
+char *slave = av_get_token(, slave_delim);
+if (!slave) {
+ret = AVERROR(ENOMEM);
 goto fail;
 }
-if (!(slaves[nb_slaves++] = av_get_token(, slave_delim))) {
+dynarray_add(, _slaves, slave);
+if (!slaves) {
 ret = AVERROR(ENOMEM);
 goto fail;
 }
@@ -461,6 +460,10 @@ static int tee_write_header(AVFormatContext *avf)
 filename++;
 }
 
+if (!(tee->slaves = av_mallocz_array(nb_slaves, sizeof(*tee->slaves {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 tee->nb_slaves = tee->nb_alive = nb_slaves;
 
 for (i = 0; i < nb_slaves; i++) {
@@ -483,12 +486,14 @@ static int tee_write_header(AVFormatContext *avf)
 av_log(avf, AV_LOG_WARNING, "Input stream #%d is not mapped "
"to any slave.\n", i);
 }
+av_free(slaves);
 return 0;
 
 fail:
 for (i = 0; i < nb_slaves; i++)
 av_freep([i]);
 close_slaves(avf);
+av_free(slaves);
 return ret;
 }
 
@@ -505,6 +510,7 @@ static int tee_write_trailer(AVFormatContext *avf)
 ret_all = ret;
 }
 }
+av_freep(>slaves);
 return ret_all;
 }
 
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH] avformat/tee: Support arbitrary number of slaves

2016-06-12 Thread Jan Sebechlebsky



On 06/12/2016 04:26 PM, Nicolas George wrote:

Le tridi 23 prairial, an CCXXIV, sebechlebsky...@gmail.com a écrit :

From: Jan Sebechlebsky 

Signed-off-by: Jan Sebechlebsky 
---
  libavformat/tee.c | 27 +--
  1 file changed, 17 insertions(+), 10 deletions(-)


Out of curiosity, in what situation is this a problem?

I don't think someone will ever need more than 16 slaves,
but why not :)

Thanks for review!

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


[FFmpeg-devel] [PATCH] lavc/vda_h264: fixes compilation after 1534ef87

2016-06-12 Thread Clément Bœsch
---
untested
---
 libavcodec/vda_h264_dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vda_h264_dec.c b/libavcodec/vda_h264_dec.c
index a092693..a196eb7 100644
--- a/libavcodec/vda_h264_dec.c
+++ b/libavcodec/vda_h264_dec.c
@@ -226,7 +226,7 @@ static av_cold int vdadec_init(AVCodecContext *avctx)
 ctx->h264_initialized = 1;
 
 for (i = 0; i < MAX_SPS_COUNT; i++) {
-SPS *sps = ctx->h264ctx.sps_buffers[i];
+const SPS *sps = (const SPS*)ctx->h264ctx.ps.sps_list[i]->data;
 if (sps && (sps->bit_depth_luma != 8 ||
 sps->chroma_format_idc == 2 ||
 sps->chroma_format_idc == 3)) {
-- 
2.8.3

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


Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread DeHackEd
On 06/12/2016 01:57 PM, Carl Eugen Hoyos wrote:
> DeHackEd  dehacked.net> writes:
> 
>>> So the bug is that the file gets longer when read with FFmpeg?
>>
>> Heh... that's my fault for copy/pasting from the wrong invocation. 
>> I have two test cases, one generated from the above testsrc and 
>> one that actually consists of a 28+ hour recording from a real TV 
>> source. It's a "real world" scenario but the file is about 90 
>> gigabytes.
> 
> I am both able to record arbitrarily long mpegts files and to run 
> FFmpeg to produce long samples.
> 
> But my question is: What goes wrong with the file?
> And how can I reproduce this with a self-produced (or self-
> recorded) file?

The effects vary a bit. One guy in IRC basically had ffmpeg crash for him every 
26.5 hours when he was saving to HLS - I
don't have his actual output on me right now. I have an libav* application fail 
because av_write_frame() returns an
error when the DTS moves backwards.

Based on chatting with other people in #ffmpeg-devel it seemed like it was best 
to implement this correction into the
demuxers themselves. Now it seems fixing libavformat/utils.c user functions may 
be the better way to go based on this
thread so far.

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

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


Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread Carl Eugen Hoyos
DeHackEd  dehacked.net> writes:

> > So the bug is that the file gets longer when read with FFmpeg?
> 
> Heh... that's my fault for copy/pasting from the wrong invocation. 
> I have two test cases, one generated from the above testsrc and 
> one that actually consists of a 28+ hour recording from a real TV 
> source. It's a "real world" scenario but the file is about 90 
> gigabytes.

I am both able to record arbitrarily long mpegts files and to run 
FFmpeg to produce long samples.

But my question is: What goes wrong with the file?
And how can I reproduce this with a self-produced (or self-
recorded) file?

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread DeHackEd
On 06/12/2016 12:06 PM, Carl Eugen Hoyos wrote:
> DeHackEd  dehacked.net> writes:
> 
>> $ ffmpeg -r 5 -f lavfi -i testsrc -c:v libx264 -profile:v veryfast 
>> -t 97000 bigfile.ts
> 
>> $ ffmpeg -i bigfile.ts -c:v copy -f null /dev/null
> 
>> frame=487718 fps=228472 q=-1.0 Lsize=N/A time=27:05:43.00
> 
> So the bug is that the file gets longer when read with FFmpeg?

Heh... that's my fault for copy/pasting from the wrong invocation. I have two 
test cases, one generated from the above
testsrc and one that actually consists of a 28+ hour recording from a real TV 
source. It's a "real world" scenario but
the file is about 90 gigabytes.

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

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


Re: [FFmpeg-devel] [PATCH] avcodec/h264_sei: Do not skip subsequent SEIs on error unless explode is set

2016-06-12 Thread Hendrik Leppkes
On Sun, Jun 12, 2016 at 12:49 PM, Michael Niedermayer
 wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/h264_sei.c |6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>

One argument here is that if one SEI is corrupt, there is no
guarantees even the size information was correct, and as such parsing
any further SEI units may not yield reliable results.
But its probably not going to change much either way, so if you feel
this is better then its fine.

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


Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread Carl Eugen Hoyos
DeHackEd  dehacked.net> writes:

> $ ffmpeg -r 5 -f lavfi -i testsrc -c:v libx264 -profile:v veryfast 
> -t 97000 bigfile.ts

> $ ffmpeg -i bigfile.ts -c:v copy -f null /dev/null

> frame=487718 fps=228472 q=-1.0 Lsize=N/A time=27:05:43.00

So the bug is that the file gets longer when read with FFmpeg?

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] avformat/tee: Support arbitrary number of slaves

2016-06-12 Thread Nicolas George
Le tridi 23 prairial, an CCXXIV, sebechlebsky...@gmail.com a écrit :
> From: Jan Sebechlebsky 
> 
> Signed-off-by: Jan Sebechlebsky 
> ---
>  libavformat/tee.c | 27 +--
>  1 file changed, 17 insertions(+), 10 deletions(-)


Out of curiosity, in what situation is this a problem?


> diff --git a/libavformat/tee.c b/libavformat/tee.c
> index 806beaa..427e999 100644
> --- a/libavformat/tee.c
> +++ b/libavformat/tee.c
> @@ -27,8 +27,6 @@
>  #include "avformat.h"
>  #include "avio_internal.h"
>  
> -#define MAX_SLAVES 16
> -
>  typedef enum {
>  ON_SLAVE_FAILURE_ABORT  = 1,
>  ON_SLAVE_FAILURE_IGNORE = 2
> @@ -52,7 +50,7 @@ typedef struct TeeContext {
>  const AVClass *class;
>  unsigned nb_slaves;
>  unsigned nb_alive;
> -TeeSlave slaves[MAX_SLAVES];
> +TeeSlave *slaves;
>  } TeeContext;
>  
>  static const char *const slave_delim = "|";
> @@ -203,6 +201,8 @@ static void close_slaves(AVFormatContext *avf)
>  for (i = 0; i < tee->nb_slaves; i++) {
>  close_slave(>slaves[i]);
>  }

> +

Minor nit: I do not think we need an extra line here.

> +av_freep(>slaves);
>  }
>  
>  static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave)
> @@ -443,17 +443,17 @@ static int tee_write_header(AVFormatContext *avf)
>  TeeContext *tee = avf->priv_data;
>  unsigned nb_slaves = 0, i;
>  const char *filename = avf->filename;
> -char *slaves[MAX_SLAVES];
> +char **slaves = NULL;
>  int ret;
>  
>  while (*filename) {
> -if (nb_slaves == MAX_SLAVES) {
> -av_log(avf, AV_LOG_ERROR, "Maximum %d slave muxers reached.\n",
> -   MAX_SLAVES);
> -ret = AVERROR_PATCHWELCOME;
> +char *slave = av_get_token(, slave_delim);
> +if (!slave) {
> +ret = AVERROR(ENOMEM);
>  goto fail;
>  }
> -if (!(slaves[nb_slaves++] = av_get_token(, slave_delim))) {
> +dynarray_add(, _slaves, slave);
> +if (!slaves) {
>  ret = AVERROR(ENOMEM);
>  goto fail;
>  }
> @@ -461,6 +461,10 @@ static int tee_write_header(AVFormatContext *avf)
>  filename++;
>  }
>  

> +if (!(tee->slaves = calloc(nb_slaves, sizeof(*tee->slaves {

Calling calloc() directly is not allowed, use av_mallocz_array() instead.

> +ret = AVERROR(ENOMEM);
> +goto fail;
> +}
>  tee->nb_slaves = tee->nb_alive = nb_slaves;
>  
>  for (i = 0; i < nb_slaves; i++) {
> @@ -483,12 +487,13 @@ static int tee_write_header(AVFormatContext *avf)
>  av_log(avf, AV_LOG_WARNING, "Input stream #%d is not mapped "
> "to any slave.\n", i);
>  }
> +av_free(slaves);
>  return 0;

> -

Stray.

>  fail:
>  for (i = 0; i < nb_slaves; i++)
>  av_freep([i]);
>  close_slaves(avf);
> +av_free(slaves);
>  return ret;
>  }
>  
> @@ -505,6 +510,8 @@ static int tee_write_trailer(AVFormatContext *avf)
>  ret_all = ret;
>  }
>  }

> +

Ditto about the empty line.

> +av_freep(>slaves);
>  return ret_all;
>  }

Apart from the calloc() point, LGTM.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [RFC] MAINTAINERS cleanup

2016-06-12 Thread Michael Niedermayer
On Sun, Jun 12, 2016 at 07:57:03AM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> I don't care much for MAINTAINERS, I certainly don't use it for anything,
> but ...
> 
> On Sat, Jun 11, 2016 at 12:31 PM, Michael Niedermayer <
> mich...@niedermayer.cc> wrote:
> 
> > On Sat, Jun 11, 2016 at 01:55:01PM +0200, Clément Bœsch wrote:
> > > On Sat, Jun 11, 2016 at 12:57:13PM +0200, Michael Niedermayer wrote:
> > > > Hi
> > > >
> > > > the MAINTAINERs file contains a bunch of inaccurate and outdated
> > > > entries.
> > > >
> > > > What should be done about this ?
> > > > should we remove everyone who was inactive in FFmpeg
> > > > (aka no commit/author since 2 years) as in git log --first-parent ... ?
> > > > should we mark everyone above as inactive instead like "(inactive)"
> > > >
> > > > shuuld someone send mails to everyone and ask if they stil maintain
> > > > the code they are listed for ?
> > > >
> > >
> > > I'd say at most 30% of the file is still accurate, which means 70% of the
> > > file could be dropped. And then we'll see that it's so small the file is
> > > mostly irrelevant.
> > >
> > > Now I'd rather have the file used as a "community profile" to look for
> > > qualified people in the various area of the project; or said differently,
> > > keep only applications, misc areas, communication, generic parts entries.
> > >
> > > I feel like this file had for mission to be used as an argument to make
> > > sure people are indeed responsible for their code (as in "hey you're the
> > > maintainer of X, please review my patch"). Does it work? Did it in the
> > > past?
> >
> > The file serves as the foundation of "who has/should have/needs
> > git write access" and who has op on IRC
> > (this works and worked)
> >
> > It serves as a list of arbiters case of disagreement
> > (that wasnt used much at least not litterally)
> >
> > Without a MAINTAINERs file git write access and irc op could become
> > more disputable
> >
> > I do like the unwritten? rule of
> > "if you maintain some code you have the last word about it"
> > "if you maintain some code you have git write access"
> > "if someone disagrees about someone else maintaining then he better
> >  volunteers himself to do a better job"
> >
> > Now, if you look at the people who left FFmpeg over the years, i
> > think in many if not most cases it involved prior conflicts with other
> > developers over the area they worked on.
> > so the idea of
> > "if you maintain some code you have the last word about it"
> > is IMO important, this doesnt strictly need a maintainers file of
> > course.
> > But many people work on what is fun for them, and while removing the
> > file or chageing its meaning doesnt directly change that, i think we
> > should be carefull to avoid creating a difference between the people
> > actively working on the code and the ones being in charge about the
> > code in question.
> 
> 
> I fundamentally disagree with this. Blind blocking was one of the largest
> frustrations that caused the creation of Libav. Haven't you learned
> anything? I don't think we've had this situation arise for a few years, but
> I certainly don't want anyone to think I'm OK with people blocking code
> just because they marked a box in MAINTAINERS first. It smells like patents.

wait wait wait, theres something very very VERY different from what
that list should be and what you say

A maintainers job is to maintain code, its his job to get things done
and solved and implemented and fixed and reviewed (within normal
limits of available time and so on)
In that it could be that he rarely askes for a complex patch to be
on hold for a week to have more time to review it or to reject a patch
that is bad with a clear explanation what is bad and how to make it
good.
OTOH sitting there and just rejecting and blocking is not maintaining
such maintainers should resign and let others take over. Because they
arent doing the job and likely by existence of blocked patches there
are others who do care about things.

Git kind of makes this also alot easier to resolve than svn
with svn you could end with 2 people like this
A says this is wrong i wont accept it
B says this is right iam happy to take over maintaince of the file
now with svn you are screwed if this cannot be condensed into a
argument that is clear and understandable. One of the 2 being much
better at argumentation and flaming might even get people to pick
wrong.
WIth git let both maintain the code for a few month in their own
git tree. Then check which works better. thats not so easy to argue
away and safes alot of flaming time on top. (even without a maintainers
file this would make sense)



> 
> If technical arguments can't resolve a particular problem, then the problem
> likely isn't technical, and one random person's opinion certainly shouldn't
> be law (but a different law for each file). That's what the voting
> committee is for (so that at least it's somewhat consistent across the
> project).

lets look at an 

Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread Michael Niedermayer
On Sun, Jun 12, 2016 at 08:31:45AM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Sun, Jun 12, 2016 at 8:23 AM, Michael Niedermayer  > wrote:
> 
> > On Sat, Jun 11, 2016 at 06:55:32PM -0400, DeHackEd wrote:
> > > Presently the mpegts demuxer passes the timestamps from received packets
> > directly to the output AVPackets. 2^33 / 9
> > > seconds is about 26.5 hours at which point applications start having a
> > fit, and that's assuming timestamps begin at time 0.
> > >
> > > So here's a first revision of a patch to fix that issue.
> > >
> > > Improvements possible:
> > > * In its current form intended for continuous sources like over-the-air
> > receivers and multicast sources. When used on
> > > files there will be problems with seeking.
> > > * Constants such as 2^33 could be turned into macros for readability
> >
> > >  mpegts.c |   56 
> > >  1 file changed, 48 insertions(+), 8 deletions(-)
> > > b95c5f58685106dab1f434a3bb465ad5a0ba1636  new-pts-dts.patch
> > > From d06a3bd39fc4f01b9ce6132d80634dd31be7b1aa Mon Sep 17 00:00:00 2001
> > > From: DHE 
> > > Date: Mon, 30 May 2016 18:31:43 -0400
> > > Subject: [PATCH] libavformat/mpegts: Prevent wrapping of PTS & DTS
> >
> > this could cause issues with seeking (as the same packet could
> > result in different timestamps depending on luck) as well as subtitles
> > (which could get misidentified as wraps)
> 
> 
> How does that work before the patch?

timestamp discontnuities are handled in ffmpeg*c, which removes them
for formats which can contain discontnuities.

The pts_wrap code in libavformat can be disabled by the user
if its not disabled it will remove the wrap closest to the start
time. So this fixes the wrap issue for which contain only 1 wrap
without introducing any inconsistencies and working timestamp based
seeking

one certainly could add an array listing IO positions and
discontnuities, and use that to reasonably consistently remove the
discontnuities.
Especially the timestamp based seeking code (which basically does
a form of bisection) would fall apart if the timestamps are randomly
unwraped whie bisecting
some list of unwrap points, should make timestamp based seeking with
multiple wraps work if its applied to the timestamps between demuxer
and seek code and the "index cache" is flushed or updated if the
discontnuities are changed


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway


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


Re: [FFmpeg-devel] [RFC] BSF list API

2016-06-12 Thread Marton Balint


On Sun, 12 Jun 2016, Nicolas George wrote:


Le quartidi 24 prairial, an CCXXIV, Marton Balint a écrit :

Maybe I am missing something, but as far as I see the alloc is due to the
alloc in ff_bsf_get_packet. We could create a similar function
ff_bsf_get_packet2(AVBSFContext *ctx, AVPacket *pkt) which does not allocate
a packet but simply moves the ref to pkt. Then this can be called with the
output packet pointer, so no allocation will be requried. And this function
can be used for performance sensitive places instead of the original.


Indeed, maybe it is as simple as that.


I think we need to support both ways to configure the bsf list. What the tee
muxer, or ffmpeg.c would use, is the text based configuration, therefore
it's worth adding the capability of parsing such lists.


That is exactly what I was suggesting.


So what we need, on top of what I proposed, is an additional API what you
proposed (av_bsf_list_append), and which can be used to add filters to the
list, after we allocated the list filter, but before we initialized it.


No, definitely no. It must be the other way around. Building a text API on
top of a programmatic is fairly common, building a programmatic API on top
of a text API is bad design.


Bad wording on my part, I did not mean "on top of" API wise :). Agreed, 
surely the text parsing can use the av_bsf_list_append functions to do the 
actual work.


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


Re: [FFmpeg-devel] [RFC] BSF list API

2016-06-12 Thread Nicolas George
Le quartidi 24 prairial, an CCXXIV, Marton Balint a écrit :
> Maybe I am missing something, but as far as I see the alloc is due to the
> alloc in ff_bsf_get_packet. We could create a similar function
> ff_bsf_get_packet2(AVBSFContext *ctx, AVPacket *pkt) which does not allocate
> a packet but simply moves the ref to pkt. Then this can be called with the
> output packet pointer, so no allocation will be requried. And this function
> can be used for performance sensitive places instead of the original.

Indeed, maybe it is as simple as that.

> I think we need to support both ways to configure the bsf list. What the tee
> muxer, or ffmpeg.c would use, is the text based configuration, therefore
> it's worth adding the capability of parsing such lists.

That is exactly what I was suggesting.

> So what we need, on top of what I proposed, is an additional API what you
> proposed (av_bsf_list_append), and which can be used to add filters to the
> list, after we allocated the list filter, but before we initialized it.

No, definitely no. It must be the other way around. Building a text API on
top of a programmatic is fairly common, building a programmatic API on top
of a text API is bad design.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] fate: add afade tes

2016-06-12 Thread Michael Niedermayer
On Sun, Jun 12, 2016 at 09:37:28AM +, Petru Rares Sincraian wrote:
> Hi there,
> 
> I'm sorry, I hadn't considered mingw. Here is the patch without the 
> filter-afade-ihsin.

applied


> 
> One question. In which cases I need to test?

Theres no definite list
linux 32/64 is a good choice as its easy
mips makes sense as it covers big endian


> At the moment I am considering linux-32, linux-64, mips,
> and now mingw-32 and mingw-64. Is there another case that I need to consider? 
> And is there a script or command to test the test on all conditions?

iam not aware of a a script but it would be really usefull to alot
of developers if there was a simple 1 commdand scritp that would
setup cross build & test/emulation environments (if they arent set up
yet) and then run tests. And have that reliable working

[...]


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread DeHackEd
On 06/12/2016 08:23 AM, Michael Niedermayer wrote:
> On Sat, Jun 11, 2016 at 06:55:32PM -0400, DeHackEd wrote:
>> Presently the mpegts demuxer passes the timestamps from received packets 
>> directly to the output AVPackets. 2^33 / 9
>> seconds is about 26.5 hours at which point applications start having a fit, 
>> and that's assuming timestamps begin at time 0.
>>
>> So here's a first revision of a patch to fix that issue.
>>
>> Improvements possible:
>> * In its current form intended for continuous sources like over-the-air 
>> receivers and multicast sources. When used on
>> files there will be problems with seeking.
>> * Constants such as 2^33 could be turned into macros for readability
> 
>>  mpegts.c |   56 
>>  1 file changed, 48 insertions(+), 8 deletions(-)
>> b95c5f58685106dab1f434a3bb465ad5a0ba1636  new-pts-dts.patch
>> From d06a3bd39fc4f01b9ce6132d80634dd31be7b1aa Mon Sep 17 00:00:00 2001
>> From: DHE 
>> Date: Mon, 30 May 2016 18:31:43 -0400
>> Subject: [PATCH] libavformat/mpegts: Prevent wrapping of PTS & DTS
> 
> this could cause issues with seeking (as the same packet could
> result in different timestamps depending on luck) as well as subtitles
> (which could get misidentified as wraps)

Yes, I found that in testing. Unfortunately I don't know enough about ffmpeg to 
fix that myself at this time. It's a big
reason I'm posting this patch as [RFC].

> also mpeg-ps has the same kind of timestamps,
> If there is an issue that would affect it too, a fix should be in
> common code
> iam not sure what issue there is though, it seems you expect something
> from the demuxer that its not supposed to do.

I did it this way because 1) it's the issue I personally ran into, and 2) I was 
talking about it in #ffmpeg-devel and
was told "mpegts demuxer should handle the wrapping in itself and just output 
timestamps that are rising"[1], so I did.

> mpeg-ps/ts have 33bit timestamps and they wrap, anything done to
> the wraping belongs to the user applications or common code in
> libavformat.
> 
> If you want to remove timestamp discontinuities in libavformat properly
> or just wraps, thats more complex and will require keeping track of
> where the discontinuities are so that seeking around in the virtual
> continuous timeline works and is fully consistant
> 


--
[1] http://ffmpeg.gusari.org/irclogs/2016/05/30/ffmpeg-devel.log.20160530


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


Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread Ronald S. Bultje
Hi,

On Sun, Jun 12, 2016 at 8:23 AM, Michael Niedermayer  wrote:

> On Sat, Jun 11, 2016 at 06:55:32PM -0400, DeHackEd wrote:
> > Presently the mpegts demuxer passes the timestamps from received packets
> directly to the output AVPackets. 2^33 / 9
> > seconds is about 26.5 hours at which point applications start having a
> fit, and that's assuming timestamps begin at time 0.
> >
> > So here's a first revision of a patch to fix that issue.
> >
> > Improvements possible:
> > * In its current form intended for continuous sources like over-the-air
> receivers and multicast sources. When used on
> > files there will be problems with seeking.
> > * Constants such as 2^33 could be turned into macros for readability
>
> >  mpegts.c |   56 
> >  1 file changed, 48 insertions(+), 8 deletions(-)
> > b95c5f58685106dab1f434a3bb465ad5a0ba1636  new-pts-dts.patch
> > From d06a3bd39fc4f01b9ce6132d80634dd31be7b1aa Mon Sep 17 00:00:00 2001
> > From: DHE 
> > Date: Mon, 30 May 2016 18:31:43 -0400
> > Subject: [PATCH] libavformat/mpegts: Prevent wrapping of PTS & DTS
>
> this could cause issues with seeking (as the same packet could
> result in different timestamps depending on luck) as well as subtitles
> (which could get misidentified as wraps)


How does that work before the patch?

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


Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread Michael Niedermayer
On Sat, Jun 11, 2016 at 06:55:32PM -0400, DeHackEd wrote:
> Presently the mpegts demuxer passes the timestamps from received packets 
> directly to the output AVPackets. 2^33 / 9
> seconds is about 26.5 hours at which point applications start having a fit, 
> and that's assuming timestamps begin at time 0.
> 
> So here's a first revision of a patch to fix that issue.
> 
> Improvements possible:
> * In its current form intended for continuous sources like over-the-air 
> receivers and multicast sources. When used on
> files there will be problems with seeking.
> * Constants such as 2^33 could be turned into macros for readability

>  mpegts.c |   56 
>  1 file changed, 48 insertions(+), 8 deletions(-)
> b95c5f58685106dab1f434a3bb465ad5a0ba1636  new-pts-dts.patch
> From d06a3bd39fc4f01b9ce6132d80634dd31be7b1aa Mon Sep 17 00:00:00 2001
> From: DHE 
> Date: Mon, 30 May 2016 18:31:43 -0400
> Subject: [PATCH] libavformat/mpegts: Prevent wrapping of PTS & DTS

this could cause issues with seeking (as the same packet could
result in different timestamps depending on luck) as well as subtitles
(which could get misidentified as wraps)
also mpeg-ps has the same kind of timestamps,
If there is an issue that would affect it too, a fix should be in
common code
iam not sure what issue there is though, it seems you expect something
from the demuxer that its not supposed to do.
mpeg-ps/ts have 33bit timestamps and they wrap, anything done to
the wraping belongs to the user applications or common code in
libavformat.

If you want to remove timestamp discontinuities in libavformat properly
or just wraps, thats more complex and will require keeping track of
where the discontinuities are so that seeking around in the virtual
continuous timeline works and is fully consistant



[...]


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates


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


Re: [FFmpeg-devel] [RFC] MAINTAINERS cleanup

2016-06-12 Thread Ronald S. Bultje
Hi,

I don't care much for MAINTAINERS, I certainly don't use it for anything,
but ...

On Sat, Jun 11, 2016 at 12:31 PM, Michael Niedermayer <
mich...@niedermayer.cc> wrote:

> On Sat, Jun 11, 2016 at 01:55:01PM +0200, Clément Bœsch wrote:
> > On Sat, Jun 11, 2016 at 12:57:13PM +0200, Michael Niedermayer wrote:
> > > Hi
> > >
> > > the MAINTAINERs file contains a bunch of inaccurate and outdated
> > > entries.
> > >
> > > What should be done about this ?
> > > should we remove everyone who was inactive in FFmpeg
> > > (aka no commit/author since 2 years) as in git log --first-parent ... ?
> > > should we mark everyone above as inactive instead like "(inactive)"
> > >
> > > shuuld someone send mails to everyone and ask if they stil maintain
> > > the code they are listed for ?
> > >
> >
> > I'd say at most 30% of the file is still accurate, which means 70% of the
> > file could be dropped. And then we'll see that it's so small the file is
> > mostly irrelevant.
> >
> > Now I'd rather have the file used as a "community profile" to look for
> > qualified people in the various area of the project; or said differently,
> > keep only applications, misc areas, communication, generic parts entries.
> >
> > I feel like this file had for mission to be used as an argument to make
> > sure people are indeed responsible for their code (as in "hey you're the
> > maintainer of X, please review my patch"). Does it work? Did it in the
> > past?
>
> The file serves as the foundation of "who has/should have/needs
> git write access" and who has op on IRC
> (this works and worked)
>
> It serves as a list of arbiters case of disagreement
> (that wasnt used much at least not litterally)
>
> Without a MAINTAINERs file git write access and irc op could become
> more disputable
>
> I do like the unwritten? rule of
> "if you maintain some code you have the last word about it"
> "if you maintain some code you have git write access"
> "if someone disagrees about someone else maintaining then he better
>  volunteers himself to do a better job"
>
> Now, if you look at the people who left FFmpeg over the years, i
> think in many if not most cases it involved prior conflicts with other
> developers over the area they worked on.
> so the idea of
> "if you maintain some code you have the last word about it"
> is IMO important, this doesnt strictly need a maintainers file of
> course.
> But many people work on what is fun for them, and while removing the
> file or chageing its meaning doesnt directly change that, i think we
> should be carefull to avoid creating a difference between the people
> actively working on the code and the ones being in charge about the
> code in question.


I fundamentally disagree with this. Blind blocking was one of the largest
frustrations that caused the creation of Libav. Haven't you learned
anything? I don't think we've had this situation arise for a few years, but
I certainly don't want anyone to think I'm OK with people blocking code
just because they marked a box in MAINTAINERS first. It smells like patents.

If technical arguments can't resolve a particular problem, then the problem
likely isn't technical, and one random person's opinion certainly shouldn't
be law (but a different law for each file). That's what the voting
committee is for (so that at least it's somewhat consistent across the
project).

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


Re: [FFmpeg-devel] [RFC] MAINTAINERS cleanup

2016-06-12 Thread Timo Rothenpieler
On 6/11/2016 12:57 PM, Michael Niedermayer wrote:
> Hi
> 
> the MAINTAINERs file contains a bunch of inaccurate and outdated
> entries.
> 
> What should be done about this ?
> should we remove everyone who was inactive in FFmpeg
> (aka no commit/author since 2 years) as in git log --first-parent ... ?
> should we mark everyone above as inactive instead like "(inactive)"

Yes, if the person maintaining is inactive, he/she should be removed
from the MAINTAINERS file.
A combination of commits/authors and ffmpeg-devel mails over the last X
month might be better than a pure commit based approach.

> shuuld someone send mails to everyone and ask if they stil maintain
> the code they are listed for ?

This could be mostly automated. A cron script running every day, parsing
commits and the ML, sending a mail about inactive maintainers to the ML
(with the maintainer on CC). So if they reply to that mail, they are
automatically active again.

It might also be interesting to move files without a maintainer to a
Maintainer-Wanted section instead of removing them from MAINTAINERS.
That way there is a single place to find parts that need a new maintainer.



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


[FFmpeg-devel] One questions about 3D video

2016-06-12 Thread qw
Hi,

My quesions are shown below:

1) Is there some way to check whether media files contain 3d Video or not?

Thanks!

B.R.

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


Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread DeHackEd
On 06/12/2016 04:07 AM, Carl Eugen Hoyos wrote:
> DeHackEd  dehacked.net> writes:
> 
>> So here's a first revision of a patch to fix that issue.
> 
> How can I reproduce the issue?

1) Produce a very long video, around 27 hours long or so, in mpegts format

$ ffmpeg -r 5 -f lavfi -i testsrc -c:v libx264 -profile:v veryfast -t 97000 
bigfile.ts

2) Process the created video to anything else.

$ ffmpeg -i bigfile.ts -c:v copy -f null /dev/null

What I saw output (I think this is going to get mangled by my mail client):

Input #0, mpegts, from 'longvideo.ts':
  Duration: 00:34:59.88, start: 1.80, bitrate: 697 kb/s
  Program 1
Metadata:
  service_name: Service01
  service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High 4:4:4 Predictive) ([27][0][0][0] / 
0x001B), yuv444p, 320x240 [SAR 1:1 DAR
4:3], 5 fps, 5 tbr, 90k tbn
[null @ 0x341f160] Using AVStream.codec to pass codec parameters to muxers is 
deprecated, use AVStream.codecpar instead.
Output #0, null, to '/dev/null':
  Metadata:
encoder : Lavf57.36.100
Stream #0:0: Video: h264 ([27][0][0][0] / 0x001B), yuv444p, 320x240 [SAR 
1:1 DAR 4:3], q=2-31, 5 fps, 5 tbr, 90k tbn
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0x3419440] Invalid timestamps stream=0, pts=43408, dts=8589888000, 
size=535
[mpegts @ 0x3419440] Invalid timestamps stream=0, pts=7408, dts=8589906000, 
size=157
frame=487718 fps=228472 q=-1.0 Lsize=N/A time=27:05:43.00 bitrate=N/A 
speed=4.57e+04x
video:121012kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB 
muxing overhead: unknown


> 
> Imo, the reindentation makes your patch very difficult to read.
> 

Yeah, sorry but it seemed like the thing to do for that one block. It just adds 
initializers for the two new fields in
the PESContext.


> 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


[FFmpeg-devel] [PATCH] avcodec/h264_sei: Do not skip subsequent SEIs on error unless explode is set

2016-06-12 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavcodec/h264_sei.c |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index 95fc5da..1c6b0d7 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -425,6 +425,8 @@ static int decode_GreenMetadata(H264Context *h)
 
 int ff_h264_decode_sei(H264Context *h)
 {
+int master_ret = 0;
+
 while (get_bits_left(>gb) > 16 && show_bits(>gb, 16)) {
 int type = 0;
 unsigned size = 0;
@@ -482,6 +484,8 @@ int ff_h264_decode_sei(H264Context *h)
 av_log(h->avctx, AV_LOG_DEBUG, "unknown SEI type %d\n", type);
 }
 if (ret < 0)
+master_ret = ret;
+if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
 return ret;
 
 skip_bits_long(>gb, next - get_bits_count(>gb));
@@ -490,7 +494,7 @@ int ff_h264_decode_sei(H264Context *h)
 align_get_bits(>gb);
 }
 
-return 0;
+return master_ret;
 }
 
 const char* ff_h264_sei_stereo_mode(H264Context *h)
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [RFC] MAINTAINERS cleanup

2016-06-12 Thread Thilo Borgmann
Am 11.06.16 um 18:35 schrieb Paul B Mahol:
> On 6/11/16, Michael Niedermayer  wrote:
>> On Sat, Jun 11, 2016 at 01:55:01PM +0200, Clement Boesch wrote:
>>> On Sat, Jun 11, 2016 at 12:57:13PM +0200, Michael Niedermayer wrote:
 Hi

 the MAINTAINERs file contains a bunch of inaccurate and outdated
 entries.

 What should be done about this ?
 should we remove everyone who was inactive in FFmpeg
 (aka no commit/author since 2 years) as in git log --first-parent ... ?
 should we mark everyone above as inactive instead like "(inactive)"

 shuuld someone send mails to everyone and ask if they stil maintain
 the code they are listed for ?

>>>
>>> I'd say at most 30% of the file is still accurate, which means 70% of the
>>> file could be dropped. And then we'll see that it's so small the file is
>>> mostly irrelevant.
>>>
>>> Now I'd rather have the file used as a "community profile" to look for
>>> qualified people in the various area of the project; or said differently,
>>> keep only applications, misc areas, communication, generic parts entries.
>>>
>>> I feel like this file had for mission to be used as an argument to make
>>> sure people are indeed responsible for their code (as in "hey you're the
>>> maintainer of X, please review my patch"). Does it work? Did it in the
>>> past?
>>
>> The file serves as the foundation of "who has/should have/needs
>> git write access" and who has op on IRC
>> (this works and worked)
>>
>> It serves as a list of arbiters case of disagreement
>> (that wasnt used much at least not litterally)
>>
>> Without a MAINTAINERs file git write access and irc op could become
>> more disputable
>>
>> I do like the unwritten? rule of
>> "if you maintain some code you have the last word about it"
>> "if you maintain some code you have git write access"
>> "if someone disagrees about someone else maintaining then he better
>>  volunteers himself to do a better job"
>>
>> Now, if you look at the people who left FFmpeg over the years, i
>> think in many if not most cases it involved prior conflicts with other
>> developers over the area they worked on.
>> so the idea of
>> "if you maintain some code you have the last word about it"
>> is IMO important, this doesnt strictly need a maintainers file of
>> course.
>> But many people work on what is fun for them, and while removing the
>> file or chageing its meaning doesnt directly change that, i think we
>> should be carefull to avoid creating a difference between the people
>> actively working on the code and the ones being in charge about the
>> code in question.
>>
>> [...]
>>
>> --
>> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>>
>> Dictatorship: All citizens are under surveillance, all their steps and
>> actions recorded, for the politicians to enforce control.
>> Democracy: All politicians are under surveillance, all their steps and
>> actions recorded, for the citizens to enforce control.
>>
> 
> If this file is not going to be cleaned up it should be removed.

I think this file should be kept and updated from time to time. We can
very well ping some maintainers asking for reliability of their
maintainership and mark/remove their entries.

I also think every file of the source should be listed, even if there's
just an inactive or no maintainer. I was looking for people to ask
specifics and have been contacted by reference to that several times.
This file makes perfect sense to me.

-Thilo

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


Re: [FFmpeg-devel] [PATCH] avcodec: Remove libutvideo support

2016-06-12 Thread Carl Eugen Hoyos
Paul B Mahol  gmail.com> writes:

> I'm still for removing this.

Please provide a new commit message.

> I added 10-bit support to native decoder.

This is a good reason for the removal.

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] [RFC] libavformat/mpegts: Prevent wrapping of PTS & DTS

2016-06-12 Thread Carl Eugen Hoyos
DeHackEd  dehacked.net> writes:

> So here's a first revision of a patch to fix that issue.

How can I reproduce the issue?

Imo, the reindentation makes your patch very difficult to read.

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] avfilter/graphparser: remove '\n' from parse_filter

2016-06-12 Thread Muhammad Faiz
On Mon, Jun 6, 2016 at 12:19 AM, Muhammad Faiz  wrote:
> On Sun, Jun 5, 2016 at 12:33 AM, Michael Niedermayer
>  wrote:
>> On Thu, Jun 02, 2016 at 03:32:49PM +0700, Muhammad Faiz wrote:
>>> On Thu, May 5, 2016 at 2:21 PM, Muhammad Faiz  wrote:
>>> > this allow a filter to be written like this:
>>> > aformat =
>>> > sample_fmts  = fltp|flt:
>>> > sample_rates = 44100|44800
>>> >
>>> > Signed-off-by: Muhammad Faiz 
>>> > ---
>>> >  libavfilter/graphparser.c | 4 ++--
>>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>>> >
>>> > diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
>>> > index 8d15b5d..03062af 100644
>>> > --- a/libavfilter/graphparser.c
>>> > +++ b/libavfilter/graphparser.c
>>> > @@ -165,12 +165,12 @@ static int parse_filter(AVFilterContext **filt_ctx, 
>>> > const char **buf, AVFilterGr
>>> >  int index, void *log_ctx)
>>> >  {
>>> >  char *opts = NULL;
>>> > -char *name = av_get_token(buf, "=,;[\n");
>>> > +char *name = av_get_token(buf, "=,;[");
>>> >  int ret;
>>> >
>>> >  if (**buf == '=') {
>>> >  (*buf)++;
>>> > -opts = av_get_token(buf, "[],;\n");
>>> > +opts = av_get_token(buf, "[],;");
>>> >  }
>>> >
>>> >  ret = create_filter(filt_ctx, graph, index, name, opts, log_ctx);
>>> > --
>>> > 2.5.0
>>> >
>>>
>>> No response. So, I will try to explain this patch.
>>> It allows filter definition to span across multiple lines.
>>> This behaviour is useful to make filter graph more readable,
>>> especially when stored on file.
>>>
>>> For example, using lavfi
>>> ffplay -graph_file filter.txt -f lavfi my_lavfi
>>> filter.txt:
>>>
>>> amovie=audio.mp3,
>>> aformat=
>>> channel_layouts = stereo:
>>> sample_rates= 48000:
>>> sample_fmts = flt|fltp,
>>> asplit [out0],
>>> showcqt =
>>> tc = 0.33:
>>> fps = 60
>>> [out1]
>>
>> Can this break (realistic) existing and documented as working cases ?
>>
>
> This should not break any existing filter graph.
> Previously, filter graph written like above will generate error.

Is it OK if I apply this patch?

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


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

2016-06-12 Thread Carl Eugen Hoyos
Josh de Kock  itanimul.li> writes:

> +if (p->buf[1080] == 'M' && p->buf[1081] == '.' &&
> +p->buf[1082] == 'K' && p->buf[1083] == '.')
> +return AVPROBE_SCORE_MAX;

This should return EXTENSION + 1 when testing 32bit.

> +openmpt->channels = openmpt_module_get_num_channels(openmpt->module);

If known, please also set the channel_layout.

And consider to wait for a real review.

Thank you, Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] avformat/mxfdec: check if source_package is NULL

2016-06-12 Thread Tomas Härdin
On Tue, 2016-05-31 at 23:02 +0200, Marton Balint wrote:
> Fixes ticket #5554.
> 
> Signed-off-by: Marton Balint 
> ---
>  libavformat/mxfdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index f8cf922..9bf676c 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -1914,7 +1914,7 @@ static int
> mxf_parse_structural_metadata(MXFContext *mxf)
>  break;
>  }
>  }
> -if (!source_track || !component)
> +if (!source_track || !component || !source_package)
>  continue;
>  
>  if (!(source_track->sequence = mxf_resolve_strong_ref(mxf,
> _track->sequence_ref, Sequence))) {

Looks OK. Crashes are important

/Tomas

signature.asc
Description: This is a digitally signed message part
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel