Re: [FFmpeg-devel] [PATCH 07/10] lavf: document that AVStream::codecpar may be modified by lavf after avformat_write_header(). This is assumed not to break API because it's already true (see e.g. matr

2018-03-15 Thread Rodger Combs
Could we just declare that lavf can update extradata (and nothing else) if it 
gets packets with new-extradata side-data? If not, I suppose we could either 
add something to AVStreamInternal, or do something internal in check_bitstream 
(and update movenc and matroskaenc, as both exhibit this behavior right now).

> On Mar 15, 2018, at 20:04, Hendrik Leppkes  wrote:
> 
> On Fri, Mar 16, 2018 at 12:29 AM, Michael Niedermayer
> mailto:mich...@niedermayer.cc>> wrote:
>> On Wed, Mar 14, 2018 at 01:24:42AM -0500, Rodger Combs wrote:
>>> ---
>>> libavformat/avformat.h | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
>>> index 9e87d6cdac..5f0ebfc114 100644
>>> --- a/libavformat/avformat.h
>>> +++ b/libavformat/avformat.h
>>> @@ -1006,7 +1006,8 @@ typedef struct AVStream {
>>>  *
>>>  * - demuxing: filled by libavformat on stream creation or in
>>>  * avformat_find_stream_info()
>>> - * - muxing: filled by the caller before avformat_write_header()
>>> + * - muxing: filled by the caller before avformat_write_header();
>>> + * - may be modified by libavformat afterwards
>>>  */
>> 
>> a generic "anything can change" is not really practical
>> a user app would have to check every field of codecpar and possibly insert
>> video scalers if resoluton changed, or all kinds of other filters and even
>> different encoders if codec_id was adjusted ...
>> 
> 
> I generally don't like this either. codecpar describes the codec as
> given to the muxer by the user. The muxer has no business changing
> things around in it.
> If it can derive better values somehow, let it store it internally somewhere.
> 
> - Hendrik
> ___
> 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 1/2] lavc/qsvenc: fix the typo of FrameRateExtD

2018-03-15 Thread Zhong Li
Signed-off-by: Zhong Li 
---
 libavcodec/qsvenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 9710f5b..0d2e223 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -366,7 +366,7 @@ static int check_enc_param(AVCodecContext *avctx, 
QSVEncContext *q)
 av_log(avctx, AV_LOG_ERROR, "Selected ratecontrol mode is 
unsupported\n");
 if (UNMATCH(LowPower))
   av_log(avctx, AV_LOG_ERROR, "Low power mode is unsupported\n");
-if (UNMATCH(FrameInfo.FrameRateExtN) || 
UNMATCH(FrameInfo.FrameRateExtN))
+if (UNMATCH(FrameInfo.FrameRateExtN) || 
UNMATCH(FrameInfo.FrameRateExtD))
   av_log(avctx, AV_LOG_ERROR, "Current frame rate is 
unsupported\n");
 if (UNMATCH(FrameInfo.PicStruct))
   av_log(avctx, AV_LOG_ERROR, "Current picture structure is 
unsupported\n");
-- 
1.8.3.1

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


[FFmpeg-devel] [PATCH 2/2] lavc/qsvenc: add the Access Unit Delimiter NAL Unit support

2018-03-15 Thread Zhong Li
Signed-off-by: Zhong Li 
---
 libavcodec/qsvenc.c  | 1 +
 libavcodec/qsvenc.h  | 2 ++
 libavcodec/qsvenc_h264.c | 2 ++
 3 files changed, 5 insertions(+)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 0d2e223..afb953e 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -595,6 +595,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 if (q->recovery_point_sei >= 0)
 q->extco.RecoveryPointSEI = q->recovery_point_sei ? 
MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
 q->extco.MaxDecFrameBuffering = q->max_dec_frame_buffering;
+q->extco.AUDelimiter  = q->aud ? MFX_CODINGOPTION_ON : 
MFX_CODINGOPTION_OFF;
 }
 
 q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer 
*)&q->extco;
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index fb5fd68..080f6f0 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -138,6 +138,8 @@ typedef struct QSVEncContext {
 int max_frame_size;
 int max_slice_size;
 
+int aud;
+
 int single_sei_nal_unit;
 int max_dec_frame_buffering;
 int trellis;
diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index e01a2a3..3f090ce 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -141,6 +141,8 @@ static const AVOption options[] = {
 { "main", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_AVC_MAIN
 }, INT_MIN, INT_MAX, VE, "profile" },
 { "high", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_AVC_HIGH
 }, INT_MIN, INT_MAX, VE, "profile" },
 
+{ "aud", "Insert the Access Unit Delimiter NAL", OFFSET(qsv.aud), 
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE},
+
 { "a53cc" , "Use A53 Closed Captions (if available)", OFFSET(qsv.a53_cc), 
AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, VE},
 { NULL },
 };
-- 
1.8.3.1

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


Re: [FFmpeg-devel] [PATCH] ffmpeg.c - drain all decoded frames during stream_loop flush

2018-03-15 Thread Gyan Doshi
Revised patch only drains 1 packet per call and loops via 
transcode_step() till EOF, just like when decoders are truly closed. 
Functionally the same result as first version.


On 3/15/2018 3:31 PM, Gyan Doshi wrote:
Fixes a bug with flushing decoders during stream_loop. Note that the 
issue is also averted if we skip flushing altogether.
From a19b5586ae343a2b36d9dce5a1343629ec0fb40f Mon Sep 17 00:00:00 2001
From: Gyan Doshi 
Date: Thu, 15 Mar 2018 16:45:51 +0530
Subject: [PATCH v2] ffmpeg.c - drain all decoded frames during stream_loop
 flush

When a decoded stream is being looped, after each post-EOF rewind,
decoders are flushed in seek_to_start(). This only drains 1 frame, and
thus the output has a few frames missing at the tail of each iteration
except the last.

With this patch, process_input is looped till process_input_packet
reaches EOF.

Fixes #7081
---
 fftools/ffmpeg.c | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index ee7258fcd1..3c18e06713 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -4170,12 +4170,6 @@ static int seek_to_start(InputFile *ifile, 
AVFormatContext *is)
 ist   = input_streams[ifile->ist_index + i];
 avctx = ist->dec_ctx;
 
-// flush decoders
-if (ist->decoding_needed) {
-process_input_packet(ist, NULL, 1);
-avcodec_flush_buffers(avctx);
-}
-
 /* duration is the length of the last frame in a stream
  * when audio stream is present we don't care about
  * last video frame length because it's not defined exactly */
@@ -4244,6 +4238,17 @@ static int process_input(int file_index)
 return ret;
 }
 if (ret < 0 && ifile->loop) {
+AVCodecContext *avctx;
+for (i = 0; i < ifile->nb_streams; i++) {
+ist = input_streams[ifile->ist_index + i];
+avctx = ist->dec_ctx;
+if (ist->decoding_needed) {
+ret = process_input_packet(ist, NULL, 1);
+if (ret>0)
+return 0;
+avcodec_flush_buffers(avctx);
+}
+}
 ret = seek_to_start(ifile, is);
 if (ret < 0)
 av_log(NULL, AV_LOG_WARNING, "Seek to start failed.\n");
-- 
2.12.2.windows.2___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 07/10] lavf: document that AVStream::codecpar may be modified by lavf after avformat_write_header(). This is assumed not to break API because it's already true (see e.g. matr

2018-03-15 Thread Hendrik Leppkes
On Fri, Mar 16, 2018 at 12:29 AM, Michael Niedermayer
 wrote:
> On Wed, Mar 14, 2018 at 01:24:42AM -0500, Rodger Combs wrote:
>> ---
>>  libavformat/avformat.h | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
>> index 9e87d6cdac..5f0ebfc114 100644
>> --- a/libavformat/avformat.h
>> +++ b/libavformat/avformat.h
>> @@ -1006,7 +1006,8 @@ typedef struct AVStream {
>>   *
>>   * - demuxing: filled by libavformat on stream creation or in
>>   * avformat_find_stream_info()
>> - * - muxing: filled by the caller before avformat_write_header()
>> + * - muxing: filled by the caller before avformat_write_header();
>> + * - may be modified by libavformat afterwards
>>   */
>
> a generic "anything can change" is not really practical
> a user app would have to check every field of codecpar and possibly insert
> video scalers if resoluton changed, or all kinds of other filters and even
> different encoders if codec_id was adjusted ...
>

I generally don't like this either. codecpar describes the codec as
given to the muxer by the user. The muxer has no business changing
things around in it.
If it can derive better values somehow, let it store it internally somewhere.

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


Re: [FFmpeg-devel] [PATCH V3 02/11] lavu/opt: add bit stream filter option dump support

2018-03-15 Thread Michael Niedermayer
On Wed, Mar 14, 2018 at 01:41:41PM +0800, Jun Zhao wrote:
> 

>  libavutil/opt.c|1 +
>  tests/ref/fate/opt |   50 +-
>  2 files changed, 26 insertions(+), 25 deletions(-)
> cd3cff1a3823029158a1f5698ea94b8917dfaa5f  
> 0002-lavu-opt-add-bit-stream-filter-option-dump-support.patch
> From e479afdf27ab250ad545ea9518644e56be38d185 Mon Sep 17 00:00:00 2001
> From: Jun Zhao 
> Date: Wed, 14 Mar 2018 10:05:05 +0800
> Subject: [PATCH V3 02/11] lavu/opt: add bit stream filter option dump support.
> 
> enable dump bit stream filter and update opt fate test ref.
> 
> Signed-off-by: Jun Zhao 
> ---
>  libavutil/opt.c|  1 +
>  tests/ref/fate/opt | 50 +-
>  2 files changed, 26 insertions(+), 25 deletions(-)

will apply

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH V3 03/11] ffmpeg: support dump bit stream filter options

2018-03-15 Thread Michael Niedermayer
On Wed, Mar 14, 2018 at 01:41:52PM +0800, Jun Zhao wrote:
> 

>  cmdutils.c   |   17 +
>  ffmpeg_opt.c |3 ++-
>  2 files changed, 19 insertions(+), 1 deletion(-)
> 354b73b3bf935d05abb5b3ddc9566f1852bcd773  
> 0003-ffmpeg-support-dump-bit-stream-filter-options.patch
> From 6b8f199d0028afb3f0a6a10275e4055ddce91a6a Mon Sep 17 00:00:00 2001
> From: Jun Zhao 
> Date: Thu, 8 Mar 2018 13:50:31 +0800
> Subject: [PATCH V3 03/11] ffmpeg: support dump bit stream filter options.
> 
> Support dump bit stream filter option in ffmpeg -h full and
> ffmpeg -h bsf=FooBar.
> 
> Signed-off-by: Jun Zhao 
> ---
>  fftools/cmdutils.c   | 17 +
>  fftools/ffmpeg_opt.c |  3 ++-
>  2 files changed, 19 insertions(+), 1 deletion(-)

will apply

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


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


Re: [FFmpeg-devel] [PATCH V3 01/11] lavu/opt: add AV_OPT_FLAG_BSF_PARAM

2018-03-15 Thread Michael Niedermayer
On Wed, Mar 14, 2018 at 01:41:04PM +0800, Jun Zhao wrote:
> V3: rearrange the patch-sets as Michael's comments
> V2: update opt fate test ref file

>  opt.h |1 +
>  1 file changed, 1 insertion(+)
> 6be6265316a6a31ffb6d4c8db7ed5d0c7c9b53c8  
> 0001-lavu-opt-add-AV_OPT_FLAG_BSF_PARAM.patch
> From c1b532a76153033efa5585915660a8d29a5f8649 Mon Sep 17 00:00:00 2001
> From: Jun Zhao 
> Date: Thu, 8 Mar 2018 13:47:23 +0800
> Subject: [PATCH V3 01/11] lavu/opt: add AV_OPT_FLAG_BSF_PARAM
> 
> add AV_OPT_FLAG_BSF_PARAM for bit stream filter options.
> 
> Signed-off-by: Jun Zhao 
> ---
>  libavutil/opt.h | 1 +
>  1 file changed, 1 insertion(+)

will apply

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"I am not trying to be anyone's saviour, I'm trying to think about the
 future and not be sad" - Elon Musk



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


Re: [FFmpeg-devel] [PATCH] avformat/movenc: move the concatenated eac3 packet reference

2018-03-15 Thread James Almer
On 3/15/2018 8:36 PM, Michael Niedermayer wrote:
> On Tue, Mar 13, 2018 at 11:35:18PM -0300, James Almer wrote:
>> Simplifies code.
>>
>> Signed-off-by: James Almer 
>> ---
>>  libavformat/movenc.c | 5 +
>>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> should be ok
> 
> thx

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


Re: [FFmpeg-devel] [PATCH] avformat/movenc: move the concatenated eac3 packet reference

2018-03-15 Thread Michael Niedermayer
On Tue, Mar 13, 2018 at 11:35:18PM -0300, James Almer wrote:
> Simplifies code.
> 
> Signed-off-by: James Almer 
> ---
>  libavformat/movenc.c | 5 +
>  1 file changed, 1 insertion(+), 4 deletions(-)

should be ok

thx

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

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin


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


Re: [FFmpeg-devel] [PATCH 07/10] lavf: document that AVStream::codecpar may be modified by lavf after avformat_write_header(). This is assumed not to break API because it's already true (see e.g. matr

2018-03-15 Thread Michael Niedermayer
On Wed, Mar 14, 2018 at 01:24:42AM -0500, Rodger Combs wrote:
> ---
>  libavformat/avformat.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 9e87d6cdac..5f0ebfc114 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -1006,7 +1006,8 @@ typedef struct AVStream {
>   *
>   * - demuxing: filled by libavformat on stream creation or in
>   * avformat_find_stream_info()
> - * - muxing: filled by the caller before avformat_write_header()
> + * - muxing: filled by the caller before avformat_write_header();
> + * - may be modified by libavformat afterwards
>   */

a generic "anything can change" is not really practical
a user app would have to check every field of codecpar and possibly insert
video scalers if resoluton changed, or all kinds of other filters and even
different encoders if codec_id was adjusted ...

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

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


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


Re: [FFmpeg-devel] [PATCH 2/2] avutil/log: print level prefix also when no AVClass context is available

2018-03-15 Thread Michael Niedermayer
On Wed, Mar 14, 2018 at 09:55:23AM +0100, Tobias Rapp wrote:
> Adds the level prefix to all log messages, except those with level <=
> AV_LOG_QUIET as they seem to be used for flushing the log buffer.
> 
> Signed-off-by: Tobias Rapp 
> ---
>  libavutil/log.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

LGTM

thx

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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch


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


Re: [FFmpeg-devel] [PATCH 08/10] lavf/matroskaenc: don't rewrite extradata if we already have some

2018-03-15 Thread Rodger Combs


> On Mar 15, 2018, at 17:36, James Almer  wrote:
> 
> On 3/14/2018 3:24 AM, Rodger Combs wrote:
>> matroska doesn't support mid-stream extradata changes
> 
> How so? We update flac extradata as sent by the encoder in the last
> packet as side data.

Right, but the format itself doesn't support changing mid-stream; we handle 
that case by rewriting the header.

> 
>> , and rewriting
>> the same extradata already written in write_header would cause errors
>> since we previously didn't write a filler void.
> 
> When would this happen? What sets both extradata in codecpar then sends
> new one as packet side data for AAC audio?

Happens after the subsequent patch ("lavf/mux: propagate extradata changes 
before we call write_header to codecpar").

> 
>> ---
>> libavformat/matroskaenc.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
>> index 5950b4de44..e4db5a9a1c 100644
>> --- a/libavformat/matroskaenc.c
>> +++ b/libavformat/matroskaenc.c
>> @@ -2266,7 +2266,8 @@ static int mkv_check_new_extra_data(AVFormatContext 
>> *s, AVPacket *pkt)
>> 
>> switch (par->codec_id) {
>> case AV_CODEC_ID_AAC:
>> -if (side_data_size && (s->pb->seekable & AVIO_SEEKABLE_NORMAL) && 
>> !mkv->is_live) {
>> +if (side_data_size && !par->extradata_size &&
>> +(s->pb->seekable & AVIO_SEEKABLE_NORMAL) && !mkv->is_live) {
>> int filler, output_sample_rate = 0;
>> int64_t curpos;
>> ret = get_aac_sample_rates(s, side_data, side_data_size, 
>> &track->sample_rate,
>> 
> 
> ___
> 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 07/10] lavf: document that AVStream::codecpar may be modified by lavf after avformat_write_header(). This is assumed not to break API because it's already true (see e.g. matr

2018-03-15 Thread James Almer
On 3/14/2018 3:24 AM, Rodger Combs wrote:
> This is assumed not to break API because it's already true (see e.g.
> matroskaenc handling of new AAC extradata)

That's an API violation from the muxer's part instead. The correct
approach is to fix the violation, not adapt the API around it.

> ---
>  libavformat/avformat.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 9e87d6cdac..5f0ebfc114 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -1006,7 +1006,8 @@ typedef struct AVStream {
>   *
>   * - demuxing: filled by libavformat on stream creation or in
>   * avformat_find_stream_info()
> - * - muxing: filled by the caller before avformat_write_header()
> + * - muxing: filled by the caller before avformat_write_header();
> + * - may be modified by libavformat afterwards

Personally I'd rather fix the current muxer-level violations and if
needed store any such changes in a separate struct in AVStreamInternal
instead when dealing with generic code (Namely patch 9/10 from this set).
But if others are fine with introducing this definition change then i
wont block it.

>   */
>  AVCodecParameters *codecpar;
>  
> 

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


Re: [FFmpeg-devel] [PATCH 08/10] lavf/matroskaenc: don't rewrite extradata if we already have some

2018-03-15 Thread James Almer
On 3/14/2018 3:24 AM, Rodger Combs wrote:
> matroska doesn't support mid-stream extradata changes

How so? We update flac extradata as sent by the encoder in the last
packet as side data.

> , and rewriting
> the same extradata already written in write_header would cause errors
> since we previously didn't write a filler void.

When would this happen? What sets both extradata in codecpar then sends
new one as packet side data for AAC audio?

> ---
>  libavformat/matroskaenc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index 5950b4de44..e4db5a9a1c 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -2266,7 +2266,8 @@ static int mkv_check_new_extra_data(AVFormatContext *s, 
> AVPacket *pkt)
>  
>  switch (par->codec_id) {
>  case AV_CODEC_ID_AAC:
> -if (side_data_size && (s->pb->seekable & AVIO_SEEKABLE_NORMAL) && 
> !mkv->is_live) {
> +if (side_data_size && !par->extradata_size &&
> +(s->pb->seekable & AVIO_SEEKABLE_NORMAL) && !mkv->is_live) {
>  int filler, output_sample_rate = 0;
>  int64_t curpos;
>  ret = get_aac_sample_rates(s, side_data, side_data_size, 
> &track->sample_rate,
> 

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


Re: [FFmpeg-devel] [PATCH 06/10] Revert "avformat/mux: stop delaying writing the header"

2018-03-15 Thread Michael Niedermayer
On Wed, Mar 14, 2018 at 01:24:41AM -0500, Rodger Combs wrote:
> This reverts commit d6d605eb05c3ca32f591016c345eb2ad9e81c554.
> ---

The commit message should explain why this change is done

and as this causes fate changes it should explain what changes and why

thx

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

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


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


Re: [FFmpeg-devel] [PATCH] Correcting spelling mistakes

2018-03-15 Thread Lou Logan
On Thu, Mar 15, 2018, at 3:00 AM, sanilraut wrote:
> Hi,
> I found a few spelling mistakes in variable names. Following is the patch.
> 
> ---
>  libavformat/dashdec.c | 18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)

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


[FFmpeg-devel] [PATCH] avfilter: add hrtfm filter

2018-03-15 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/Makefile |   1 +
 libavfilter/af_hrtfm.c   | 477 +++
 libavfilter/allfilters.c |   1 +
 3 files changed, 479 insertions(+)
 create mode 100644 libavfilter/af_hrtfm.c

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index fc16512e2c..65783a8443 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -99,6 +99,7 @@ OBJS-$(CONFIG_HAAS_FILTER)   += af_haas.o
 OBJS-$(CONFIG_HDCD_FILTER)   += af_hdcd.o
 OBJS-$(CONFIG_HEADPHONE_FILTER)  += af_headphone.o
 OBJS-$(CONFIG_HIGHPASS_FILTER)   += af_biquads.o
+OBJS-$(CONFIG_HRTFM_FILTER)  += af_hrtfm.o
 OBJS-$(CONFIG_JOIN_FILTER)   += af_join.o
 OBJS-$(CONFIG_LADSPA_FILTER) += af_ladspa.o
 OBJS-$(CONFIG_LOUDNORM_FILTER)   += af_loudnorm.o ebur128.o
diff --git a/libavfilter/af_hrtfm.c b/libavfilter/af_hrtfm.c
new file mode 100644
index 00..48536edd4b
--- /dev/null
+++ b/libavfilter/af_hrtfm.c
@@ -0,0 +1,477 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/avstring.h"
+#include "libavutil/ffmath.h"
+#include "libavutil/opt.h"
+
+#include "audio.h"
+#include "avfilter.h"
+#include "internal.h"
+
+typedef struct ChParams {
+float azim; /* azimuth of the virtual loudspeakers */
+float elev; /* elevation of the virtual loudspeakers */
+int lfe;
+
+float Al[2], Bl[2], al[2], bl[2];
+float Ar[2], Br[2], ar[2], br[2];
+
+float gain[2];
+int M[2];
+
+float *delayed_samples[2];
+int delayed_index[2];
+
+float cache1_in[2];
+float cache1_out[2];
+
+float cache2_in[2];
+float cache2_out[2];
+} ChParams;
+
+typedef struct VirtualSpeaker {
+uint8_t set;
+float azim;
+float elev;
+} VirtualSpeaker;
+
+typedef struct HRTFMContext {
+const AVClass *class;
+
+float sspeed;
+float hradius;
+float gain;  /* filter gain (in dB) */
+float lfe_gain;
+float gain_lfe;
+float rotation;  /* rotation of virtual loudspeakers (in degrees)  */
+float elevation; /* elevation of virtual loudspeakers (in deg.) */
+char *speakers_pos;  /* custom positions of the virtual loudspeakers */
+
+ChParams *params;
+
+int lfe_channel;
+int n_conv;
+
+VirtualSpeaker vspkrpos[64];
+} HRTFMContext;
+
+static int query_formats(AVFilterContext *ctx)
+{
+AVFilterFormats *formats = NULL;
+AVFilterChannelLayouts *layouts = NULL;
+int ret;
+
+ret = ff_add_format(&formats, AV_SAMPLE_FMT_FLT);
+if (ret)
+return ret;
+ret = ff_set_common_formats(ctx, formats);
+if (ret)
+return ret;
+
+layouts = ff_all_channel_layouts();
+if (!layouts)
+return AVERROR(ENOMEM);
+
+ret = ff_channel_layouts_ref(layouts, 
&ctx->inputs[0]->out_channel_layouts);
+if (ret)
+return ret;
+
+layouts = NULL;
+ret = ff_add_channel_layout(&layouts, AV_CH_LAYOUT_STEREO);
+if (ret)
+return ret;
+
+ret = ff_channel_layouts_ref(layouts, 
&ctx->outputs[0]->in_channel_layouts);
+if (ret)
+return ret;
+
+formats = ff_all_samplerates();
+if (!formats)
+return AVERROR(ENOMEM);
+return ff_set_common_samplerates(ctx, formats);
+}
+
+static int parse_channel_name(char **arg, int *rchannel, char *buf)
+{
+int len, i, channel_id = 0;
+int64_t layout, layout0;
+
+/* try to parse a channel name, e.g. "FL" */
+if (sscanf(*arg, "%7[A-Z]%n", buf, &len)) {
+layout0 = layout = av_get_channel_layout(buf);
+/* channel_id <- first set bit in layout */
+for (i = 32; i > 0; i >>= 1) {
+if (layout >= 1LL << i) {
+channel_id += i;
+layout >>= i;
+}
+}
+/* reject layouts that are not a single channel */
+if (channel_id >= 64 || layout0 != 1LL << channel_id)
+return AVERROR(EINVAL);
+*rchannel = channel_id;
+*arg += len;
+return 0;
+}
+return AVERROR(EINVAL);
+}
+
+static void parse_speaker_pos(AVFilterContext *ctx, int64_t in_channel_layout)
+{
+HRTFMContext *s = ctx->priv;
+char *a

Re: [FFmpeg-devel] GSoC

2018-03-15 Thread Mark Thompson
On 15/03/18 01:08, Dylan Fernando wrote:
> On Sun, Mar 11, 2018 at 10:18 PM, Mark Thompson  wrote:
> 
>> On 11/03/18 04:36, Dylan Fernando wrote:
>>> On Thu, Mar 8, 2018 at 8:57 AM, Mark Thompson  wrote:
>>>
 On 07/03/18 03:56, Dylan Fernando wrote:
> Thanks, it works now
>
> Would trying to implement an OpenCL version of vf_fade be a good idea
 for a
> qualification task, or would it be a better idea to try a different
 filter?

 That sounds like a sensible choice to me, though if you haven't written
>> a
 filter before you might find it helpful to write something simpler
>> first to
 understand how it fits together (for example: vflip, which has trivial
 processing parts but still needs the surrounding boilerplate).

 - Mark

 (PS: be aware that top-posting is generally frowned upon on this mailing
 list.)


> On Wed, Mar 7, 2018 at 1:20 AM, Mark Thompson  wrote:
>
>> On 06/03/18 12:37, Dylan Fernando wrote:
>>> Hi,
>>>
>>> I am Dylan Fernando. I am a Computer Science student from Australia.
>> I
 am
>>> new to FFmpeg and I wish to apply for GSoC this year.
>>> I would like to do the Video filtering with OpenCL project and I
>> have a
>> few
>>> questions. Would trying to implement an opencl version of vf_fade be
>> a
>> good
>>> idea for the qualification task, or would I be better off using a
>> different
>>> filter?
>>>
>>> Also, I’m having a bit of trouble with running unsharp_opencl. I
>> tried
>>> running:
>>> ffmpeg -hide_banner -nostats -v verbose -init_hw_device
>> opencl=ocl:0.1
>>> -filter_hw_device ocl -i space.mpg -filter_complex unsharp_opencl
>> output.mp4
>>>
>>> but I got the error:
>>> [AVHWDeviceContext @ 0x7fdac050c700] 0.1: Apple / Intel(R) Iris(TM)
>>> Graphics 6100
>>> [mpeg @ 0x7fdac3132600] max_analyze_duration 500 reached at
>> 5005000
>>> microseconds st:0
>>> Input #0, mpeg, from 'space.mpg':
>>>   Duration: 00:00:21.99, start: 0.387500, bitrate: 6108 kb/s
>>> Stream #0:0[0x1e0]: Video: mpeg2video (Main), 1 reference frame,
>>> yuv420p(tv, bt470bg, bottom first, left), 720x480 [SAR 8:9 DAR 4:3],
 6000
>>> kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
>>> Stream mapping:
>>>   Stream #0:0 (mpeg2video) -> unsharp_opencl
>>>   unsharp_opencl -> Stream #0:0 (mpeg4)
>>> Press [q] to stop, [?] for help
>>> [graph 0 input from stream 0:0 @ 0x7fdac0418800] w:720 h:480
>> pixfmt:yuv420p
>>> tb:1/9 fr:3/1001 sar:8/9 sws_param:flags=2
>>> [auto_scaler_0 @ 0x7fdac05232c0] w:iw h:ih flags:'bilinear' interl:0
>>> [Parsed_unsharp_opencl_0 @ 0x7fdac0715a80] auto-inserting filter
>>> 'auto_scaler_0' between the filter 'graph 0 input from stream 0:0'
>> and
>> the
>>> filter 'Parsed_unsharp_opencl_0'
>>> Impossible to convert between the formats supported by the filter
 'graph
>> 0
>>> input from stream 0:0' and the filter 'auto_scaler_0'
>>> Error reinitializing filters!
>>> Failed to inject frame into filter network: Function not implemented
>>> Error while processing the decoded data for stream #0:0
>>> Conversion failed!
>>>
>>> How do I correctly run unsharp_opencl? Should I be running it on a
>>> different video file?
>>
>> It's intended to be used in filter graphs where much of the activity
>> is
>> already happening on the GPU, so the input and output are in the
>> AV_PIX_FMT_OPENCL format which contains GPU-side OpenCL images.
>>
>> If you want to use it standalone then you need hwupload and hwdownload
>> filters to move the frames between the CPU and GPU.  For your example,
 it
>> should work with:
>>
>> ffmpeg -init_hw_device opencl=ocl:0.1 -filter_hw_device ocl -i
>> space.mpg
>> -filter_complex hwupload,unsharp_opencl,hwdownload output.mp4
>>
>> (There are constraints on what formats can be used and therefore
 suitable
>> files (or required format conversions), but I believe a normal yuv420p
>> video like this should work in all cases.)
>>
>> - Mark

>>>
>>> Thanks.
>>>
>>> How is AV_PIX_FMT_OPENCL formatted? When using read_imagef(), does xyzw
>>> correspond to RGBA respectively, or to YUV? Would I have to account for
>>> different formats? If so, how do I check the format of the input?
>>
>> See libavutil/hwcontext_opencl.c and in particular the functions
>> opencl_get_buffer(), opencl_pool_alloc() and opencl_get_plane_format() for
>> the code creating the AV_PIX_FMT_OPENCL images.
>>
>> It tries to support all formats which are representable as OpenCL images,
>> so the component values are dependent on what the format of the underlying
>> image is.  What can actually be represented does depends a bit on the
>> implementation - for example, CL_R channel order is needed for all planar
>> YUV

Re: [FFmpeg-devel] [PATCH] libavfilter/vf_avgblur_opencl.c: add openCL version of libavfilter/vf_avgblur.c filter

2018-03-15 Thread Mark Thompson
On 15/03/18 02:49, Dylan Fernando wrote:
> [master 319e56f87c] lavfi: Add OpenCL avgblur filter
>  6 files changed, 381 insertions(+)
>  create mode 100644 libavfilter/opencl/avgblur.cl
>  create mode 100644 libavfilter/vf_avgblur_opencl.c

This patch is corrupted by newlines, probably inserted by your MUA.  Can you 
configure your MUA not to mess with it, or alternatively send it via git 
send-email?  (It's also possible to send it as an attachment if neither of 
those options work for you.)


> diff --git a/configure b/configure
> index fe81ba31b5..203737615c 100755
> --- a/configure
> +++ b/configure
> @@ -3205,6 +3205,7 @@ aresample_filter_deps="swresample"
>  ass_filter_deps="libass"
>  atempo_filter_deps="avcodec"
>  atempo_filter_select="rdft"
> +avgblur_opencl_filter_deps="opencl"
>  azmq_filter_deps="libzmq"
>  blackframe_filter_deps="gpl"
>  boxblur_filter_deps="gpl"
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 6a6083618d..6bf32ad260 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -138,6 +138,8 @@ OBJS-$(CONFIG_ALPHAMERGE_FILTER) +=
> vf_alphamerge.o
>  OBJS-$(CONFIG_ASS_FILTER)+= vf_subtitles.o
>  OBJS-$(CONFIG_ATADENOISE_FILTER) += vf_atadenoise.o
>  OBJS-$(CONFIG_AVGBLUR_FILTER)+= vf_avgblur.o
> +OBJS-$(CONFIG_AVGBLUR_OPENCL_FILTER) += vf_avgblur_opencl.o
> opencl.o \
> +opencl/avgblur.o
>  OBJS-$(CONFIG_BBOX_FILTER)   += bbox.o vf_bbox.o
>  OBJS-$(CONFIG_BENCH_FILTER)  += f_bench.o
>  OBJS-$(CONFIG_BITPLANENOISE_FILTER)  += vf_bitplanenoise.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index 9adb1090b7..cb04d1b113 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -148,6 +148,7 @@ static void register_all(void)
>  REGISTER_FILTER(ASS,ass,vf);
>  REGISTER_FILTER(ATADENOISE, atadenoise, vf);
>  REGISTER_FILTER(AVGBLUR,avgblur,vf);
> +REGISTER_FILTER(AVGBLUR_OPENCL, avgblur_opencl, vf);
>  REGISTER_FILTER(BBOX,   bbox,   vf);
>  REGISTER_FILTER(BENCH,  bench,  vf);
>  REGISTER_FILTER(BITPLANENOISE,  bitplanenoise,  vf);
> diff --git a/libavfilter/opencl/avgblur.cl b/libavfilter/opencl/avgblur.cl
> new file mode 100644
> index 00..fff655529b
> --- /dev/null
> +++ b/libavfilter/opencl/avgblur.cl
> @@ -0,0 +1,60 @@
> +/*
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301 USA
> + */
> +
> +
> +__kernel void avgblur_horiz(__write_only image2d_t dst,
> +__read_only  image2d_t src,
> +int rad)
> +{
> +const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
> +   CLK_FILTER_NEAREST);
> +int2 loc = (int2)(get_global_id(0), get_global_id(1));
> +int2 size = (int2)(get_global_size(0), get_global_size(1));
> +
> +int count = 0;
> +float4 acc = (float4)(0,0,0,0);
> +
> +for (int xx = max(0,loc.x-rad); xx < min(loc.x+rad+1,size.x); xx++)
> +{
> +count++;
> +acc += read_imagef(src, sampler, (int2)(xx, loc.y));
> +}
> +
> +write_imagef(dst, loc, acc / count);
> +}
> +
> +__kernel void avgblur_vert(__write_only image2d_t dst,
> +   __read_only  image2d_t src,
> +   int radv)
> +{
> +const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
> +   CLK_FILTER_NEAREST);
> +int2 loc = (int2)(get_global_id(0), get_global_id(1));
> +int2 size = (int2)(get_global_size(0), get_global_size(1));
> +
> +int count = 0;
> +float4 acc = (float4)(0,0,0,0);
> +
> +for (int yy = max(0,loc.y-radv); yy < min(loc.y+radv+1,size.y); yy++)
> +{
> +count++;
> +acc += read_imagef(src, sampler, (int2)(loc.x, yy));
> +}
> +
> +write_imagef(dst, loc, acc / count);
> +}
> diff --git a/libavfilter/opencl_source.h b/libavfilter/opencl_source.h
> index 23cdfc6ac9..02bc1723b0 100644
> --- a/libavfilter/opencl_source.h
> +++ b/libavfilter/opencl_source.h
> @@ -19,6 +19,7 @@
>  #ifndef AVFILTER

Re: [FFmpeg-devel] [CLT2018] FFmpeg at Chemnitzer Linux-Tage

2018-03-15 Thread Paul B Mahol
On 3/13/18, Thilo Borgmann  wrote:
> Am 13.03.18 um 19:52 schrieb Paul B Mahol:
>> On 3/13/18, Thilo Borgmann  wrote:
>>> Hi,
>>>
 once again, FFmpeg has been accepted for CLT 2018 in Chemnitz, Germany!
 This "Chemnitzer Linux Tage" will take place on 10th and 11th of March.
 You can find more details on their homepage:

 https://chemnitzer.linux-tage.de/2018/en/

 Thus once again, we will man a booth with our staff and are happily
 waiting for
 our users to get in touch with us! If you're a developer and want to
 help
 us or
 just want to visit and check in at our booth, please let us know.
>>>
>>> we've returned from the CLT. This year has been the 20th anniversary of
>>> the
>>> CLT - so they'd put some additional effort into it to make it even a
>>> better
>>> pleasure for all the exhibitors. Most notably in terms of an updated
>>> Saturday dinner :)
>>>
>>> We presented our usual demo using motion vector overlay to attract people
>>> and Thomas and Alexander created a very nice new demo for visualization
>>> filters, command-line expressions and video output, randomly altered. We
>>> again had a lot of users coming by and Gerion also gave a workshop on
>>> command-line based filtering.
>>
>> Which filter where used?
>
> Alexander knows about the complete list, maybe he can answer to that in
> particular.

Where is he at all?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] doc/outdevs: Add declink signal generator example

2018-03-15 Thread Marton Balint


On Thu, 15 Mar 2018, Carl Eugen Hoyos wrote:


2018-03-09 21:58 GMT+01:00, Marton Balint :


On Fri, 9 Mar 2018, Devin Heitmueller wrote:



Also, isn’t -format_code a capture parameter?  Is it even valid
to provide that on output?


Yes, it is capture only indeed. Wonder why does ffmpeg
accept it in the first place?


Output options are not (cannot?) be validated, this is also discussed
in several tickets.


Can you point me to the tickets?

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


Re: [FFmpeg-devel] [PATCH] doc/outdevs: Add declink signal generator example

2018-03-15 Thread Marton Balint



On Thu, 15 Mar 2018, Mike Goins wrote:


On Fri, Mar 9, 2018 at 3:38 PM, Devin Heitmueller
 wrote:



+ffmpeg -re -f lavfi -i "testsrc=s=1920x1080:rate=3/1000" -f lavfi -i 
"sine=frequency=1000:sample_rate=48000" +-ac 2 -acodec pcm_s16le -pix_fmt uyvy422 
-format_code Hi30 -f decklink 'DeckLink Studio 2'


You should not need the -re flag, the decklink outdev blocks if it gets too many frames 
and because of this the "encoding" speed should be limited to realtime even 
without -re. Or you see something different?


If don't use -re I get an average of ~31 fps and speed 1.03x, but with
-re the status stays at 30 fps and 1x.  No idea why the difference.


I'd say that is due to the initial buffering, it should smooth out to 
1.000 in time. So I'd avoid -re because it depends on the local computer 
clock.


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


Re: [FFmpeg-devel] [PATCH] Correcting spelling mistakes

2018-03-15 Thread Steven Liu
2018-03-15 19:00 GMT+08:00 sanilraut :
> Hi,
> I found a few spelling mistakes in variable names. Following is the patch.
>
> ---
>  libavformat/dashdec.c | 18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
> index 2b396a0..7b79b93 100644
> --- a/libavformat/dashdec.c
> +++ b/libavformat/dashdec.c
> @@ -1106,8 +1106,8 @@ static int parse_manifest(AVFormatContext *s, const 
> char *url, AVIOContext *in)
>  xmlNodePtr adaptionset_node = NULL;
>  xmlAttrPtr attr = NULL;
>  char *val  = NULL;
> -uint32_t perdiod_duration_sec = 0;
> -uint32_t perdiod_start_sec = 0;
> +uint32_t period_duration_sec = 0;
> +uint32_t period_start_sec = 0;
>
>  if (!in) {
>  close_in = 1;
> @@ -1202,23 +1202,23 @@ static int parse_manifest(AVFormatContext *s, const 
> char *url, AVIOContext *in)
>  node = xmlFirstElementChild(node);
>  while (node) {
>  if (!av_strcasecmp(node->name, (const char *)"Period")) {
> -perdiod_duration_sec = 0;
> -perdiod_start_sec = 0;
> +period_duration_sec = 0;
> +period_start_sec = 0;
>  attr = node->properties;
>  while (attr) {
>  val = xmlGetProp(node, attr->name);
>  if (!av_strcasecmp(attr->name, (const char 
> *)"duration")) {
> -perdiod_duration_sec = get_duration_insec(s, (const 
> char *)val);
> +period_duration_sec = get_duration_insec(s, (const 
> char *)val);
>  } else if (!av_strcasecmp(attr->name, (const char 
> *)"start")) {
> -perdiod_start_sec = get_duration_insec(s, (const 
> char *)val);
> +period_start_sec = get_duration_insec(s, (const char 
> *)val);
>  }
>  attr = attr->next;
>  xmlFree(val);
>  }
> -if ((perdiod_duration_sec) >= (c->period_duration)) {
> +if ((period_duration_sec) >= (c->period_duration)) {
>  period_node = node;
> -c->period_duration = perdiod_duration_sec;
> -c->period_start = perdiod_start_sec;
> +c->period_duration = period_duration_sec;
> +c->period_start = period_start_sec;
>  if (c->period_start > 0)
>  c->media_presentation_duration = c->period_duration;
>  }
> --
> Thanks
>
> 2.7.4
>
> ___


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


[FFmpeg-devel] [PATCH] Correcting spelling mistakes

2018-03-15 Thread sanilraut
Hi,
I found a few spelling mistakes in variable names. Following is the patch.

---
 libavformat/dashdec.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 2b396a0..7b79b93 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1106,8 +1106,8 @@ static int parse_manifest(AVFormatContext *s, const char 
*url, AVIOContext *in)
 xmlNodePtr adaptionset_node = NULL;
 xmlAttrPtr attr = NULL;
 char *val  = NULL;
-uint32_t perdiod_duration_sec = 0;
-uint32_t perdiod_start_sec = 0;
+uint32_t period_duration_sec = 0;
+uint32_t period_start_sec = 0;
 
 if (!in) {
 close_in = 1;
@@ -1202,23 +1202,23 @@ static int parse_manifest(AVFormatContext *s, const 
char *url, AVIOContext *in)
 node = xmlFirstElementChild(node);
 while (node) {
 if (!av_strcasecmp(node->name, (const char *)"Period")) {
-perdiod_duration_sec = 0;
-perdiod_start_sec = 0;
+period_duration_sec = 0;
+period_start_sec = 0;
 attr = node->properties;
 while (attr) {
 val = xmlGetProp(node, attr->name);
 if (!av_strcasecmp(attr->name, (const char *)"duration")) {
-perdiod_duration_sec = get_duration_insec(s, (const 
char *)val);
+period_duration_sec = get_duration_insec(s, (const 
char *)val);
 } else if (!av_strcasecmp(attr->name, (const char 
*)"start")) {
-perdiod_start_sec = get_duration_insec(s, (const char 
*)val);
+period_start_sec = get_duration_insec(s, (const char 
*)val);
 }
 attr = attr->next;
 xmlFree(val);
 }
-if ((perdiod_duration_sec) >= (c->period_duration)) {
+if ((period_duration_sec) >= (c->period_duration)) {
 period_node = node;
-c->period_duration = perdiod_duration_sec;
-c->period_start = perdiod_start_sec;
+c->period_duration = period_duration_sec;
+c->period_start = period_start_sec;
 if (c->period_start > 0)
 c->media_presentation_duration = c->period_duration;
 }
-- 
Thanks

2.7.4

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


Re: [FFmpeg-devel] [PATCH] Fix iterating of input and output devices

2018-03-15 Thread Timo Rothenpieler
Looks reasonable to me.



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


[FFmpeg-devel] [PATCH] ffmpeg.c - drain all decoded frames during stream_loop flush

2018-03-15 Thread Gyan Doshi
Fixes a bug with flushing decoders during stream_loop. Note that the 
issue is also averted if we skip flushing altogether.
From 2d3f9b06092d1a0ac09d9b2d1b86fbf6692282e4 Mon Sep 17 00:00:00 2001
From: Gyan Doshi 
Date: Thu, 15 Mar 2018 15:01:53 +0530
Subject: [PATCH] ffmpeg.c - drain all decoded frames during stream_loop flush

When a decoded stream is being looped, after each post-EOF rewind, decoders
are flushed in seek_to_start(). This only drains 1 frame, and thus the output 
has a few
frames missing at the tail of each iteration except the last.

With patch, when process_input_packet is called with no_eof=1, decoding
is looped till EOF is returned.

Fixes #7081
---
 fftools/ffmpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index ee7258fcd1..503af6b483 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2694,7 +2694,7 @@ static int process_input_packet(InputStream *ist, const 
AVPacket *pkt, int no_eo
 // Decode only 1 frame per call on EOF to appease these FATE tests.
 // The ideal solution would be to rewrite decoding to use the new
 // decoding API in a better way.
-if (!pkt)
+if (!pkt && !no_eof)
 break;
 
 repeating = 1;
-- 
2.12.2.windows.2___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/movenc : Change MOV_TIMESCALE from 1000 to 600

2018-03-15 Thread Mark Burton
On 14 Mar 2018, at 23:20, Michael Niedermayer  wrote:
> is there something that i am missing or can this simply
> be computed from the input timebases instead of being
> a fixed value ?
> so its accurate for the input when that is possible
> and only some fixed value when that is not possible

I think that would be a much better solution. Unfortunately, I don’t have the 
skill to write that kind of patch.
If anyone has any ideas for this patch, would be great to see this tested and 
potentially applied.

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


Re: [FFmpeg-devel] [PATCH] doc/outdevs: Add declink signal generator example

2018-03-15 Thread Carl Eugen Hoyos
2018-03-09 21:58 GMT+01:00, Marton Balint :
>
> On Fri, 9 Mar 2018, Devin Heitmueller wrote:

>> Also, isn’t -format_code a capture parameter?  Is it even valid
>> to provide that on output?
>
> Yes, it is capture only indeed. Wonder why does ffmpeg
> accept it in the first place?

Output options are not (cannot?) be validated, this is also discussed
in several tickets.

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


Re: [FFmpeg-devel] [PATCH] doc/outdevs: Add declink signal generator example

2018-03-15 Thread Mike Goins
On Fri, Mar 9, 2018 at 3:38 PM, Devin Heitmueller
 wrote:
>
>>> +ffmpeg -re -f lavfi -i "testsrc=s=1920x1080:rate=3/1000" -f lavfi -i 
>>> "sine=frequency=1000:sample_rate=48000" +-ac 2 -acodec pcm_s16le 
>>> -pix_fmt uyvy422 -format_code Hi30 -f decklink 'DeckLink Studio 2'
>>
>> You should not need the -re flag, the decklink outdev blocks if it gets too 
>> many frames and because of this the "encoding" speed should be limited to 
>> realtime even without -re. Or you see something different?

If don't use -re I get an average of ~31 fps and speed 1.03x, but with
-re the status stays at 30 fps and 1x.  No idea why the difference.

> Also, isn’t -format_code a capture parameter?  Is it even valid to provide 
> that on output?
>
> I had plans to add support for -format_code for output - if it’s already 
> working then that’s great.

You are right, -format_code does not appear to do anything for the output.


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