Re: [FFmpeg-devel] [PATCH v2] lavf/movenc: suggest video_track_timescale for invalid timescale

2016-10-12 Thread Nicolas George
Le decadi 20 vendémiaire, an CCXXV, Josh de Kock a écrit :
> Fixes ticket #5882. While it doesn't automatically set the timescale
> for the user as that would destroy data without prompt, it will tell
> the user how they could set the timescale (as this is mostly likely
> what they want).
> 
> Signed-off-by: Josh de Kock 
> ---
> 
> >Would it be useful to print the max duration?
>  I'm not entirely sure, open to suggestions though.
> 
>  libavformat/movenc.c | 9 +++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index d7c7158..6bada25 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -5677,11 +5677,16 @@ static int mov_write_header(AVFormatContext *s)
>  ret = AVERROR(EINVAL);
>  goto error;
>  }
> -if (track->mode == MODE_MOV && track->timescale > 10)
> +if (track->mode == MODE_MOV && track->timescale > 10) {
> +/* NOTE: forcing setting the suggested timescale manually 
> means ffmpeg won't destroy
> + * timestamps without explicit instruction. */
> +unsigned int suggested = (unsigned 
> int)av_rescale(st->time_base.den, 1000, st->time_base.num);
>  av_log(s, AV_LOG_WARNING,
> "WARNING codec timebase is very high. If duration is 
> too long,\n"
> "file may not be playable by quicktime. Specify a 
> shorter timebase\n"
> -   "or choose different container.\n");

> +   "or choose different container. Using 
> -video_track_timescale %d\n"

Nit: the leading dash is specific to the command-line tools. At the library
level, the option is named just "video_track_timescale".

> +   "may fix this issue.\n", suggested);
> +}
>  if (track->mode == MODE_MOV &&
>  track->par->codec_id == AV_CODEC_ID_RAWVIDEO &&
>  track->tag == MKTAG('r','a','w',' ')) {

Regards,

-- 
  Nicolas George


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


[FFmpeg-devel] [PATCH] add hds demuxer

2016-10-12 Thread Steven Liu
init add hds demuxer

Based-on: patch by CORY MCCARTHY 
Based-on: patch by Gorilla Maguila 
Signed-off-by: Steven Liu 
---
 configure |5 +
 libavformat/Makefile  |1 +
 libavformat/allformats.c  |2 +-
 libavformat/amfmetadata.c |  219 +
 libavformat/amfmetadata.h |   39 +++
 libavformat/f4fbox.c  |  381 +++
 libavformat/f4fbox.h  |   95 ++
 libavformat/f4mmanifest.c |  324 +++
 libavformat/f4mmanifest.h |   59 
 libavformat/flvtag.c  |  370 ++
 libavformat/flvtag.h  |   32 ++
 libavformat/hdsdec.c  |  759 +
 12 files changed, 2285 insertions(+), 1 deletions(-)
 create mode 100644 libavformat/amfmetadata.c
 create mode 100644 libavformat/amfmetadata.h
 create mode 100644 libavformat/f4fbox.c
 create mode 100644 libavformat/f4fbox.h
 create mode 100644 libavformat/f4mmanifest.c
 create mode 100644 libavformat/f4mmanifest.h
 create mode 100644 libavformat/flvtag.c
 create mode 100644 libavformat/flvtag.h
 create mode 100644 libavformat/hdsdec.c

diff --git a/configure b/configure
index 8fc71fb..d695e29 100755
--- a/configure
+++ b/configure
@@ -295,6 +295,7 @@ External library support:
on OSX if openssl and gnutls are not used 
[autodetect]
   --enable-x11grab enable X11 grabbing (legacy) [no]
   --disable-xlib   disable xlib [autodetect]
+  --disable-xml2   disable XML parsing using the C library libxml2 
[autodetect]
   --disable-zlib   disable zlib [autodetect]
 
   The following libraries provide various hardware acceleration features:
@@ -1552,6 +1553,7 @@ EXTERNAL_LIBRARY_LIST="
 videotoolbox
 x11grab
 xlib
+xml2
 zlib
 "
 
@@ -2854,6 +2856,7 @@ eac3_demuxer_select="ac3_parser"
 f4v_muxer_select="mov_muxer"
 fifo_muxer_deps="threads"
 flac_demuxer_select="flac_parser"
+hds_demuxer_select="xml2"
 hds_muxer_select="flv_muxer"
 hls_muxer_select="mpegts_muxer"
 image2_alias_pix_demuxer_select="image2_demuxer"
@@ -5627,6 +5630,8 @@ disabled  zlib || check_lib   zlib.h  zlibVersion -lz 
  || disable  zlib
 disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
 disabled  lzma || check_lib2  lzma.h lzma_version_number -llzma || disable lzma
 
+disabled xml2 || require_pkg_config libxml-2.0 libxml2/libxml/xmlversion.h 
xmlCheckVersion || disable xml2
+
 check_lib math.h sin -lm && LIBM="-lm"
 disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h 
DtsCrystalHDVersion -lcrystalhd || disable crystalhd
 
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 5d827d3..e2b4dd4 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -202,6 +202,7 @@ OBJS-$(CONFIG_H264_DEMUXER)  += h264dec.o 
rawdec.o
 OBJS-$(CONFIG_H264_MUXER)+= rawenc.o
 OBJS-$(CONFIG_HASH_MUXER)+= hashenc.o
 OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
+OBJS-$(CONFIG_HDS_DEMUXER)   += hdsdec.o amfmetadata.o 
f4mmanifest.o f4fbox.o flvtag.o
 OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
 OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o
 OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 6a216ef..39505c3 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -146,9 +146,9 @@ void av_register_all(void)
 REGISTER_MUXDEMUX(H263, h263);
 REGISTER_MUXDEMUX(H264, h264);
 REGISTER_MUXER   (HASH, hash);
-REGISTER_MUXER   (HDS,  hds);
 REGISTER_MUXDEMUX(HEVC, hevc);
 REGISTER_MUXDEMUX(HLS,  hls);
+REGISTER_MUXDEMUX(HDS,  hds);
 REGISTER_DEMUXER (HNM,  hnm);
 REGISTER_MUXDEMUX(ICO,  ico);
 REGISTER_DEMUXER (IDCIN,idcin);
diff --git a/libavformat/amfmetadata.c b/libavformat/amfmetadata.c
new file mode 100644
index 000..0e7a2ea
--- /dev/null
+++ b/libavformat/amfmetadata.c
@@ -0,0 +1,219 @@
+/*
+ * Adobe Action Message Format Parser
+ * Copyright (c) 2013 Cory McCarthy
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+

Re: [FFmpeg-devel] [PATCH] add hds demuxer

2016-10-12 Thread Steven Liu
patch update!

fix tool/patcheck warning!

2016-10-12 15:56 GMT+08:00 Steven Liu :

> init add hds demuxer
>
> Based-on: patch by CORY MCCARTHY 
> Based-on: patch by Gorilla Maguila 
> Signed-off-by: Steven Liu 
> ---
>  configure |5 +
>  libavformat/Makefile  |1 +
>  libavformat/allformats.c  |2 +-
>  libavformat/amfmetadata.c |  219 +
>  libavformat/amfmetadata.h |   39 +++
>  libavformat/f4fbox.c  |  381 +++
>  libavformat/f4fbox.h  |   95 ++
>  libavformat/f4mmanifest.c |  324 +++
>  libavformat/f4mmanifest.h |   59 
>  libavformat/flvtag.c  |  370 ++
>  libavformat/flvtag.h  |   32 ++
>  libavformat/hdsdec.c  |  759 ++
> +++
>  12 files changed, 2285 insertions(+), 1 deletions(-)
>  create mode 100644 libavformat/amfmetadata.c
>  create mode 100644 libavformat/amfmetadata.h
>  create mode 100644 libavformat/f4fbox.c
>  create mode 100644 libavformat/f4fbox.h
>  create mode 100644 libavformat/f4mmanifest.c
>  create mode 100644 libavformat/f4mmanifest.h
>  create mode 100644 libavformat/flvtag.c
>  create mode 100644 libavformat/flvtag.h
>  create mode 100644 libavformat/hdsdec.c
>
> diff --git a/configure b/configure
> index 8fc71fb..d695e29 100755
> --- a/configure
> +++ b/configure
> @@ -295,6 +295,7 @@ External library support:
> on OSX if openssl and gnutls are not used
> [autodetect]
>--enable-x11grab enable X11 grabbing (legacy) [no]
>--disable-xlib   disable xlib [autodetect]
> +  --disable-xml2   disable XML parsing using the C library
> libxml2 [autodetect]
>--disable-zlib   disable zlib [autodetect]
>
>The following libraries provide various hardware acceleration features:
> @@ -1552,6 +1553,7 @@ EXTERNAL_LIBRARY_LIST="
>  videotoolbox
>  x11grab
>  xlib
> +xml2
>  zlib
>  "
>
> @@ -2854,6 +2856,7 @@ eac3_demuxer_select="ac3_parser"
>  f4v_muxer_select="mov_muxer"
>  fifo_muxer_deps="threads"
>  flac_demuxer_select="flac_parser"
> +hds_demuxer_select="xml2"
>  hds_muxer_select="flv_muxer"
>  hls_muxer_select="mpegts_muxer"
>  image2_alias_pix_demuxer_select="image2_demuxer"
> @@ -5627,6 +5630,8 @@ disabled  zlib || check_lib   zlib.h
> zlibVersion -lz   || disable  zlib
>  disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable
> bzlib
>  disabled  lzma || check_lib2  lzma.h lzma_version_number -llzma ||
> disable lzma
>
> +disabled xml2 || require_pkg_config libxml-2.0
> libxml2/libxml/xmlversion.h xmlCheckVersion || disable xml2
> +
>  check_lib math.h sin -lm && LIBM="-lm"
>  disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h
> DtsCrystalHDVersion -lcrystalhd || disable crystalhd
>
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index 5d827d3..e2b4dd4 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -202,6 +202,7 @@ OBJS-$(CONFIG_H264_DEMUXER)  += h264dec.o
> rawdec.o
>  OBJS-$(CONFIG_H264_MUXER)+= rawenc.o
>  OBJS-$(CONFIG_HASH_MUXER)+= hashenc.o
>  OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
> +OBJS-$(CONFIG_HDS_DEMUXER)   += hdsdec.o amfmetadata.o
> f4mmanifest.o f4fbox.o flvtag.o
>  OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
>  OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o
>  OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o
> diff --git a/libavformat/allformats.c b/libavformat/allformats.c
> index 6a216ef..39505c3 100644
> --- a/libavformat/allformats.c
> +++ b/libavformat/allformats.c
> @@ -146,9 +146,9 @@ void av_register_all(void)
>  REGISTER_MUXDEMUX(H263, h263);
>  REGISTER_MUXDEMUX(H264, h264);
>  REGISTER_MUXER   (HASH, hash);
> -REGISTER_MUXER   (HDS,  hds);
>  REGISTER_MUXDEMUX(HEVC, hevc);
>  REGISTER_MUXDEMUX(HLS,  hls);
> +REGISTER_MUXDEMUX(HDS,  hds);
>  REGISTER_DEMUXER (HNM,  hnm);
>  REGISTER_MUXDEMUX(ICO,  ico);
>  REGISTER_DEMUXER (IDCIN,idcin);
> diff --git a/libavformat/amfmetadata.c b/libavformat/amfmetadata.c
> new file mode 100644
> index 000..0e7a2ea
> --- /dev/null
> +++ b/libavformat/amfmetadata.c
> @@ -0,0 +1,219 @@
> +/*
> + * Adobe Action Message Format Parser
> + * Copyright (c) 2013 Cory McCarthy
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PART

Re: [FFmpeg-devel] [PATCH 2/3] lavc/mediacodecdec: rename dequeued_buffer_nb to output_buffer_count

2016-10-12 Thread Matthieu Bouron
On Tue, Oct 11, 2016 at 10:24 AM, Matthieu Bouron  wrote:

>
>
> On Thu, Oct 6, 2016 at 2:31 PM, Matthieu Bouron  > wrote:
>
>> From: Matthieu Bouron 
>>
>> ---
>>  libavcodec/mediacodecdec.c | 6 +++---
>>  libavcodec/mediacodecdec.h | 2 +-
>>  2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c
>> index 2ab173b..3d519ca 100644
>> --- a/libavcodec/mediacodecdec.c
>> +++ b/libavcodec/mediacodecdec.c
>> @@ -427,7 +427,7 @@ static int mediacodec_dec_flush_codec(AVCodecContext
>> *avctx, MediaCodecDecContex
>>  FFAMediaCodec *codec = s->codec;
>>  int status;
>>
>> -s->dequeued_buffer_nb = 0;
>> +s->output_buffer_count = 0;
>>
>>  s->draining = 0;
>>  s->flushing = 0;
>> @@ -621,7 +621,7 @@ int ff_mediacodec_dec_decode(AVCodecContext *avctx,
>> MediaCodecDecContext *s,
>>  /* If the codec is flushing or need to be flushed, block for a
>> fair
>>   * amount of time to ensure we got a frame */
>>  output_dequeue_timeout_us = OUTPUT_DEQUEUE_BLOCK_TIMEOUT_US;
>> -} else if (s->dequeued_buffer_nb == 0) {
>> +} else if (s->output_buffer_count == 0) {
>>  /* If the codec hasn't produced any frames, do not block so we
>>   * can push data to it as fast as possible, and get the first
>>   * frame */
>> @@ -661,7 +661,7 @@ int ff_mediacodec_dec_decode(AVCodecContext *avctx,
>> MediaCodecDecContext *s,
>>  }
>>
>>  *got_frame = 1;
>> -s->dequeued_buffer_nb++;
>> +s->output_buffer_count++;
>>  } else {
>>  status = ff_AMediaCodec_releaseOutputBuffer(codec, index,
>> 0);
>>  if (status < 0) {
>> diff --git a/libavcodec/mediacodecdec.h b/libavcodec/mediacodecdec.h
>> index 52c8bf1..7b0b7bb 100644
>> --- a/libavcodec/mediacodecdec.h
>> +++ b/libavcodec/mediacodecdec.h
>> @@ -59,7 +59,7 @@ typedef struct MediaCodecDecContext {
>>  int crop_left;
>>  int crop_right;
>>
>> -uint64_t dequeued_buffer_nb;
>> +uint64_t output_buffer_count;
>>
>>  } MediaCodecDecContext;
>>
>> --
>> 2.10.0
>>
>>
> If there is no objection I will push both patches in a few hours.
>

Applied.

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


[FFmpeg-devel] Please feel free to take my patch, modify and apply it

2016-10-12 Thread Alexey Eromenko
Dear ffmpeg community,

I don't have too much time to spend on this (Apple) issue, but I did
my best, including providing test material, bug report and a possible
patch.

If you modify, you can change name to your own, of course.

Best wishes,
-- 
-Alexey Eromenko "Technologov"
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec/vda: define av_vda_default_init2 when CONFIG_H264_VDA_HWACCEL equ 0

2016-10-12 Thread Steven Liu
on OSX:
../configure --disable-everything --enable-demuxer=hls make
error message: Undefined symbols for architecture x86_64:
"_av_vda_default_init2", referenced from:_videotoolbox_init in
ffmpeg_videotoolbox.o
so add av_vda_default_init2 when CONFIG_H264_VDA_HWACCEL=0

Signed-off-by: Steven Liu 
---
 libavcodec/vda.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/vda.c b/libavcodec/vda.c
index 4670140..819ae03 100644
--- a/libavcodec/vda.c
+++ b/libavcodec/vda.c
@@ -73,6 +73,11 @@ int av_vda_default_init(AVCodecContext *avctx)
 return AVERROR(ENOSYS);
 }
 
+int av_vda_default_init2(AVCodecContext *avctx, AVVDAContext *vdactx)
+{
+return AVERROR(ENOSYS);
+}
+
 void av_vda_default_free(AVCodecContext *ctx)
 {
 }
-- 
1.7.1



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


Re: [FFmpeg-devel] [PATCH] Apple Quicktime fix

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

On Oct 11, 2016 2:40 PM, "Alexey Eromenko"  wrote:
>
> On Tue, Oct 11, 2016 at 8:29 PM, Josh de Kock  wrote:
> > On 11/10/2016 18:24, Alexey Eromenko wrote:
> >>
> >> ---
> >>  libavformat/movenc.c | 14 +-
> >>  1 file changed, 9 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> >> index 8b4aa5f..0e2fc55 100644
> >> --- a/libavformat/movenc.c
> >> +++ b/libavformat/movenc.c
> >> @@ -5666,16 +5666,20 @@ static int mov_write_header(AVFormatContext *s)
> >>  while(track->timescale < 1)
> >>  track->timescale *= 2;
> >>  }
> >> +if (track->timescale > 10 &&
> >> (!mov->video_track_timescale)) {
> >
> > As I said before, having this as 'default' behaviour would interfere
with
> > large, but correct timescales. This should only be a suggestion to the
user.
> >
>
> This happens only for very high timescale from source video, and it
> seems to work on Apple QuickTime/iTunes, WMP and VLC.
> For the vast majority videos (99%+), I _do not_ touch the timebase.
> And when I do touch, I give a WARNING to the user.
> Plus I offer to override this decision via a parameter.
> It should be stable and regression-free for most of our users.
> Is there any downside for this approach ?
>
> >> +unsigned int timescale_new = (unsigned
> >> int)((double)(st->time_base.den)
> >> +* 1000 / (double)(st->time_base.num));
> >
> > You surely don't need all these casts.
>
> Unless I'm guaranteed to get int64 on ALL platforms, I don't see
> how-to write this code without casts to double-float. Int32 will
> over-flow, even unsigned.
> I can do the multiply after the division, but afraid of losing precision.
> And since this is not a real-time code anyway, I consider this an
> "okay" trade-off.
> Feel free to replace it with a better alternative.

We use int64_t all over the place, it's OK to rely on it since it
guarantees the same result across archs, which floats don't.

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


Re: [FFmpeg-devel] [PATCH] Apple Quicktime fix / MP4 and MOV Timebase

2016-10-12 Thread Josh de Kock

On 11/10/2016 22:53, Moritz Barsnick wrote:

On Tue, Oct 11, 2016 at 19:32:14 +0100, Josh de Kock wrote:

On 11/10/2016 18:24, Alexey Eromenko wrote:

*** BLURB HERE ***


This commit message isn't very useful, it doesn't describe the change at
all. See:
https://www.ffmpeg.org/developer.html#Patches_002fCommitting


That's the cover letter "git format-patch --cover-letter" creates for
you, but you need to/should edit it before sending. The proper patch
has the commit message from your local repo.

(I too have quite a hassle with creating the intermediate files,
reformatting the subjects when sending and so on. Perhaps I just
haven't gotten the flow of git well enough.)



Pretty sure 'Apple Quicktime fix' was the commit message, which, of 
course, isn't very descriptive. Correct me if I'm wrong though.


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


Re: [FFmpeg-devel] [PATCH v2] lavf/movenc: suggest video_track_timescale for invalid timescale

2016-10-12 Thread Carl Eugen Hoyos
2016-10-11 21:06 GMT+02:00 Josh de Kock :
> Fixes ticket #5882.

I don't object but I don't think it is correct.

> While it doesn't automatically set the timescale
> for the user as that would destroy data without prompt, it will tell
> the user how they could set the timescale (as this is mostly likely
> what they want).
>
> Signed-off-by: Josh de Kock 
> ---
>
>>Would it be useful to print the max duration?
>  I'm not entirely sure, open to suggestions though.
>
>  libavformat/movenc.c | 9 +++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index d7c7158..6bada25 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -5677,11 +5677,16 @@ static int mov_write_header(AVFormatContext *s)
>  ret = AVERROR(EINVAL);
>  goto error;
>  }
> -if (track->mode == MODE_MOV && track->timescale > 10)
> +if (track->mode == MODE_MOV && track->timescale > 10) {
> +/* NOTE: forcing setting the suggested timescale manually 
> means ffmpeg won't destroy
> + * timestamps without explicit instruction. */

> +unsigned int suggested = (unsigned 
> int)av_rescale(st->time_base.den, 1000, st->time_base.num);

If we go this way (I am not completely convinced about it), we definitely need
a heuristic that suggests 24000 for 1000/417083 fps and 3 if applicable.

>  av_log(s, AV_LOG_WARNING,
> "WARNING codec timebase is very high. If duration is 
> too long,\n"
> "file may not be playable by quicktime. Specify a 
> shorter timebase\n"
> -   "or choose different container.\n");
> +   "or choose different container. Using 
> -video_track_timescale %d\n"
> +   "may fix this issue.\n", suggested);

I believe this should also suggest to "force a sane framerate" as an
alternative.

Suggesting video_track_timescale is very useful, thank you!

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


[FFmpeg-devel] [PATCH] avformat/flvenc: do not write duration and filesize when cannot seekable

2016-10-12 Thread Steven Liu
when living stream cannot seekable, don't write duration and
filesize in metadata, and donnot seek at the flv_write_trailer

Signed-off-by: Steven Liu 
---
 libavformat/flvenc.c |   49 -
 1 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 99903f5..e50f8e4 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -234,16 +234,18 @@ static void write_metadata(AVFormatContext *s, unsigned 
int ts)
 metadata_count_pos = avio_tell(pb);
 metadata_count = 4 * !!flv->video_par +
  5 * !!flv->audio_par +
- 1 * !!flv->data_par  +
- 2; // +2 for duration and file size
-
+ 1 * !!flv->data_par;
+if (pb->seekable) {
+metadata_count += 2; // +2 for duration and file size
+}
 avio_wb32(pb, metadata_count);
 
-put_amf_string(pb, "duration");
-flv->duration_offset = avio_tell(pb);
-
-// fill in the guessed duration, it'll be corrected later if incorrect
-put_amf_double(pb, s->duration / AV_TIME_BASE);
+if (pb->seekable) {
+put_amf_string(pb, "duration");
+flv->duration_offset = avio_tell(pb);
+// fill in the guessed duration, it'll be corrected later if incorrect
+put_amf_double(pb, s->duration / AV_TIME_BASE);
+}
 
 if (flv->video_par) {
 put_amf_string(pb, "width");
@@ -319,9 +321,11 @@ static void write_metadata(AVFormatContext *s, unsigned 
int ts)
 metadata_count++;
 }
 
-put_amf_string(pb, "filesize");
-flv->filesize_offset = avio_tell(pb);
-put_amf_double(pb, 0); // delayed write
+if (pb->seekable) {
+put_amf_string(pb, "filesize");
+flv->filesize_offset = avio_tell(pb);
+put_amf_double(pb, 0); // delayed write
+}
 
 put_amf_string(pb, "");
 avio_w8(pb, AMF_END_OF_OBJECT);
@@ -543,16 +547,19 @@ static int flv_write_trailer(AVFormatContext *s)
 
 file_size = avio_tell(pb);
 
-/* update information */
-if (avio_seek(pb, flv->duration_offset, SEEK_SET) < 0)
-av_log(s, AV_LOG_WARNING, "Failed to update header with correct 
duration.\n");
-else
-put_amf_double(pb, flv->duration / (double)1000);
-if (avio_seek(pb, flv->filesize_offset, SEEK_SET) < 0)
-av_log(s, AV_LOG_WARNING, "Failed to update header with correct 
filesize.\n");
-else
-put_amf_double(pb, file_size);
-
+if (pb->seekable) {
+/* update information */
+if (avio_seek(pb, flv->duration_offset, SEEK_SET) < 0) {
+av_log(s, AV_LOG_WARNING, "Failed to update header with correct 
duration.\n");
+} else {
+put_amf_double(pb, flv->duration / (double)1000);
+}
+if (avio_seek(pb, flv->filesize_offset, SEEK_SET) < 0) {
+av_log(s, AV_LOG_WARNING, "Failed to update header with correct 
filesize.\n");
+} else {
+put_amf_double(pb, file_size);
+}
+}
 avio_seek(pb, file_size, SEEK_SET);
 return 0;
 }
-- 
1.7.1



___
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-10-12 Thread Carl Eugen Hoyos
2016-10-11 10:13 GMT+02:00 Carl Eugen Hoyos :
> 2016-09-26 12:39 GMT+02:00 Carl Eugen Hoyos :
>
>> Attached patch allows to write arbitrary (mono) channel_masks
>> even for 16bit 48kHz pcm audio.
>
> I'll push this if there are no objections.

Patch applied.

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


Re: [FFmpeg-devel] FFmpeg at LinuxCon 2016

2016-10-12 Thread Thilo Borgmann
Hi,

> FFmpeg will have a booth at the LinuxCon Europe 2016 in Berlin, Germany from
> Oct. 4th to Oct 6th!
> 
> The booth will be manned with Thomas Volkert and me, everyone interested is
> welcome to visit us and the rest of the LinuxCon.
> 
> Find more details about the LinuxCon at the Linux Foundations events website:
> 
> http://events.linuxfoundation.org/events/linuxcon-europe

The conference went fine and we had a lot of people there talking to us at the
booth. We got great feedback about our work and spread the word about FFmpeg at
that business-related conference.

Thomas has (all) the photos being taken there and will hopefully update the
social media about that soon.


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


Re: [FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts

2016-10-12 Thread Carl Eugen Hoyos
2016-10-11 15:52 GMT+02:00 Ståle kristoffersen :

> I have some transport streams with only one pid, containing MJPEG 2000
> video. Since the PMT/PAT is missing ffmpeg is unable to decode it.

Do you also have samples that can be decoded by FFmpeg? (We don't)
How are your samples produced? Do you have a way to playback the
samples now without FFmpeg? I ask because I would love to see this
patch tested:
https://ffmpeg.org/pipermail/ffmpeg-devel/2015-August/177303.html

> The attached patch makes ffmpeg able to guess that it does contain a
> stream of jpeg 2000, but I am not sure if this is the correct approach.

The approach is correct but if you want to improve the patch, it should
look more like the mjpeg probe function and return a higher score if
more valid frames can be found.

> Also, should LIBAVFORMAT_VERSION_MICRO

It should be MINOR since you add a new symbol to the library.

> and the Changelog be updated?

I don't Changelog should be updated for this patch.

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


Re: [FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts

2016-10-12 Thread Carl Eugen Hoyos
2016-10-11 16:27 GMT+02:00 Michael Niedermayer :

> also the img2 demuxer for mjpeg2000 from img2dec.c does not work
> for this ?

We separated the jpg from the mjpeg probe, jpg makes sure that the
sample starts like a jpg image and contains an end marker and can
be decoded, mjpeg probe is less strict but requires more than one
frame.
Same could be argued for j2k or was our reasoning bad?

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


Re: [FFmpeg-devel] [PATCH] add hds demuxer

2016-10-12 Thread Michael Niedermayer
On Wed, Oct 12, 2016 at 03:56:49PM +0800, Steven Liu wrote:
> init add hds demuxer
> 
> Based-on: patch by CORY MCCARTHY 
> Based-on: patch by Gorilla Maguila 
> Signed-off-by: Steven Liu 
> ---
>  configure |5 +
>  libavformat/Makefile  |1 +
>  libavformat/allformats.c  |2 +-
>  libavformat/amfmetadata.c |  219 +
>  libavformat/amfmetadata.h |   39 +++
>  libavformat/f4fbox.c  |  381 +++
>  libavformat/f4fbox.h  |   95 ++
>  libavformat/f4mmanifest.c |  324 +++
>  libavformat/f4mmanifest.h |   59 
>  libavformat/flvtag.c  |  370 ++
>  libavformat/flvtag.h  |   32 ++
>  libavformat/hdsdec.c  |  759 
> +
>  12 files changed, 2285 insertions(+), 1 deletions(-)
>  create mode 100644 libavformat/amfmetadata.c
>  create mode 100644 libavformat/amfmetadata.h
>  create mode 100644 libavformat/f4fbox.c
>  create mode 100644 libavformat/f4fbox.h
>  create mode 100644 libavformat/f4mmanifest.c
>  create mode 100644 libavformat/f4mmanifest.h
>  create mode 100644 libavformat/flvtag.c
>  create mode 100644 libavformat/flvtag.h
>  create mode 100644 libavformat/hdsdec.c
> 
> diff --git a/configure b/configure
> index 8fc71fb..d695e29 100755
> --- a/configure
> +++ b/configure
> @@ -295,6 +295,7 @@ External library support:
> on OSX if openssl and gnutls are not used 
> [autodetect]
>--enable-x11grab enable X11 grabbing (legacy) [no]
>--disable-xlib   disable xlib [autodetect]
> +  --disable-xml2   disable XML parsing using the C library libxml2 
> [autodetect]
>--disable-zlib   disable zlib [autodetect]
>  
>The following libraries provide various hardware acceleration features:
> @@ -1552,6 +1553,7 @@ EXTERNAL_LIBRARY_LIST="
>  videotoolbox
>  x11grab
>  xlib
> +xml2
>  zlib
>  "
>  
> @@ -2854,6 +2856,7 @@ eac3_demuxer_select="ac3_parser"
>  f4v_muxer_select="mov_muxer"
>  fifo_muxer_deps="threads"
>  flac_demuxer_select="flac_parser"
> +hds_demuxer_select="xml2"
>  hds_muxer_select="flv_muxer"
>  hls_muxer_select="mpegts_muxer"
>  image2_alias_pix_demuxer_select="image2_demuxer"
> @@ -5627,6 +5630,8 @@ disabled  zlib || check_lib   zlib.h  zlibVersion 
> -lz   || disable  zlib
>  disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
>  disabled  lzma || check_lib2  lzma.h lzma_version_number -llzma || disable 
> lzma
>  
> +disabled xml2 || require_pkg_config libxml-2.0 libxml2/libxml/xmlversion.h 
> xmlCheckVersion || disable xml2
> +
>  check_lib math.h sin -lm && LIBM="-lm"
>  disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h 
> DtsCrystalHDVersion -lcrystalhd || disable crystalhd

this breaks build without libxml2

../configure --cc='ccache x86_64-w64-mingw32-gcc'   --arch=x86_64 
--target-os=mingw32 --cross-prefix=x86_64-w64-mingw32-
ERROR: libxml-2.0 not found using pkg-config

it should be autodetected or disabled by default

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

What does censorship reveal? It reveals fear. -- Julian Assange


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


Re: [FFmpeg-devel] [PATCH v2] lavf/movenc: suggest video_track_timescale for invalid timescale

2016-10-12 Thread Mark Thompson
On 12/10/16 11:04, Carl Eugen Hoyos wrote:
> 2016-10-11 21:06 GMT+02:00 Josh de Kock :
>> Fixes ticket #5882.
> 
> I don't object but I don't think it is correct.
> 
>> While it doesn't automatically set the timescale
>> for the user as that would destroy data without prompt, it will tell
>> the user how they could set the timescale (as this is mostly likely
>> what they want).
>>
>> Signed-off-by: Josh de Kock 
>> ---
>>
>>> Would it be useful to print the max duration?
>>  I'm not entirely sure, open to suggestions though.
>>
>>  libavformat/movenc.c | 9 +++--
>>  1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>> index d7c7158..6bada25 100644
>> --- a/libavformat/movenc.c
>> +++ b/libavformat/movenc.c
>> @@ -5677,11 +5677,16 @@ static int mov_write_header(AVFormatContext *s)
>>  ret = AVERROR(EINVAL);
>>  goto error;
>>  }
>> -if (track->mode == MODE_MOV && track->timescale > 10)
>> +if (track->mode == MODE_MOV && track->timescale > 10) {
>> +/* NOTE: forcing setting the suggested timescale manually 
>> means ffmpeg won't destroy
>> + * timestamps without explicit instruction. */
> 
>> +unsigned int suggested = (unsigned 
>> int)av_rescale(st->time_base.den, 1000, st->time_base.num);
> 
> If we go this way (I am not completely convinced about it), we definitely need
> a heuristic that suggests 24000 for 1000/417083 fps and 3 if 
> applicable.

How about the approach in the test program below?  This makes the whole timebase
fraction; the suggested timescale would then be the denominator of that.  (It is
currently just a program linked with lavu, I could make it into a patch if
someone else thinks this might actually be a good idea.  It would need better
error handling and some thoughts about overflow, too.)

It shows that we can do significantly better in the 417083/1000 case than
any of the currently-suggested approaches (divide by 1000, guess 1/24 or
1001/24000):

$ ./a.out 417083 1000 10
3715/89071
$ bc -l
417083/1000
.04170830
3715/89071
.04170830012012888594
417/1
.0417
1/24
.0416
1001/24000
.04170833

(The suggested timescale value would be 89071.)

---

#include 

#include "libavutil/rational.h"

AVRational av_rational_reduce(AVRational qi, int max_den)
{
  AVRational qc = qi;
  AVRational q0 = { 0, 1 };
  AVRational q1 = { 1, 0 };
  AVRational q2;
  int a, t, k;

  if (qc.den <= max_den)
return qc;

  while (1) {
a = qc.num / qc.den;

q2.num = q0.num + a * q1.num;
q2.den = q0.den + a * q1.den;
if (q2.den > max_den)
  break;

q0 = q1;
q1 = q2;

t = qc.num;
qc.num = qc.den;
qc.den = t - a * qc.den;
  }

  k = (max_den - q0.den) / q1.den;
  q2.num = q0.num + k * q1.num;
  q2.den = q0.den + k * q1.den;

  if (av_nearer_q(qi, q1, q2) >= 0)
return q1;
  else
return q2;
}

int main(int argc, char **argv)
{
  AVRational ri, ro;
  int max;
  sscanf(argv[1], "%d", &ri.num);
  sscanf(argv[2], "%d", &ri.den);
  sscanf(argv[3], "%d", &max);

  ro = av_rational_reduce(ri, max);

  printf("%d/%d\n", ro.num, ro.den);

  return 0;
}

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


[FFmpeg-devel] [PATCH 1/4] lavc/mediacodec_wrapper: do not discard codecs reporting they do not support any profile

2016-10-12 Thread Matthieu Bouron
From: Matthieu Bouron 

Depending on the device, some (VP8/VP9/...) decoders report that they do
not support any profiles.
---
 libavcodec/mediacodec_wrapper.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/mediacodec_wrapper.c b/libavcodec/mediacodec_wrapper.c
index 97e3a29..c2af950 100644
--- a/libavcodec/mediacodec_wrapper.c
+++ b/libavcodec/mediacodec_wrapper.c
@@ -480,6 +480,9 @@ char *ff_AMediaCodecList_getCodecNameByType(const char 
*mime, int profile, int e
 }
 
 profile_count = (*env)->GetArrayLength(env, profile_levels);
+if (!profile_count) {
+found_codec = 1;
+}
 for (k = 0; k < profile_count; k++) {
 int supported_profile = 0;
 
-- 
2.10.0

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


[FFmpeg-devel] [PATCH 2/4] lavc: add vp8/vp9 mediacodec decoders

2016-10-12 Thread Matthieu Bouron
From: Matthieu Bouron 

---
 configure|  4 +++
 libavcodec/Makefile  |  2 ++
 libavcodec/allcodecs.c   |  4 +++
 libavcodec/mediacodecdec.c   | 14 
 libavcodec/mediacodecdec_h2645.c | 73 +++-
 libavcodec/version.h |  2 +-
 6 files changed, 97 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 8fc71fb..9587184 100755
--- a/configure
+++ b/configure
@@ -2662,10 +2662,14 @@ vc1_vdpau_hwaccel_deps="vdpau"
 vc1_vdpau_hwaccel_select="vc1_decoder"
 vp8_cuvid_hwaccel_deps="cuda cuvid"
 vp9_cuvid_hwaccel_deps="cuda cuvid"
+vp8_mediacodec_decoder_deps="mediacodec"
+vp8_mediacodec_hwaccel_deps="mediacodec"
 vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
 vp9_d3d11va_hwaccel_select="vp9_decoder"
 vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
 vp9_dxva2_hwaccel_select="vp9_decoder"
+vp9_mediacodec_decoder_deps="mediacodec"
+vp9_mediacodec_hwaccel_deps="mediacodec"
 vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9"
 vp9_vaapi_hwaccel_select="vp9_decoder"
 wmv3_crystalhd_decoder_select="crystalhd"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index a1560ba..734c79d 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -595,9 +595,11 @@ OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o 
vp56data.o \
 OBJS-$(CONFIG_VP7_DECODER) += vp8.o vp56rac.o
 OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp56rac.o
 OBJS-$(CONFIG_VP8_CUVID_DECODER)   += cuvid.o
+OBJS-$(CONFIG_VP8_MEDIACODEC_DECODER)  += mediacodecdec_h2645.o
 OBJS-$(CONFIG_VP9_DECODER) += vp9.o vp9dsp.o vp56rac.o 
vp9dsp_8bpp.o \
   vp9dsp_10bpp.o vp9dsp_12bpp.o
 OBJS-$(CONFIG_VP9_CUVID_DECODER)   += cuvid.o
+OBJS-$(CONFIG_VP9_MEDIACODEC_DECODER)  += mediacodecdec_h2645.o
 OBJS-$(CONFIG_VPLAYER_DECODER) += textdec.o ass.o
 OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o
 OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index fed740a..44f7205 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -115,9 +115,11 @@ void avcodec_register_all(void)
 REGISTER_HWACCEL(VC1_MMAL,  vc1_mmal);
 REGISTER_HWACCEL(VC1_QSV,   vc1_qsv);
 REGISTER_HWACCEL(VP8_CUVID, vp8_cuvid);
+REGISTER_HWACCEL(VP8_MEDIACODEC,vp8_mediacodec);
 REGISTER_HWACCEL(VP9_CUVID, vp9_cuvid);
 REGISTER_HWACCEL(VP9_D3D11VA,   vp9_d3d11va);
 REGISTER_HWACCEL(VP9_DXVA2, vp9_dxva2);
+REGISTER_HWACCEL(VP9_MEDIACODEC,vp9_mediacodec);
 REGISTER_HWACCEL(VP9_VAAPI, vp9_vaapi);
 REGISTER_HWACCEL(WMV3_D3D11VA,  wmv3_d3d11va);
 REGISTER_HWACCEL(WMV3_DXVA2,wmv3_dxva2);
@@ -657,7 +659,9 @@ void avcodec_register_all(void)
 REGISTER_DECODER(MPEG4_CUVID,   mpeg4_cuvid);
 REGISTER_DECODER(VC1_CUVID, vc1_cuvid);
 REGISTER_DECODER(VP8_CUVID, vp8_cuvid);
+REGISTER_DECODER(VP8_MEDIACODEC,vp8_mediacodec);
 REGISTER_DECODER(VP9_CUVID, vp9_cuvid);
+REGISTER_DECODER(VP9_MEDIACODEC,vp9_mediacodec);
 
 /* parsers */
 REGISTER_PARSER(AAC,aac);
diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c
index 8ff1138..e5a8dbc 100644
--- a/libavcodec/mediacodecdec.c
+++ b/libavcodec/mediacodecdec.c
@@ -766,3 +766,17 @@ AVHWAccel ff_hevc_mediacodec_hwaccel = {
 .id  = AV_CODEC_ID_HEVC,
 .pix_fmt = AV_PIX_FMT_MEDIACODEC,
 };
+
+AVHWAccel ff_vp8_mediacodec_hwaccel = {
+.name= "mediacodec",
+.type= AVMEDIA_TYPE_VIDEO,
+.id  = AV_CODEC_ID_VP8,
+.pix_fmt = AV_PIX_FMT_MEDIACODEC,
+};
+
+AVHWAccel ff_vp9_mediacodec_hwaccel = {
+.name= "mediacodec",
+.type= AVMEDIA_TYPE_VIDEO,
+.id  = AV_CODEC_ID_VP9,
+.pix_fmt = AV_PIX_FMT_MEDIACODEC,
+};
diff --git a/libavcodec/mediacodecdec_h2645.c b/libavcodec/mediacodecdec_h2645.c
index d5a35a1..c5f5af2 100644
--- a/libavcodec/mediacodecdec_h2645.c
+++ b/libavcodec/mediacodecdec_h2645.c
@@ -1,5 +1,5 @@
 /*
- * Android MediaCodec H.264 / H.265 decoders
+ * Android MediaCodec H.264 / H.265 / VP8 / VP9 decoders
  *
  * Copyright (c) 2015-2016 Matthieu Bouron 
  *
@@ -65,6 +65,7 @@ static av_cold int mediacodec_decode_close(AVCodecContext 
*avctx)
 return 0;
 }
 
+#if CONFIG_H264_MEDIACODEC_DECODER || CONFIG_HEVC_MEDIACODEC_DECODER
 static int h2645_ps_to_nalu(const uint8_t *src, int src_size, uint8_t **out, 
int *out_size)
 {
 int i;
@@ -116,6 +117,7 @@ done:
 
 return ret;
 }
+#endif
 
 #if CONFIG_H264_MEDIACODEC_DECODER
 static int h264_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
@@ -264,6 +266,19 @@ done:
 }
 #endif
 
+#if CONFIG_VP8_MEDIACODEC_DECODER || CONFIG_VP9_MEDIACODEC_DECODER
+static int vpx_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
+{
+int ret = 0;
+

[FFmpeg-devel] [PATCH 4/4] lavc/mediacodec: use more meaningful filenames

2016-10-12 Thread Matthieu Bouron
From: Matthieu Bouron 

Adds the following changes:
  * mediacodecdec.{c,h} -> mediacodecdec_common.{c,h}
  * mediacodecdec_h2645.c -> mediacodecdec.c
---
 libavcodec/Makefile|   12 +-
 libavcodec/mediacodec.c|3 +-
 libavcodec/mediacodec_sw_buffer.c  |2 +-
 libavcodec/mediacodec_sw_buffer.h  |2 +-
 libavcodec/mediacodecdec.c | 1064 +---
 libavcodec/mediacodecdec_common.c  |  789 +++
 .../{mediacodecdec.h => mediacodecdec_common.h}|6 +-
 libavcodec/mediacodecdec_h2645.c   |  623 
 8 files changed, 1251 insertions(+), 1250 deletions(-)
 create mode 100644 libavcodec/mediacodecdec_common.c
 rename libavcodec/{mediacodecdec.h => mediacodecdec_common.h} (95%)
 delete mode 100644 libavcodec/mediacodecdec_h2645.c

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index e8b1b00..7b85378 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -94,7 +94,7 @@ OBJS-$(CONFIG_LSP) += lsp.o
 OBJS-$(CONFIG_LZF) += lzf.o
 OBJS-$(CONFIG_MDCT)+= mdct_fixed.o mdct_float.o 
mdct_fixed_32.o
 OBJS-$(CONFIG_ME_CMP)  += me_cmp.o
-OBJS-$(CONFIG_MEDIACODEC)  += mediacodecdec.o mediacodec_surface.o 
mediacodec_wrapper.o mediacodec_sw_buffer.o
+OBJS-$(CONFIG_MEDIACODEC)  += mediacodecdec_common.o 
mediacodec_surface.o mediacodec_wrapper.o mediacodec_sw_buffer.o
 OBJS-$(CONFIG_MPEG_ER) += mpeg_er.o
 OBJS-$(CONFIG_MPEGAUDIO)   += mpegaudio.o mpegaudiodata.o   \
   mpegaudiodecheader.o
@@ -316,7 +316,7 @@ OBJS-$(CONFIG_H264_DECODER)+= h264dec.o 
h264_cabac.o h264_cavlc.o \
   h264_slice.o h264data.o h264_parse.o 
\
   h2645_parse.o
 OBJS-$(CONFIG_H264_CUVID_DECODER)  += cuvid.o
-OBJS-$(CONFIG_H264_MEDIACODEC_DECODER) += mediacodecdec_h2645.o
+OBJS-$(CONFIG_H264_MEDIACODEC_DECODER) += mediacodecdec.o
 OBJS-$(CONFIG_H264_MMAL_DECODER)   += mmaldec.o
 OBJS-$(CONFIG_H264_NVENC_ENCODER)  += nvenc_h264.o
 OBJS-$(CONFIG_NVENC_ENCODER)   += nvenc_h264.o
@@ -333,7 +333,7 @@ OBJS-$(CONFIG_HEVC_DECODER)+= hevc.o hevc_mvs.o 
hevc_ps.o hevc_sei.o
   hevc_cabac.o hevc_refs.o hevcpred.o  
  \
   hevcdsp.o hevc_filter.o 
h2645_parse.o hevc_data.o
 OBJS-$(CONFIG_HEVC_CUVID_DECODER)  += cuvid.o
-OBJS-$(CONFIG_HEVC_MEDIACODEC_DECODER) += mediacodecdec_h2645.o hevc_parse.o
+OBJS-$(CONFIG_HEVC_MEDIACODEC_DECODER) += mediacodecdec.o hevc_parse.o
 OBJS-$(CONFIG_HEVC_NVENC_ENCODER)  += nvenc_hevc.o
 OBJS-$(CONFIG_NVENC_HEVC_ENCODER)  += nvenc_hevc.o
 OBJS-$(CONFIG_HEVC_QSV_DECODER)+= qsvdec_h2645.o
@@ -413,7 +413,7 @@ OBJS-$(CONFIG_MPEG2_QSV_ENCODER)   += qsvenc_mpeg2.o
 OBJS-$(CONFIG_MPEG2VIDEO_DECODER)  += mpeg12dec.o mpeg12.o mpeg12data.o
 OBJS-$(CONFIG_MPEG2VIDEO_ENCODER)  += mpeg12enc.o mpeg12.o
 OBJS-$(CONFIG_MPEG4_DECODER)   += xvididct.o
-OBJS-$(CONFIG_MPEG4_MEDIACODEC_DECODER) += mediacodecdec_h2645.o
+OBJS-$(CONFIG_MPEG4_MEDIACODEC_DECODER) += mediacodecdec.o
 OBJS-$(CONFIG_MPEG4_OMX_ENCODER)   += omx.o
 OBJS-$(CONFIG_MPL2_DECODER)+= mpl2dec.o ass.o
 OBJS-$(CONFIG_MSA1_DECODER)+= mss3.o
@@ -596,11 +596,11 @@ OBJS-$(CONFIG_VP6_DECODER) += vp6.o vp56.o 
vp56data.o \
 OBJS-$(CONFIG_VP7_DECODER) += vp8.o vp56rac.o
 OBJS-$(CONFIG_VP8_DECODER) += vp8.o vp56rac.o
 OBJS-$(CONFIG_VP8_CUVID_DECODER)   += cuvid.o
-OBJS-$(CONFIG_VP8_MEDIACODEC_DECODER)  += mediacodecdec_h2645.o
+OBJS-$(CONFIG_VP8_MEDIACODEC_DECODER)  += mediacodecdec.o
 OBJS-$(CONFIG_VP9_DECODER) += vp9.o vp9dsp.o vp56rac.o 
vp9dsp_8bpp.o \
   vp9dsp_10bpp.o vp9dsp_12bpp.o
 OBJS-$(CONFIG_VP9_CUVID_DECODER)   += cuvid.o
-OBJS-$(CONFIG_VP9_MEDIACODEC_DECODER)  += mediacodecdec_h2645.o
+OBJS-$(CONFIG_VP9_MEDIACODEC_DECODER)  += mediacodecdec.o
 OBJS-$(CONFIG_VPLAYER_DECODER) += textdec.o ass.o
 OBJS-$(CONFIG_VQA_DECODER) += vqavideo.o
 OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o
diff --git a/libavcodec/mediacodec.c b/libavcodec/mediacodec.c
index a658f0e..3521c8a 100644
--- a/libavcodec/mediacodec.c
+++ b/libavcodec/mediacodec.c
@@ -34,7 +34,8 @@
 
 #include "ffjni.h"
 #include "mediacodec.h"
-#include "mediacodecdec.h"
+#include "mediacodecdec_common.h"
+#include "version.h"
 
 AVMediaCodecContext *av_mediacodec_alloc_context(void)
 {
diff --git a/libavcodec/mediacodec_sw_buffer.c 
b/libavcodec/mediacodec_sw_buffer.c
index 7baf120..92428e8 100644
--- a/libavcodec/mediacodec_sw_buffer.c
+++ b/libavcodec/mediacodec_sw_buffer.c
@@ -2

[FFmpeg-devel] [PATCH 3/4] lavc: add mpeg4 mediacodec decoder

2016-10-12 Thread Matthieu Bouron
From: Matthieu Bouron 

---
 configure|  2 ++
 libavcodec/Makefile  |  1 +
 libavcodec/allcodecs.c   |  2 ++
 libavcodec/mediacodecdec.c   |  7 +++
 libavcodec/mediacodecdec_h2645.c | 38 ++
 libavcodec/version.h |  2 +-
 6 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 9587184..da4d4c4 100755
--- a/configure
+++ b/configure
@@ -2630,6 +2630,8 @@ mpeg2_xvmc_hwaccel_deps="xvmc"
 mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
 mpeg4_crystalhd_decoder_select="crystalhd"
 mpeg4_cuvid_hwaccel_deps="cuda cuvid"
+mpeg4_mediacodec_decoder_deps="mediacodec"
+mpeg4_mediacodec_hwaccel_deps="mediacodec"
 mpeg4_mmal_decoder_deps="mmal"
 mpeg4_mmal_decoder_select="mmal"
 mpeg4_mmal_hwaccel_deps="mmal"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 734c79d..e8b1b00 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -413,6 +413,7 @@ OBJS-$(CONFIG_MPEG2_QSV_ENCODER)   += qsvenc_mpeg2.o
 OBJS-$(CONFIG_MPEG2VIDEO_DECODER)  += mpeg12dec.o mpeg12.o mpeg12data.o
 OBJS-$(CONFIG_MPEG2VIDEO_ENCODER)  += mpeg12enc.o mpeg12.o
 OBJS-$(CONFIG_MPEG4_DECODER)   += xvididct.o
+OBJS-$(CONFIG_MPEG4_MEDIACODEC_DECODER) += mediacodecdec_h2645.o
 OBJS-$(CONFIG_MPEG4_OMX_ENCODER)   += omx.o
 OBJS-$(CONFIG_MPL2_DECODER)+= mpl2dec.o ass.o
 OBJS-$(CONFIG_MSA1_DECODER)+= mss3.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 44f7205..b592aa3 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -103,6 +103,7 @@ void avcodec_register_all(void)
 REGISTER_HWACCEL(MPEG2_VDPAU,   mpeg2_vdpau);
 REGISTER_HWACCEL(MPEG2_VIDEOTOOLBOX, mpeg2_videotoolbox);
 REGISTER_HWACCEL(MPEG4_CUVID,   mpeg4_cuvid);
+REGISTER_HWACCEL(MPEG4_MEDIACODEC,  mpeg4_mediacodec);
 REGISTER_HWACCEL(MPEG4_MMAL,mpeg4_mmal);
 REGISTER_HWACCEL(MPEG4_VAAPI,   mpeg4_vaapi);
 REGISTER_HWACCEL(MPEG4_VDPAU,   mpeg4_vdpau);
@@ -657,6 +658,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(MPEG2_CUVID,   mpeg2_cuvid);
 REGISTER_ENCODER(MPEG2_QSV, mpeg2_qsv);
 REGISTER_DECODER(MPEG4_CUVID,   mpeg4_cuvid);
+REGISTER_DECODER(MPEG4_MEDIACODEC,  mpeg4_mediacodec);
 REGISTER_DECODER(VC1_CUVID, vc1_cuvid);
 REGISTER_DECODER(VP8_CUVID, vp8_cuvid);
 REGISTER_DECODER(VP8_MEDIACODEC,vp8_mediacodec);
diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c
index e5a8dbc..c031de8 100644
--- a/libavcodec/mediacodecdec.c
+++ b/libavcodec/mediacodecdec.c
@@ -767,6 +767,13 @@ AVHWAccel ff_hevc_mediacodec_hwaccel = {
 .pix_fmt = AV_PIX_FMT_MEDIACODEC,
 };
 
+AVHWAccel ff_mpeg4_mediacodec_hwaccel = {
+.name= "mediacodec",
+.type= AVMEDIA_TYPE_VIDEO,
+.id  = AV_CODEC_ID_MPEG4,
+.pix_fmt = AV_PIX_FMT_MEDIACODEC,
+};
+
 AVHWAccel ff_vp8_mediacodec_hwaccel = {
 .name= "mediacodec",
 .type= AVMEDIA_TYPE_VIDEO,
diff --git a/libavcodec/mediacodecdec_h2645.c b/libavcodec/mediacodecdec_h2645.c
index c5f5af2..3cc2492 100644
--- a/libavcodec/mediacodecdec_h2645.c
+++ b/libavcodec/mediacodecdec_h2645.c
@@ -266,6 +266,19 @@ done:
 }
 #endif
 
+#if CONFIG_MPEG4_MEDIACODEC_DECODER
+static int mpeg4_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
+{
+int ret = 0;
+
+if (avctx->extradata) {
+ff_AMediaFormat_setBuffer(format, "csd-0", avctx->extradata, 
avctx->extradata_size);
+}
+
+return ret;
+}
+#endif
+
 #if CONFIG_VP8_MEDIACODEC_DECODER || CONFIG_VP9_MEDIACODEC_DECODER
 static int vpx_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
 {
@@ -319,6 +332,15 @@ static av_cold int mediacodec_decode_init(AVCodecContext 
*avctx)
 goto done;
 break;
 #endif
+#if CONFIG_MPEG4_MEDIACODEC_DECODER
+case AV_CODEC_ID_MPEG4:
+codec_mime = "video/mp4v-es",
+
+ret = mpeg4_set_extradata(avctx, format);
+if (ret < 0)
+goto done;
+break;
+#endif
 #if CONFIG_VP8_MEDIACODEC_DECODER
 case AV_CODEC_ID_VP8:
 codec_mime = "video/x-vnd.on2.vp8";
@@ -552,6 +574,22 @@ AVCodec ff_hevc_mediacodec_decoder = {
 };
 #endif
 
+#if CONFIG_MPEG4_MEDIACODEC_DECODER
+AVCodec ff_mpeg4_mediacodec_decoder = {
+.name   = "mpeg4_mediacodec",
+.long_name  = NULL_IF_CONFIG_SMALL("MPEG4 Android MediaCodec decoder"),
+.type   = AVMEDIA_TYPE_VIDEO,
+.id = AV_CODEC_ID_MPEG4,
+.priv_data_size = sizeof(MediaCodecH264DecContext),
+.init   = mediacodec_decode_init,
+.decode = mediacodec_decode_frame,
+.flush  = mediacodec_decode_flush,
+.close  = mediacodec_decode_close,
+.capabilities   = CODEC_CAP_DELAY,
+.caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,
+};
+#endif
+
 #if CONFIG_VP8_MEDIACODEC_DECODER
 AVCodec ff_vp8_mediacodec

Re: [FFmpeg-devel] [PATCH v2] lavf/movenc: suggest video_track_timescale for invalid timescale

2016-10-12 Thread Sven C. Dack

On 12/10/16 13:44, Mark Thompson wrote:

How about the approach in the test program below?  This makes the whole timebase
fraction; the suggested timescale would then be the denominator of that.  (It is
currently just a program linked with lavu, I could make it into a patch if
someone else thinks this might actually be a good idea.  It would need better
error handling and some thoughts about overflow, too.)

It shows that we can do significantly better in the 417083/1000 case than
any of the currently-suggested approaches (divide by 1000, guess 1/24 or
1001/24000):


It may be too much. We only know of 3 video files, which don't play on the Apple 
player. We don't know how they got produced, what produced them, what caused 
them to have this deviation, if it was done intentionally or by accident, nor do 
we know why Apple chooses to deviate in their playback from other players, why 
exactly it fails and where else it fails apart from these 3 files. We really 
only know about 3 files, which could have already been fixed with the help of 
ffmpeg and without applying any patches to it. So I wouldn't take it this too 
far. Patches are supposed to be simple and one should try to make then even 
simpler, so say the rules of the project.


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


Re: [FFmpeg-devel] [PATCH v2] lavf/movenc: suggest video_track_timescale for invalid timescale

2016-10-12 Thread Michael Niedermayer
On Wed, Oct 12, 2016 at 01:44:52PM +0100, Mark Thompson wrote:
> On 12/10/16 11:04, Carl Eugen Hoyos wrote:
> > 2016-10-11 21:06 GMT+02:00 Josh de Kock :
> >> Fixes ticket #5882.
> > 
> > I don't object but I don't think it is correct.
> > 
> >> While it doesn't automatically set the timescale
> >> for the user as that would destroy data without prompt, it will tell
> >> the user how they could set the timescale (as this is mostly likely
> >> what they want).
> >>
> >> Signed-off-by: Josh de Kock 
> >> ---
> >>
> >>> Would it be useful to print the max duration?
> >>  I'm not entirely sure, open to suggestions though.
> >>
> >>  libavformat/movenc.c | 9 +++--
> >>  1 file changed, 7 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> >> index d7c7158..6bada25 100644
> >> --- a/libavformat/movenc.c
> >> +++ b/libavformat/movenc.c
> >> @@ -5677,11 +5677,16 @@ static int mov_write_header(AVFormatContext *s)
> >>  ret = AVERROR(EINVAL);
> >>  goto error;
> >>  }
> >> -if (track->mode == MODE_MOV && track->timescale > 10)
> >> +if (track->mode == MODE_MOV && track->timescale > 10) {
> >> +/* NOTE: forcing setting the suggested timescale manually 
> >> means ffmpeg won't destroy
> >> + * timestamps without explicit instruction. */
> > 
> >> +unsigned int suggested = (unsigned 
> >> int)av_rescale(st->time_base.den, 1000, st->time_base.num);
> > 
> > If we go this way (I am not completely convinced about it), we definitely 
> > need
> > a heuristic that suggests 24000 for 1000/417083 fps and 3 if 
> > applicable.
> 
> How about the approach in the test program below?  This makes the whole 
> timebase
> fraction; the suggested timescale would then be the denominator of that.  (It 
> is
> currently just a program linked with lavu, I could make it into a patch if
> someone else thinks this might actually be a good idea.  It would need better
> error handling and some thoughts about overflow, too.)
> 
> It shows that we can do significantly better in the 417083/1000 case than
> any of the currently-suggested approaches (divide by 1000, guess 1/24 or
> 1001/24000):
> 
> $ ./a.out 417083 1000 10
> 3715/89071
> $ bc -l
> 417083/1000
> .04170830
> 3715/89071
> .04170830012012888594
> 417/1
> .0417
> 1/24
> .0416
> 1001/24000
> .04170833
> 
> (The suggested timescale value would be 89071.)
> 
> ---
> 
> #include 
> 
> #include "libavutil/rational.h"
> 
> AVRational av_rational_reduce(AVRational qi, int max_den)

why dont you use av_reduce() directly ?


[...]


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA


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


Re: [FFmpeg-devel] [PATCH v2] lavf/movenc: suggest video_track_timescale for invalid timescale

2016-10-12 Thread Sven C. Dack

On 12/10/16 14:38, Sven C. Dack wrote:


It may be too much. We only know of 3 video files, which don't play on the 
Apple player. We don't know how they got produced, what produced them, what 
caused them to have this deviation, if it was done intentionally or by 
accident, nor do we know why Apple chooses to deviate in their playback from 
other players, why exactly it fails and where else it fails apart from these 3 
files. We really only know about 3 files, which could have already been fixed 
with the help of ffmpeg and without applying any patches to it. So I wouldn't 
take it this too far. Patches are supposed to be simple and one should try to 
make then even simpler, so say the rules of the project. 
That said, I believe that Alex has already produced his 3 files and can now play 
them on his Apple player, all with the help of ffmpeg and the use of the right 
command option. So the fix isn't actually needed any longer.


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


Re: [FFmpeg-devel] [PATCH v2] lavf/movenc: suggest video_track_timescale for invalid timescale

2016-10-12 Thread Mark Thompson
On 12/10/16 14:35, Michael Niedermayer wrote:
> why dont you use av_reduce() directly ?

Because I didn't know it existed.  That would indeed be better (it appears to be
doing the same thing with continued fraction).  The sentiment behind a suggested
patch is equivalent.

- Mark

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


[FFmpeg-devel] nvenc/cuda force IDR

2016-10-12 Thread Grant Brownewell
Hello,

I've been experimenting with encoding with a  cuda card, and I noticed that 
setting the pict_type member of the AVFrame structure to AV_PICTURE_TYPE_I does 
not trigger it to encode the next frame as an IDR frame as libx264 does. I 
looked at the nvidia docs and it appears there is a mechanism for this behavior.

To force the current frame to be encoded as IDR frame, set
NV_ENC_PIC_PARAMS::encodePicFlags = NV_ENC_PIC_FLAG_FORCEIDR

Nvenc_encode_frame in nvenc.c doesn't inspect the pict_type member of the 
incoming AVFrame and set the corresponding NV_ENC_PIC_FLAG_* values.

Is this functionality not present because it doesn't work or just an 
unintentional omission? I understand patches are always welcome but I wanted to 
connect with you all before attempting such a patch. Am I on the right track?

Thanks for all your work, ffmpeg is truly amazing.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts

2016-10-12 Thread Ståle Kristoffersen
On 2016-10-12 at 13:54, Carl Eugen Hoyos wrote:
> 2016-10-11 15:52 GMT+02:00 Ståle kristoffersen :
> 
> > I have some transport streams with only one pid, containing MJPEG 2000
> > video. Since the PMT/PAT is missing ffmpeg is unable to decode it.
> 
> Do you also have samples that can be decoded by FFmpeg? (We don't)

I do (they are decodable by ffmpeg without the patch if I take the whole
stream with PMT, or with only the j2k-pid using my patch), but I am unsure
if I can share them.

> How are your samples produced?

They were given to me, so I do not know what produced them.

> Do you have a way to playback the samples now without FFmpeg?

I have not been able to play them back using any other tool.

> I ask because I would love to see this
> patch tested:
> https://ffmpeg.org/pipermail/ffmpeg-devel/2015-August/177303.html

I can confirm that the stream I have does indeed have stream_type set to 21
in the PMT, so the patch matches that. 

> > The attached patch makes ffmpeg able to guess that it does contain a
> > stream of jpeg 2000, but I am not sure if this is the correct approach.
> 
> The approach is correct but if you want to improve the patch, it should
> look more like the mjpeg probe function and return a higher score if
> more valid frames can be found.

That code will have to be reworked, so I'll look into doing that as well.
Is there any guidelines for how high score a probe should return?

> > Also, should LIBAVFORMAT_VERSION_MICRO
> 
> It should be MINOR since you add a new symbol to the library.

Ok.

> > and the Changelog be updated?
> 
> I don't Changelog should be updated for this patch.

Ok.

-- 
Ståle Kristoffersen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 0/2] crystalhd: Fix various regressions

2016-10-12 Thread Philip Langdale
On Sun,  9 Oct 2016 10:50:11 -0700
Philip Langdale  wrote:

> These changes should bring CrystalHD functionality back to where it
> was when the decoder was originally completed. There are various
> interlaced edge cases that remain problematic, and can probably only
> be addressed by switching to the new m:n decode API - which I might
> do someday.
> 
> Philip Langdale (2):
>   crystalhd: Fix handling of PTS
>   crystalhd: Use mpeg4_unpack_bframes to avoid buggy crystalhd
> handling
> 
>  libavcodec/crystalhd.c | 143
> + 1 file changed, 74
> insertions(+), 69 deletions(-)
> 

Both pushed.

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


[FFmpeg-devel] [PATCH] libavcodec/mips/h264dsp_msa.c: fix type in some function parameters

2016-10-12 Thread Vicente Olivert Riera
This fixes a build problem for MIPS architecture that looks like this:

libavcodec/mips/h264dsp_msa.c:2498:6: error: conflicting types for
‘ff_weight_h264_pixels16_8_msa’
 void ff_weight_h264_pixels16_8_msa(uint8_t *src, int stride,

This bug was introduced by commit bc26fe89275c267d169b468356c82ee59874407d:

  avcodec/h264: Use ptrdiff_t for (bi)weight functions

That commit changed the data type of some function parameters in some
function definitions. However, the implementation of those functions in
libavcodec/mips/h264dsp_msa.c wasn't changed accordingly.

Signed-off-by: Vicente Olivert Riera 
---
 libavcodec/mips/h264dsp_msa.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavcodec/mips/h264dsp_msa.c b/libavcodec/mips/h264dsp_msa.c
index fce01ac..16e4858 100644
--- a/libavcodec/mips/h264dsp_msa.c
+++ b/libavcodec/mips/h264dsp_msa.c
@@ -2495,21 +2495,21 @@ void ff_h264_h_loop_filter_luma_mbaff_intra_msa(uint8_t 
*src,
 avc_h_loop_filter_luma_mbaff_intra_msa(src, ystride, alpha, beta);
 }
 
-void ff_weight_h264_pixels16_8_msa(uint8_t *src, int stride,
+void ff_weight_h264_pixels16_8_msa(uint8_t *src, ptrdiff_t stride,
int height, int log2_denom,
int weight_src, int offset)
 {
 avc_wgt_16width_msa(src, stride, height, log2_denom, weight_src, offset);
 }
 
-void ff_weight_h264_pixels8_8_msa(uint8_t *src, int stride,
+void ff_weight_h264_pixels8_8_msa(uint8_t *src, ptrdiff_t stride,
   int height, int log2_denom,
   int weight_src, int offset)
 {
 avc_wgt_8width_msa(src, stride, height, log2_denom, weight_src, offset);
 }
 
-void ff_weight_h264_pixels4_8_msa(uint8_t *src, int stride,
+void ff_weight_h264_pixels4_8_msa(uint8_t *src, ptrdiff_t stride,
   int height, int log2_denom,
   int weight_src, int offset)
 {
@@ -2517,7 +2517,7 @@ void ff_weight_h264_pixels4_8_msa(uint8_t *src, int 
stride,
 }
 
 void ff_biweight_h264_pixels16_8_msa(uint8_t *dst, uint8_t *src,
- int stride, int height,
+ ptrdiff_t stride, int height,
  int log2_denom, int weight_dst,
  int weight_src, int offset)
 {
@@ -2526,7 +2526,7 @@ void ff_biweight_h264_pixels16_8_msa(uint8_t *dst, 
uint8_t *src,
 }
 
 void ff_biweight_h264_pixels8_8_msa(uint8_t *dst, uint8_t *src,
-int stride, int height,
+ptrdiff_t stride, int height,
 int log2_denom, int weight_dst,
 int weight_src, int offset)
 {
@@ -2535,7 +2535,7 @@ void ff_biweight_h264_pixels8_8_msa(uint8_t *dst, uint8_t 
*src,
 }
 
 void ff_biweight_h264_pixels4_8_msa(uint8_t *dst, uint8_t *src,
-int stride, int height,
+ptrdiff_t stride, int height,
 int log2_denom, int weight_dst,
 int weight_src, int offset)
 {
-- 
2.10.0

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


Re: [FFmpeg-devel] [PATCH] configure: fix detection of libopenjpeg

2016-10-12 Thread Andreas Cadhalpun
On 12.10.2016 03:35, Michael Bradshaw wrote:
> Oh man, I literally just wrote a patch for this today. You beat me by 6
> hours. Anyway, thanks for the patch!

What a coincidence!

> On Tue, Oct 11, 2016 at 11:37 AM, Andreas Cadhalpun <
> andreas.cadhal...@googlemail.com> wrote:
> 
[...]
>> +enabled libopenjpeg   && { { check_lib2 openjpeg-2.1/openjpeg.h
>> opj_version -lopenjp2 -DOPJ_STATIC && add_cflags -DOPJ_STATIC; } ||
>>
> 
> Use add_cppflags instead of add_cflags. The macro isn't needed for linking.

Fixed.

>> +   check_lib2 openjpeg-2.1/openjpeg.h
>> opj_version -lopenjp2 ||
>> +   { check_lib openjpeg-2.0/openjpeg.h
>> opj_version -lopenjp2 -DOPJ_STATIC  && add_cflags -DOPJ_STATIC; } ||
>>
> 
> You can drop the changes for v2.0 and below. Only v2.1 needs the check. The
> new OPJ_STATIC behavior was introduced in OpenJPEG v2.1.1.

Thanks for sharing that information.
Updated patch attached.

Best regards,
Andreas

>From 5c9e02fa1a0f45d84fc31de4ba53d8362a10b4e5 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun 
Date: Tue, 11 Oct 2016 20:28:35 +0200
Subject: [PATCH] configure: fix detection of libopenjpeg

Use check_lib2 to test the header together with the function. This is
necessary, because '-DOPJ_STATIC' changes what the included header does.

Also add '-DOPJ_STATIC' to CPPFLAGS, so that it isn't necessary to
hardcode this in libavcodec/libopenjpeg{dec,enc}.c.

Finally, check for non-static openjpeg 2.1, too.

Signed-off-by: Andreas Cadhalpun 
---
 configure   | 9 +
 libavcodec/libopenjpegdec.c | 2 --
 libavcodec/libopenjpegenc.c | 2 --
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index 8fc71fb..2b71415 100755
--- a/configure
+++ b/configure
@@ -5710,10 +5710,11 @@ enabled libopencv && { check_header opencv2/core/core_c.h &&
  require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
 enabled libopenh264   && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
-enabled libopenjpeg   && { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC ||
-   check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC ||
-   check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
-   check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
+enabled libopenjpeg   && { { check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+   check_lib2 openjpeg-2.1/openjpeg.h opj_version -lopenjp2 ||
+   { check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+   { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
+   { check_lib2 openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
die "ERROR: libopenjpeg not found"; }
 enabled libopenmpt&& require_pkg_config "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create
 enabled libopus   && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
index 65167e6..b4ce834 100644
--- a/libavcodec/libopenjpegdec.c
+++ b/libavcodec/libopenjpegdec.c
@@ -24,8 +24,6 @@
  * JPEG 2000 decoder using libopenjpeg
  */
 
-#define  OPJ_STATIC
-
 #include "libavutil/common.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/intreadwrite.h"
diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index 1443551..5042507 100644
--- a/libavcodec/libopenjpegenc.c
+++ b/libavcodec/libopenjpegenc.c
@@ -24,8 +24,6 @@
  * JPEG 2000 encoder using libopenjpeg
  */
 
-#define  OPJ_STATIC
-
 #include "libavutil/avassert.h"
 #include "libavutil/common.h"
 #include "libavutil/imgutils.h"
-- 
2.9.3

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


Re: [FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts

2016-10-12 Thread Carl Eugen Hoyos
2016-10-12 16:57 GMT+02:00 Ståle Kristoffersen :
> On 2016-10-12 at 13:54, Carl Eugen Hoyos wrote:
>> 2016-10-11 15:52 GMT+02:00 Ståle kristoffersen :
>>
>> > I have some transport streams with only one pid, containing MJPEG 2000
>> > video. Since the PMT/PAT is missing ffmpeg is unable to decode it.
>>
>> Do you also have samples that can be decoded by FFmpeg? (We don't)
>
> I do (they are decodable by ffmpeg without the patch if I take the whole
> stream with PMT, or with only the j2k-pid using my patch), but I am unsure
> if I can share them.

Maybe you could ask for samples that can be shared?

>> How are your samples produced?
>
> They were given to me, so I do not know what produced them.
>
>> Do you have a way to playback the samples now without FFmpeg?
>
> I have not been able to play them back using any other tool.

Neither with nor without PMT/PAT?

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


Re: [FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts

2016-10-12 Thread Ståle Kristoffersen
On 2016-10-12 at 17:32, Carl Eugen Hoyos wrote:
> 2016-10-12 16:57 GMT+02:00 Ståle Kristoffersen :



> > I do (they are decodable by ffmpeg without the patch if I take the whole
> > stream with PMT, or with only the j2k-pid using my patch), but I am unsure
> > if I can share them.
> 
> Maybe you could ask for samples that can be shared?

I'll look into it, but don't count on it. I can try to 'recreate' something
similar with ffmpeg if that is useful.

> >> How are your samples produced?
> >
> > They were given to me, so I do not know what produced them.
> >
> >> Do you have a way to playback the samples now without FFmpeg?
> >
> > I have not been able to play them back using any other tool.
> 
> Neither with nor without PMT/PAT?

Yes, but I have not really tried very hard.

-- 
Ståle Kristoffersen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libopenjpegenc: recreate image data buffer after encoding frame

2016-10-12 Thread Andreas Cadhalpun
On 12.10.2016 03:42, Michael Bradshaw wrote:
> On Tue, Oct 11, 2016 at 9:57 AM, Andreas Cadhalpun <
> andreas.cadhal...@googlemail.com> wrote:
> 
>> openjpeg 2 sets the data pointers of the image components to NULL,
>> causing segfaults if the image is reused.
>>
> 
> I've never seen this issue.

That's strange, as it happens practically always here (on Debian testing/sid).

> Is there a particular version of OpenJPEG or

The OpenJPEG version is 2.1.2, i.e. the latest.

> reproduction steps available?

For example:
$ ffmpeg -f lavfi -i testsrc -c:v libopenjpeg -f null /dev/null

> Where are the data pointers being set to NULL here?
>>
>> The relevant openjpeg2 code is:
>> https://sources.debian.net/src/openjpeg2/2.1.2-1/src/lib/openjp2/j2k.c/?hl=10253#L10247

I didn't include this link in the commit message, as it will become invalid,
as soon as the next OpenJPEG version enters Debian.

For future reference, the code is:
/* TODO_MSD: Find a better way */
if (p_image->comps) {
OPJ_UINT32 it_comp;
for (it_comp = 0 ; it_comp < p_image->numcomps; it_comp++) {
if (p_image->comps[it_comp].data) {
p_j2k->m_private_image->comps[it_comp].data 
=p_image->comps[it_comp].data;
p_image->comps[it_comp].data = NULL;

}
}
}


Best regards,
Andreas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]configure: Enable pie for toolchain=hardened.

2016-10-12 Thread Andreas Cadhalpun
On 04.10.2016 12:24, Carl Eugen Hoyos wrote:
> Sorry if I miss something but with this patch, the hardening_check 
> script succeeds here both for x86_32 and x86_64 (static and shared).

This script uses a very simplistic approach for testing position
independent executables.
I think it just does the equivalent of 'readelf -h $PROGRAM | grep Type'.
If the Type is EXEC, it's a normal executable, and if it is DYN, it
assumes it's compiled as PIE.
However, that doesn't guarantee that the executable is actually position
independent, i.e. does not contain text relocations.

> --- a/configure
> +++ b/configure
> @@ -3577,6 +3577,8 @@ case "$toolchain" in
>  add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
>  add_cflags   -fno-strict-overflow -fstack-protector-all
>  add_ldflags  -Wl,-z,relro -Wl,-z,now
> +add_cflags   -fPIE

I think this should be -fPIC, at least when building shared libraries.
That's how I understand the gcc manual [1]:
-fpie
-fPIE
These options are similar to -fpic and -fPIC, but generated position
independent code can be only linked into executables.

> +add_ldexeflags -fPIE -pie
>  ;;
>  ?*)
>  die "Unknown toolchain $toolchain"
> -- 1.7.10.4

In general, enabling PIE for toolchain=hardened is a good idea.
But According to [2] PIE doesn't work on hppa and m68k, so it shouldn't get
enabled for these architectures.

On 05.10.2016 15:14, Carl Eugen Hoyos wrote:
> I would have expected that this (pie) patch does not work on x86_32
> but the binary runs fine here: Am I missing something or should I
> apply to get this tested?

The problem on x86_32 is that libavcodec, libavutil, etc. use
text relocations in hand-written assembler code, so these libraries
won't be position independent, unless using --disable-asm.

Now, when producing shared libraries, the ffmpeg binary is actually
position independent, just not libavcodec, libavutil...
However, when linking statically, the ffmpeg binary contains the
text relocations from the hand-written assembler code and is thus
not really position independent.

This can be tested e.g. with scanelf from pax-utils [3].
 * shared PIE build on x86_32 (no text relocations):
$ scanelf -t ./ffmpeg
 TYPE   TEXTREL FILE 
ET_DYN-./ffmpeg 
 * static PIE build on x86_32 (with text relocations):
$ scanelf -t ./ffmpeg
 TYPE   TEXTREL FILE 
ET_DYN TEXTREL ./ffmpeg 

The '-T' options shows were exactly the text relocations are.

Best regards,
Andreas


1: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
2: 
https://wiki.debian.org/Hardening#DEB_BUILD_HARDENING_PIE_.28gcc.2Fg.2B-.2B-_-fPIE_-pie.29
3: https://wiki.gentoo.org/wiki/Hardened/PaX_Utilities
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] nvenc/cuda force IDR

2016-10-12 Thread Timo Rothenpieler
On 10/12/2016 4:15 PM, Grant Brownewell wrote:
> Hello,
> 
> I've been experimenting with encoding with a  cuda card, and I noticed that 
> setting the pict_type member of the AVFrame structure to AV_PICTURE_TYPE_I 
> does not trigger it to encode the next frame as an IDR frame as libx264 does. 
> I looked at the nvidia docs and it appears there is a mechanism for this 
> behavior.

Is that behaviour documented anywhere?

There should not be any technical issue with triggering a forced iframe,
the encoder might just choose to ignore it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]configure: Use LDEXEFLAGS in check_ld().

2016-10-12 Thread Andreas Cadhalpun
On 05.10.2016 15:12, Carl Eugen Hoyos wrote:
> From 5e26339b041f5e35112ed7f479ade6e57c3b5248 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos 
> Date: Wed, 5 Oct 2016 15:10:23 +0200
> Subject: [PATCH] configure: Use LDEXEFLAGS in check_ld().
> 
> Avoids detecting libraries that are not compatible with ldexeflags.
> ---
>  configure |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index f593191..9297321 100755
> --- a/configure
> +++ b/configure
> @@ -985,7 +985,7 @@ check_ld(){
>  check_$type $($cflags_filter $flags) || return
>  flags=$($ldflags_filter $flags)
>  libs=$($ldflags_filter $libs)
> -check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
> +check_cmd $ld $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs 
> $extralibs
>  }
>  
>  print_include(){
> -- 1.7.10.4

LGTM.

Best regards,
Andreas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] nvenc/cuda force IDR

2016-10-12 Thread Grant Brownewell
>> Hello,
>> 
>> I've been experimenting with encoding with a  cuda card, and I noticed that 
>> setting the pict_type member of the AVFrame structure to AV_PICTURE_TYPE_I 
>> >does not trigger it to encode the next frame as an IDR frame as libx264 
>> does. I looked at the nvidia docs and it appears there is a mechanism for 
>> this behavior.

>Is that behaviour documented anywhere?

I found documentation on the nvidia site 
(https://developer.nvidia.com/nvencode), here is the section of the document 
that I referred to in my previous post...

4.2.3 Forcing current frame to be used as an IDR frame 
To force the current frame to be encoded as IDR frame, set  
NV_ENC_PIC_PARAMS::encodePicFlags = NV_ENC_PIC_FLAG_FORCEIDR  

>There should not be any technical issue with triggering a forced iframe, the 
>encoder might just choose to ignore it.

Looking at the latest nvenc.c and the function ff_nvenc_encode_frame, I see 
that the encodePicFlags member is just always being set to zero...

pic_params.encodePicFlags = 0;

...before being passed along in this line...

nv_status = p_nvenc->nvEncEncodePicture(ctx->nvencoder, &pic_params);


I have not contributed any patches to ffmpeg before, but this seems like a 
simple and small patch to look at the incoming AVFrame's pict_type member and 
when it's value is AV_PICTURE_TYPE_I, set the corresponding 
NV_ENC_PIC_PARAMS::encodePicFlags  member to NV_ENC_PIC_FLAG_FORCEIDR.

Would this be a welcome patch, or would I just be duplicating effort because 
there is already someone maintaining this code? It seems to me there is quite a 
bit of activity with nvenc.c, it works well and I don't want to interfere. 
Also, my situation is somewhat narrow and perhaps a patch should be more 
complete than what I describe?

I appreciate the guidance.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] nvenc/cuda force IDR

2016-10-12 Thread Timo Rothenpieler


On 10/12/2016 7:45 PM, Grant Brownewell wrote:
>>> Hello,
>>>
>>> I've been experimenting with encoding with a  cuda card, and I noticed that 
>>> setting the pict_type member of the AVFrame structure to AV_PICTURE_TYPE_I 
>>> >does not trigger it to encode the next frame as an IDR frame as libx264 
>>> does. I looked at the nvidia docs and it appears there is a mechanism for 
>>> this behavior.
> 
>> Is that behaviour documented anywhere?
> 
> I found documentation on the nvidia site 
> (https://developer.nvidia.com/nvencode), here is the section of the document 
> that I referred to in my previous post...

I'm talking about ffmpeg AVFrames.
I was not aware libx264 even did that, and I don't see any documentation
that it's possible to force an IDR/I frame that way.

It should be trivial to add the same behaviour to nvenc.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/4] lavc: add vp8/vp9 mediacodec decoders

2016-10-12 Thread James Zern
On Wed, Oct 12, 2016 at 6:22 AM, Matthieu Bouron 
wrote:

> From: Matthieu Bouron 
>
> ---
>  configure|  4 +++
>  libavcodec/Makefile  |  2 ++
>  libavcodec/allcodecs.c   |  4 +++
>  libavcodec/mediacodecdec.c   | 14 
>  libavcodec/mediacodecdec_h2645.c | 73 ++
> +-
>  libavcodec/version.h |  2 +-
>  6 files changed, 97 insertions(+), 2 deletions(-)
>
>
Exoplayer [1] and probably others have some blacklists for vp8/9, not sure
if you want to pick them up here.

[1]
https://github.com/google/ExoPlayer/blob/7d991cef305e95cae5cd2a9feadf4af8858b284b/library/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecUtil.java#L214
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] nvenc/cuda force IDR

2016-10-12 Thread Grant Brownewell
 Hello,

 I've been experimenting with encoding with a  cuda card, and I noticed 
 that setting the pict_type member of the AVFrame structure to 
 AV_PICTURE_TYPE_I >does not trigger it to encode the next frame as an IDR 
 frame as libx264 does. I looked at the nvidia docs and it appears there is 
 a mechanism for this behavior.
>> 
>>> Is that behaviour documented anywhere?
>> 
>> I found documentation on the nvidia site 
>> (https://developer.nvidia.com/nvencode), here is the section of the document 
>> that I referred to in my previous post...
>
>I'm talking about ffmpeg AVFrames.
>I was not aware libx264 even did that, and I don't see any documentation that 
>it's possible to force an IDR/I frame that way.
>
>It should be trivial to add the same behaviour to nvenc.

Not exactly documented completely, but I found out about it when I look at the 
libx264 options output by the command "ffmpeg -h encoder=libx264" which lists a 
-forced_idr option. After seeing that I looked into libx264.c and found the 
area where it switches on frame->pict_type and sets the corresponding 
X264Context members.

Here is the code from libx264.c, X264_frame function. Its indispensable when 
dealing with live RTP streams and recovering from packet loss.

switch (frame->pict_type) {
case AV_PICTURE_TYPE_I:
x4->pic.i_type = x4->forced_idr >= 0 ? X264_TYPE_IDR
 : X264_TYPE_KEYFRAME;
break;
case AV_PICTURE_TYPE_P:
x4->pic.i_type = X264_TYPE_P;
break;
case AV_PICTURE_TYPE_B:
x4->pic.i_type = X264_TYPE_B;
break;
default:
x4->pic.i_type = X264_TYPE_AUTO;
break;
}

I'm trying to put together a patch, but I'm struggling a bit setting up to 
build.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] Improve selftest coverage for libavutil library

2016-10-12 Thread Michael Niedermayer
On Mon, Oct 10, 2016 at 08:56:51PM -0700, Thomas Turner wrote:
> Code coverage for av_fifo_generic_peek(...) and av_fifo_grow(...) .
> ---
>  libavutil/tests/fifo2.c | 77 
> +
>  1 file changed, 77 insertions(+)
>  create mode 100644 libavutil/tests/fifo2.c
> 
> diff --git a/libavutil/tests/fifo2.c b/libavutil/tests/fifo2.c
> new file mode 100644
> index 000..923feee
> --- /dev/null
> +++ b/libavutil/tests/fifo2.c

We generally put all tests for "something" into the same file
these could be put into fifo.c
[...]

> +data_arr = (int32_t*)malloc(fifo_size);

the cast is unneeded in C

also please dont add code that is changed in the immedeatly next patch
that makes review difficult

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] nvenc/cuda force IDR

2016-10-12 Thread Timo Rothenpieler
> I'm trying to put together a patch, but I'm struggling a bit setting up to 
> build.

I just pushed the neccesary changes.
Works slightly diffrent than on x264, as the option it has seems a bit
broken, seeing that both 0 and 1 force IDR frames:

x4->forced_idr >= 0 ? X264_TYPE_IDR : X264_TYPE_KEYFRAME

For nvenc -1, the default, does not forward the flag, 0 forces
keyframes, 1 forces idr frames.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec/libx264: fix forced_idr logic

2016-10-12 Thread Timo Rothenpieler
Currently, it forces IDR frames for both true and false.
Not entirely sure what the original idea behind the tri-state bool
option is.
---
 libavcodec/libx264.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 9e12464..32e767e 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -293,8 +293,8 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, 
const AVFrame *frame,
 
 switch (frame->pict_type) {
 case AV_PICTURE_TYPE_I:
-x4->pic.i_type = x4->forced_idr >= 0 ? X264_TYPE_IDR
- : X264_TYPE_KEYFRAME;
+x4->pic.i_type = x4->forced_idr > 0 ? X264_TYPE_IDR
+: X264_TYPE_KEYFRAME;
 break;
 case AV_PICTURE_TYPE_P:
 x4->pic.i_type = X264_TYPE_P;
-- 
2.10.1

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


Re: [FFmpeg-devel] [PATCH] avformat/flvenc: do not write duration and filesize when cannot seekable

2016-10-12 Thread Michael Niedermayer
On Wed, Oct 12, 2016 at 06:11:41PM +0800, Steven Liu wrote:
> when living stream cannot seekable, don't write duration and
> filesize in metadata, and donnot seek at the flv_write_trailer
> 
> Signed-off-by: Steven Liu 
> ---
>  libavformat/flvenc.c |   49 -
>  1 files changed, 28 insertions(+), 21 deletions(-)

This will also remove these fields from
-f hds
is that intended ?
is this correct (that is according to hds specs) ?

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

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


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


[FFmpeg-devel] [PATCH] avformat/matroska: fix MatroskaVideoFieldOrder enum values

2016-10-12 Thread James Almer
The spec says

9: Interlaced with bottom field displayed first and top field stored first
14: Interlaced with top field displayed first and bottom field stored first

And avcodec.h states

AV_FIELD_TB,  //< Top coded first, bottom displayed first
AV_FIELD_BT,  //< Bottom coded first, top displayed first

Signed-off-by: James Almer 
---
 libavformat/matroska.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroska.h b/libavformat/matroska.h
index 1ff76e6..15e401c 100644
--- a/libavformat/matroska.h
+++ b/libavformat/matroska.h
@@ -286,8 +286,8 @@ typedef enum {
 MATROSKA_VIDEO_FIELDORDER_UNDETERMINED = 2,
 MATROSKA_VIDEO_FIELDORDER_TT   = 1,
 MATROSKA_VIDEO_FIELDORDER_BB   = 6,
-MATROSKA_VIDEO_FIELDORDER_BT   = 9,
-MATROSKA_VIDEO_FIELDORDER_TB   = 14,
+MATROSKA_VIDEO_FIELDORDER_TB   = 9,
+MATROSKA_VIDEO_FIELDORDER_BT   = 14,
 } MatroskaVideoFieldOrder;
 
 typedef enum {
-- 
2.9.1

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


Re: [FFmpeg-devel] [PATCH]configure: Use LDEXEFLAGS in check_ld().

2016-10-12 Thread Carl Eugen Hoyos
2016-10-12 19:10 GMT+02:00 Andreas Cadhalpun :
> On 05.10.2016 15:12, Carl Eugen Hoyos wrote:

>> -check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
>> +check_cmd $ld $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs 
>> $extralibs
>>  }
>>
>>  print_include(){
>> -- 1.7.10.4
>
> LGTM.

Patch applied.

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


Re: [FFmpeg-devel] [PATCH] libavf: Auto-detect mjpeg 2000 in mpeg-ts

2016-10-12 Thread Carl Eugen Hoyos
2016-10-12 17:40 GMT+02:00 Ståle Kristoffersen :
> On 2016-10-12 at 17:32, Carl Eugen Hoyos wrote:
>> 2016-10-12 16:57 GMT+02:00 Ståle Kristoffersen :

>> > I do (they are decodable by ffmpeg without the patch if I take the
>> > whole stream with PMT, or with only the j2k-pid using my patch),
>> > but I am unsure if I can share them.
>>
>> Maybe you could ask for samples that can be shared?
>
> I'll look into it, but don't count on it. I can try to 'recreate' something
> similar with ffmpeg if that is useful.

Perhaps you can provide ffmpeg -i output for a file with PMT and PAT
if you cannot share a sample?

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


Re: [FFmpeg-devel] [PATCH] avformat/matroska: fix MatroskaVideoFieldOrder enum values

2016-10-12 Thread Dave Rice

> On Oct 12, 2016, at 3:54 PM, James Almer  wrote:
> 
> The spec says
> 
> 9: Interlaced with bottom field displayed first and top field stored first
> 14: Interlaced with top field displayed first and bottom field stored first
> 
> And avcodec.h states
> 
> AV_FIELD_TB,  //< Top coded first, bottom displayed first
> AV_FIELD_BT,  //< Bottom coded first, top displayed first
> 
> Signed-off-by: James Almer 
> ---
> libavformat/matroska.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/matroska.h b/libavformat/matroska.h
> index 1ff76e6..15e401c 100644
> --- a/libavformat/matroska.h
> +++ b/libavformat/matroska.h
> @@ -286,8 +286,8 @@ typedef enum {
> MATROSKA_VIDEO_FIELDORDER_UNDETERMINED = 2,
> MATROSKA_VIDEO_FIELDORDER_TT   = 1,
> MATROSKA_VIDEO_FIELDORDER_BB   = 6,
> -MATROSKA_VIDEO_FIELDORDER_BT   = 9,
> -MATROSKA_VIDEO_FIELDORDER_TB   = 14,
> +MATROSKA_VIDEO_FIELDORDER_TB   = 9,
> +MATROSKA_VIDEO_FIELDORDER_BT   = 14,
> } MatroskaVideoFieldOrder;
> 
> typedef enum {
> -- 
> 2.9.1

LGTM. Thanks for fixing this. It now aligns to the same list in QuickTime as 
was intended in the spec.

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


Re: [FFmpeg-devel] [PATCH] avformat/matroska: fix MatroskaVideoFieldOrder enum values

2016-10-12 Thread James Almer
On 10/12/2016 6:22 PM, Dave Rice wrote:
> 
>> On Oct 12, 2016, at 3:54 PM, James Almer  wrote:
>>
>> The spec says
>>
>> 9: Interlaced with bottom field displayed first and top field stored first
>> 14: Interlaced with top field displayed first and bottom field stored first
>>
>> And avcodec.h states
>>
>> AV_FIELD_TB,  //< Top coded first, bottom displayed first
>> AV_FIELD_BT,  //< Bottom coded first, top displayed first
>>
>> Signed-off-by: James Almer 
>> ---
>> libavformat/matroska.h | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavformat/matroska.h b/libavformat/matroska.h
>> index 1ff76e6..15e401c 100644
>> --- a/libavformat/matroska.h
>> +++ b/libavformat/matroska.h
>> @@ -286,8 +286,8 @@ typedef enum {
>> MATROSKA_VIDEO_FIELDORDER_UNDETERMINED = 2,
>> MATROSKA_VIDEO_FIELDORDER_TT   = 1,
>> MATROSKA_VIDEO_FIELDORDER_BB   = 6,
>> -MATROSKA_VIDEO_FIELDORDER_BT   = 9,
>> -MATROSKA_VIDEO_FIELDORDER_TB   = 14,
>> +MATROSKA_VIDEO_FIELDORDER_TB   = 9,
>> +MATROSKA_VIDEO_FIELDORDER_BT   = 14,
>> } MatroskaVideoFieldOrder;
>>
>> typedef enum {
>> -- 
>> 2.9.1
> 
> LGTM. Thanks for fixing this. It now aligns to the same list in QuickTime as 
> was intended in the spec.
> 
> Dave Rice

Pushed, thanks.

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


Re: [FFmpeg-devel] [PATCH]configure: Enable pie for toolchain=hardened.

2016-10-12 Thread Carl Eugen Hoyos
2016-10-12 19:04 GMT+02:00 Andreas Cadhalpun :
> On 04.10.2016 12:24, Carl Eugen Hoyos wrote:
>> Sorry if I miss something but with this patch, the hardening_check
>> script succeeds here both for x86_32 and x86_64 (static and shared).
>
> This script uses a very simplistic approach for testing position
> independent executables.
> I think it just does the equivalent of 'readelf -h $PROGRAM | grep Type'.
> If the Type is EXEC, it's a normal executable, and if it is DYN, it
> assumes it's compiled as PIE.

> However, that doesn't guarantee that the executable is actually position
> independent, i.e. does not contain text relocations.

My understanding of PIE is (very) limited but I suspect text relocations
and PIE do not exclude each other.

>> --- a/configure
>> +++ b/configure
>> @@ -3577,6 +3577,8 @@ case "$toolchain" in
>>  add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
>>  add_cflags   -fno-strict-overflow -fstack-protector-all
>>  add_ldflags  -Wl,-z,relro -Wl,-z,now
>> +add_cflags   -fPIE
>
> I think this should be -fPIC, at least when building shared libraries.

Afaiu, shared libraries and PIE do exclude each other, pic is already
supported in FFmpeg (--enable-pic) but this patch is only meant for
PIE.

> That's how I understand the gcc manual [1]:
> -fpie
> -fPIE
> These options are similar to -fpic and -fPIC, but generated position
> independent code can be only linked into executables.

So shared libraries and PIE exclude each other but PIE is for
static linking what pic is for dynamic linking.
Good to know!

>> +add_ldexeflags -fPIE -pie
>>  ;;
>>  ?*)
>>  die "Unknown toolchain $toolchain"
>> -- 1.7.10.4
>
> In general, enabling PIE for toolchain=hardened is a good idea.

> But According to [2] PIE doesn't work on hppa and m68k, so it
> shouldn't get enabled for these architectures.

I was convinced that my ancient Linux system wouldn't know
about ASLR but to my surprise, I was able to reproduce that
my patch actually works (56bit entropy iiuc).
My hppa test-system is currently down (and all reports about
pie not working on hppa seem to be from 2008), I will try to test,
in any case, I will commit the patch soon.

I will not be able to test on m68k.

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


Re: [FFmpeg-devel] [PATCH] avcodec/libx264: fix forced_idr logic

2016-10-12 Thread Moritz Barsnick
On Wed, Oct 12, 2016 at 21:57:16 +0200, Timo Rothenpieler wrote:
> Currently, it forces IDR frames for both true and false.
> Not entirely sure what the original idea behind the tri-state bool
> option is.

The option's default of -1 ("auto") doesn't seem useful either, since
the code doesn't do any sort of automatic handling. The default (and
the minimum) might as well be 0 now, with your change.

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


[FFmpeg-devel] [PATCH] fate: add test for firequalizer filter

2016-10-12 Thread Muhammad Faiz
Signed-off-by: Muhammad Faiz 
---
 tests/fate/filter-audio.mak | 10 ++
 tests/filtergraphs/firequalizer | 27 +++
 2 files changed, 37 insertions(+)
 create mode 100644 tests/filtergraphs/firequalizer

diff --git a/tests/fate/filter-audio.mak b/tests/fate/filter-audio.mak
index 809bf4e..a20ff74 100644
--- a/tests/fate/filter-audio.mak
+++ b/tests/fate/filter-audio.mak
@@ -114,6 +114,16 @@ fate-filter-extrastereo: tests/data/asynth-44100-2.wav
 fate-filter-extrastereo: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
 fate-filter-extrastereo: CMD = framecrc -i $(SRC) -aframes 20 -af 
extrastereo=m=2
 
+FATE_AFILTER-$(call FILTERDEMDECENCMUX, FIREQUALIZER ATRIM VOLUME, WAV, 
PCM_S16LE, PCM_S16LE, WAV) += fate-filter-firequalizer
+fate-filter-firequalizer: tests/data/asynth-44100-2.wav
+fate-filter-firequalizer: tests/data/filtergraphs/firequalizer
+fate-filter-firequalizer: REF = tests/data/asynth-44100-2.wav
+fate-filter-firequalizer: CMD = ffmpeg -i 
$(TARGET_PATH)/tests/data/asynth-44100-2.wav -filter_script 
$(TARGET_PATH)/tests/data/filtergraphs/firequalizer -f wav -acodec pcm_s16le -
+fate-filter-firequalizer: CMP = stddev
+fate-filter-firequalizer: FUZZ = 0.01
+fate-filter-firequalizer: CMP_UNIT = s16
+fate-filter-firequalizer: SIZE_TOLERANCE = 1058400 - 1097208
+
 FATE_AFILTER_SAMPLES-$(call FILTERDEMDECENCMUX, SILENCEREMOVE, WAV, PCM_S16LE, 
PCM_S16LE, WAV) += fate-filter-silenceremove
 fate-filter-silenceremove: SRC = 
$(TARGET_SAMPLES)/audio-reference/divertimenti_2ch_96kHz_s24.wav
 fate-filter-silenceremove: CMD = framecrc -i $(SRC) -aframes 30 -af 
silenceremove=0:0:0:-1:0:-90dB
diff --git a/tests/filtergraphs/firequalizer b/tests/filtergraphs/firequalizer
new file mode 100644
index 000..ee432e2
--- /dev/null
+++ b/tests/filtergraphs/firequalizer
@@ -0,0 +1,27 @@
+firequalizer=
+gain= 'sin(0.001*f) - 1':
+delay   = 0.05,
+
+firequalizer=
+gain= 'if (ch, -0.7 * sin(0.001*f), -0.2 * sin(0.001*f)) - 1':
+delay   = 0.1:
+fixed   = on:
+multi   = on:
+zero_phase  = on:
+wfunc   = nuttall,
+
+firequalizer=
+gain= 'if (ch, -0.3 * sin(0.001*f), -0.8 * sin(0.001*f)) - 1':
+delay   = 0.05:
+multi   = on,
+
+firequalizer=
+gain_entry  = 'entry(1000, 0); entry(5000, 0.1); entry(1, 0.2)',
+
+firequalizer=
+gain_entry  = 'entry(1000, 0.2); entry(5000, 0.1); entry(1, 0)',
+
+volume  = 2.8dB,
+
+atrim   =
+start   = 0.12
-- 
2.5.0

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


Re: [FFmpeg-devel] [PATCH] avformat/matroska: fix MatroskaVideoFieldOrder enum values

2016-10-12 Thread Michael Niedermayer
On Wed, Oct 12, 2016 at 04:54:56PM -0300, James Almer wrote:
> The spec says
> 
> 9: Interlaced with bottom field displayed first and top field stored first
> 14: Interlaced with top field displayed first and bottom field stored first
> 
> And avcodec.h states
> 
> AV_FIELD_TB,  //< Top coded first, bottom displayed first
> AV_FIELD_BT,  //< Bottom coded first, top displayed first
> 
> Signed-off-by: James Almer 
> ---
>  libavformat/matroska.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/matroska.h b/libavformat/matroska.h
> index 1ff76e6..15e401c 100644
> --- a/libavformat/matroska.h
> +++ b/libavformat/matroska.h
> @@ -286,8 +286,8 @@ typedef enum {
>  MATROSKA_VIDEO_FIELDORDER_UNDETERMINED = 2,
>  MATROSKA_VIDEO_FIELDORDER_TT   = 1,
>  MATROSKA_VIDEO_FIELDORDER_BB   = 6,
> -MATROSKA_VIDEO_FIELDORDER_BT   = 9,
> -MATROSKA_VIDEO_FIELDORDER_TB   = 14,
> +MATROSKA_VIDEO_FIELDORDER_TB   = 9,
> +MATROSKA_VIDEO_FIELDORDER_BT   = 14,
>  } MatroskaVideoFieldOrder;

this requires a bump in the version to cause a change to
LIBAVFORMAT_IDENT

the demuxer should use this version to detect and correct the past
muxer mistake

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

Observe your enemies, for they first find out your faults. -- Antisthenes


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


Re: [FFmpeg-devel] [PATCH]configure: Enable pie for toolchain=hardened.

2016-10-12 Thread Andreas Cadhalpun
On 12.10.2016 23:44, Carl Eugen Hoyos wrote:
> 2016-10-12 19:04 GMT+02:00 Andreas Cadhalpun 
> :
>> On 04.10.2016 12:24, Carl Eugen Hoyos wrote:
>>> Sorry if I miss something but with this patch, the hardening_check
>>> script succeeds here both for x86_32 and x86_64 (static and shared).
>>
>> This script uses a very simplistic approach for testing position
>> independent executables.
>> I think it just does the equivalent of 'readelf -h $PROGRAM | grep Type'.
>> If the Type is EXEC, it's a normal executable, and if it is DYN, it
>> assumes it's compiled as PIE.
> 
>> However, that doesn't guarantee that the executable is actually position
>> independent, i.e. does not contain text relocations.
> 
> My understanding of PIE is (very) limited but I suspect text relocations
> and PIE do not exclude each other.

As I understand it the literal meaning of position independent code is
code without text relocations, because those are what makes the code
position dependent. So in this literal sense PIE and text relocations
exclude each other.
(The -fPIC/-fPIE flags tell the compiler to produce code without text
relocations.)

The additional complication for executables is that ASLR doesn't work for
normal executables, because they are always mapped to the same point in
address space. The basic idea of PIE is to build the executables actually
as shared libraries, so that they can benefit from ASLR just as normal
shared libraries.
(The '-pie' flag tells the linker to produce such an executable.)

However, such a '-pie' executable is not necessarily position independent
in the literal sense, i.e. might contain text relocations.
In that sense PIE and text relocations don't exclude each other.

If you want both NX and ASLR security features for an executable it has
to be built with '-pie' and must not contain text relocations.

>>> --- a/configure
>>> +++ b/configure
>>> @@ -3577,6 +3577,8 @@ case "$toolchain" in
>>>  add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
>>>  add_cflags   -fno-strict-overflow -fstack-protector-all
>>>  add_ldflags  -Wl,-z,relro -Wl,-z,now
>>> +add_cflags   -fPIE
>>
>> I think this should be -fPIC, at least when building shared libraries.
> 
> Afaiu, shared libraries and PIE do exclude each other, pic is already
> supported in FFmpeg (--enable-pic) but this patch is only meant for
> PIE.
> 
>> That's how I understand the gcc manual [1]:
>> -fpie
>> -fPIE
>> These options are similar to -fpic and -fPIC, but generated position
>> independent code can be only linked into executables.
> 
> So shared libraries and PIE exclude each other but PIE is for
> static linking what pic is for dynamic linking.
> Good to know!

I think you misunderstood this. The problem with -fPIE is that it allows the
compiler to make optimizations only suitable if the resulting object ends
up in an executable. However, it is entirely possible to build the objects
with -fPIC and produce an executable with '-pie'. These same objects can
also be used to build normal shared libraries, while objects compiled
with '-fPIE' shouldn't be used for that. And '-pie' is also useful for
dynamic linking.

So using -fPIC in CFLAGS and '-fPIC -pie' in LDEXEFLAGS should always work.

>>> +add_ldexeflags -fPIE -pie
>>>  ;;
>>>  ?*)
>>>  die "Unknown toolchain $toolchain"
>>> -- 1.7.10.4
>>
>> In general, enabling PIE for toolchain=hardened is a good idea.
> 
>> But According to [2] PIE doesn't work on hppa and m68k, so it
>> shouldn't get enabled for these architectures.
> 
> I was convinced that my ancient Linux system wouldn't know
> about ASLR but to my surprise, I was able to reproduce that
> my patch actually works (56bit entropy iiuc).
> My hppa test-system is currently down (and all reports about
> pie not working on hppa seem to be from 2008),

The information from the wiki might be outdated...

> I will try to test,
> in any case, I will commit the patch soon.
> 
> I will not be able to test on m68k.

I can't test hppa or m68k directly either.

Best regards,
Andreas

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


[FFmpeg-devel] [PATCH] avfilter/showcqt: add csp option

2016-10-12 Thread Muhammad Faiz
from colorspace filter

Signed-off-by: Muhammad Faiz 
---
 doc/filters.texi  | 26 ++
 libavfilter/avf_showcqt.c | 56 ++-
 libavfilter/avf_showcqt.h |  2 ++
 3 files changed, 79 insertions(+), 5 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 76265e7..a79972b 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -16884,6 +16884,32 @@ Enable/disable drawing text to the axis. If it is set 
to @code{0}, drawing to
 the axis is disabled, ignoring @var{fontfile} and @var{axisfile} option.
 Default value is @code{1}.
 
+@item csp
+Set colorspace. The accepted values are:
+@table @samp
+@item unspecified
+Unspecified (default)
+
+@item bt709
+BT.709
+
+@item fcc
+FCC
+
+@item bt470bg
+BT.470BG or BT.601-6 625
+
+@item smpte170m
+SMPTE-170M or BT.601-6 525
+
+@item smpte240m
+SMPTE-240M
+
+@item bt2020ncl
+BT.2020 with non-constant luminance
+
+@end table
+
 @end table
 
 @subsection Examples
diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c
index 16bb2be..7c76b1f 100644
--- a/libavfilter/avf_showcqt.c
+++ b/libavfilter/avf_showcqt.c
@@ -83,6 +83,14 @@ static const AVOption showcqt_options[] = {
 { "axisfile", "set axis image", OFFSET(axisfile),  AV_OPT_TYPE_STRING, 
{ .str = NULL },  CHAR_MIN, CHAR_MAX, FLAGS },
 { "axis",  "draw axis", OFFSET(axis),AV_OPT_TYPE_BOOL, 
{ .i64 = 1 },0, 1,FLAGS },
 { "text",  "draw axis", OFFSET(axis),AV_OPT_TYPE_BOOL, 
{ .i64 = 1 },0, 1,FLAGS },
+{ "csp", "set color space", OFFSET(csp),  AV_OPT_TYPE_INT, 
{ .i64 = AVCOL_SPC_UNSPECIFIED }, 0, INT_MAX, FLAGS, "csp" },
+{ "unspecified", "unspecified", 0,  AV_OPT_TYPE_CONST, 
{ .i64 = AVCOL_SPC_UNSPECIFIED }, 0, 0, FLAGS, "csp" },
+{ "bt709", "bt709", 0,  AV_OPT_TYPE_CONST, 
{ .i64 = AVCOL_SPC_BT709 },   0, 0, FLAGS, "csp" },
+{ "fcc", "fcc", 0,  AV_OPT_TYPE_CONST, 
{ .i64 = AVCOL_SPC_FCC }, 0, 0, FLAGS, "csp" },
+{ "bt470bg", "bt470bg", 0,  AV_OPT_TYPE_CONST, 
{ .i64 = AVCOL_SPC_BT470BG }, 0, 0, FLAGS, "csp" },
+{ "smpte170m", "smpte170m", 0,  AV_OPT_TYPE_CONST, 
{ .i64 = AVCOL_SPC_SMPTE170M },   0, 0, FLAGS, "csp" },
+{ "smpte240m", "smpte240m", 0,  AV_OPT_TYPE_CONST, 
{ .i64 = AVCOL_SPC_SMPTE240M },   0, 0, FLAGS, "csp" },
+{ "bt2020ncl", "bt2020ncl", 0,  AV_OPT_TYPE_CONST, 
{ .i64 = AVCOL_SPC_BT2020_NCL },  0, 0, FLAGS, "csp" },
 { NULL }
 };
 
@@ -656,7 +664,7 @@ static void rgb_from_cqt(ColorFloat *c, const FFTComplex 
*v, float g, int len)
 }
 }
 
-static void yuv_from_cqt(ColorFloat *c, const FFTComplex *v, float gamma, int 
len)
+static void yuv_from_cqt(ColorFloat *c, const FFTComplex *v, float gamma, int 
len, float cm[3][3])
 {
 int x;
 for (x = 0; x < len; x++) {
@@ -664,9 +672,9 @@ static void yuv_from_cqt(ColorFloat *c, const FFTComplex 
*v, float gamma, int le
 r = calculate_gamma(FFMIN(1.0f, v[x].re), gamma);
 g = calculate_gamma(FFMIN(1.0f, 0.5f * (v[x].re + v[x].im)), gamma);
 b = calculate_gamma(FFMIN(1.0f, v[x].im), gamma);
-c[x].yuv.y = 65.481f * r + 128.553f * g + 24.966f * b;
-c[x].yuv.u = -37.797f * r - 74.203f * g + 112.0f * b;
-c[x].yuv.v = 112.0f * r - 93.786f * g - 18.214 * b;
+c[x].yuv.y = cm[0][0] * r + cm[0][1] * g + cm[0][2] * b;
+c[x].yuv.u = cm[1][0] * r + cm[1][1] * g + cm[1][2] * b;
+c[x].yuv.v = cm[2][0] * r + cm[2][1] * g + cm[2][2] * b;
 }
 }
 
@@ -1036,7 +1044,7 @@ static void process_cqt(ShowCQTContext *s)
 if (s->format == AV_PIX_FMT_RGB24)
 rgb_from_cqt(s->c_buf, s->cqt_result, s->sono_g, s->width);
 else
-yuv_from_cqt(s->c_buf, s->cqt_result, s->sono_g, s->width);
+yuv_from_cqt(s->c_buf, s->cqt_result, s->sono_g, s->width, s->cmatrix);
 }
 
 static int plot_cqt(AVFilterContext *ctx, AVFrame **frameout)
@@ -1075,6 +1083,7 @@ static int plot_cqt(AVFilterContext *ctx, AVFrame 
**frameout)
 return AVERROR(ENOMEM);
 out->sample_aspect_ratio = av_make_q(1, 1);
 av_frame_set_color_range(out, AVCOL_RANGE_MPEG);
+av_frame_set_colorspace(out, s->csp);
 UPDATE_TIME(s->alloc_time);
 
 if (s->bar_h) {
@@ -1100,6 +1109,41 @@ static int plot_cqt(AVFilterContext *ctx, AVFrame 
**frameout)
 return 0;
 }
 
+static void init_colormatrix(ShowCQTContext *s)
+{
+double kr, kg, kb;
+
+/* from vf_colorspace.c */
+switch (s->csp) {
+default:
+av_log(s->ctx, AV_LOG_WARNING, "unsupported colorspace, setting it to 
unspecified.\n");
+s->csp = AVCOL_SPC_UNSPECIFIED;
+case AVCOL_SPC_UNSPECIFIED:
+case AVCOL_SPC_BT470BG:
+case AVCOL_SPC_SMP

[FFmpeg-devel] [PATCH] avformat/matroskadec: workaround the field_order bug in the Matroska muxer

2016-10-12 Thread James Almer
Signed-off-by: James Almer 
---
 libavformat/matroskadec.c | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index a94398b..0acf6df 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1752,8 +1752,15 @@ static int matroska_parse_flac(AVFormatContext *s,
 return 0;
 }
 
-static int mkv_field_order(int64_t field_order)
+static int mkv_field_order(MatroskaDemuxContext *matroska, int64_t field_order)
 {
+int major, minor, micro, bttb = 0;
+
+/* workaround a bug in our Matroska muxer, introduced in version 57.36 
alongside
+ * this function, and fixed in 57.52 */
+if (sscanf(matroska->muxingapp, "Lavf%d.%d.%d", &major, &minor, µ) == 
3)
+bttb = (major == 57 && minor >= 36 && minor <= 51);
+
 switch (field_order) {
 case MATROSKA_VIDEO_FIELDORDER_PROGRESSIVE:
 return AV_FIELD_PROGRESSIVE;
@@ -1764,9 +1771,9 @@ static int mkv_field_order(int64_t field_order)
 case MATROSKA_VIDEO_FIELDORDER_BB:
 return AV_FIELD_BB;
 case MATROSKA_VIDEO_FIELDORDER_BT:
-return AV_FIELD_BT;
+return bttb ? AV_FIELD_TB : AV_FIELD_BT;
 case MATROSKA_VIDEO_FIELDORDER_TB:
-return AV_FIELD_TB;
+return bttb ? AV_FIELD_BT : AV_FIELD_TB;
 default:
 return AV_FIELD_UNKNOWN;
 }
@@ -2282,7 +2289,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
 st->codecpar->height = track->video.pixel_height;
 
 if (track->video.interlaced == 
MATROSKA_VIDEO_INTERLACE_FLAG_INTERLACED)
-st->codecpar->field_order = 
mkv_field_order(track->video.field_order);
+st->codecpar->field_order = mkv_field_order(matroska, 
track->video.field_order);
 else if (track->video.interlaced == 
MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE)
 st->codecpar->field_order = AV_FIELD_PROGRESSIVE;
 
-- 
2.9.1

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


[FFmpeg-devel] [PATCH v2] avformat/matroskadec: workaround the field_order bug in the Matroska muxer

2016-10-12 Thread James Almer
Signed-off-by: James Almer 
---
Now also checks for micro version.

 libavformat/matroskadec.c | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index a94398b..acf1ccb 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1752,8 +1752,15 @@ static int matroska_parse_flac(AVFormatContext *s,
 return 0;
 }
 
-static int mkv_field_order(int64_t field_order)
+static int mkv_field_order(MatroskaDemuxContext *matroska, int64_t field_order)
 {
+int major, minor, micro, bttb = 0;
+
+/* workaround a bug in our Matroska muxer, introduced in version 57.36 
alongside
+ * this function, and fixed in 57.52 */
+if (sscanf(matroska->muxingapp, "Lavf%d.%d.%d", &major, &minor, µ) == 
3)
+bttb = (major == 57 && minor >= 36 && minor <= 51 && micro >= 100);
+
 switch (field_order) {
 case MATROSKA_VIDEO_FIELDORDER_PROGRESSIVE:
 return AV_FIELD_PROGRESSIVE;
@@ -1764,9 +1771,9 @@ static int mkv_field_order(int64_t field_order)
 case MATROSKA_VIDEO_FIELDORDER_BB:
 return AV_FIELD_BB;
 case MATROSKA_VIDEO_FIELDORDER_BT:
-return AV_FIELD_BT;
+return bttb ? AV_FIELD_TB : AV_FIELD_BT;
 case MATROSKA_VIDEO_FIELDORDER_TB:
-return AV_FIELD_TB;
+return bttb ? AV_FIELD_BT : AV_FIELD_TB;
 default:
 return AV_FIELD_UNKNOWN;
 }
@@ -2282,7 +2289,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
 st->codecpar->height = track->video.pixel_height;
 
 if (track->video.interlaced == 
MATROSKA_VIDEO_INTERLACE_FLAG_INTERLACED)
-st->codecpar->field_order = 
mkv_field_order(track->video.field_order);
+st->codecpar->field_order = mkv_field_order(matroska, 
track->video.field_order);
 else if (track->video.interlaced == 
MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE)
 st->codecpar->field_order = AV_FIELD_PROGRESSIVE;
 
-- 
2.9.1

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


Re: [FFmpeg-devel] [PATCH] fate: add test for firequalizer filter

2016-10-12 Thread Michael Niedermayer
On Thu, Oct 13, 2016 at 05:14:38AM +0700, Muhammad Faiz wrote:
> Signed-off-by: Muhammad Faiz 
> ---
>  tests/fate/filter-audio.mak | 10 ++
>  tests/filtergraphs/firequalizer | 27 +++
>  2 files changed, 37 insertions(+)
>  create mode 100644 tests/filtergraphs/firequalizer

works on mingw liunx x86 32/64
but fails on qemu arm
TESTfilter-firequalizer
stddev:0.68 PSNR: 99.68 MAXDIFF:1 bytes:  1058400/  1097208
stddev: |0.68 - 0| >= 0.01
Test filter-firequalizer failed. Look at 
tests/data/fate/filter-firequalizer.err for details.
make: *** [fate-filter-firequalizer] Error 1

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

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


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


Re: [FFmpeg-devel] [PATCH] libopenjpegenc: recreate image data buffer after encoding frame

2016-10-12 Thread Michael Bradshaw
On Wed, Oct 12, 2016 at 8:45 AM, Andreas Cadhalpun <
andreas.cadhal...@googlemail.com> wrote:

> On 12.10.2016 03:42, Michael Bradshaw wrote:
> > On Tue, Oct 11, 2016 at 9:57 AM, Andreas Cadhalpun <
> > andreas.cadhal...@googlemail.com> wrote:
> >
> >> openjpeg 2 sets the data pointers of the image components to NULL,
> >> causing segfaults if the image is reused.
> >>
> >
> > I've never seen this issue.
>
> That's strange, as it happens practically always here (on Debian
> testing/sid).
>
> > Is there a particular version of OpenJPEG or
>
> The OpenJPEG version is 2.1.2, i.e. the latest.
>
> > reproduction steps available?
>
> For example:
> $ ffmpeg -f lavfi -i testsrc -c:v libopenjpeg -f null /dev/null


Thanks for that (and the link back to the OpenJPEG source). Well dang. I
think it would be better to change the patch to completely remove the image
member from LibOpenJPEGContext, and instead just create a local image (and
destroy it) for every call to libopenjpeg_encode_frame.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fate: add test for firequalizer filter

2016-10-12 Thread Muhammad Faiz
On Thu, Oct 13, 2016 at 8:19 AM, Michael Niedermayer
 wrote:
> On Thu, Oct 13, 2016 at 05:14:38AM +0700, Muhammad Faiz wrote:
>> Signed-off-by: Muhammad Faiz 
>> ---
>>  tests/fate/filter-audio.mak | 10 ++
>>  tests/filtergraphs/firequalizer | 27 +++
>>  2 files changed, 37 insertions(+)
>>  create mode 100644 tests/filtergraphs/firequalizer
>
> works on mingw liunx x86 32/64
> but fails on qemu arm
> TESTfilter-firequalizer
> stddev:0.68 PSNR: 99.68 MAXDIFF:1 bytes:  1058400/  1097208
> stddev: |0.68 - 0| >= 0.01
> Test filter-firequalizer failed. Look at 
> tests/data/fate/filter-firequalizer.err for details.
> make: *** [fate-filter-firequalizer] Error 1
>

new patch with oneoff test
patch attached

thx
From e25da07363c2126ac4642794f905678e95bf14a4 Mon Sep 17 00:00:00 2001
From: Muhammad Faiz 
Date: Thu, 13 Oct 2016 08:43:50 +0700
Subject: [PATCH] fate: add test for firequalizer filter

Signed-off-by: Muhammad Faiz 
---
 tests/fate/filter-audio.mak |  9 +
 tests/filtergraphs/firequalizer | 27 +++
 2 files changed, 36 insertions(+)
 create mode 100644 tests/filtergraphs/firequalizer

diff --git a/tests/fate/filter-audio.mak b/tests/fate/filter-audio.mak
index 809bf4e..9c6f7cd 100644
--- a/tests/fate/filter-audio.mak
+++ b/tests/fate/filter-audio.mak
@@ -114,6 +114,15 @@ fate-filter-extrastereo: tests/data/asynth-44100-2.wav
 fate-filter-extrastereo: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
 fate-filter-extrastereo: CMD = framecrc -i $(SRC) -aframes 20 -af extrastereo=m=2
 
+FATE_AFILTER-$(call FILTERDEMDECENCMUX, FIREQUALIZER ATRIM VOLUME, WAV, PCM_S16LE, PCM_S16LE, WAV) += fate-filter-firequalizer
+fate-filter-firequalizer: tests/data/asynth-44100-2.wav
+fate-filter-firequalizer: tests/data/filtergraphs/firequalizer
+fate-filter-firequalizer: REF = tests/data/asynth-44100-2.wav
+fate-filter-firequalizer: CMD = ffmpeg -i $(TARGET_PATH)/tests/data/asynth-44100-2.wav -filter_script $(TARGET_PATH)/tests/data/filtergraphs/firequalizer -f wav -acodec pcm_s16le -
+fate-filter-firequalizer: CMP = oneoff
+fate-filter-firequalizer: CMP_UNIT = s16
+fate-filter-firequalizer: SIZE_TOLERANCE = 1058400 - 1097208
+
 FATE_AFILTER_SAMPLES-$(call FILTERDEMDECENCMUX, SILENCEREMOVE, WAV, PCM_S16LE, PCM_S16LE, WAV) += fate-filter-silenceremove
 fate-filter-silenceremove: SRC = $(TARGET_SAMPLES)/audio-reference/divertimenti_2ch_96kHz_s24.wav
 fate-filter-silenceremove: CMD = framecrc -i $(SRC) -aframes 30 -af silenceremove=0:0:0:-1:0:-90dB
diff --git a/tests/filtergraphs/firequalizer b/tests/filtergraphs/firequalizer
new file mode 100644
index 000..ee432e2
--- /dev/null
+++ b/tests/filtergraphs/firequalizer
@@ -0,0 +1,27 @@
+firequalizer=
+gain= 'sin(0.001*f) - 1':
+delay   = 0.05,
+
+firequalizer=
+gain= 'if (ch, -0.7 * sin(0.001*f), -0.2 * sin(0.001*f)) - 1':
+delay   = 0.1:
+fixed   = on:
+multi   = on:
+zero_phase  = on:
+wfunc   = nuttall,
+
+firequalizer=
+gain= 'if (ch, -0.3 * sin(0.001*f), -0.8 * sin(0.001*f)) - 1':
+delay   = 0.05:
+multi   = on,
+
+firequalizer=
+gain_entry  = 'entry(1000, 0); entry(5000, 0.1); entry(1, 0.2)',
+
+firequalizer=
+gain_entry  = 'entry(1000, 0.2); entry(5000, 0.1); entry(1, 0)',
+
+volume  = 2.8dB,
+
+atrim   =
+start   = 0.12
-- 
2.5.0

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


Re: [FFmpeg-devel] [PATCH] configure: fix detection of libopenjpeg

2016-10-12 Thread Michael Bradshaw
On Wed, Oct 12, 2016 at 8:30 AM, Andreas Cadhalpun <
andreas.cadhal...@googlemail.com> wrote:
>
> Updated patch attached.


New patch looks good to me (though I don't have push privileges so can't
commit it).

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


Re: [FFmpeg-devel] [PATCH] avformat/flvenc: do not write duration and filesize when cannot seekable

2016-10-12 Thread Steven Liu
2016-10-13 4:08 GMT+08:00 Michael Niedermayer :

> On Wed, Oct 12, 2016 at 06:11:41PM +0800, Steven Liu wrote:
> > when living stream cannot seekable, don't write duration and
> > filesize in metadata, and donnot seek at the flv_write_trailer
> >
> > Signed-off-by: Steven Liu 
> > ---
> >  libavformat/flvenc.c |   49 --
> ---
> >  1 files changed, 28 insertions(+), 21 deletions(-)
>
> This will also remove these fields from
> -f hds
> is that intended ?
>
if cannot seekable when living stream. the duration and the filesize value
is 0, the value is wrong.
so i think remove it is a right way, because there have no describe to the
duration and the filesize for use,
some media player will use the value to control play duration. yes! that's
a shit media player, but i think it can fix by publish tools.

is this correct (that is according to hds specs) ?
>
so i think it can use a flvflags to control is write the duration and
filesize, for example FLV_RTMP  FLV_HDS is that right?



Thanks

>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> I am the wisest man alive, for I know one thing, and that is that I know
> nothing. -- Socrates
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/mpeg12dec.c: Read cc words field-wise, limit to cc_count and support extra field.

2016-10-12 Thread Jonathan Campbell
I just realized this has been sitting in my inbox for awhile.

Here's the clip in question.

If you play it in VLC player with "Closed Captions 1" selected, you'll notice 
that some of the text in the captions is missing.

https://www.dropbox.com/s/orrzn9vfcjmk7vb/bighero6.evenoddfieldcc.vob?dl=0

On 09/15/2016 02:49 PM, Carl Eugen Hoyos wrote:
> 2016-09-15 21:52 GMT+02:00 Jonathan Campbell :
> 
>> Do you need me to upload a small 20-second clip of the VOB where
>> the garbled captions are visible?
> 
> I believe it would be useful.
> 
> Thank you, Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 4/4] ffprobe: report field order for video streams

2016-10-12 Thread Tobias Rapp

On 04.10.2016 08:15, Clément Bœsch wrote:

On Mon, Oct 03, 2016 at 11:49:39PM -0500, Rodger Combs wrote:

---
 ffprobe.c   | 13 +
 tests/ref/fate/concat-demuxer-extended-lavf-mxf |  2 +-
 tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 |  2 +-
 tests/ref/fate/concat-demuxer-simple1-lavf-mxf  |  2 +-
 tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10  |  2 +-
 tests/ref/fate/concat-demuxer-simple2-lavf-ts   |  2 +-
 tests/ref/fate/ffprobe_compact  |  4 ++--
 tests/ref/fate/ffprobe_csv  |  4 ++--
 tests/ref/fate/ffprobe_default  |  2 ++
 tests/ref/fate/ffprobe_flat |  2 ++
 tests/ref/fate/ffprobe_ini  |  2 ++
 11 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/ffprobe.c b/ffprobe.c
index bb3979c..3118e80 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -2268,6 +2268,19 @@ static int show_stream(WriterContext *w, AVFormatContext 
*fmt_ctx, int stream_id
 else
 print_str_opt("chroma_location", 
av_chroma_location_name(par->chroma_location));

+if (par->field_order == AV_FIELD_PROGRESSIVE)
+print_str("field_order", "progressive");
+else if (par->field_order == AV_FIELD_TT)
+print_str("field_order", "tt");
+else if (par->field_order == AV_FIELD_BB)
+print_str("field_order", "bb");
+else if (par->field_order == AV_FIELD_TB)
+print_str("field_order", "tb");
+else if (par->field_order == AV_FIELD_BT)
+print_str("field_order", "bt");
+else
+print_str_opt("field_order", "unknown");
+


This probably needs an update of doc/ffprobe.xsd


@Rodger: I guess the XSD update will look like:

diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
index 757de12..ac0347f 100644
--- a/doc/ffprobe.xsd
+++ b/doc/ffprobe.xsd
@@ -201,6 +201,7 @@
   
   
   
+  
   
   

I'd love to see the patch included in FFmpeg 3.2.

Regards,
Tobias

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


[FFmpeg-devel] [PATCH] add hds demuxer

2016-10-12 Thread Steven Liu
init add hds demuxer

Based-on: patch by CORY MCCARTHY 
Based-on: patch by Gorilla Maguila 
Signed-off-by: Steven Liu 
---
 configure |4 +
 libavformat/Makefile  |1 +
 libavformat/allformats.c  |2 +-
 libavformat/amfmetadata.c |  219 +
 libavformat/amfmetadata.h |   39 +++
 libavformat/f4fbox.c  |  381 +++
 libavformat/f4fbox.h  |   95 ++
 libavformat/f4mmanifest.c |  324 +++
 libavformat/f4mmanifest.h |   59 
 libavformat/flvtag.c  |  370 ++
 libavformat/flvtag.h  |   32 ++
 libavformat/hdsdec.c  |  759 +
 12 files changed, 2284 insertions(+), 1 deletions(-)
 create mode 100644 libavformat/amfmetadata.c
 create mode 100644 libavformat/amfmetadata.h
 create mode 100644 libavformat/f4fbox.c
 create mode 100644 libavformat/f4fbox.h
 create mode 100644 libavformat/f4mmanifest.c
 create mode 100644 libavformat/f4mmanifest.h
 create mode 100644 libavformat/flvtag.c
 create mode 100644 libavformat/flvtag.h
 create mode 100644 libavformat/hdsdec.c

diff --git a/configure b/configure
index 8d9b21b..9f844ea 100755
--- a/configure
+++ b/configure
@@ -295,6 +295,7 @@ External library support:
on OSX if openssl and gnutls are not used 
[autodetect]
   --enable-x11grab enable X11 grabbing (legacy) [no]
   --disable-xlib   disable xlib [autodetect]
+  --disable-xml2   disable XML parsing using the C library libxml2 
[autodetect]
   --disable-zlib   disable zlib [autodetect]
 
   The following libraries provide various hardware acceleration features:
@@ -1552,6 +1553,7 @@ EXTERNAL_LIBRARY_LIST="
 videotoolbox
 x11grab
 xlib
+xml2
 zlib
 "
 
@@ -2854,6 +2856,7 @@ eac3_demuxer_select="ac3_parser"
 f4v_muxer_select="mov_muxer"
 fifo_muxer_deps="threads"
 flac_demuxer_select="flac_parser"
+hds_demuxer_select="xml2"
 hds_muxer_select="flv_muxer"
 hls_muxer_select="mpegts_muxer"
 image2_alias_pix_demuxer_select="image2_demuxer"
@@ -5675,6 +5678,7 @@ enabled jni   && { [ $target_os = "android" ] 
&& check_header jni.h
check_lib2 "dlfcn.h" dlopen -ldl; }
 enabled ladspa&& { check_header ladspa.h || die "ERROR: ladspa.h 
header not found"; }
 enabled libiec61883   && require libiec61883 libiec61883/iec61883.h 
iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
+disabled xml2 && require_pkg_config libxml-2.0 
libxml2/libxml/xmlversion.h xmlCheckVersion
 enabled libass&& require_pkg_config libass ass/ass.h 
ass_library_init
 enabled libbluray && require_pkg_config libbluray libbluray/bluray.h 
bd_open
 enabled libbs2b   && require_pkg_config libbs2b bs2b.h bs2b_open
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 5d827d3..e2b4dd4 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -202,6 +202,7 @@ OBJS-$(CONFIG_H264_DEMUXER)  += h264dec.o 
rawdec.o
 OBJS-$(CONFIG_H264_MUXER)+= rawenc.o
 OBJS-$(CONFIG_HASH_MUXER)+= hashenc.o
 OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
+OBJS-$(CONFIG_HDS_DEMUXER)   += hdsdec.o amfmetadata.o 
f4mmanifest.o f4fbox.o flvtag.o
 OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
 OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o
 OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 6a216ef..39505c3 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -146,9 +146,9 @@ void av_register_all(void)
 REGISTER_MUXDEMUX(H263, h263);
 REGISTER_MUXDEMUX(H264, h264);
 REGISTER_MUXER   (HASH, hash);
-REGISTER_MUXER   (HDS,  hds);
 REGISTER_MUXDEMUX(HEVC, hevc);
 REGISTER_MUXDEMUX(HLS,  hls);
+REGISTER_MUXDEMUX(HDS,  hds);
 REGISTER_DEMUXER (HNM,  hnm);
 REGISTER_MUXDEMUX(ICO,  ico);
 REGISTER_DEMUXER (IDCIN,idcin);
diff --git a/libavformat/amfmetadata.c b/libavformat/amfmetadata.c
new file mode 100644
index 000..0e7a2ea
--- /dev/null
+++ b/libavformat/amfmetadata.c
@@ -0,0 +1,219 @@
+/*
+ * Adobe Action Message Format Parser
+ * Copyright (c) 2013 Cory McCarthy
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *

Re: [FFmpeg-devel] [PATCH] add hds demuxer

2016-10-12 Thread Steven Liu
patch update.

xml2 disabled by default


test passed:

../configure --cc='ccache x86_64-w64-mingw32-gcc'   --arch=x86_64
--target-os=mingw32 --cross-prefix=x86_64-w64-mingw32- --disable-yasm

2016-10-13 14:49 GMT+08:00 Steven Liu :

> init add hds demuxer
>
> Based-on: patch by CORY MCCARTHY 
> Based-on: patch by Gorilla Maguila 
> Signed-off-by: Steven Liu 
> ---
>  configure |4 +
>  libavformat/Makefile  |1 +
>  libavformat/allformats.c  |2 +-
>  libavformat/amfmetadata.c |  219 +
>  libavformat/amfmetadata.h |   39 +++
>  libavformat/f4fbox.c  |  381 +++
>  libavformat/f4fbox.h  |   95 ++
>  libavformat/f4mmanifest.c |  324 +++
>  libavformat/f4mmanifest.h |   59 
>  libavformat/flvtag.c  |  370 ++
>  libavformat/flvtag.h  |   32 ++
>  libavformat/hdsdec.c  |  759 ++
> +++
>  12 files changed, 2284 insertions(+), 1 deletions(-)
>  create mode 100644 libavformat/amfmetadata.c
>  create mode 100644 libavformat/amfmetadata.h
>  create mode 100644 libavformat/f4fbox.c
>  create mode 100644 libavformat/f4fbox.h
>  create mode 100644 libavformat/f4mmanifest.c
>  create mode 100644 libavformat/f4mmanifest.h
>  create mode 100644 libavformat/flvtag.c
>  create mode 100644 libavformat/flvtag.h
>  create mode 100644 libavformat/hdsdec.c
>
> diff --git a/configure b/configure
> index 8d9b21b..9f844ea 100755
> --- a/configure
> +++ b/configure
> @@ -295,6 +295,7 @@ External library support:
> on OSX if openssl and gnutls are not used
> [autodetect]
>--enable-x11grab enable X11 grabbing (legacy) [no]
>--disable-xlib   disable xlib [autodetect]
> +  --disable-xml2   disable XML parsing using the C library
> libxml2 [autodetect]
>--disable-zlib   disable zlib [autodetect]
>
>The following libraries provide various hardware acceleration features:
> @@ -1552,6 +1553,7 @@ EXTERNAL_LIBRARY_LIST="
>  videotoolbox
>  x11grab
>  xlib
> +xml2
>  zlib
>  "
>
> @@ -2854,6 +2856,7 @@ eac3_demuxer_select="ac3_parser"
>  f4v_muxer_select="mov_muxer"
>  fifo_muxer_deps="threads"
>  flac_demuxer_select="flac_parser"
> +hds_demuxer_select="xml2"
>  hds_muxer_select="flv_muxer"
>  hls_muxer_select="mpegts_muxer"
>  image2_alias_pix_demuxer_select="image2_demuxer"
> @@ -5675,6 +5678,7 @@ enabled jni   && { [ $target_os =
> "android" ] && check_header jni.h
> check_lib2 "dlfcn.h" dlopen -ldl; }
>  enabled ladspa&& { check_header ladspa.h || die "ERROR:
> ladspa.h header not found"; }
>  enabled libiec61883   && require libiec61883 libiec61883/iec61883.h
> iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
> +disabled xml2 && require_pkg_config libxml-2.0
> libxml2/libxml/xmlversion.h xmlCheckVersion
>  enabled libass&& require_pkg_config libass ass/ass.h
> ass_library_init
>  enabled libbluray && require_pkg_config libbluray
> libbluray/bluray.h bd_open
>  enabled libbs2b   && require_pkg_config libbs2b bs2b.h bs2b_open
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index 5d827d3..e2b4dd4 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -202,6 +202,7 @@ OBJS-$(CONFIG_H264_DEMUXER)  += h264dec.o
> rawdec.o
>  OBJS-$(CONFIG_H264_MUXER)+= rawenc.o
>  OBJS-$(CONFIG_HASH_MUXER)+= hashenc.o
>  OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
> +OBJS-$(CONFIG_HDS_DEMUXER)   += hdsdec.o amfmetadata.o
> f4mmanifest.o f4fbox.o flvtag.o
>  OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
>  OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o
>  OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o
> diff --git a/libavformat/allformats.c b/libavformat/allformats.c
> index 6a216ef..39505c3 100644
> --- a/libavformat/allformats.c
> +++ b/libavformat/allformats.c
> @@ -146,9 +146,9 @@ void av_register_all(void)
>  REGISTER_MUXDEMUX(H263, h263);
>  REGISTER_MUXDEMUX(H264, h264);
>  REGISTER_MUXER   (HASH, hash);
> -REGISTER_MUXER   (HDS,  hds);
>  REGISTER_MUXDEMUX(HEVC, hevc);
>  REGISTER_MUXDEMUX(HLS,  hls);
> +REGISTER_MUXDEMUX(HDS,  hds);
>  REGISTER_DEMUXER (HNM,  hnm);
>  REGISTER_MUXDEMUX(ICO,  ico);
>  REGISTER_DEMUXER (IDCIN,idcin);
> diff --git a/libavformat/amfmetadata.c b/libavformat/amfmetadata.c
> new file mode 100644
> index 000..0e7a2ea
> --- /dev/null
> +++ b/libavformat/amfmetadata.c
> @@ -0,0 +1,219 @@
> +/*
> + * Adobe Action Message Format Parser
> + * Copyright (c) 2013 Cory McCarthy
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + *