Re: [FFmpeg-devel] [PATCH] lavc/movtextdec.c: Avoid infinite loop on invalid data.

2016-09-27 Thread Philip Langdale
On Tue, 27 Sep 2016 19:23:20 -0700
Sasi Inguva  wrote:

> Signed-off-by: Sasi Inguva 
> ---
>  libavcodec/movtextdec.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
> index abf8711..a33fff7 100644
> --- a/libavcodec/movtextdec.c
> +++ b/libavcodec/movtextdec.c
> @@ -471,6 +471,10 @@ static int mov_text_decode_frame(AVCodecContext
> *avctx, tsmb_type = AV_RB32(tsmb);
>  tsmb += 4;
>  
> +if (tsmb_size == 0) {
> +  return AVERROR_INVALIDDATA;
> +}
> +
>  if (tsmb_size == 1) {
>  if (m->tracksize + 16 > avpkt->size)
>  break;

Pushed. Thanks.

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


Re: [FFmpeg-devel] order T-shirts

2016-09-27 Thread Steven Liu
2016-09-05 22:28 GMT+08:00 Nicolas George :

> Le nonidi 19 fructidor, an CCXXIV, Ronald S. Bultje a écrit :
> > I like it, I still don't have one!
>
> I would very much like to wear FFmpeg t-shirts on occasion too.
>
> Regards,
>
> --
>   Nicolas George
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
Hi guys,
what about the next step :-D
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavc/movtextdec.c: Avoid infinite loop on invalid data.

2016-09-27 Thread Sasi Inguva
Signed-off-by: Sasi Inguva 
---
 libavcodec/movtextdec.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index abf8711..a33fff7 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -471,6 +471,10 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
 tsmb_type = AV_RB32(tsmb);
 tsmb += 4;
 
+if (tsmb_size == 0) {
+  return AVERROR_INVALIDDATA;
+}
+
 if (tsmb_size == 1) {
 if (m->tracksize + 16 > avpkt->size)
 break;
-- 
2.8.0.rc3.226.g39d4020

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


Re: [FFmpeg-devel] [PATCH 1/2] compat/avisynth: minor update for alpha offsets

2016-09-27 Thread Stephen Hutchinson

On 9/27/2016 4:11 PM, Michael Niedermayer wrote:

can you update the status for the patch(es) on
https://patchwork.ffmpeg.org/project/ffmpeg/list/?submitter=49
?

so developers know what needs a review, needs to be applied and what
is on hold/revovked, ...

thx



Done.  I think I did it right, hopefully.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffprobe: don't use AVStream.codec to set decoder framerate

2016-09-27 Thread James Almer
On 9/27/2016 7:20 PM, Josh de Kock wrote:
> On 27/09/2016 02:57, James Almer wrote:
>> Also don't set time_base. It's deprecated for decoding and avcodec_open2()
>> will overwrite it
>>
>> Signed-off-by: James Almer 
>> ---
>>  ffprobe.c | 5 +
>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/ffprobe.c b/ffprobe.c
>> index b59f11e..bb3979c 100644
>> --- a/ffprobe.c
>> +++ b/ffprobe.c
>> @@ -2612,10 +2612,7 @@ static int open_input_file(InputFile *ifile, const 
>> char *filename)
>>  exit(1);
>>
>>  av_codec_set_pkt_timebase(ist->dec_ctx, stream->time_base);
>> -#if FF_API_LAVF_AVCTX
>> -ist->dec_ctx->time_base = stream->codec->time_base;
>> -ist->dec_ctx->framerate = stream->codec->framerate;
>> -#endif
>> +ist->dec_ctx->framerate = stream->avg_frame_rate;
>>
>>  if (avcodec_open2(ist->dec_ctx, codec, &opts) < 0) {
>>  av_log(NULL, AV_LOG_WARNING, "Could not open codec for 
>> input stream %d\n",
>>
> 
> LGTM
> 
> -- 
> Josh

Pushed, thanks.

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


[FFmpeg-devel] [PATCH 2/2] avformat/matroskadec: check for more reserved values on some Colour elements

2016-09-27 Thread James Almer
Signed-off-by: James Almer 
---
 libavformat/matroskadec.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 32b2457..a94398b 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1810,9 +1810,11 @@ static int mkv_parse_video_color(AVStream *st, const 
MatroskaTrack *track) {
 
 if (track->video.color.matrix_coefficients != AVCOL_SPC_RESERVED)
 st->codecpar->color_space = track->video.color.matrix_coefficients;
-if (track->video.color.primaries != AVCOL_PRI_RESERVED)
+if (track->video.color.primaries != AVCOL_PRI_RESERVED &&
+track->video.color.primaries != AVCOL_PRI_RESERVED0)
 st->codecpar->color_primaries = track->video.color.primaries;
-if (track->video.color.transfer_characteristics != AVCOL_TRC_RESERVED)
+if (track->video.color.transfer_characteristics != AVCOL_TRC_RESERVED &&
+track->video.color.transfer_characteristics != AVCOL_TRC_RESERVED0)
 st->codecpar->color_trc = track->video.color.transfer_characteristics;
 if (track->video.color.range != AVCOL_RANGE_UNSPECIFIED &&
 track->video.color.range <= AVCOL_RANGE_JPEG)
-- 
2.9.1

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


[FFmpeg-devel] [PATCH 1/2] avformat/matroskaenc: don't write an empty Colour master element

2016-09-27 Thread James Almer
Signed-off-by: James Almer 
---
 libavformat/matroskaenc.c | 53 ++-
 1 file changed, 34 insertions(+), 19 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 3eeb09b..3cbc437 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -734,60 +734,73 @@ static int mkv_write_codecprivate(AVFormatContext *s, 
AVIOContext *pb,
 }
 
 static int mkv_write_video_color(AVIOContext *pb, AVCodecParameters *par, 
AVStream *st) {
+AVIOContext *dyn_cp;
+uint8_t *colorinfo_ptr;
 int side_data_size = 0;
+int ret, colorinfo_size;
 const uint8_t *side_data = av_stream_get_side_data(
 st, AV_PKT_DATA_MASTERING_DISPLAY_METADATA, &side_data_size);
-ebml_master colorinfo = start_ebml_master(pb, MATROSKA_ID_VIDEOCOLOR, 0);
+
+ret = avio_open_dyn_buf(&dyn_cp);
+if (ret < 0)
+return ret;
 
 if (par->color_trc != AVCOL_TRC_UNSPECIFIED &&
 par->color_trc < AVCOL_TRC_NB) {
-put_ebml_uint(pb, MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS,
+put_ebml_uint(dyn_cp, MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS,
   par->color_trc);
 }
 if (par->color_space != AVCOL_SPC_UNSPECIFIED &&
 par->color_space < AVCOL_SPC_NB) {
-put_ebml_uint(pb, MATROSKA_ID_VIDEOCOLORMATRIXCOEFF, par->color_space);
+put_ebml_uint(dyn_cp, MATROSKA_ID_VIDEOCOLORMATRIXCOEFF, 
par->color_space);
 }
 if (par->color_primaries != AVCOL_PRI_UNSPECIFIED &&
 par->color_primaries < AVCOL_PRI_NB) {
-put_ebml_uint(pb, MATROSKA_ID_VIDEOCOLORPRIMARIES, 
par->color_primaries);
+put_ebml_uint(dyn_cp, MATROSKA_ID_VIDEOCOLORPRIMARIES, 
par->color_primaries);
 }
 if (par->color_range != AVCOL_RANGE_UNSPECIFIED &&
 par->color_range < AVCOL_RANGE_NB) {
-put_ebml_uint(pb, MATROSKA_ID_VIDEOCOLORRANGE, par->color_range);
+put_ebml_uint(dyn_cp, MATROSKA_ID_VIDEOCOLORRANGE, par->color_range);
 }
 if (side_data_size == sizeof(AVMasteringDisplayMetadata)) {
 ebml_master meta_element = start_ebml_master(
-pb, MATROSKA_ID_VIDEOCOLORMASTERINGMETA, 0);
+dyn_cp, MATROSKA_ID_VIDEOCOLORMASTERINGMETA, 0);
 const AVMasteringDisplayMetadata *metadata =
 (const AVMasteringDisplayMetadata*)side_data;
 if (metadata->has_primaries) {
-put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_RX,
+put_ebml_float(dyn_cp, MATROSKA_ID_VIDEOCOLOR_RX,
av_q2d(metadata->display_primaries[0][0]));
-put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_RY,
+put_ebml_float(dyn_cp, MATROSKA_ID_VIDEOCOLOR_RY,
av_q2d(metadata->display_primaries[0][1]));
-put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_GX,
+put_ebml_float(dyn_cp, MATROSKA_ID_VIDEOCOLOR_GX,
av_q2d(metadata->display_primaries[1][0]));
-put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_GY,
+put_ebml_float(dyn_cp, MATROSKA_ID_VIDEOCOLOR_GY,
av_q2d(metadata->display_primaries[1][1]));
-put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_BX,
+put_ebml_float(dyn_cp, MATROSKA_ID_VIDEOCOLOR_BX,
av_q2d(metadata->display_primaries[2][0]));
-put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_BY,
+put_ebml_float(dyn_cp, MATROSKA_ID_VIDEOCOLOR_BY,
av_q2d(metadata->display_primaries[2][1]));
-put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_WHITEX,
+put_ebml_float(dyn_cp, MATROSKA_ID_VIDEOCOLOR_WHITEX,
av_q2d(metadata->white_point[0]));
-put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_WHITEY,
+put_ebml_float(dyn_cp, MATROSKA_ID_VIDEOCOLOR_WHITEY,
av_q2d(metadata->white_point[1]));
 }
 if (metadata->has_luminance) {
-put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_LUMINANCEMAX,
+put_ebml_float(dyn_cp, MATROSKA_ID_VIDEOCOLOR_LUMINANCEMAX,
av_q2d(metadata->max_luminance));
-put_ebml_float(pb, MATROSKA_ID_VIDEOCOLOR_LUMINANCEMIN,
+put_ebml_float(dyn_cp, MATROSKA_ID_VIDEOCOLOR_LUMINANCEMIN,
av_q2d(metadata->min_luminance));
 }
-end_ebml_master(pb, meta_element);
+end_ebml_master(dyn_cp, meta_element);
 }
-end_ebml_master(pb, colorinfo);
+
+colorinfo_size = avio_close_dyn_buf(dyn_cp, &colorinfo_ptr);
+if (colorinfo_size) {
+ebml_master colorinfo = start_ebml_master(pb, MATROSKA_ID_VIDEOCOLOR, 
0);
+avio_write(pb, colorinfo_ptr, colorinfo_size);
+end_ebml_master(pb, colorinfo);
+}
+av_free(colorinfo_ptr);
 return 0;
 }
 
@@ -1125,7 +1138,9 @@ static int mkv_write_track(AVFormatContext *s, 
MatroskaMuxConte

Re: [FFmpeg-devel] [PATCH 3/3] avformat/matroskadec: set AVCodecParameters.field_order on progressive video

2016-09-27 Thread James Almer
On 9/27/2016 8:26 PM, Michael Niedermayer wrote:
> On Tue, Sep 27, 2016 at 03:03:05PM -0300, James Almer wrote:
>> Signed-off-by: James Almer 
>> ---
>>  libavformat/matroskadec.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
>> index 77b8a5d..2317024 100644
>> --- a/libavformat/matroskadec.c
>> +++ b/libavformat/matroskadec.c
>> @@ -2279,6 +2279,8 @@ static int matroska_parse_tracks(AVFormatContext *s)
>>  
>>  if (track->video.interlaced == 
>> MATROSKA_VIDEO_INTERLACE_FLAG_INTERLACED)
>>  st->codecpar->field_order = 
>> mkv_field_order(track->video.field_order);
>> +else if (track->video.interlaced == 
>> MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE)
>> +st->codecpar->field_order = AV_FIELD_PROGRESSIVE;
> 
> 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 3/3] avformat/matroskadec: set AVCodecParameters.field_order on progressive video

2016-09-27 Thread Michael Niedermayer
On Tue, Sep 27, 2016 at 03:03:05PM -0300, James Almer wrote:
> Signed-off-by: James Almer 
> ---
>  libavformat/matroskadec.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> index 77b8a5d..2317024 100644
> --- a/libavformat/matroskadec.c
> +++ b/libavformat/matroskadec.c
> @@ -2279,6 +2279,8 @@ static int matroska_parse_tracks(AVFormatContext *s)
>  
>  if (track->video.interlaced == 
> MATROSKA_VIDEO_INTERLACE_FLAG_INTERLACED)
>  st->codecpar->field_order = 
> mkv_field_order(track->video.field_order);
> +else if (track->video.interlaced == 
> MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE)
> +st->codecpar->field_order = AV_FIELD_PROGRESSIVE;

should be ok

thx

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

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


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


Re: [FFmpeg-devel] [PATCH 2/3] avformat/matroskaenc: write the FieldOrder element for non-interlaced video

2016-09-27 Thread James Almer
On 9/27/2016 6:36 PM, Hendrik Leppkes wrote:
> On Tue, Sep 27, 2016 at 11:14 PM, James Almer  wrote:
>> On 9/27/2016 5:56 PM, Hendrik Leppkes wrote:
>>> On Tue, Sep 27, 2016 at 8:03 PM, James Almer  wrote:
 It's listed as mandatory in https://matroska.org/technical/specs/index.html

 Signed-off-by: James Almer 
 ---
 The spec also mentions FieldOrder "MUST be ignored if FlagInterlaced is not
 set to interlaced". Since it's a mandatory element, i interpreted that as a
 demuxer guideline.

>>>
>>> Its a mandatory field with a default value - that kind of definition
>>> is a bit weird, but the general consensus is that it does not have to
>>> be written if it would write the default anyway.
>>>
>>> - Hendrik
>>
>> I find it weird it was defined this way, considering the precedent set by
>> BlockDuration which is not tagged as mandatory but its description
>> explicitly says "This Element is mandatory when DefaultDuration is set for
>> the track".
>>
>> Alright then, patch dropped from the set.
>>
> 
> For the record, its written here:
> https://matroska.org/technical/specs/notes.html
> 
> 4. Mandatory
> - This element is mandatory in the file.
> - Mandatory elements with a default value may be left out of the file.
> In the absence of a mandatory element, the element's default value is
> used.
> - A mandatory element is not written if its parent is not in the file.

Ok, that clears things.

For that matter, since FlagInterlaced is also mandatory with a default
"Undetermined" value, i guess it would make sense to not write it in
such scenario.

> 
> The BlockDuration is a bit weird, but the same concept applies. If
> DefaultDuration is set, it becomes mandatory, but it still has a
> default value (ie. the DefaultDuration), so it doesn't have to be
> written if it matches this value.
> This whole concept of mandatory with default can be very confusing,
> but it is what it is.
> 
> And you conveniently left out the good part "This Element is mandatory
> when DefaultDuration is set for the track (but can be omitted as other
> default values).", specifically mentioning this case =)

Somehow missed that, heh.

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


Re: [FFmpeg-devel] [PATCH] libavcodec/qdm2.c: fix warning due to misleading indentation

2016-09-27 Thread Michael Niedermayer
On Tue, Sep 27, 2016 at 09:47:32PM +0200, Adriano Pallavicino wrote:
> Sure
> 
> Adriano
> 
> 2016-09-27 21:19 GMT+02:00 Josh de Kock :
> 
> > On 27/09/2016 19:46, Adriano Pallavicino wrote:
> >
> >> ---
> >>  libavcodec/qdm2.c | 117
> >> +++---
> >>  1 file changed, 59 insertions(+), 58 deletions(-)
> >>
> >> diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
> >> index dd8b257..e3cc902 100644
> >> --- a/libavcodec/qdm2.c
> >> +++ b/libavcodec/qdm2.c
> >> @@ -537,7 +537,7 @@ static void fill_coding_method_array(sb_int8_array
> >> tone_level_idx,
> >>  /* This case is untested, no samples available */
> >>  avpriv_request_sample(NULL, "!superblocktype_2_3");
> >>  return;
> >> -for (ch = 0; ch < nb_channels; ch++)
> >> +for (ch = 0; ch < nb_channels; ch++) {
> >>  for (sb = 0; sb < 30; sb++) {
> >>  for (j = 1; j < 63; j++) {  // The loop only iterates to
> >> 63 so the code doesn't overflow the buffer
> >>  add1 = tone_level_idx[ch][sb][j] - 10;
> >> @@ -566,67 +566,68 @@ static void fill_coding_method_array(sb_int8_array
> >> tone_level_idx,
> >>  }
> >>  tone_level_idx_temp[ch][sb][0] =
> >> tone_level_idx_temp[ch][sb][1];
> >>  }
> >> -acc = 0;
> >> -for (ch = 0; ch < nb_channels; ch++)
> >> -for (sb = 0; sb < 30; sb++)
> >> -for (j = 0; j < 64; j++)
> >> -acc += tone_level_idx_temp[ch][sb][j];
> >> -
> >> -multres = 0x6667LL * (acc * 10);
> >> -esp_40 = (multres >> 32) / 8 + ((multres & 0x) >>
> >> 31);
> >> -for (ch = 0;  ch < nb_channels; ch++)
> >> -for (sb = 0; sb < 30; sb++)
> >> -for (j = 0; j < 64; j++) {
> >> -comp = tone_level_idx_temp[ch][sb][j]* esp_40 *
> >> 10;
> >> -if (comp < 0)
> >> -comp += 0xff;
> >> -comp /= 256; // signed shift
> >> -switch(sb) {
> >> -case 0:
> >> -if (comp < 30)
> >> -comp = 30;
> >> -comp += 15;
> >> -break;
> >> -case 1:
> >> -if (comp < 24)
> >> -comp = 24;
> >> -comp += 10;
> >> -break;
> >> -case 2:
> >> -case 3:
> >> -case 4:
> >> -if (comp < 16)
> >> -comp = 16;
> >> -}
> >> -if (comp <= 5)
> >> -tmp = 0;
> >> -else if (comp <= 10)
> >> -tmp = 10;
> >> -else if (comp <= 16)
> >> -tmp = 16;
> >> -else if (comp <= 24)
> >> -tmp = -1;
> >> -else
> >> -tmp = 0;
> >> -coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30
> >> )&
> >> 0xff;
> >> +}
> >> +acc = 0;
> >> +for (ch = 0; ch < nb_channels; ch++)
> >> +for (sb = 0; sb < 30; sb++)
> >> +for (j = 0; j < 64; j++)
> >> +acc += tone_level_idx_temp[ch][sb][j];
> >> +
> >> +multres = 0x6667LL * (acc * 10);
> >> +esp_40 = (multres >> 32) / 8 + ((multres & 0x) >> 31);
> >> +for (ch = 0;  ch < nb_channels; ch++)
> >> +for (sb = 0; sb < 30; sb++)
> >> +for (j = 0; j < 64; j++) {
> >> +comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10;
> >> +if (comp < 0)
> >> +comp += 0xff;
> >> +comp /= 256; // signed shift
> >> +switch(sb) {
> >> +case 0:
> >> +if (comp < 30)
> >> +comp = 30;
> >> +comp += 15;
> >> +break;
> >> +case 1:
> >> +if (comp < 24)
> >> +comp = 24;
> >> +comp += 10;
> >> +break;
> >> +case 2:
> >> +case 3:
> >> +case 4:
> >> +if (comp < 16)
> >> +comp = 16;
> >>  }
> >> +if (comp <= 5)
> >> +  

[FFmpeg-devel] [PATCH 1/2 v2] movenc: use similar logic to DASH when writing bit rate to ISML

2016-09-27 Thread Jan Ekström
This way, in case of bit rate not being set, max_bitrate will be
used instead. This enables, for example, re-using max_bitrate
information from the input or doing transcoding with a rate
control mode that is not bit rate based.

Signed-off-by: Jan Ekström 
---
 libavformat/movenc.c | 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 449d0b5..8992782 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3581,6 +3581,9 @@ static int mov_write_isml_manifest(AVIOContext *pb, 
MOVMuxContext *mov, AVFormat
 {
 int64_t pos = avio_tell(pb);
 int i;
+int64_t manifest_bit_rate = 0;
+AVCPBProperties *props = NULL;
+
 static const uint8_t uuid[] = {
 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66
@@ -3615,9 +3618,18 @@ static int mov_write_isml_manifest(AVIOContext *pb, 
MOVMuxContext *mov, AVFormat
 } else {
 continue;
 }
+
+props = (AVCPBProperties*)av_stream_get_side_data(track->st, 
AV_PKT_DATA_CPB_PROPERTIES, NULL);
+
+if (track->par->bit_rate) {
+manifest_bit_rate = track->par->bit_rate;
+} else if (props) {
+manifest_bit_rate = props->max_bitrate;
+}
+
 avio_printf(pb, "<%s systemBitrate=\"%"PRId64"\">\n", type,
-(int64_t)track->par->bit_rate);
-param_write_int(pb, "systemBitrate", track->par->bit_rate);
+manifest_bit_rate);
+param_write_int(pb, "systemBitrate", manifest_bit_rate);
 param_write_int(pb, "trackID", track_id);
 if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
 if (track->par->codec_id == AV_CODEC_ID_H264) {
-- 
2.7.4

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


Re: [FFmpeg-devel] [PATCH] avformat/matroskadec: retain error codes in matroska_resync() and matroska_read_packet()

2016-09-27 Thread Michael Niedermayer
On Tue, Sep 27, 2016 at 12:00:29PM -0700, Sophia Wang wrote:
> Signed-off-by: Sophia Wang 
> ---
>  libavformat/matroskadec.c | 15 +--
>  1 file changed, 9 insertions(+), 6 deletions(-)

applied

thanks

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

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire


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


Re: [FFmpeg-devel] [PATCH 2/3] lavf/mov.c: Make audio timestamps strictly monotonically increasing inside an edit list.

2016-09-27 Thread Sasi Inguva
Corrected indentation. Don't know why the patch would not apply. I am
attaching it as a file, if it helps.

On Tue, Sep 27, 2016 at 12:02 PM, Moritz Barsnick  wrote:

> On Tue, Sep 27, 2016 at 09:28:13 -0700, Sasi Inguva wrote:
> >  if (curr_cts < edit_list_media_time || curr_cts >=
> (edit_list_duration + edit_list_media_time)) {
> > -if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
> curr_cts < edit_list_media_time &&
> > -curr_cts + frame_duration > edit_list_media_time &&
> > -st->skip_samples == 0 && msc->start_pad == 0) {
> > -st->skip_samples = msc->start_pad =
> edit_list_media_time - curr_cts;
> > -
> > -// Shift the index entry timestamp by skip_samples
> to be correct.
> > -edit_list_dts_counter -= st->skip_samples;
> > +if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
> st->codecpar->codec_id != AV_CODEC_ID_VORBIS &&
> > +curr_cts < edit_list_media_time && curr_cts +
> frame_duration > edit_list_media_time &&
> > +first_non_zero_audio_edit > 0) {
> > + packet_skip_samples = edit_list_media_time -
> curr_cts;
> > + st->skip_samples += packet_skip_samples;
> > +
> > +// Shift the index entry timestamp by
> packet_skip_samples to be correct.
> > +edit_list_dts_counter -= packet_skip_samples;
> >  if (edit_list_start_encountered == 0)  {
> > -  edit_list_start_encountered = 1;
> > +edit_list_start_encountered = 1;
> > +// Make timestamps strictly monotonically
> increasing for audio, by rewriting timestamps for
> > +// discarded packets.
> > +if (frame_duration_buffer) {
> > +  fix_index_entry_timestamps(st,
> st->nb_index_entries, edit_list_dts_counter,
> > +
>  frame_duration_buffer, num_discarded_begin);
> > +  av_freep(&frame_duration_buffer);
> > +}
>
> Something's fishy with your indentation here.
>
> > +if (!frame_duration_buffer) {
> > +av_log(mov->fc, AV_LOG_ERROR, "Cannot
> reallocate frame duration buffer\n");
> > +break;
> > +}
>
> I fail to see the whole code block (and I have problems applying the
> patch). What is this breaking from?
>
> Moritz
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
From cd2fa9c14a068165c8480b8ca72eccdbb8edd54b Mon Sep 17 00:00:00 2001
From: Sasi Inguva 
Date: Mon, 26 Sep 2016 09:56:26 -0700
Subject: [PATCH 2/3] lavf/mov.c: Make audio timestamps strictly monotonically
 increasing inside an edit list.

Fixes gapless decoding. Adjust skip_samples field correctly in case of DISCARDed audio frames.

Signed-off-by: Sasi Inguva 
---
 libavformat/mov.c| 80 
 tests/ref/fate/gaplessenc-itunes-to-ipod-aac |  2 +-
 tests/ref/fate/gaplessenc-pcm-to-mov-aac |  2 +-
 3 files changed, 71 insertions(+), 13 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index b84d9c0..8b7bbf1 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2856,6 +2856,21 @@ static int64_t add_index_entry(AVStream *st, int64_t pos, int64_t timestamp,
 }
 
 /**
+ * Rewrite timestamps of index entries in the range [end_index - frame_duration_buffer_size, end_index)
+ * by subtracting end_ts successively by the amounts given in frame_duration_buffer.
+ */
+static void fix_index_entry_timestamps(AVStream* st, int end_index, int64_t end_ts,
+   int64_t* frame_duration_buffer,
+   int frame_duration_buffer_size) {
+int i = 0;
+av_assert0(end_index >= 0 && end_index <= st->nb_index_entries);
+for (i = 0; i < frame_duration_buffer_size; i++) {
+end_ts -= frame_duration_buffer[frame_duration_buffer_size - 1 - i];
+st->index_entries[end_index - 1 - i].timestamp = end_ts;
+}
+}
+
+/**
  * Append a new ctts entry to ctts_data.
  * Returns the new ctts_count if successful, else returns -1.
  */
@@ -2919,7 +2934,10 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 int64_t edit_list_media_time_dts = 0;
 int64_t edit_list_start_encountered = 0;
 int64_t search_timestamp = 0;
-
+int64_t* frame_duration_buffer = NULL;
+int num_discarded_begin = 0;
+int first_non_zero_audio_edit = -1;
+int packet_skip_samples = 0;
 
 if (!msc->elst_data || msc->elst_count <= 0) {
 return;
@@ -2955,6 +2973,7 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 edit_list_index++;
 edit_list_dts_counter

[FFmpeg-devel] [PATCH 2/3] lavf/mov.c: Make audio timestamps strictly monotonically increasing inside an edit list.

2016-09-27 Thread Sasi Inguva
Fixes gapless decoding. Adjust skip_samples field correctly in case of 
DISCARDed audio frames.

Signed-off-by: Sasi Inguva 
---
 libavformat/mov.c| 80 
 tests/ref/fate/gaplessenc-itunes-to-ipod-aac |  2 +-
 tests/ref/fate/gaplessenc-pcm-to-mov-aac |  2 +-
 3 files changed, 71 insertions(+), 13 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index b84d9c0..8b7bbf1 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2856,6 +2856,21 @@ static int64_t add_index_entry(AVStream *st, int64_t 
pos, int64_t timestamp,
 }
 
 /**
+ * Rewrite timestamps of index entries in the range [end_index - 
frame_duration_buffer_size, end_index)
+ * by subtracting end_ts successively by the amounts given in 
frame_duration_buffer.
+ */
+static void fix_index_entry_timestamps(AVStream* st, int end_index, int64_t 
end_ts,
+   int64_t* frame_duration_buffer,
+   int frame_duration_buffer_size) {
+int i = 0;
+av_assert0(end_index >= 0 && end_index <= st->nb_index_entries);
+for (i = 0; i < frame_duration_buffer_size; i++) {
+end_ts -= frame_duration_buffer[frame_duration_buffer_size - 1 - i];
+st->index_entries[end_index - 1 - i].timestamp = end_ts;
+}
+}
+
+/**
  * Append a new ctts entry to ctts_data.
  * Returns the new ctts_count if successful, else returns -1.
  */
@@ -2919,7 +2934,10 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 int64_t edit_list_media_time_dts = 0;
 int64_t edit_list_start_encountered = 0;
 int64_t search_timestamp = 0;
-
+int64_t* frame_duration_buffer = NULL;
+int num_discarded_begin = 0;
+int first_non_zero_audio_edit = -1;
+int packet_skip_samples = 0;
 
 if (!msc->elst_data || msc->elst_count <= 0) {
 return;
@@ -2955,6 +2973,7 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 edit_list_index++;
 edit_list_dts_counter = edit_list_dts_entry_end;
 edit_list_dts_entry_end += edit_list_duration;
+num_discarded_begin = 0;
 if (edit_list_media_time == -1) {
 continue;
 }
@@ -2962,7 +2981,14 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 // If we encounter a non-negative edit list reset the 
skip_samples/start_pad fields and set them
 // according to the edit list below.
 if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
-st->skip_samples = msc->start_pad = 0;
+if (first_non_zero_audio_edit < 0) {
+first_non_zero_audio_edit = 1;
+} else {
+first_non_zero_audio_edit = 0;
+}
+
+if (first_non_zero_audio_edit > 0)
+st->skip_samples = msc->start_pad = 0;
 }
 
 //find closest previous key frame
@@ -3041,24 +3067,56 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 }
 
 if (curr_cts < edit_list_media_time || curr_cts >= 
(edit_list_duration + edit_list_media_time)) {
-if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && curr_cts 
< edit_list_media_time &&
-curr_cts + frame_duration > edit_list_media_time &&
-st->skip_samples == 0 && msc->start_pad == 0) {
-st->skip_samples = msc->start_pad = edit_list_media_time - 
curr_cts;
-
-// Shift the index entry timestamp by skip_samples to be 
correct.
-edit_list_dts_counter -= st->skip_samples;
+if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && 
st->codecpar->codec_id != AV_CODEC_ID_VORBIS &&
+curr_cts < edit_list_media_time && curr_cts + 
frame_duration > edit_list_media_time &&
+first_non_zero_audio_edit > 0) {
+packet_skip_samples = edit_list_media_time - curr_cts;
+st->skip_samples += packet_skip_samples;
+
+// Shift the index entry timestamp by packet_skip_samples 
to be correct.
+edit_list_dts_counter -= packet_skip_samples;
 if (edit_list_start_encountered == 0)  {
-  edit_list_start_encountered = 1;
+edit_list_start_encountered = 1;
+// Make timestamps strictly monotonically increasing 
for audio, by rewriting timestamps for
+// discarded packets.
+if (frame_duration_buffer) {
+fix_index_entry_timestamps(st, 
st->nb_index_entries, edit_list_dts_counter,
+   frame_duration_buffer, 
num_discarded_begin);
+av_freep(&frame_duration_buffer);
+}
 }
 
-av_log(mov->fc, AV_LOG_DEBUG, "skip %d audio samples from 
curr

Re: [FFmpeg-devel] FFmpeg 3.2

2016-09-27 Thread Lou Logan
On Tue, 27 Sep 2016 15:30:03 +0200, Michael Niedermayer wrote:

> also a name needs to be choosen

Plenty of suggestions from the previous release:


I think Kyle had a good suggestion:


Perhaps it's time for a Release Name Suggestions wiki page.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffmpeg_vaapi: fix choice of decoder_format

2016-09-27 Thread Mark Thompson
On 27/09/16 14:23, Moritz Barsnick wrote:
> The check could previously never evaluate to true, probably due to
> a typo.
>
> Reported-By: Mihai Chindea 
> Signed-off-by: Moritz Barsnick 
> ---
> As discovered and suggested by Mihai Chindea,
> http://ffmpeg.org/pipermail/ffmpeg-devel/2016-September/198932.html
>
> I have only inspected/reviewed this change visually, not tested.
>
> Moritz
>
>  ffmpeg_vaapi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ffmpeg_vaapi.c b/ffmpeg_vaapi.c
> index 8090597..f1e7c76 100644
> --- a/ffmpeg_vaapi.c
> +++ b/ffmpeg_vaapi.c
> @@ -302,7 +302,7 @@ static int vaapi_build_decoder_config(VAAPIDecoderContext 
> *ctx,
>  if (ctx->output_format != AV_PIX_FMT_NONE &&
>  ctx->output_format != AV_PIX_FMT_VAAPI) {
>  for (i = 0; constraints->valid_sw_formats[i] != AV_PIX_FMT_NONE; 
> i++) {
> -if (constraints->valid_sw_formats[i] == ctx->decode_format) {
> +if (constraints->valid_sw_formats[i] == ctx->output_format) {
>  ctx->decode_format = ctx->output_format;
>  av_log(ctx, AV_LOG_DEBUG, "Using decode format %s (output "
> "format).\n", 
> av_get_pix_fmt_name(ctx->decode_format));
> --
> 2.7.4

Yeah, that was what was intended there.  Tested and fine with the i965 driver: 
I don't have any case where it will actually change the behaviour, but it does 
change the log message.

- Mark

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


Re: [FFmpeg-devel] [PATCH] ffprobe: don't use AVStream.codec to set decoder framerate

2016-09-27 Thread Josh de Kock

On 27/09/2016 02:57, James Almer wrote:

Also don't set time_base. It's deprecated for decoding and avcodec_open2()
will overwrite it

Signed-off-by: James Almer 
---
 ffprobe.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/ffprobe.c b/ffprobe.c
index b59f11e..bb3979c 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -2612,10 +2612,7 @@ static int open_input_file(InputFile *ifile, const char 
*filename)
 exit(1);

 av_codec_set_pkt_timebase(ist->dec_ctx, stream->time_base);
-#if FF_API_LAVF_AVCTX
-ist->dec_ctx->time_base = stream->codec->time_base;
-ist->dec_ctx->framerate = stream->codec->framerate;
-#endif
+ist->dec_ctx->framerate = stream->avg_frame_rate;

 if (avcodec_open2(ist->dec_ctx, codec, &opts) < 0) {
 av_log(NULL, AV_LOG_WARNING, "Could not open codec for input stream 
%d\n",



LGTM

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


Re: [FFmpeg-devel] [PATCH 2/4] V11 - SCTE-35 extraction from mpegts

2016-09-27 Thread Marton Balint


On Tue, 27 Sep 2016, Carlos Fernandez Sanz wrote:


From: Carlos Fernandez 

Signed-off-by: Carlos Fernandez 
---
libavformat/mpegts.c | 48 ++--
1 file changed, 46 insertions(+), 2 deletions(-)



[...]


+static void scte_data_cb(MpegTSFilter *filter, const uint8_t *section,
+int section_len)
+{
+AVProgram *prg = NULL;
+MpegTSContext *ts = filter->u.section_filter.opaque;
+
+int idx = ff_find_stream_index(ts->stream, filter->pid);
+new_data_packet(section, section_len, ts->pkt);


One more thing you might consider: now, you are creating a data packet 
from the whole section, including the header and the rest. Since the 
section is already parsed, and the crc is already checked, and as far 
as I see there is nothing useful in the header, it might make 
sense to create a data packet only from the buffer _after_ the 
section_length field, skipping the last CRC32 field as well.


This way, the SCTE codec does not have to do any section parsing at all, 
which seems a cleaner solution to me. What do you think?


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


Re: [FFmpeg-devel] [PATCH] libavcodec/qdm2.c: fix warning due to misleading indentation

2016-09-27 Thread Josh de Kock

On 27/09/2016 20:47, Adriano Pallavicino wrote:

Sure

Adriano



This patch looks good to me, just going to give it a little time for 
others to comment.


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


Re: [FFmpeg-devel] [PATCH 2/4] V11 - SCTE-35 extraction from mpegts

2016-09-27 Thread Marton Balint


On Tue, 27 Sep 2016, Carlos Fernandez Sanz wrote:


From: Carlos Fernandez 

Signed-off-by: Carlos Fernandez 
---
libavformat/mpegts.c | 48 ++--
1 file changed, 46 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index b31d233..d816450 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -725,6 +725,12 @@ static const StreamType HDMV_types[] = {
{ 0 },
};

+/* SCTE types */
+static const StreamType SCTE_types[] = {
+{ 0x86, AVMEDIA_TYPE_DATA,  AV_CODEC_ID_SCTE_35},
+{ 0 },
+};
+
/* ATSC ? */
static const StreamType MISC_types[] = {
{ 0x81, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 },
@@ -872,6 +878,13 @@ static void reset_pes_packet_state(PESContext *pes)
av_buffer_unref(&pes->buffer);
}

+static void new_data_packet(const uint8_t *buffer, int len, AVPacket *pkt)
+{
+av_init_packet(pkt);
+pkt->data = buffer;
+pkt->size = len;
+}
+
static int new_pes_packet(PESContext *pes, AVPacket *pkt)
{
char *sd;
@@ -1590,6 +1603,27 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t 
*section,
av_free(mp4_descr[i].dec_config_descr);
}

+static void scte_data_cb(MpegTSFilter *filter, const uint8_t *section,
+int section_len)
+{
+AVProgram *prg = NULL;
+MpegTSContext *ts = filter->u.section_filter.opaque;
+
+int idx = ff_find_stream_index(ts->stream, filter->pid);


If idx can be negative (you implied it can be, I am not sure), then 
bail out as early as possible:


if (idx < 0)
return;


+new_data_packet(section, section_len, ts->pkt);
+if (idx >= 0) {


So you don't have to check it here anymore.


+ts->pkt->stream_index = idx;
+}
+prg = av_find_program_from_stream(ts->stream, NULL, idx);
+if (prg && prg->pcr_pid != -1 && prg->discard != AVDISCARD_ALL) {
+MpegTSFilter *f = ts->pids[prg->pcr_pid];
+if (f)


if (f && f->last_pcr != -1)


+ts->pkt->pts = ts->pkt->dts = f->last_pcr/300;
+}
+ts->stop_parse = 1;
+
+}
+
static const uint8_t opus_coupled_stream_cnt[9] = {
1, 0, 1, 1, 2, 2, 2, 3, 3
};
@@ -1868,6 +1902,12 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, 
AVStream *st, int stream_type
return 0;
}

+static int is_pes_stream(int stream_type, uint32_t prog_reg_desc)
+{
+return !(stream_type == 0x13 ||
+ (stream_type == 0x86 && prog_reg_desc == AV_RL32("CUEI")) );


There is an extra space in the indentation.


+}
+
static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
{
MpegTSContext *ts = filter->u.section_filter.opaque;
@@ -1975,7 +2015,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
pes->st->id = pes->pid;
}
st = pes->st;
-} else if (stream_type != 0x13) {
+
+} else if (is_pes_stream(stream_type, prog_reg_desc)) {
if (ts->pids[pid])
mpegts_close_filter(ts, ts->pids[pid]); // wrongly added sdt 
filter probably
pes = add_pes_stream(ts, pid, pcr_pid);
@@ -1995,6 +2036,10 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
goto out;
st->id = pid;
st->codecpar->codec_type = AVMEDIA_TYPE_DATA;
+if (stream_type == 0x86 && prog_reg_desc == AV_RL32("CUEI")) {
+mpegts_find_stream_type(st, stream_type, SCTE_types);
+mpegts_open_section_filter(ts, pid, scte_data_cb, ts, 1);
+}
}
}

@@ -2317,7 +2362,6 @@ static int handle_packet(MpegTSContext *ts, const uint8_t 
*packet)
}
}
}
-


Stray line deletion.


} else {
int ret;
// Note: The position here points actually behind the current packet.


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


Re: [FFmpeg-devel] [PATCH] cmdutils: improve `-buildconf` for shell substitution

2016-09-27 Thread Kyle Swanson
On Tue, Sep 27, 2016 at 4:37 PM, Clément Bœsch  wrote:
>
> On Tue, Sep 27, 2016 at 04:25:52PM -0500, Kyle Swanson wrote:
> > Hi,
> >
> > Always thought something like this might be useful, but I finally took the
> > time to take a look. Useful when you want to configure a new FFmpeg build
> > using the configuration string of a previously built version. True you
> > could accomplish the same thing with sed, but I think this tweak is still
> > useful. Example usage looks like this:
> >
> > ./configure $(ffmpeg -hide_banner -buildconf) && make install
> >
>
> how about using make config?

(-‸ლ)

Thanks. Ignore this patch.

>
> --
> Clément B.
> ___
> 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 2/3] avformat/matroskaenc: write the FieldOrder element for non-interlaced video

2016-09-27 Thread Hendrik Leppkes
On Tue, Sep 27, 2016 at 11:14 PM, James Almer  wrote:
> On 9/27/2016 5:56 PM, Hendrik Leppkes wrote:
>> On Tue, Sep 27, 2016 at 8:03 PM, James Almer  wrote:
>>> It's listed as mandatory in https://matroska.org/technical/specs/index.html
>>>
>>> Signed-off-by: James Almer 
>>> ---
>>> The spec also mentions FieldOrder "MUST be ignored if FlagInterlaced is not
>>> set to interlaced". Since it's a mandatory element, i interpreted that as a
>>> demuxer guideline.
>>>
>>
>> Its a mandatory field with a default value - that kind of definition
>> is a bit weird, but the general consensus is that it does not have to
>> be written if it would write the default anyway.
>>
>> - Hendrik
>
> I find it weird it was defined this way, considering the precedent set by
> BlockDuration which is not tagged as mandatory but its description
> explicitly says "This Element is mandatory when DefaultDuration is set for
> the track".
>
> Alright then, patch dropped from the set.
>

For the record, its written here:
https://matroska.org/technical/specs/notes.html

4. Mandatory
- This element is mandatory in the file.
- Mandatory elements with a default value may be left out of the file.
In the absence of a mandatory element, the element's default value is
used.
- A mandatory element is not written if its parent is not in the file.

The BlockDuration is a bit weird, but the same concept applies. If
DefaultDuration is set, it becomes mandatory, but it still has a
default value (ie. the DefaultDuration), so it doesn't have to be
written if it matches this value.
This whole concept of mandatory with default can be very confusing,
but it is what it is.

And you conveniently left out the good part "This Element is mandatory
when DefaultDuration is set for the track (but can be omitted as other
default values).", specifically mentioning this case =)

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


Re: [FFmpeg-devel] [PATCH] cmdutils: improve `-buildconf` for shell substitution

2016-09-27 Thread Clément Bœsch
On Tue, Sep 27, 2016 at 04:25:52PM -0500, Kyle Swanson wrote:
> Hi,
> 
> Always thought something like this might be useful, but I finally took the
> time to take a look. Useful when you want to configure a new FFmpeg build
> using the configuration string of a previously built version. True you
> could accomplish the same thing with sed, but I think this tweak is still
> useful. Example usage looks like this:
> 
> ./configure $(ffmpeg -hide_banner -buildconf) && make install
> 

how about using make config?

-- 
Clément B.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] imagepipe filter (was [PATCH] avfilter: add dynoverlay filter.)

2016-09-27 Thread Paul B Mahol
On 9/27/16, Priebe, Jason  wrote:
> On 9/23/16, Paul B Mahol  wrote:
>
>> Named pipe approach would implement video source which would read images
>> from named pipe. It would read from named pipe until it decodes single
>> frame
>> and then would use that frame as input to next filter, for example
>> overlay filter.
>>
>> If it encounters EOF in named pipe it would not abort but would instead
>> keep
>> sending last frame it got, for example completely transparent frame.
>>
>> If it suddenly get more data from pipe it would update its internal
>> frame and output it as input to next filter in chain.
>>
>> So command would look like this:
>>
>> imagepipe=named_pipe:rate=30[o],[0:v][o]overlay=x=0:y=0 ...
>>
>> And than in another terminal, you would use commands like this:
>>
>> cat random_image.format > named_pipe
>
> Paul:  this is a really good idea (when you first mentioned pipes, I
> thought you meant to use pipes as a standard ffmpeg input, which doesn't
> really work in the way I'm trying to make it work here).  But a purpose-
> built filter that reads from a pipe is another story.
>
> I built an imagepipe filter that I'd like to submit as a patch, but
> I have some questions before I do that:
>
> - it outputs YUVA420P.  Does it need to output other pixel formats to
>   be accepted?

Not neccessary if adding other formats is easy.

>
> - it uses a slightly inelegant technique to read the images; it writes
>   the image data to a temp file so it can call ff_load_image().  I didn't
>   see a function that can load an image directly from an in-memory byte
> array.

AVFrame stores all decoded data from image. Using temp files is ridicculous.

>
> - I'm not 100% sure how to write the test.  I added a block=1 option to
>   the filter so that it will block on each frame to read in an image from
>   the pipe; this is designed for testing only (normally, you want
> non-blocking
>   reads).  But I don't know how to leverage FATE to build a test that
>   runs ffmpeg and also in another process, writes files to the pipe.  I
>   think I can do it if I add a new function to fate-run.sh, but I don't know
>   if that is discouraged.

Test can be added later.

>
> - Portability - I'm worried this is the big one.  mkfifo isn't readily
>   available on Windows without compatibility libraries, and even then,
>   I'm not sure whether they would work the same way they do under *nix.
>   Generally speaking, how does the ffmpeg team tackle cross-platform
>   issues like this?

IIRC named pipes are available for Windows.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] cmdutils: improve `-buildconf` for shell substitution

2016-09-27 Thread Kyle Swanson
Hi,

Always thought something like this might be useful, but I finally took the
time to take a look. Useful when you want to configure a new FFmpeg build
using the configuration string of a previously built version. True you
could accomplish the same thing with sed, but I think this tweak is still
useful. Example usage looks like this:

./configure $(ffmpeg -hide_banner -buildconf) && make install

Kyle


0001-cmdutils-improve-buildconf-for-shell-substitution.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] flv format support mp3 audio with 48khz

2016-09-27 Thread Yusuke Nakamura
2016-09-28 0:01 GMT+09:00 :

> From: frankos2 
>
> ---
>  libavformat/flvenc.c |8 
>  1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
> index 99903f5..296426a 100644
> --- a/libavformat/flvenc.c
> +++ b/libavformat/flvenc.c
> @@ -107,6 +107,13 @@ static int get_audio_flags(AVFormatContext *s,
> AVCodecParameters *par)
>  return FLV_CODECID_SPEEX | FLV_SAMPLERATE_11025HZ |
> FLV_SAMPLESSIZE_16BIT;
>  } else {
>  switch (par->sample_rate) {
> +case 48000:
> +if (par->codec_id == AV_CODEC_ID_MP3) {
> +flags |= FLV_SAMPLERATE_44100HZ;
> +break;
> +} else {
> +goto error;
> +}
>  case 44100:
>  flags |= FLV_SAMPLERATE_44100HZ;
>  break;
> @@ -124,6 +131,7 @@ static int get_audio_flags(AVFormatContext *s,
> AVCodecParameters *par)
>  break;
>  }
>  default:
> +error:
>  av_log(s, AV_LOG_ERROR,
> "FLV does not support sample rate %d, "
> "choose from (44100, 22050, 11025)\n",
> par->sample_rate);
> --
> 1.7.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

Out of the spec I think. Did you confirm that Adobe (Flash Player) allows
48kHz mp3? About AAC, the spec (Adobe Flash Video File Format
Specification) says the Flash Player ignores sample rate in AudioTagHeader,
which is a dummy, and extracts the actual sample rate from AAC bitstream.
But the spec does not say about MP3 in the same way.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/3] avformat/matroskaenc: write the FieldOrder element for non-interlaced video

2016-09-27 Thread James Almer
On 9/27/2016 5:56 PM, Hendrik Leppkes wrote:
> On Tue, Sep 27, 2016 at 8:03 PM, James Almer  wrote:
>> It's listed as mandatory in https://matroska.org/technical/specs/index.html
>>
>> Signed-off-by: James Almer 
>> ---
>> The spec also mentions FieldOrder "MUST be ignored if FlagInterlaced is not
>> set to interlaced". Since it's a mandatory element, i interpreted that as a
>> demuxer guideline.
>>
> 
> Its a mandatory field with a default value - that kind of definition
> is a bit weird, but the general consensus is that it does not have to
> be written if it would write the default anyway.
> 
> - Hendrik

I find it weird it was defined this way, considering the precedent set by
BlockDuration which is not tagged as mandatory but its description
explicitly says "This Element is mandatory when DefaultDuration is set for
the track".

Alright then, patch dropped from the set.

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


Re: [FFmpeg-devel] [PATCH 2/3] avformat/matroskaenc: write the FieldOrder element for non-interlaced video

2016-09-27 Thread Hendrik Leppkes
On Tue, Sep 27, 2016 at 8:03 PM, James Almer  wrote:
> It's listed as mandatory in https://matroska.org/technical/specs/index.html
>
> Signed-off-by: James Almer 
> ---
> The spec also mentions FieldOrder "MUST be ignored if FlagInterlaced is not
> set to interlaced". Since it's a mandatory element, i interpreted that as a
> demuxer guideline.
>

Its a mandatory field with a default value - that kind of definition
is a bit weird, but the general consensus is that it does not have to
be written if it would write the default anyway.

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


Re: [FFmpeg-devel] [PATCH 2/4] V10 - SCTE-35 extraction from mpegts

2016-09-27 Thread Carlos Fernandez Sanz
On Mon, Sep 26, 2016 at 3:25 PM, Michael Niedermayer
 wrote:
>
> this breaks fate:
> make: *** [fate-h264-skip-nokey] Error 1

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


[FFmpeg-devel] [PATCH 4/4] V11 - Correct Indentation

2016-09-27 Thread Carlos Fernandez Sanz
From: Carlos Fernandez 

Signed-off-by: Carlos Fernandez 
---
 libavformat/hlsenc.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 3303dc8..39d1fe9 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -373,12 +373,12 @@ static int hls_append_segment(struct AVFormatContext *s, 
HLSContext *hls, double
 else
 en->sub_filename[0] = '\0';
 
-en->duration = duration;
-en->pos  = pos;
-en->event= event;
-en->size = size;
+en->duration   = duration;
+en->pos= pos;
+en->event  = event;
+en->size   = size;
 en->start_pts  = start_pts;
-en->next = NULL;
+en->next   = NULL;
 
 if (hls->scte_iface) {
 if (hls->scte_iface->event_state == EVENT_OUT_CONT) {
-- 
2.7.4

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


[FFmpeg-devel] [PATCH 3/4] V11 - SCTE-35 support in hlsenc

2016-09-27 Thread Carlos Fernandez Sanz
From: Carlos Fernandez 

Signed-off-by: Carlos Fernandez 
---
 libavformat/Makefile  |   2 +-
 libavformat/hlsenc.c  | 108 +--
 libavformat/scte_35.c | 527 ++
 libavformat/scte_35.h |  86 
 4 files changed, 701 insertions(+), 22 deletions(-)
 create mode 100644 libavformat/scte_35.c
 create mode 100644 libavformat/scte_35.h

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 5d827d31..9218606 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -205,7 +205,7 @@ OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
 OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
 OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o
 OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o
-OBJS-$(CONFIG_HLS_MUXER) += hlsenc.o
+OBJS-$(CONFIG_HLS_MUXER) += hlsenc.o scte_35.o
 OBJS-$(CONFIG_HNM_DEMUXER)   += hnm.o
 OBJS-$(CONFIG_ICO_DEMUXER)   += icodec.o
 OBJS-$(CONFIG_ICO_MUXER) += icoenc.o
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 428bae4..3303dc8 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -38,6 +38,7 @@
 #include "avio_internal.h"
 #include "internal.h"
 #include "os_support.h"
+#include "scte_35.h"
 
 #define KEYSIZE 16
 #define LINE_BUFFER_SIZE 1024
@@ -48,6 +49,10 @@ typedef struct HLSSegment {
 double duration; /* in seconds */
 int64_t pos;
 int64_t size;
+struct scte_35_event *event;
+int out;
+int adv_count;
+int64_t start_pts;
 
 char key_uri[LINE_BUFFER_SIZE + 1];
 char iv_string[KEYSIZE*2 + 1];
@@ -92,6 +97,8 @@ typedef struct HLSContext {
 uint32_t flags;// enum HLSFlags
 uint32_t pl_type;  // enum PlaylistType
 char *segment_filename;
+char *adv_filename;
+char *adv_subfilename;
 
 int use_localtime;  ///< flag to expand filename with localtime
 int use_localtime_mkdir;///< flag to mkdir dirname in timebased filename
@@ -108,6 +115,8 @@ typedef struct HLSContext {
 int nb_entries;
 int discontinuity_set;
 
+int adv_count;
+struct scte_35_interface *scte_iface;
 HLSSegment *segments;
 HLSSegment *last_segment;
 HLSSegment *old_segments;
@@ -208,6 +217,8 @@ static int hls_delete_old_segments(HLSContext *hls) {
 av_freep(&path);
 previous_segment = segment;
 segment = previous_segment->next;
+if (hls->scte_iface)
+hls->scte_iface->unref_scte35_event(&previous_segment->event);
 av_free(previous_segment);
 }
 
@@ -327,8 +338,8 @@ static int hls_mux_init(AVFormatContext *s)
 }
 
 /* Create a new segment and append it to the segment list */
-static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, 
double duration,
-  int64_t pos, int64_t size)
+static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, 
double duration, int64_t pos,
+  int64_t start_pts, struct scte_35_event *event, 
int64_t size)
 {
 HLSSegment *en = av_malloc(sizeof(*en));
 char *tmp, *p;
@@ -364,9 +375,23 @@ static int hls_append_segment(struct AVFormatContext *s, 
HLSContext *hls, double
 
 en->duration = duration;
 en->pos  = pos;
+en->event= event;
 en->size = size;
+en->start_pts  = start_pts;
 en->next = NULL;
 
+if (hls->scte_iface) {
+if (hls->scte_iface->event_state == EVENT_OUT_CONT) {
+en->adv_count = hls->adv_count;;
+hls->adv_count++;
+en->out = hls->scte_iface->event_state;
+} else {
+hls->adv_count = 0;
+en->out = hls->scte_iface->event_state;
+}
+}
+
+
 if (hls->key_info_file) {
 av_strlcpy(en->key_uri, hls->key_uri, sizeof(en->key_uri));
 av_strlcpy(en->iv_string, hls->iv_string, sizeof(en->iv_string));
@@ -440,7 +465,7 @@ static int parse_playlist(AVFormatContext *s, const char 
*url)
 new_start_pos = avio_tell(hls->avf->pb);
 hls->size = new_start_pos - hls->start_pos;
 av_strlcpy(hls->avf->filename, line, sizeof(line));
-ret = hls_append_segment(s, hls, hls->duration, 
hls->start_pos, hls->size);
+ret = hls_append_segment(s, hls, hls->duration, 
hls->start_pos, 0, NULL, hls->size);
 if (ret < 0)
 goto fail;
 hls->start_pos = new_start_pos;
@@ -570,9 +595,23 @@ static int hls_window(AVFormatContext *s, int last)
 avio_printf(out, "#EXT-X-PROGRAM-DATE-TIME:%s.%03d%s\n", buf0, 
milli, buf1);
 prog_date_time += en->duration;
 }
-if (hls->baseurl)
-avio_printf(out, "%s", hls->baseurl);
-avio_printf(out, "%s\n", en->filename);
+if (hls->scte_iface && (en->event || en->out) ) {
+char *str;
+char fname[1024]

[FFmpeg-devel] [PATCH 2/4] V11 - SCTE-35 extraction from mpegts

2016-09-27 Thread Carlos Fernandez Sanz
From: Carlos Fernandez 

Signed-off-by: Carlos Fernandez 
---
 libavformat/mpegts.c | 48 ++--
 1 file changed, 46 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index b31d233..d816450 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -725,6 +725,12 @@ static const StreamType HDMV_types[] = {
 { 0 },
 };
 
+/* SCTE types */
+static const StreamType SCTE_types[] = {
+{ 0x86, AVMEDIA_TYPE_DATA,  AV_CODEC_ID_SCTE_35},
+{ 0 },
+};
+
 /* ATSC ? */
 static const StreamType MISC_types[] = {
 { 0x81, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 },
@@ -872,6 +878,13 @@ static void reset_pes_packet_state(PESContext *pes)
 av_buffer_unref(&pes->buffer);
 }
 
+static void new_data_packet(const uint8_t *buffer, int len, AVPacket *pkt)
+{
+av_init_packet(pkt);
+pkt->data = buffer;
+pkt->size = len;
+}
+
 static int new_pes_packet(PESContext *pes, AVPacket *pkt)
 {
 char *sd;
@@ -1590,6 +1603,27 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t 
*section,
 av_free(mp4_descr[i].dec_config_descr);
 }
 
+static void scte_data_cb(MpegTSFilter *filter, const uint8_t *section,
+int section_len)
+{
+AVProgram *prg = NULL;
+MpegTSContext *ts = filter->u.section_filter.opaque;
+
+int idx = ff_find_stream_index(ts->stream, filter->pid);
+new_data_packet(section, section_len, ts->pkt);
+if (idx >= 0) {
+ts->pkt->stream_index = idx;
+}
+prg = av_find_program_from_stream(ts->stream, NULL, idx);
+if (prg && prg->pcr_pid != -1 && prg->discard != AVDISCARD_ALL) {
+MpegTSFilter *f = ts->pids[prg->pcr_pid];
+if (f)
+ts->pkt->pts = ts->pkt->dts = f->last_pcr/300;
+}
+ts->stop_parse = 1;
+
+}
+
 static const uint8_t opus_coupled_stream_cnt[9] = {
 1, 0, 1, 1, 2, 2, 2, 3, 3
 };
@@ -1868,6 +1902,12 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, 
AVStream *st, int stream_type
 return 0;
 }
 
+static int is_pes_stream(int stream_type, uint32_t prog_reg_desc)
+{
+return !(stream_type == 0x13 ||
+ (stream_type == 0x86 && prog_reg_desc == AV_RL32("CUEI")) );
+}
+
 static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
@@ -1975,7 +2015,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 pes->st->id = pes->pid;
 }
 st = pes->st;
-} else if (stream_type != 0x13) {
+
+} else if (is_pes_stream(stream_type, prog_reg_desc)) {
 if (ts->pids[pid])
 mpegts_close_filter(ts, ts->pids[pid]); // wrongly added sdt 
filter probably
 pes = add_pes_stream(ts, pid, pcr_pid);
@@ -1995,6 +2036,10 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 goto out;
 st->id = pid;
 st->codecpar->codec_type = AVMEDIA_TYPE_DATA;
+if (stream_type == 0x86 && prog_reg_desc == AV_RL32("CUEI")) {
+mpegts_find_stream_type(st, stream_type, SCTE_types);
+mpegts_open_section_filter(ts, pid, scte_data_cb, ts, 1);
+}
 }
 }
 
@@ -2317,7 +2362,6 @@ static int handle_packet(MpegTSContext *ts, const uint8_t 
*packet)
 }
 }
 }
-
 } else {
 int ret;
 // Note: The position here points actually behind the current packet.
-- 
2.7.4

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


[FFmpeg-devel] [PATCH 1/4] V11 - Adding SCTE-35 CUI codec

2016-09-27 Thread Carlos Fernandez Sanz
From: Carlos Fernandez 

Signed-off-by: Carlos Fernandez 
---
 libavcodec/avcodec.h| 2 ++
 libavcodec/codec_desc.c | 6 ++
 2 files changed, 8 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index b174116..e3103a1 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -631,6 +631,8 @@ enum AVCodecID {
 AV_CODEC_ID_FIRST_UNKNOWN = 0x18000,   ///< A dummy ID pointing at 
the start of various fake codecs.
 AV_CODEC_ID_TTF = 0x18000,
 
+AV_CODEC_ID_SCTE_35,/**< Contain no valid time stamp in DTS PTS of 
avpacket, avpacket data contain time stamp
+  in scte-35 format which is relative to DTS/PTS 
of video stream */
 AV_CODEC_ID_BINTEXT= 0x18800,
 AV_CODEC_ID_XBIN,
 AV_CODEC_ID_IDF,
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 24948ca..2612215 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -2964,6 +2964,12 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("binary data"),
 .mime_types= MT("application/octet-stream"),
 },
+{
+.id= AV_CODEC_ID_SCTE_35,
+.type  = AVMEDIA_TYPE_DATA,
+.name  = "scte_35",
+.long_name = NULL_IF_CONFIG_SMALL("SCTE 35 Message Queue"),
+},
 
 /* deprecated codec ids */
 };
-- 
2.7.4

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


[FFmpeg-devel] [PATCH 0/4] V11 - SCTE-35 support

2016-09-27 Thread Carlos Fernandez Sanz
- Addresses all new comments
- fate now passes all tests

Carlos Fernandez (4):
  Adding SCTE-35 CUI codec
  SCTE-35 extraction from mpegts
  SCTE-35 support in hlsenc
  Correct Indentation

 libavcodec/avcodec.h|   2 +
 libavcodec/codec_desc.c |   6 +
 libavformat/Makefile|   2 +-
 libavformat/hlsenc.c| 116 ---
 libavformat/mpegts.c|  48 -
 libavformat/scte_35.c   | 527 
 libavformat/scte_35.h   |  86 
 7 files changed, 759 insertions(+), 28 deletions(-)
 create mode 100644 libavformat/scte_35.c
 create mode 100644 libavformat/scte_35.h

-- 
2.7.4

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


Re: [FFmpeg-devel] [PATCH 1/2] compat/avisynth: minor update for alpha offsets

2016-09-27 Thread Michael Niedermayer
On Tue, Sep 27, 2016 at 12:48:18PM -0400, Stephen Hutchinson wrote:
> On 9/27/2016 3:12 AM, Carl Eugen Hoyos wrote:
> >2016-08-31 16:16 GMT+02:00 Stephen Hutchinson :
> >>On 8/31/2016 9:37 AM, Carl Eugen Hoyos wrote:
> >>>
> >>>2016-08-31 2:26 GMT+02:00 Stephen Hutchinson :
> 
> -//AVS_CPUF_AVX= 0x800,   //  Sandy Bridge, Bulldozer
> +  AVS_CPUF_AVX= 0x800,   //  Sandy Bridge, Bulldozer
> >>>
> >>>
> >>>Is this related to alpha offsets?
> >>>
> >>
> >>It's part of the changes to the header upstream.
> >
> >Then "sync with upstream header" would be less confusing imo.
> >
> >Sorry for missing your message, Carl Eugen
> >___
> >ffmpeg-devel mailing list
> >ffmpeg-devel@ffmpeg.org
> >http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> It's not necessary to sync with upstream yet, so
> the header update patch was revoked.  Only the
> Planar RGB fix patch is actually necessary.

can you update the status for the patch(es) on
https://patchwork.ffmpeg.org/project/ffmpeg/list/?submitter=49
?

so developers know what needs a review, needs to be applied and what
is on hold/revovked, ...

thx

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

You can kill me, but you cannot change the truth.


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


Re: [FFmpeg-devel] [PATCH] flv format support mp3 audio with 48khz

2016-09-27 Thread Michael Niedermayer
On Tue, Sep 27, 2016 at 08:01:13AM -0700, fu.qiup...@hotmail.com wrote:

> From: frankos2 

This is not a name and email address
is this intended as "Author" information for git ?
Or is this a mistake ?
If its a mistake please correct it and resubmit the patch

thx

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

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


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


Re: [FFmpeg-devel] [PATCH] libavcodec/qdm2.c: fix warning due to misleading indentation

2016-09-27 Thread Adriano Pallavicino
Sure

Adriano

2016-09-27 21:19 GMT+02:00 Josh de Kock :

> On 27/09/2016 19:46, Adriano Pallavicino wrote:
>
>> ---
>>  libavcodec/qdm2.c | 117
>> +++---
>>  1 file changed, 59 insertions(+), 58 deletions(-)
>>
>> diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
>> index dd8b257..e3cc902 100644
>> --- a/libavcodec/qdm2.c
>> +++ b/libavcodec/qdm2.c
>> @@ -537,7 +537,7 @@ static void fill_coding_method_array(sb_int8_array
>> tone_level_idx,
>>  /* This case is untested, no samples available */
>>  avpriv_request_sample(NULL, "!superblocktype_2_3");
>>  return;
>> -for (ch = 0; ch < nb_channels; ch++)
>> +for (ch = 0; ch < nb_channels; ch++) {
>>  for (sb = 0; sb < 30; sb++) {
>>  for (j = 1; j < 63; j++) {  // The loop only iterates to
>> 63 so the code doesn't overflow the buffer
>>  add1 = tone_level_idx[ch][sb][j] - 10;
>> @@ -566,67 +566,68 @@ static void fill_coding_method_array(sb_int8_array
>> tone_level_idx,
>>  }
>>  tone_level_idx_temp[ch][sb][0] =
>> tone_level_idx_temp[ch][sb][1];
>>  }
>> -acc = 0;
>> -for (ch = 0; ch < nb_channels; ch++)
>> -for (sb = 0; sb < 30; sb++)
>> -for (j = 0; j < 64; j++)
>> -acc += tone_level_idx_temp[ch][sb][j];
>> -
>> -multres = 0x6667LL * (acc * 10);
>> -esp_40 = (multres >> 32) / 8 + ((multres & 0x) >>
>> 31);
>> -for (ch = 0;  ch < nb_channels; ch++)
>> -for (sb = 0; sb < 30; sb++)
>> -for (j = 0; j < 64; j++) {
>> -comp = tone_level_idx_temp[ch][sb][j]* esp_40 *
>> 10;
>> -if (comp < 0)
>> -comp += 0xff;
>> -comp /= 256; // signed shift
>> -switch(sb) {
>> -case 0:
>> -if (comp < 30)
>> -comp = 30;
>> -comp += 15;
>> -break;
>> -case 1:
>> -if (comp < 24)
>> -comp = 24;
>> -comp += 10;
>> -break;
>> -case 2:
>> -case 3:
>> -case 4:
>> -if (comp < 16)
>> -comp = 16;
>> -}
>> -if (comp <= 5)
>> -tmp = 0;
>> -else if (comp <= 10)
>> -tmp = 10;
>> -else if (comp <= 16)
>> -tmp = 16;
>> -else if (comp <= 24)
>> -tmp = -1;
>> -else
>> -tmp = 0;
>> -coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30
>> )&
>> 0xff;
>> +}
>> +acc = 0;
>> +for (ch = 0; ch < nb_channels; ch++)
>> +for (sb = 0; sb < 30; sb++)
>> +for (j = 0; j < 64; j++)
>> +acc += tone_level_idx_temp[ch][sb][j];
>> +
>> +multres = 0x6667LL * (acc * 10);
>> +esp_40 = (multres >> 32) / 8 + ((multres & 0x) >> 31);
>> +for (ch = 0;  ch < nb_channels; ch++)
>> +for (sb = 0; sb < 30; sb++)
>> +for (j = 0; j < 64; j++) {
>> +comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10;
>> +if (comp < 0)
>> +comp += 0xff;
>> +comp /= 256; // signed shift
>> +switch(sb) {
>> +case 0:
>> +if (comp < 30)
>> +comp = 30;
>> +comp += 15;
>> +break;
>> +case 1:
>> +if (comp < 24)
>> +comp = 24;
>> +comp += 10;
>> +break;
>> +case 2:
>> +case 3:
>> +case 4:
>> +if (comp < 16)
>> +comp = 16;
>>  }
>> +if (comp <= 5)
>> +tmp = 0;
>> +else if (comp <= 10)
>> +tmp = 10;
>> +else if (comp <= 16)
>> +tmp = 16;
>> +else if (comp <= 24)
>> +tmp = -1;
>> +else

Re: [FFmpeg-devel] [PATCH] libavcodec/qdm2.c: fix warning due to misleading indentation

2016-09-27 Thread Josh de Kock

On 27/09/2016 19:46, Adriano Pallavicino wrote:

---
 libavcodec/qdm2.c | 117
+++---
 1 file changed, 59 insertions(+), 58 deletions(-)

diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index dd8b257..e3cc902 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -537,7 +537,7 @@ static void fill_coding_method_array(sb_int8_array
tone_level_idx,
 /* This case is untested, no samples available */
 avpriv_request_sample(NULL, "!superblocktype_2_3");
 return;
-for (ch = 0; ch < nb_channels; ch++)
+for (ch = 0; ch < nb_channels; ch++) {
 for (sb = 0; sb < 30; sb++) {
 for (j = 1; j < 63; j++) {  // The loop only iterates to
63 so the code doesn't overflow the buffer
 add1 = tone_level_idx[ch][sb][j] - 10;
@@ -566,67 +566,68 @@ static void fill_coding_method_array(sb_int8_array
tone_level_idx,
 }
 tone_level_idx_temp[ch][sb][0] =
tone_level_idx_temp[ch][sb][1];
 }
-acc = 0;
-for (ch = 0; ch < nb_channels; ch++)
-for (sb = 0; sb < 30; sb++)
-for (j = 0; j < 64; j++)
-acc += tone_level_idx_temp[ch][sb][j];
-
-multres = 0x6667LL * (acc * 10);
-esp_40 = (multres >> 32) / 8 + ((multres & 0x) >> 31);
-for (ch = 0;  ch < nb_channels; ch++)
-for (sb = 0; sb < 30; sb++)
-for (j = 0; j < 64; j++) {
-comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10;
-if (comp < 0)
-comp += 0xff;
-comp /= 256; // signed shift
-switch(sb) {
-case 0:
-if (comp < 30)
-comp = 30;
-comp += 15;
-break;
-case 1:
-if (comp < 24)
-comp = 24;
-comp += 10;
-break;
-case 2:
-case 3:
-case 4:
-if (comp < 16)
-comp = 16;
-}
-if (comp <= 5)
-tmp = 0;
-else if (comp <= 10)
-tmp = 10;
-else if (comp <= 16)
-tmp = 16;
-else if (comp <= 24)
-tmp = -1;
-else
-tmp = 0;
-coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )&
0xff;
+}
+acc = 0;
+for (ch = 0; ch < nb_channels; ch++)
+for (sb = 0; sb < 30; sb++)
+for (j = 0; j < 64; j++)
+acc += tone_level_idx_temp[ch][sb][j];
+
+multres = 0x6667LL * (acc * 10);
+esp_40 = (multres >> 32) / 8 + ((multres & 0x) >> 31);
+for (ch = 0;  ch < nb_channels; ch++)
+for (sb = 0; sb < 30; sb++)
+for (j = 0; j < 64; j++) {
+comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10;
+if (comp < 0)
+comp += 0xff;
+comp /= 256; // signed shift
+switch(sb) {
+case 0:
+if (comp < 30)
+comp = 30;
+comp += 15;
+break;
+case 1:
+if (comp < 24)
+comp = 24;
+comp += 10;
+break;
+case 2:
+case 3:
+case 4:
+if (comp < 16)
+comp = 16;
 }
+if (comp <= 5)
+tmp = 0;
+else if (comp <= 10)
+tmp = 10;
+else if (comp <= 16)
+tmp = 16;
+else if (comp <= 24)
+tmp = -1;
+else
+tmp = 0;
+coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )&
0xff;
+}
+for (sb = 0; sb < 30; sb++)
+fix_coding_method_array(sb, nb_channels, coding_method);
+for (ch = 0; ch < nb_channels; ch++)
 for (sb = 0; sb < 30; sb++)
-fix_coding_method_array(sb, nb_channels, coding_method);
-

Re: [FFmpeg-devel] [PATCH] doc/filters: blend-by-default-terminates-on-longest-input

2016-09-27 Thread Lou Logan
On Sat, 24 Sep 2016 09:14:02 +0530, Mulvya V wrote:

> From a740ed91ea2d651f7cdf731befc4de673f4db784 Mon Sep 17 00:00:00 2001
> From: Mulvya 
> Date: Sat, 24 Sep 2016 09:05:27 +0530
> Subject: [PATCH] blend, by default, terminates on longest input
> 
> Signed-off-by: Mulvya 
> ---
>  doc/filters.texi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

LGTM and pushed.

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


Re: [FFmpeg-devel] [PATCH 2/3] lavf/mov.c: Make audio timestamps strictly monotonically increasing inside an edit list.

2016-09-27 Thread Moritz Barsnick
On Tue, Sep 27, 2016 at 09:28:13 -0700, Sasi Inguva wrote:
>  if (curr_cts < edit_list_media_time || curr_cts >= 
> (edit_list_duration + edit_list_media_time)) {
> -if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && 
> curr_cts < edit_list_media_time &&
> -curr_cts + frame_duration > edit_list_media_time &&
> -st->skip_samples == 0 && msc->start_pad == 0) {
> -st->skip_samples = msc->start_pad = edit_list_media_time 
> - curr_cts;
> -
> -// Shift the index entry timestamp by skip_samples to be 
> correct.
> -edit_list_dts_counter -= st->skip_samples;
> +if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && 
> st->codecpar->codec_id != AV_CODEC_ID_VORBIS &&
> +curr_cts < edit_list_media_time && curr_cts + 
> frame_duration > edit_list_media_time &&
> +first_non_zero_audio_edit > 0) {
> + packet_skip_samples = edit_list_media_time - curr_cts;
> + st->skip_samples += packet_skip_samples;
> +
> +// Shift the index entry timestamp by 
> packet_skip_samples to be correct.
> +edit_list_dts_counter -= packet_skip_samples;
>  if (edit_list_start_encountered == 0)  {
> -  edit_list_start_encountered = 1;
> +edit_list_start_encountered = 1;
> +// Make timestamps strictly monotonically increasing 
> for audio, by rewriting timestamps for
> +// discarded packets.
> +if (frame_duration_buffer) {
> +  fix_index_entry_timestamps(st, 
> st->nb_index_entries, edit_list_dts_counter,
> + frame_duration_buffer, 
> num_discarded_begin);
> +  av_freep(&frame_duration_buffer);
> +}

Something's fishy with your indentation here.

> +if (!frame_duration_buffer) {
> +av_log(mov->fc, AV_LOG_ERROR, "Cannot reallocate 
> frame duration buffer\n");
> +break;
> +}

I fail to see the whole code block (and I have problems applying the
patch). What is this breaking from?

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


[FFmpeg-devel] [PATCH] avformat/matroskadec: retain error codes in matroska_resync() and matroska_read_packet()

2016-09-27 Thread Sophia Wang
Signed-off-by: Sophia Wang 
---
 libavformat/matroskadec.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 77b8a5d..7ee1c7a 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -738,13 +738,16 @@ static int matroska_read_close(AVFormatContext *s);
 static int matroska_resync(MatroskaDemuxContext *matroska, int64_t last_pos)
 {
 AVIOContext *pb = matroska->ctx->pb;
+int64_t ret;
 uint32_t id;
 matroska->current_id = 0;
 matroska->num_levels = 0;
 
 /* seek to next position to resync from */
-if (avio_seek(pb, last_pos + 1, SEEK_SET) < 0)
-goto eof;
+if ((ret = avio_seek(pb, last_pos + 1, SEEK_SET)) < 0) {
+matroska->done = 1;
+return ret;
+}
 
 id = avio_rb32(pb);
 
@@ -760,7 +763,6 @@ static int matroska_resync(MatroskaDemuxContext *matroska, 
int64_t last_pos)
 id = (id << 8) | avio_r8(pb);
 }
 
-eof:
 matroska->done = 1;
 return AVERROR_EOF;
 }
@@ -3317,16 +3319,17 @@ static int matroska_parse_cluster(MatroskaDemuxContext 
*matroska)
 static int matroska_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
 MatroskaDemuxContext *matroska = s->priv_data;
+int ret = 0;
 
 while (matroska_deliver_packet(matroska, pkt)) {
 int64_t pos = avio_tell(matroska->ctx->pb);
 if (matroska->done)
-return AVERROR_EOF;
+return (ret < 0) ? ret : AVERROR_EOF;
 if (matroska_parse_cluster(matroska) < 0)
-matroska_resync(matroska, pos);
+ret = matroska_resync(matroska, pos);
 }
 
-return 0;
+return ret;
 }
 
 static int matroska_read_seek(AVFormatContext *s, int stream_index,
-- 
2.8.0.rc3.226.g39d4020

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


Re: [FFmpeg-devel] [PATCH] avformat/matroskadec: retain error codes in matroska_resync() and matroska_read_packet()

2016-09-27 Thread Sophia Wang
On Fri, Sep 23, 2016 at 1:40 AM, Benoit Fouet  wrote:

> Hi,
>
>
> On 22/09/2016 23:03, Sophia Wang wrote:
>
>> Signed-off-by: Sophia Wang 
>> ---
>>   libavformat/matroskadec.c | 13 -
>>   1 file changed, 8 insertions(+), 5 deletions(-)
>>
>> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
>> index 77b8a5d..936690d 100644
>> --- a/libavformat/matroskadec.c
>> +++ b/libavformat/matroskadec.c
>> @@ -738,13 +738,16 @@ static int matroska_read_close(AVFormatContext *s);
>>   static int matroska_resync(MatroskaDemuxContext *matroska, int64_t
>> last_pos)
>>   {
>>   AVIOContext *pb = matroska->ctx->pb;
>> +int64_t ret;
>>   uint32_t id;
>>   matroska->current_id = 0;
>>   matroska->num_levels = 0;
>> /* seek to next position to resync from */
>> -if (avio_seek(pb, last_pos + 1, SEEK_SET) < 0)
>> -goto eof;
>> +if ((ret = avio_seek(pb, last_pos + 1, SEEK_SET)) < 0) {
>> +matroska->done = 1;
>> +return ret;
>>
>
> doesn't this generate a warning, returning an int64 from a function
> supposed to return an int?


avio_seek returns an int64, so at some point an int64 is going to be
converted to an int. I don't believe it will make a difference where,
especially since the values that will actually be returned (error codes)
should fit in an int.


>
> +}
>> id = avio_rb32(pb);
>>   @@ -760,7 +763,6 @@ static int matroska_resync(MatroskaDemuxContext
>> *matroska, int64_t last_pos)
>>   id = (id << 8) | avio_r8(pb);
>>   }
>>   -eof:
>>   matroska->done = 1;
>>   return AVERROR_EOF;
>>   }
>> @@ -3317,13 +3319,14 @@ static int 
>> matroska_parse_cluster(MatroskaDemuxContext
>> *matroska)
>>   static int matroska_read_packet(AVFormatContext *s, AVPacket *pkt)
>>   {
>>   MatroskaDemuxContext *matroska = s->priv_data;
>> +int ret = 0;
>> while (matroska_deliver_packet(matroska, pkt)) {
>>   int64_t pos = avio_tell(matroska->ctx->pb);
>>   if (matroska->done)
>> -return AVERROR_EOF;
>> +return (ret < 0) ? ret : AVERROR_EOF;
>>   if (matroska_parse_cluster(matroska) < 0)
>> -matroska_resync(matroska, pos);
>> +ret = matroska_resync(matroska, pos);
>>   }
>> return 0;
>>
>
> You might want to return ret instead of 0 here.


Done.


>
>
> --
> Ben
>
>
> ___
> 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] libavcodec/qdm2.c: fix warning due to misleading indentation

2016-09-27 Thread Adriano Pallavicino
---
 libavcodec/qdm2.c | 117
+++---
 1 file changed, 59 insertions(+), 58 deletions(-)

diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index dd8b257..e3cc902 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -537,7 +537,7 @@ static void fill_coding_method_array(sb_int8_array
tone_level_idx,
 /* This case is untested, no samples available */
 avpriv_request_sample(NULL, "!superblocktype_2_3");
 return;
-for (ch = 0; ch < nb_channels; ch++)
+for (ch = 0; ch < nb_channels; ch++) {
 for (sb = 0; sb < 30; sb++) {
 for (j = 1; j < 63; j++) {  // The loop only iterates to
63 so the code doesn't overflow the buffer
 add1 = tone_level_idx[ch][sb][j] - 10;
@@ -566,67 +566,68 @@ static void fill_coding_method_array(sb_int8_array
tone_level_idx,
 }
 tone_level_idx_temp[ch][sb][0] =
tone_level_idx_temp[ch][sb][1];
 }
-acc = 0;
-for (ch = 0; ch < nb_channels; ch++)
-for (sb = 0; sb < 30; sb++)
-for (j = 0; j < 64; j++)
-acc += tone_level_idx_temp[ch][sb][j];
-
-multres = 0x6667LL * (acc * 10);
-esp_40 = (multres >> 32) / 8 + ((multres & 0x) >> 31);
-for (ch = 0;  ch < nb_channels; ch++)
-for (sb = 0; sb < 30; sb++)
-for (j = 0; j < 64; j++) {
-comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10;
-if (comp < 0)
-comp += 0xff;
-comp /= 256; // signed shift
-switch(sb) {
-case 0:
-if (comp < 30)
-comp = 30;
-comp += 15;
-break;
-case 1:
-if (comp < 24)
-comp = 24;
-comp += 10;
-break;
-case 2:
-case 3:
-case 4:
-if (comp < 16)
-comp = 16;
-}
-if (comp <= 5)
-tmp = 0;
-else if (comp <= 10)
-tmp = 10;
-else if (comp <= 16)
-tmp = 16;
-else if (comp <= 24)
-tmp = -1;
-else
-tmp = 0;
-coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )&
0xff;
+}
+acc = 0;
+for (ch = 0; ch < nb_channels; ch++)
+for (sb = 0; sb < 30; sb++)
+for (j = 0; j < 64; j++)
+acc += tone_level_idx_temp[ch][sb][j];
+
+multres = 0x6667LL * (acc * 10);
+esp_40 = (multres >> 32) / 8 + ((multres & 0x) >> 31);
+for (ch = 0;  ch < nb_channels; ch++)
+for (sb = 0; sb < 30; sb++)
+for (j = 0; j < 64; j++) {
+comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10;
+if (comp < 0)
+comp += 0xff;
+comp /= 256; // signed shift
+switch(sb) {
+case 0:
+if (comp < 30)
+comp = 30;
+comp += 15;
+break;
+case 1:
+if (comp < 24)
+comp = 24;
+comp += 10;
+break;
+case 2:
+case 3:
+case 4:
+if (comp < 16)
+comp = 16;
 }
+if (comp <= 5)
+tmp = 0;
+else if (comp <= 10)
+tmp = 10;
+else if (comp <= 16)
+tmp = 16;
+else if (comp <= 24)
+tmp = -1;
+else
+tmp = 0;
+coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )&
0xff;
+}
+for (sb = 0; sb < 30; sb++)
+fix_coding_method_array(sb, nb_channels, coding_method);
+for (ch = 0; ch < nb_channels; ch++)
 for (sb = 0; sb < 30; sb++)
-fix_coding_method_array(sb, nb_channels, coding_method);
-for (ch = 0; ch < nb_channels; ch++)
-

[FFmpeg-devel] imagepipe filter (was [PATCH] avfilter: add dynoverlay filter.)

2016-09-27 Thread Priebe, Jason
On 9/23/16, Paul B Mahol  wrote:

> Named pipe approach would implement video source which would read images
> from named pipe. It would read from named pipe until it decodes single frame
> and then would use that frame as input to next filter, for example
> overlay filter.
>
> If it encounters EOF in named pipe it would not abort but would instead keep
> sending last frame it got, for example completely transparent frame.
>
> If it suddenly get more data from pipe it would update its internal
> frame and output it as input to next filter in chain.
>
> So command would look like this:
>
> imagepipe=named_pipe:rate=30[o],[0:v][o]overlay=x=0:y=0 ...
>
> And than in another terminal, you would use commands like this:
>
> cat random_image.format > named_pipe

Paul:  this is a really good idea (when you first mentioned pipes, I
thought you meant to use pipes as a standard ffmpeg input, which doesn't
really work in the way I'm trying to make it work here).  But a purpose-
built filter that reads from a pipe is another story.

I built an imagepipe filter that I'd like to submit as a patch, but 
I have some questions before I do that:

- it outputs YUVA420P.  Does it need to output other pixel formats to
  be accepted?

- it uses a slightly inelegant technique to read the images; it writes
  the image data to a temp file so it can call ff_load_image().  I didn't
  see a function that can load an image directly from an in-memory byte array.

- I'm not 100% sure how to write the test.  I added a block=1 option to
  the filter so that it will block on each frame to read in an image from
  the pipe; this is designed for testing only (normally, you want non-blocking
  reads).  But I don't know how to leverage FATE to build a test that
  runs ffmpeg and also in another process, writes files to the pipe.  I
  think I can do it if I add a new function to fate-run.sh, but I don't know
  if that is discouraged.

- Portability - I'm worried this is the big one.  mkfifo isn't readily
  available on Windows without compatibility libraries, and even then,
  I'm not sure whether they would work the same way they do under *nix.
  Generally speaking, how does the ffmpeg team tackle cross-platform
  issues like this?

Thanks for any guidance!

Jason Priebe
CBC New Media
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/3] avformat/matroskaenc: write the FieldOrder element for non-interlaced video

2016-09-27 Thread James Almer
It's listed as mandatory in https://matroska.org/technical/specs/index.html

Signed-off-by: James Almer 
---
The spec also mentions FieldOrder "MUST be ignored if FlagInterlaced is not
set to interlaced". Since it's a mandatory element, i interpreted that as a
demuxer guideline.

 libavformat/matroskaenc.c |  6 ++
 tests/fate/matroska.mak   |  2 +-
 tests/ref/fate/rgb24-mkv  |  4 ++--
 tests/ref/lavf/mkv|  8 
 tests/ref/seek/lavf-mkv   | 44 ++--
 5 files changed, 35 insertions(+), 29 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 6cb0376..a766b81 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -798,10 +798,16 @@ static void mkv_write_field_order(AVIOContext *pb, int 
mode,
 case AV_FIELD_UNKNOWN:
 put_ebml_uint(pb, MATROSKA_ID_VIDEOFLAGINTERLACED,
   MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED);
+if (mode != MODE_WEBM)
+put_ebml_uint(pb, MATROSKA_ID_VIDEOFIELDORDER,
+  MATROSKA_VIDEO_FIELDORDER_UNDETERMINED);
 break;
 case AV_FIELD_PROGRESSIVE:
 put_ebml_uint(pb, MATROSKA_ID_VIDEOFLAGINTERLACED,
   MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE);
+if (mode != MODE_WEBM)
+put_ebml_uint(pb, MATROSKA_ID_VIDEOFIELDORDER,
+  MATROSKA_VIDEO_FIELDORDER_PROGRESSIVE);
 break;
 case AV_FIELD_TT:
 case AV_FIELD_BB:
diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak
index 8e4a1e8..fd242b7 100644
--- a/tests/fate/matroska.mak
+++ b/tests/fate/matroska.mak
@@ -4,6 +4,6 @@
 FATE_MATROSKA-$(call DEMMUX, MATROSKA, MATROSKA) += fate-matroska-remux
 fate-matroska-remux: CMD = md5 -i 
$(TARGET_SAMPLES)/vp9-test-vectors/vp90-2-2pass-akiyo.webm -color_trc 4 -c:v 
copy -fflags +bitexact -strict -2 -f matroska
 fate-matroska-remux: CMP = oneline
-fate-matroska-remux: REF = f08b20b90f158a4de5a02a52c25596b9
+fate-matroska-remux: REF = b745381b5a0b3af0e3f2d7d65a18e20f
 
 FATE_SAMPLES_AVCONV += $(FATE_MATROSKA-yes)
diff --git a/tests/ref/fate/rgb24-mkv b/tests/ref/fate/rgb24-mkv
index 69584f5..0efd49d 100644
--- a/tests/ref/fate/rgb24-mkv
+++ b/tests/ref/fate/rgb24-mkv
@@ -1,5 +1,5 @@
-0d081c8e151a922435830f95000d3c71 *tests/data/fate/rgb24-mkv.matroska
-58321 tests/data/fate/rgb24-mkv.matroska
+909a07a48b9d3ae8691daa7eb305c40a *tests/data/fate/rgb24-mkv.matroska
+58324 tests/data/fate/rgb24-mkv.matroska
 #tb 0: 1/10
 #media_type 0: video
 #codec_id 0: rawvideo
diff --git a/tests/ref/lavf/mkv b/tests/ref/lavf/mkv
index 5b0d386..e43bd02 100644
--- a/tests/ref/lavf/mkv
+++ b/tests/ref/lavf/mkv
@@ -1,6 +1,6 @@
-5b982c8dfbadc71f51b206cbd10b9a71 *./tests/data/lavf/lavf.mkv
-472875 ./tests/data/lavf/lavf.mkv
+8ec784fcba03cee098140729315d073e *./tests/data/lavf/lavf.mkv
+472878 ./tests/data/lavf/lavf.mkv
 ./tests/data/lavf/lavf.mkv CRC=0xec6c3c68
-b4a295bae8e6cf536563cb840386f3a4 *./tests/data/lavf/lavf.mkv
-320551 ./tests/data/lavf/lavf.mkv
+0f064370de5762f91cb9777163e89ae0 *./tests/data/lavf/lavf.mkv
+320554 ./tests/data/lavf/lavf.mkv
 ./tests/data/lavf/lavf.mkv CRC=0xec6c3c68
diff --git a/tests/ref/seek/lavf-mkv b/tests/ref/seek/lavf-mkv
index bf34766..12b8267 100644
--- a/tests/ref/seek/lavf-mkv
+++ b/tests/ref/seek/lavf-mkv
@@ -1,48 +1,48 @@
-ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:800 size:   
208
+ret: 0 st: 1 flags:1 dts: 0.00 pts: 0.00 pos:803 size:   
208
 ret: 0 st:-1 flags:0  ts:-1.00
-ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:   1016 size: 
27837
+ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:   1019 size: 
27837
 ret: 0 st:-1 flags:1  ts: 1.894167
-ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292430 size: 
27834
+ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292433 size: 
27834
 ret: 0 st: 0 flags:0  ts: 0.788000
-ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292430 size: 
27834
+ret: 0 st: 0 flags:1 dts: 0.971000 pts: 0.971000 pos: 292433 size: 
27834
 ret: 0 st: 0 flags:1  ts:-0.317000
-ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:   1016 size: 
27837
+ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:   1019 size: 
27837
 ret:-1 st: 1 flags:0  ts: 2.577000
 ret: 0 st: 1 flags:1  ts: 1.471000
-ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 320271 size:   
209
+ret: 0 st: 1 flags:1 dts: 0.993000 pts: 0.993000 pos: 320274 size:   
209
 ret: 0 st:-1 flags:0  ts: 0.365002
-ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 146983 size: 
27925
+ret: 0 st: 0 flags:1 dts: 0.491000 pts: 0.491000 pos: 146986 size: 
27925
 ret: 0 st:-1 flags:1  ts:-0.740831
-ret: 0 st: 0 flags:1 dts: 0.011000 pts: 0.011000 pos:   1016 size: 
27837
+ret: 0 st: 0 flag

Re: [FFmpeg-devel] FFmpeg 3.2

2016-09-27 Thread Reto Kromer
Michael Niedermayer wrote:

>also a name needs to be choosen

Bryce and/or Bayer

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


[FFmpeg-devel] [PATCH 1/3] avformat/matroska: write FlagInterlaced element in WebM

2016-09-27 Thread James Almer
It's listed as supported in both https://www.webmproject.org/docs/container/
and https://matroska.org/technical/specs/index.html

Signed-off-by: James Almer 
---
 libavformat/matroskaenc.c | 41 +
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 3eeb09b..6cb0376 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -791,7 +791,7 @@ static int mkv_write_video_color(AVIOContext *pb, 
AVCodecParameters *par, AVStre
 return 0;
 }
 
-static void mkv_write_field_order(AVIOContext *pb,
+static void mkv_write_field_order(AVIOContext *pb, int mode,
   enum AVFieldOrder field_order)
 {
 switch (field_order) {
@@ -809,23 +809,25 @@ static void mkv_write_field_order(AVIOContext *pb,
 case AV_FIELD_BT:
 put_ebml_uint(pb, MATROSKA_ID_VIDEOFLAGINTERLACED,
   MATROSKA_VIDEO_INTERLACE_FLAG_INTERLACED);
-switch (field_order) {
-case AV_FIELD_TT:
-put_ebml_uint(pb, MATROSKA_ID_VIDEOFIELDORDER,
-  MATROSKA_VIDEO_FIELDORDER_TT);
-break;
-case AV_FIELD_BB:
- put_ebml_uint(pb, MATROSKA_ID_VIDEOFIELDORDER,
-  MATROSKA_VIDEO_FIELDORDER_BB);
-break;
-case AV_FIELD_TB:
-put_ebml_uint(pb, MATROSKA_ID_VIDEOFIELDORDER,
-  MATROSKA_VIDEO_FIELDORDER_TB);
-break;
-case AV_FIELD_BT:
-put_ebml_uint(pb, MATROSKA_ID_VIDEOFIELDORDER,
-  MATROSKA_VIDEO_FIELDORDER_BT);
-break;
+if (mode != MODE_WEBM) {
+switch (field_order) {
+case AV_FIELD_TT:
+put_ebml_uint(pb, MATROSKA_ID_VIDEOFIELDORDER,
+  MATROSKA_VIDEO_FIELDORDER_TT);
+break;
+case AV_FIELD_BB:
+ put_ebml_uint(pb, MATROSKA_ID_VIDEOFIELDORDER,
+  MATROSKA_VIDEO_FIELDORDER_BB);
+break;
+case AV_FIELD_TB:
+put_ebml_uint(pb, MATROSKA_ID_VIDEOFIELDORDER,
+  MATROSKA_VIDEO_FIELDORDER_TB);
+break;
+case AV_FIELD_BT:
+put_ebml_uint(pb, MATROSKA_ID_VIDEOFIELDORDER,
+  MATROSKA_VIDEO_FIELDORDER_BT);
+break;
+}
 }
 }
 }
@@ -1088,8 +1090,7 @@ static int mkv_write_track(AVFormatContext *s, 
MatroskaMuxContext *mkv,
 put_ebml_uint (pb, MATROSKA_ID_VIDEOPIXELWIDTH , par->width);
 put_ebml_uint (pb, MATROSKA_ID_VIDEOPIXELHEIGHT, par->height);
 
-if (mkv->mode != MODE_WEBM)
-mkv_write_field_order(pb, par->field_order);
+mkv_write_field_order(pb, mkv->mode, par->field_order);
 
 // check both side data and metadata for stereo information,
 // write the result to the bitstream if any is found
-- 
2.9.1

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


[FFmpeg-devel] [PATCH 3/3] avformat/matroskadec: set AVCodecParameters.field_order on progressive video

2016-09-27 Thread James Almer
Signed-off-by: James Almer 
---
 libavformat/matroskadec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 77b8a5d..2317024 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2279,6 +2279,8 @@ static int matroska_parse_tracks(AVFormatContext *s)
 
 if (track->video.interlaced == 
MATROSKA_VIDEO_INTERLACE_FLAG_INTERLACED)
 st->codecpar->field_order = 
mkv_field_order(track->video.field_order);
+else if (track->video.interlaced == 
MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE)
+st->codecpar->field_order = AV_FIELD_PROGRESSIVE;
 
 if (track->video.stereo_mode && track->video.stereo_mode < 
MATROSKA_VIDEO_STEREOMODE_TYPE_NB)
 mkv_stereo_mode_display_mul(track->video.stereo_mode, 
&display_width_mul, &display_height_mul);
-- 
2.9.1

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


Re: [FFmpeg-devel] [PATCH 1/2] compat/avisynth: minor update for alpha offsets

2016-09-27 Thread Stephen Hutchinson

On 9/27/2016 3:12 AM, Carl Eugen Hoyos wrote:

2016-08-31 16:16 GMT+02:00 Stephen Hutchinson :

On 8/31/2016 9:37 AM, Carl Eugen Hoyos wrote:


2016-08-31 2:26 GMT+02:00 Stephen Hutchinson :


-//AVS_CPUF_AVX= 0x800,   //  Sandy Bridge, Bulldozer
+  AVS_CPUF_AVX= 0x800,   //  Sandy Bridge, Bulldozer



Is this related to alpha offsets?



It's part of the changes to the header upstream.


Then "sync with upstream header" would be less confusing imo.

Sorry for missing your message, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel



It's not necessary to sync with upstream yet, so
the header update patch was revoked.  Only the
Planar RGB fix patch is actually necessary.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/3] lavf/mov.c: Make audio timestamps strictly monotonically increasing inside an edit list.

2016-09-27 Thread Sasi Inguva
Fixes gapless decoding. Adjust skip_samples field correctly in case of 
DISCARDed audio frames.

Signed-off-by: Sasi Inguva 
---
 libavformat/mov.c| 81 
 tests/ref/fate/gaplessenc-itunes-to-ipod-aac |  2 +-
 tests/ref/fate/gaplessenc-pcm-to-mov-aac |  2 +-
 3 files changed, 72 insertions(+), 13 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index b84d9c0..bb86780 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2856,6 +2856,21 @@ static int64_t add_index_entry(AVStream *st, int64_t 
pos, int64_t timestamp,
 }
 
 /**
+ * Rewrite timestamps of index entries in the range [end_index - 
frame_duration_buffer_size, end_index)
+ * by subtracting end_ts successively by the amounts given in 
frame_duration_buffer.
+ */
+static void fix_index_entry_timestamps(AVStream* st, int end_index, int64_t 
end_ts,
+   int64_t* frame_duration_buffer,
+   int frame_duration_buffer_size) {
+int i = 0;
+av_assert0(end_index >= 0 && end_index <= st->nb_index_entries);
+for (i = 0; i < frame_duration_buffer_size; i++) {
+end_ts -= frame_duration_buffer[frame_duration_buffer_size - 1 - i];
+st->index_entries[end_index - 1 - i].timestamp = end_ts;
+}
+}
+
+/**
  * Append a new ctts entry to ctts_data.
  * Returns the new ctts_count if successful, else returns -1.
  */
@@ -2919,7 +2934,10 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 int64_t edit_list_media_time_dts = 0;
 int64_t edit_list_start_encountered = 0;
 int64_t search_timestamp = 0;
-
+int64_t* frame_duration_buffer = NULL;
+int num_discarded_begin = 0;
+int first_non_zero_audio_edit = -1;
+int packet_skip_samples = 0;
 
 if (!msc->elst_data || msc->elst_count <= 0) {
 return;
@@ -2955,6 +2973,7 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 edit_list_index++;
 edit_list_dts_counter = edit_list_dts_entry_end;
 edit_list_dts_entry_end += edit_list_duration;
+num_discarded_begin = 0;
 if (edit_list_media_time == -1) {
 continue;
 }
@@ -2962,7 +2981,14 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 // If we encounter a non-negative edit list reset the 
skip_samples/start_pad fields and set them
 // according to the edit list below.
 if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
-st->skip_samples = msc->start_pad = 0;
+if (first_non_zero_audio_edit < 0) {
+first_non_zero_audio_edit = 1;
+} else {
+first_non_zero_audio_edit = 0;
+}
+
+if (first_non_zero_audio_edit > 0)
+st->skip_samples = msc->start_pad = 0;
 }
 
 //find closest previous key frame
@@ -3041,24 +3067,57 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 }
 
 if (curr_cts < edit_list_media_time || curr_cts >= 
(edit_list_duration + edit_list_media_time)) {
-if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && curr_cts 
< edit_list_media_time &&
-curr_cts + frame_duration > edit_list_media_time &&
-st->skip_samples == 0 && msc->start_pad == 0) {
-st->skip_samples = msc->start_pad = edit_list_media_time - 
curr_cts;
-
-// Shift the index entry timestamp by skip_samples to be 
correct.
-edit_list_dts_counter -= st->skip_samples;
+if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && 
st->codecpar->codec_id != AV_CODEC_ID_VORBIS &&
+curr_cts < edit_list_media_time && curr_cts + 
frame_duration > edit_list_media_time &&
+first_non_zero_audio_edit > 0) {
+ packet_skip_samples = edit_list_media_time - curr_cts;
+ st->skip_samples += packet_skip_samples;
+
+// Shift the index entry timestamp by packet_skip_samples 
to be correct.
+edit_list_dts_counter -= packet_skip_samples;
 if (edit_list_start_encountered == 0)  {
-  edit_list_start_encountered = 1;
+edit_list_start_encountered = 1;
+// Make timestamps strictly monotonically increasing 
for audio, by rewriting timestamps for
+// discarded packets.
+if (frame_duration_buffer) {
+  fix_index_entry_timestamps(st, st->nb_index_entries, 
edit_list_dts_counter,
+ frame_duration_buffer, 
num_discarded_begin);
+  av_freep(&frame_duration_buffer);
+}
 }
 
-av_log(mov->fc, AV_LOG_DEBUG, "skip %d audio samples from 
curr_cts

Re: [FFmpeg-devel] 答复: [PATCH] flv format support mp3 audio with 48khz

2016-09-27 Thread Steven Liu
2016-09-27 23:30 GMT+08:00 付 秋平 :

> AAC 48khz has alreay been supported in flv_enc.c file, when the flv with
> audio format is aac
>
> it just set it into:
>
> if (enc->codec_id == AV_CODEC_ID_AAC) // specs force these parameters
> return FLV_CODECID_AAC | FLV_SAMPLERATE_44100HZ |
>FLV_SAMPLESSIZE_16BIT | FLV_STEREO;
>
> when i use ffmpeg in the live video stream project, some user publish the
> rtmp stream with (h264 and mp3 48khz)
> then i need to use ffmpeg to convert the "rtmp" live stream to "flv" live
> stream,  ffmpeg can not support and make a warning.
> so i change this code to make it support this.
> 
> 发件人: ffmpeg-devel  代表 Steven Liu <
> lingjiujia...@gmail.com>
> 发送时间: 2016年9月27日 15:15
> 收件人: FFmpeg development discussions and patches
> 主题: Re: [FFmpeg-devel] [PATCH] flv format support mp3 audio with 48khz
>
> 2016-09-27 23:01 GMT+08:00 :
>
> > From: frankos2 
> >
> > ---
> >  libavformat/flvenc.c |8 
> >  1 files changed, 8 insertions(+), 0 deletions(-)
> >
> > diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
> > index 99903f5..296426a 100644
> > --- a/libavformat/flvenc.c
> > +++ b/libavformat/flvenc.c
> > @@ -107,6 +107,13 @@ static int get_audio_flags(AVFormatContext *s,
> > AVCodecParameters *par)
> >  return FLV_CODECID_SPEEX | FLV_SAMPLERATE_11025HZ |
> > FLV_SAMPLESSIZE_16BIT;
> >  } else {
> >  switch (par->sample_rate) {
> > +case 48000:
> > +if (par->codec_id == AV_CODEC_ID_MP3) {
> > +flags |= FLV_SAMPLERATE_44100HZ;
> >
> and you can support aac too.
>
> > +break;
> > +} else {
> > +goto error;
> > +}
> >  case 44100:
> >  flags |= FLV_SAMPLERATE_44100HZ;
> >  break;
> > @@ -124,6 +131,7 @@ static int get_audio_flags(AVFormatContext *s,
> > AVCodecParameters *par)
> >  break;
> >  }
> >  default:
> > +error:
> >  av_log(s, AV_LOG_ERROR,
> > "FLV does not support sample rate %d, "
> > "choose from (44100, 22050, 11025)\n",
> > par->sample_rate);
> > --
> > 1.7.1
> >
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> ffmpeg-devel Info Page
> ffmpeg.org
> This list is about FFmpeg development discussions and patches; but not for
> bug-reports. Please read the Code-of-conduct. To see the collection of
> prior postings to ...
>
>
>
> >
> ___
> 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
>

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


[FFmpeg-devel] 答复: [PATCH] flv format support mp3 audio with 48khz

2016-09-27 Thread 付 秋平
AAC 48khz has alreay been supported in flv_enc.c file, when the flv with audio 
format is aac

it just set it into:

if (enc->codec_id == AV_CODEC_ID_AAC) // specs force these parameters
return FLV_CODECID_AAC | FLV_SAMPLERATE_44100HZ |
   FLV_SAMPLESSIZE_16BIT | FLV_STEREO;

when i use ffmpeg in the live video stream project, some user publish the rtmp 
stream with (h264 and mp3 48khz)
then i need to use ffmpeg to convert the "rtmp" live stream to "flv" live 
stream,  ffmpeg can not support and make a warning.
so i change this code to make it support this.

发件人: ffmpeg-devel  代表 Steven Liu 

发送时间: 2016年9月27日 15:15
收件人: FFmpeg development discussions and patches
主题: Re: [FFmpeg-devel] [PATCH] flv format support mp3 audio with 48khz

2016-09-27 23:01 GMT+08:00 :

> From: frankos2 
>
> ---
>  libavformat/flvenc.c |8 
>  1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
> index 99903f5..296426a 100644
> --- a/libavformat/flvenc.c
> +++ b/libavformat/flvenc.c
> @@ -107,6 +107,13 @@ static int get_audio_flags(AVFormatContext *s,
> AVCodecParameters *par)
>  return FLV_CODECID_SPEEX | FLV_SAMPLERATE_11025HZ |
> FLV_SAMPLESSIZE_16BIT;
>  } else {
>  switch (par->sample_rate) {
> +case 48000:
> +if (par->codec_id == AV_CODEC_ID_MP3) {
> +flags |= FLV_SAMPLERATE_44100HZ;
>
and you can support aac too.

> +break;
> +} else {
> +goto error;
> +}
>  case 44100:
>  flags |= FLV_SAMPLERATE_44100HZ;
>  break;
> @@ -124,6 +131,7 @@ static int get_audio_flags(AVFormatContext *s,
> AVCodecParameters *par)
>  break;
>  }
>  default:
> +error:
>  av_log(s, AV_LOG_ERROR,
> "FLV does not support sample rate %d, "
> "choose from (44100, 22050, 11025)\n",
> par->sample_rate);
> --
> 1.7.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
ffmpeg-devel Info Page
ffmpeg.org
This list is about FFmpeg development discussions and patches; but not for 
bug-reports. Please read the Code-of-conduct. To see the collection of prior 
postings to ...



>
___
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] FFmpeg 3.2

2016-09-27 Thread Bodecs Bela

Shannon

https://en.wikipedia.org/wiki/Claude_Shannon



2016.09.27. 15:30 keltezéssel, Michael Niedermayer írta:

Hi all

Its long since FFmpeg 3.1, so its time to make 3.2
ill branch release/3.2 off master and make 3.2 in maybe about a week or
2 unless something delays it

also a name needs to be choosen

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 2/4] V10 - SCTE-35 extraction from mpegts

2016-09-27 Thread Carlos Fernandez Sanz
On Tue, Sep 27, 2016 at 12:30 AM, Marton Balint  wrote:

>> +} else if (ts->pids[i] && ts->pids[i]->type ==
>> MPEGTS_SECTION) {
>> +return ret;
>
>
> Why do you need this hunk? I think you can delete it, and everything will
> remain working. This loop flushes existing half-read PES packets, so you
> cannot simply return in the middle of the loop.

If we remove it we don't get SCTE-35.

New patch coming up later today.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] flv format support mp3 audio with 48khz

2016-09-27 Thread Steven Liu
2016-09-27 23:01 GMT+08:00 :

> From: frankos2 
>
> ---
>  libavformat/flvenc.c |8 
>  1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
> index 99903f5..296426a 100644
> --- a/libavformat/flvenc.c
> +++ b/libavformat/flvenc.c
> @@ -107,6 +107,13 @@ static int get_audio_flags(AVFormatContext *s,
> AVCodecParameters *par)
>  return FLV_CODECID_SPEEX | FLV_SAMPLERATE_11025HZ |
> FLV_SAMPLESSIZE_16BIT;
>  } else {
>  switch (par->sample_rate) {
> +case 48000:
> +if (par->codec_id == AV_CODEC_ID_MP3) {
> +flags |= FLV_SAMPLERATE_44100HZ;
>
and you can support aac too.

> +break;
> +} else {
> +goto error;
> +}
>  case 44100:
>  flags |= FLV_SAMPLERATE_44100HZ;
>  break;
> @@ -124,6 +131,7 @@ static int get_audio_flags(AVFormatContext *s,
> AVCodecParameters *par)
>  break;
>  }
>  default:
> +error:
>  av_log(s, AV_LOG_ERROR,
> "FLV does not support sample rate %d, "
> "choose from (44100, 22050, 11025)\n",
> par->sample_rate);
> --
> 1.7.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] flv format support mp3 audio with 48khz

2016-09-27 Thread Steven Liu
2016-09-27 23:01 GMT+08:00 :

> From: frankos2 
>
> ---
>  libavformat/flvenc.c |8 
>  1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
> index 99903f5..296426a 100644
> --- a/libavformat/flvenc.c
> +++ b/libavformat/flvenc.c
> @@ -107,6 +107,13 @@ static int get_audio_flags(AVFormatContext *s,
> AVCodecParameters *par)
>  return FLV_CODECID_SPEEX | FLV_SAMPLERATE_11025HZ |
> FLV_SAMPLESSIZE_16BIT;
>  } else {
>  switch (par->sample_rate) {
> +case 48000:
> +if (par->codec_id == AV_CODEC_ID_MP3) {
> +flags |= FLV_SAMPLERATE_44100HZ;
>
maybe you want support 48000HZ for mp3?

> +break;
> +} else {
> +goto error;
> +}
>  case 44100:
>  flags |= FLV_SAMPLERATE_44100HZ;
>  break;
> @@ -124,6 +131,7 @@ static int get_audio_flags(AVFormatContext *s,
> AVCodecParameters *par)
>  break;
>  }
>  default:
> +error:
>  av_log(s, AV_LOG_ERROR,
> "FLV does not support sample rate %d, "
> "choose from (44100, 22050, 11025)\n",
> par->sample_rate);
> --
> 1.7.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] flv format support mp3 audio with 48khz

2016-09-27 Thread fu . qiuping
From: frankos2 

---
 libavformat/flvenc.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 99903f5..296426a 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -107,6 +107,13 @@ static int get_audio_flags(AVFormatContext *s, 
AVCodecParameters *par)
 return FLV_CODECID_SPEEX | FLV_SAMPLERATE_11025HZ | 
FLV_SAMPLESSIZE_16BIT;
 } else {
 switch (par->sample_rate) {
+case 48000:
+if (par->codec_id == AV_CODEC_ID_MP3) {
+flags |= FLV_SAMPLERATE_44100HZ;
+break;
+} else {
+goto error;
+}
 case 44100:
 flags |= FLV_SAMPLERATE_44100HZ;
 break;
@@ -124,6 +131,7 @@ static int get_audio_flags(AVFormatContext *s, 
AVCodecParameters *par)
 break;
 }
 default:
+error:
 av_log(s, AV_LOG_ERROR,
"FLV does not support sample rate %d, "
"choose from (44100, 22050, 11025)\n", par->sample_rate);
-- 
1.7.1

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


[FFmpeg-devel] (no subject)

2016-09-27 Thread fu . qiuping

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


Re: [FFmpeg-devel] [PATCH 1/3] avformat/hlsenc: support mkdir_p for use_localtime_mkdir

2016-09-27 Thread Steven Liu
2016-09-27 6:50 GMT+08:00 Michael Niedermayer :

> On Mon, Sep 26, 2016 at 04:04:32PM +0800, Steven Liu wrote:
> >
>
> >  hlsenc.c |   31 ++-
> >  1 file changed, 30 insertions(+), 1 deletion(-)
> > 8647c63d575b475e6e19b6427061787e39081bc4  0001-avformat-hlsenc-support-
> mkdir_p-for-use_localtime_mk.patch
> > From 4897d06fc1c9c4d9d302942b6e3ac8a8e25aa793 Mon Sep 17 00:00:00 2001
> > From: Steven Liu 
> > Date: Mon, 26 Sep 2016 13:50:31 +0800
> > Subject: [PATCH 1/3] avformat/hlsenc: support mkdir_p for
> use_localtime_mkdir
> >
> > when use use_localtime_mkdir to create multi level dir,
> > ffmpeg give error message:
> > ffmpeg -i ~/Movies/objectC/facebook.mp4 -c copy -use_localtime 1
> > -use_localtime_mkdir 1 -hls_segment_filename '%Y%m%d/file-%Y%m%d/%s.ts'
> > out.m3u8
> > error message:
> > Could not create directory 20160926/file-20160926 with
> use_localtime_mkdir
> > add mkdir_p for support the multi level dir
> >
> > Signed-off-by: Steven Liu 
> > ---
> >  libavformat/hlsenc.c | 31 ++-
> >  1 file changed, 30 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> > index 428bae4..ac79759 100644
> > --- a/libavformat/hlsenc.c
> > +++ b/libavformat/hlsenc.c
> > @@ -133,6 +133,35 @@ typedef struct HLSContext {
> >  double initial_prog_date_time;
> >  } HLSContext;
> >
> > +static int mkdir_p(const char *path) {
>
> > +char *temp = strdup(path);
>
> mixing malloc() based functions and av_malloc() is not safe
> av_strdup()
>
>
>
> > +char *pos = temp;
> > +
> > +if (!path) {
> > +return -1;
> > +}
> > +
> > +if (!strncmp(temp, "/", 1)) {
>
> missing allocation failure check
>
>
>
> > +pos++;
> > +} else if (!strncmp(temp, "./", 2)) {
> > +pos += 2;
> > +}
> > +for ( ; *pos != '\0'; ++pos) {
> > +if (*pos == '/') {
> > +*pos = '\0';
> > +mkdir(temp, 0755);
> > +*pos = '/';
> > +}
> > +}
> > +
> > +if (*(pos - 1) != '/') {
>
> all the '/' stuff looks non portable (windows)
>
> Hi Michael,
  Do you have any suggestion for portable (windows) with the
'/'(Linux/OSX/Unix) and '\'(Windows) ?

>
> [...]
>
>
> --
> 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.
>
> ___
> 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] FFmpeg 3.2

2016-09-27 Thread Sven C. Dack

On 27/09/16 14:30, Michael Niedermayer wrote:

Hi all

Its long since FFmpeg 3.1, so its time to make 3.2
ill branch release/3.2 off master and make 3.2 in maybe about a week or
2 unless something delays it

also a name needs to be choosen

Thanks


I narrowed it down for myself to Trump, Clinton and Fourier.

Hope this helps.

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


Re: [FFmpeg-devel] [PATCH 2/2] ffmpeg: stop using AVStream.codec on stream copy

2016-09-27 Thread James Almer
On 9/26/2016 10:28 PM, Michael Niedermayer wrote:
> On Mon, Sep 26, 2016 at 08:06:47PM -0300, James Almer wrote:
>> This commit is based on commit 35c8580 from Anton Khirnov 
>> which was skipped in b8945c4.
>>
>> The avcodec_copy_context() call in the encode path is left in place for now
>> as AVStream.codec is apparently still required even after porting ffmpeg to
>> the new bsf API.
>>
>> Signed-off-by: James Almer 
>> ---
>>  ffmpeg.c | 25 -
>>  ffmpeg.h |  1 +
>>  ffmpeg_opt.c |  3 +++
>>  3 files changed, 16 insertions(+), 13 deletions(-)
> 
> Tested-by: Michael

Applied, thanks.

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


Re: [FFmpeg-devel] [PATCH 2/3] lavf/mov.c: Make audio timestamps strictly monotonically increasing inside an edit list. Fixes gapless decoding. Adjust skip_samples field correctly in case of DISCARDed

2016-09-27 Thread Moritz Barsnick
On Mon, Sep 26, 2016 at 11:42:51 -0700, Sasi Inguva wrote:

> Subject: [FFmpeg-devel] [PATCH 2/3] lavf/mov.c: Make audio timestamps 
> strictly monotonically increasing inside an edit list. Fixes gapless 
> decoding. Adjust skip_samples field correctly in case of DISCARDed audio 
> frames.

Please wrap this, and leave a blank line between the (summary) title
line and the more verbose description when committing:

"lavf/mov.c: Make audio timestamps strictly monotonically increasing inside an 
edit list

Fixes gapless decoding. Adjust skip_samples field correctly in case of
DISCARDed audio frames."

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


[FFmpeg-devel] FFmpeg 3.2

2016-09-27 Thread Michael Niedermayer
Hi all

Its long since FFmpeg 3.1, so its time to make 3.2
ill branch release/3.2 off master and make 3.2 in maybe about a week or
2 unless something delays it

also a name needs to be choosen

Thanks
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator


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


Re: [FFmpeg-devel] [PATCH 2/2] swresample: Add swr_build_matrix()

2016-09-27 Thread Michael Niedermayer
On Tue, Sep 27, 2016 at 10:03:35AM -0300, James Almer wrote:
> On 9/27/2016 8:12 AM, Michael Niedermayer wrote:
> > On Thu, Aug 18, 2016 at 02:03:56AM +0200, Michael Niedermayer wrote:
> >> API and Doxy documentation is taken from avresample_build_matrix()
> >> Fixes: Ticket5780
> >>
> >> Signed-off-by: Michael Niedermayer 
> >> ---
> >>  libswresample/rematrix.c   | 157 
> >> +
> >>  libswresample/swresample.h |  31 +
> >>  2 files changed, 117 insertions(+), 71 deletions(-)
> > 
> > applied
> 
> You forgot APIchanges and version bump.

fixed, thanks

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

I have often repented speaking, but never of holding my tongue.
-- Xenocrates


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


[FFmpeg-devel] [PATCH] ffmpeg_vaapi: fix choice of decoder_format

2016-09-27 Thread Moritz Barsnick
As discovered and suggested by Mihai Chindea,
http://ffmpeg.org/pipermail/ffmpeg-devel/2016-September/198932.html

I have only inspected/reviewed this change visually, not tested.

Moritz
>From bc8437848870f6143d3cf5b3e615e865b0411ecf Mon Sep 17 00:00:00 2001
From: Moritz Barsnick 
Date: Tue, 27 Sep 2016 14:21:49 +0200
Subject: [PATCH] ffmpeg_vaapi: fix choice of decoder_format

The check could previously never evaluate to true, probably due to
a typo.

Reported-By: Mihai Chindea 
Signed-off-by: Moritz Barsnick 
---
 ffmpeg_vaapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffmpeg_vaapi.c b/ffmpeg_vaapi.c
index 8090597..f1e7c76 100644
--- a/ffmpeg_vaapi.c
+++ b/ffmpeg_vaapi.c
@@ -302,7 +302,7 @@ static int vaapi_build_decoder_config(VAAPIDecoderContext 
*ctx,
 if (ctx->output_format != AV_PIX_FMT_NONE &&
 ctx->output_format != AV_PIX_FMT_VAAPI) {
 for (i = 0; constraints->valid_sw_formats[i] != AV_PIX_FMT_NONE; i++) {
-if (constraints->valid_sw_formats[i] == ctx->decode_format) {
+if (constraints->valid_sw_formats[i] == ctx->output_format) {
 ctx->decode_format = ctx->output_format;
 av_log(ctx, AV_LOG_DEBUG, "Using decode format %s (output "
"format).\n", av_get_pix_fmt_name(ctx->decode_format));
-- 
2.7.4

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


Re: [FFmpeg-devel] [PATCH 2/2] swresample: Add swr_build_matrix()

2016-09-27 Thread James Almer
On 9/27/2016 8:12 AM, Michael Niedermayer wrote:
> On Thu, Aug 18, 2016 at 02:03:56AM +0200, Michael Niedermayer wrote:
>> API and Doxy documentation is taken from avresample_build_matrix()
>> Fixes: Ticket5780
>>
>> Signed-off-by: Michael Niedermayer 
>> ---
>>  libswresample/rematrix.c   | 157 
>> +
>>  libswresample/swresample.h |  31 +
>>  2 files changed, 117 insertions(+), 71 deletions(-)
> 
> applied

You forgot APIchanges and version bump.

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


Re: [FFmpeg-devel] [PATCH 3/4] V10 - SCTE-35 support in hlsenc

2016-09-27 Thread Moritz Barsnick
On Mon, Sep 26, 2016 at 10:59:46 -0700, Carlos Fernandez Sanz wrote:
> @@ -1,4 +1,4 @@
> -/*
> + /*

Stray accidental change.

> + * Refrence Material Used
Reference
> + * ANSI/SCTE 35 2013 ( Digital Program Insertion Cueing Message for Cable )
Drop the spaces next to the brackets.

Nit: There's also plenty of whitespace style violations: Too many
spaces near brackets, missing spaces near operators, "if(" instead of
"if (", and so on.

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


Re: [FFmpeg-devel] [PATCH 2/2] swresample: Add swr_build_matrix()

2016-09-27 Thread Michael Niedermayer
On Thu, Aug 18, 2016 at 02:03:56AM +0200, Michael Niedermayer wrote:
> API and Doxy documentation is taken from avresample_build_matrix()
> Fixes: Ticket5780
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  libswresample/rematrix.c   | 157 
> +
>  libswresample/swresample.h |  31 +
>  2 files changed, 117 insertions(+), 71 deletions(-)

applied

[...]
-- 
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] [PATCH] pass TLS args for RTSPS

2016-09-27 Thread Moritz Barsnick
On Mon, Sep 26, 2016 at 11:24:33 -0400, jayri...@gmail.com wrote:
> +{ "tls_verify", "Verify the peer certificate", OFFSET(verify), 
> AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC|ENC},
AV_OPT_TYPE_BOOL

> +{ "cert_file", "Certificate file", OFFSET(cert_file), 
> AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC|ENC },
> +{ "key_file", "Private key file", OFFSET(key_file),  AV_OPT_TYPE_STRING, 
> {.str = NULL}, 0, 0, DEC|ENC },

When all the other options' descriptions begin with non-capital
letters, why do these use capitals? (Exception: "Certificate Authority"
is probably fine.)

I can't judge on the rest (or can't support my opinions).

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


Re: [FFmpeg-devel] [PATCH 1/2] swresample: Use double and float for matrixes for best quality and speed

2016-09-27 Thread Michael Niedermayer
On Thu, Aug 18, 2016 at 02:03:55AM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libswresample/rematrix.c| 11 ++-
>  libswresample/swresample_internal.h |  3 ++-
>  2 files changed, 12 insertions(+), 2 deletions(-)

applied

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

Avoid a single point of failure, be that a person or equipment.


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


Re: [FFmpeg-devel] [PATCH 4/4] lavf/mp3dec: read encoder delay/padding from Info tag

2016-09-27 Thread wm4
On Mon, 26 Sep 2016 16:04:26 -0700
Jon Toohill  wrote:

> A similar concern was raised in a previous related patch:
> http://ffmpeg.org/pipermail/ffmpeg-devel/2016-May/194690.html
> I think the resolution at the time was to go ahead with using both, since
> both are used widely and serve slightly different purposes, although I do
> agree that it's confusing.
> 
> I think I could use AV_PKT_DATA_SKIP_SAMPLES here, and change mp3enc to use
> that to fill out the Info tag. But that only seems worthwhile to me if
> there is a general consensus to move to just AV_PKT_DATA_SKIP_SAMPLES (and
> deprecate/remove initial_padding and trailing_padding). If there's a
> concrete case where knowing trailing_padding at the start of a stream is
> necessary, then that's not possible, but I'm pretty new to this and don't
> know of one. Thoughts?

AV_PKT_DATA_SKIP_SAMPLES is FFmpeg's own "recent" solution for handling
gapless, the codecpar padding fields are Libav's newer solution for the
same problem. Libav doesn't have AV_PKT_DATA_SKIP_SAMPLES. There's also
AVCodecContext.delay, which is an older solution for the initial
padding. We're entering a real mess here. So we should make a conscious
decision about what mechanism should be used in the future, rather than
making an ad-hoc decision for a single patch. (And then probably
changing our opinion later, all contributing to furthering the mess.)

So we need to decide a few things:
- which mechanism should be used?
- should the older mechanism(s) be deprecated?
- do they conflict? how should compatibility be kept?
- should decoding (i.e. in AVCodecContext) use the newer mechanism to
  change output data, like with AV_PKT_DATA_SKIP_SAMPLES?
- should this patch be held back until a decision was made?

(Unless I'm missing something, which is possible.)

And of course we need to know how to make a decision, since we
apparently don't have a process for this in this project.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [OPW] OPW Project Proposal

2016-09-27 Thread Pallavi Kumari
Lou, Jean thanks for your suggestions. I will go through them meanwhile I
have finished a rough sketch of the idea. Please find it at [1].

[1]  https://wiki.mozilla.org/Atana/idea

On Tue, Sep 27, 2016 at 11:33 AM, Jean First  wrote:

> On Sun Sep 25 2016 14:32:25 GMT+0200 (CEST), Pallavi Kumari wrote:
>
> [...]
>
> > I want to propose the idea of implementing filters for ffmpeg that would
> > give different audio fingerprints for an audio which could be reused by
> > other people for variety of applications. Goal of this system is given a
> > song as a input, it would spits out similar sounding songs. Some of its
> > applications are:
> [...]
>
> Hi Pallavi,
>
> Your work could also be useful for applications similar to
> https://github.com/stendardo/shenidam
> Good luck with your work.
>
> Kind Regards,
> Jean
> ___
> 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 2/4] lavc/libmp3lame: set trailing_padding after flushing encoder

2016-09-27 Thread Carl Eugen Hoyos
2016-09-26 19:13 GMT+02:00 Jon Toohill :

> +avctx->trailing_padding = FFMAX(lame_get_encoder_padding(s->gfp) - 
> 528 - 1, 0);

Can you confirm that this function exists in lame 3.98.3?

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


Re: [FFmpeg-devel] [PATCH 2/2] lavf/mxfdec: begin utilizing the newly parsed widths and heights

2016-09-27 Thread Marton Balint


On Mon, 26 Sep 2016, Jan Ekstrom wrote:


On Sep 26, 2016 04:05, "Marton Balint"  wrote:


Overriding width/height with display width/height does not seem right, check 
what happens with a PAL IMX50 MXF file for example. If you want to signal this, 
then a stream side data with some AVPanScan values might make more sense.



Such a file was actually the reason why I started looking into this :)
. And it would all depend on the definition of width/height in
codecpar, which as far as I can tell is not clearly cut (see the notes
regarding container crop in at least the AVC decoder, I think?). My
understanding was that it would be the displayed width/height. Of
course, the container cropping/padding makes this less simple, since
you have:

1) Decoded picture
2) Decoder cropped picture (what the decoders *currently* output)
3) Decoder cropped picture cropped/padded according to available metadata

So my understanding was - since a decoder should output the pictures
according to 3) - that the displayed width/height fields should be
utilized for signaling the final display width/height of the picture.
The X/Y offset handling of course should have had its own fields
*somewhere* so that stuff could be done in some common part of avcodec
(for example). But if the codecpar->width/height is specified to 2)
(at least in lavf), then of course side data would be the correct way
to handle this. Also thanks for the hint regarding AVPanScan, I had no
idea this existed. Will have to check if it actually is used anywhere.



Thanks, I think it is 2) indeed. Also container width/height information 
is overridden from what is probed in the codec, so even if you set 
height to 576 in the demuxer part, later, when the first frame is 
analyzed, it will get written back to 608.


You might also check some earlier mails in a similar topic: 
http://ffmpeg.org/pipermail/ffmpeg-devel/2012-September/131203.html


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


Re: [FFmpeg-devel] [PATCH]lavf/riffenc: Always write unexpected channel_mask

2016-09-27 Thread Carl Eugen Hoyos
2016-09-27 9:38 GMT+02:00 Tobias Rapp :
> On 27.09.2016 09:02, Carl Eugen Hoyos wrote:
>>
>> 2016-09-27 8:49 GMT+02:00 Tobias Rapp :
>>>
>>> On 26.09.2016 12:39, Carl Eugen Hoyos wrote:
>>
 Attached patch allows to write arbitrary (mono) channel_masks
 even for 16bit 48kHz pcm audio.
>>>
>>> As far as I understand this patch is in response to
>>> https://ffmpeg.org/pipermail/ffmpeg-user/2016-September/033757.html
>>> but in my opinion it doesn't match Robert's use-case.
>>
>> Where do I claim this?
>
> It was how I interpreted the "just sent a patch" in
> https://ffmpeg.org/pipermail/ffmpeg-user/2016-September/033756.html .

"I just sent a patch after trying to interpret your report that
was missing command line and console output."

I only understood later what Robert needs and I believe it does
fix a (not extremely unusual) use-case.

>> Do you believe the patch is wrong or does something
>> unexpected?
>
> The patch looks fine, although I haven't actually tested it.
>
>>> Instead the "-channel_layout 0" input option should be fixed
>>
>> Please do send a patch!
>
> Some time ago I tried to work on it but it turned out to be quite difficult

> especially when adding some audio filters (amerge? pan?) to the pipeline.

This issue may have been fixed, some filters do not require a channel
layout anymore. In any case, fixing the issue for the no-filter case would
be a step forward imo.

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


Re: [FFmpeg-devel] [PATCH 1/4] V10 - Adding SCTE-35 CUI codec

2016-09-27 Thread Carl Eugen Hoyos
2016-09-26 19:59 GMT+02:00 Carlos Fernandez Sanz :
> From: Carlos Fernandez 
>
> Signed-off-by: Carlos Fernandez 
> ---
>  libavcodec/avcodec.h| 3 ++-
>  libavcodec/codec_desc.c | 6 ++
>  2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index b174116..0eee2ab 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -630,7 +630,8 @@ enum AVCodecID {
>  /* other specific kind of codecs (generally used for attachments) */
>  AV_CODEC_ID_FIRST_UNKNOWN = 0x18000,   ///< A dummy ID pointing 
> at the start of various fake codecs.
>  AV_CODEC_ID_TTF = 0x18000,
> -
> +AV_CODEC_ID_SCTE_35,/**< Contain no valid time stamp in DTS PTS of 
> avpacket, avpacket data contain time stamp
> +  in scte-35 format which is relative to DTS/PTS 
> of video stream */
>  AV_CODEC_ID_BINTEXT= 0x18800,

The empty line is there to make the list slightly more readable,
please do not remove it.

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


Re: [FFmpeg-devel] [PATCH]lavf/riffenc: Always write unexpected channel_mask

2016-09-27 Thread Tobias Rapp

On 27.09.2016 09:02, Carl Eugen Hoyos wrote:

2016-09-27 8:49 GMT+02:00 Tobias Rapp :

On 26.09.2016 12:39, Carl Eugen Hoyos wrote:



Attached patch allows to write arbitrary (mono) channel_masks
even for 16bit 48kHz pcm audio.


As far as I understand this patch is in response to
https://ffmpeg.org/pipermail/ffmpeg-user/2016-September/033757.html
but in my opinion it doesn't match Robert's use-case.


Where do I claim this?


It was how I interpreted the "just sent a patch" in 
https://ffmpeg.org/pipermail/ffmpeg-user/2016-September/033756.html .



Do you believe the patch is wrong or does something
unexpected?


The patch looks fine, although I haven't actually tested it.


Instead the "-channel_layout 0" input option should be fixed


Please do send a patch!


Some time ago I tried to work on it but it turned out to be quite 
difficult especially when adding some audio filters (amerge? pan?) to 
the pipeline. So finally I refrained from doing it. Maybe I will try 
again if I find some time.


Regards,
Tobias

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


Re: [FFmpeg-devel] [PATCH 1/2] movenc: use similar logic to DASH when writing bit rate to ISML

2016-09-27 Thread Carl Eugen Hoyos
2016-09-27 0:10 GMT+02:00 Jan Ekström :

>  avio_printf(pb, "<%s systemBitrate=\"%"PRId64"\">\n", type,
> -(int64_t)track->par->bit_rate);
> -param_write_int(pb, "systemBitrate", track->par->bit_rate);
> +(int64_t)manifest_bit_rate);

The cast looks unneeded (and ugly).

Please consider adding braces to the if-else clause you add above.

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


Re: [FFmpeg-devel] [PATCH 2/4] V10 - SCTE-35 extraction from mpegts

2016-09-27 Thread Marton Balint


On Mon, 26 Sep 2016, Carlos Fernandez Sanz wrote:


From: Carlos Fernandez 

Signed-off-by: Carlos Fernandez 
---
libavformat/mpegts.c | 64 ++--
1 file changed, 62 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index b31d233..ad6f141 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -725,6 +725,12 @@ static const StreamType HDMV_types[] = {
{ 0 },
};

+/* SCTE types */
+static const StreamType SCTE_types[] = {
+{ 0x86, AVMEDIA_TYPE_DATA,  AV_CODEC_ID_SCTE_35},
+{ 0 },
+};
+
/* ATSC ? */
static const StreamType MISC_types[] = {
{ 0x81, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 },
@@ -872,6 +878,13 @@ static void reset_pes_packet_state(PESContext *pes)
av_buffer_unref(&pes->buffer);
}

+static void new_data_packet(const uint8_t *buffer, int len, AVPacket *pkt)
+{
+av_init_packet(pkt);
+pkt->data = buffer;
+pkt->size = len;
+}
+
static int new_pes_packet(PESContext *pes, AVPacket *pkt)
{
char *sd;
@@ -1590,6 +1603,27 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t 
*section,
av_free(mp4_descr[i].dec_config_descr);
}

+static void scte_data_cb(MpegTSFilter *filter, const uint8_t *section,
+int section_len)
+{
+AVProgram *prg = NULL;
+MpegTSContext *ts = filter->u.section_filter.opaque;
+
+int idx = ff_find_stream_index(ts->stream, filter->pid);
+new_data_packet(section, section_len, ts->pkt);
+if (idx >= 0) {
+ts->pkt->stream_index = idx;
+}
+prg = av_find_program_from_stream(ts->stream, NULL, idx);
+if (prg && prg->pcr_pid != -1 && prg->discard != AVDISCARD_ALL) {
+MpegTSFilter *f = ts->pids[prg->pcr_pid];
+if(f)
+ts->pkt->pts = ts->pkt->dts = f->last_pcr/300;
+}
+ts->stop_parse = 1;
+
+}
+
static const uint8_t opus_coupled_stream_cnt[9] = {
1, 0, 1, 1, 2, 2, 2, 3, 3
};
@@ -1868,6 +1902,12 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, 
AVStream *st, int stream_type
return 0;
}

+static int is_pes_stream(int stream_type, uint32_t prog_reg_desc)
+{
+return !(stream_type == 0x13 ||
+ stream_type == 0x86 && prog_reg_desc == AV_RL32("CUEI"));
+}
+
static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
{
MpegTSContext *ts = filter->u.section_filter.opaque;
@@ -1975,7 +2015,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
pes->st->id = pes->pid;
}
st = pes->st;
-} else if (stream_type != 0x13) {
+
+} else if (is_pes_stream(stream_type, prog_reg_desc)) {
if (ts->pids[pid])
mpegts_close_filter(ts, ts->pids[pid]); // wrongly added sdt 
filter probably
pes = add_pes_stream(ts, pid, pcr_pid);
@@ -1994,7 +2035,9 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
if (!st)
goto out;
st->id = pid;
+mpegts_find_stream_type(st, stream_type, SCTE_types);
st->codecpar->codec_type = AVMEDIA_TYPE_DATA;
+mpegts_open_section_filter(ts, pid, scte_data_cb, ts, 1);


probably you only want to call these additional functions, if the data 
stream really is an SCTE section (if prog_reg_desc == AV_RL32("CUEI")).



}
}

@@ -2317,7 +2360,22 @@ static int handle_packet(MpegTSContext *ts, const 
uint8_t *packet)
}
}
}
-
+if(0) {


This is some leftover, which can be deleted?


+AVProgram *prg = NULL;
+int idx = ff_find_stream_index(ts->stream, pid);
+p++;
+new_data_packet(p,p_end - p, ts->pkt);
+if (idx >= 0) {
+ts->pkt->stream_index = idx;
+}
+prg = av_find_program_from_stream(ts->stream, prg, idx);
+if (prg->pcr_pid != -1 && prg->discard != AVDISCARD_ALL) {
+MpegTSFilter *f = ts->pids[prg->pcr_pid];
+if(f)
+ts->pkt->pts = ts->pkt->dts = f->last_pcr/300;
+}
+ts->stop_parse = 1;
+}
} else {
int ret;
// Note: The position here points actually behind the current packet.
@@ -2730,6 +2788,8 @@ static int mpegts_read_packet(AVFormatContext *s, 
AVPacket *pkt)
ret = 0;
break;
}
+} else if (ts->pids[i] && ts->pids[i]->type == MPEGTS_SECTION) {
+return ret;


Why do you need this hunk? I think you can delete it, and everything will 
remain working. This loop flushes existing half-read PES packets, so you 
cannot simply return in the middle of the loop.


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


Re: [FFmpeg-devel] [PATCH]lavf/mpegtsenc: Set min PID for data pkt to 0x0010

2016-09-27 Thread Carl Eugen Hoyos
2016-09-27 5:42 GMT+02:00 Andrey Turkin :
> Nevermind, I didn't though this through. Default value is high enough to
> comply with all standards.

I'll apply the patch if there are no objections.

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


Re: [FFmpeg-devel] [PATCH 2/2] avisynth: fix Planar RGB output

2016-09-27 Thread Carl Eugen Hoyos
2016-09-27 6:45 GMT+02:00 Stephen Hutchinson :

> Ping.

Consider sending your public key to Michael, you maintain this code.

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


Re: [FFmpeg-devel] [PATCH 1/2] compat/avisynth: minor update for alpha offsets

2016-09-27 Thread Carl Eugen Hoyos
2016-08-31 16:16 GMT+02:00 Stephen Hutchinson :
> On 8/31/2016 9:37 AM, Carl Eugen Hoyos wrote:
>>
>> 2016-08-31 2:26 GMT+02:00 Stephen Hutchinson :
>>>
>>> -//AVS_CPUF_AVX= 0x800,   //  Sandy Bridge, Bulldozer
>>> +  AVS_CPUF_AVX= 0x800,   //  Sandy Bridge, Bulldozer
>>
>>
>> Is this related to alpha offsets?
>>
>
> It's part of the changes to the header upstream.

Then "sync with upstream header" would be less confusing imo.

Sorry for missing your message, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavf/riffenc: Always write unexpected channel_mask

2016-09-27 Thread Carl Eugen Hoyos
2016-09-27 8:49 GMT+02:00 Tobias Rapp :
> On 26.09.2016 12:39, Carl Eugen Hoyos wrote:

>> Attached patch allows to write arbitrary (mono) channel_masks
>> even for 16bit 48kHz pcm audio.
>
> As far as I understand this patch is in response to
> https://ffmpeg.org/pipermail/ffmpeg-user/2016-September/033757.html
> but in my opinion it doesn't match Robert's use-case.

Where do I claim this?

Do you believe the patch is wrong or does something
unexpected?

> Instead the "-channel_layout 0" input option should be fixed

Please do send a patch!

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