Re: [FFmpeg-devel] [PATCH] avformat/thp: implement seeking

2016-01-26 Thread Paul B Mahol
On 1/26/16, Michael Niedermayer  wrote:
> On Mon, Jan 25, 2016 at 11:02:35PM +0100, Paul B Mahol wrote:
>> On 1/25/16, Michael Niedermayer  wrote:
>> > On Mon, Jan 25, 2016 at 10:29:08PM +0100, Paul B Mahol wrote:
>> >> On 1/25/16, Michael Niedermayer  wrote:
>> >> > On Sun, Nov 22, 2015 at 12:58:51AM +0100, Paul B Mahol wrote:
>> >> >> Signed-off-by: Paul B Mahol 
>> >> >> ---
>> >> >>  libavformat/thp.c | 44
>> >> >> +---
>> >> >>  1 file changed, 41 insertions(+), 3 deletions(-)
>> >> >
>> >> > confirmed to be working
>> >>
>> >> No, it doesnt always. AFAIK its not possible to fix.
>> >
>> > it worked with the thp files i had locally :(
>> > where can i find a file with which it doesnt work ?
>>
>> https://www.dropbox.com/s/zr8034va0y6tfyy/KilllaKillOP.thp
>
> seeking (clicking right/left arrows in ffplay) seems to work with
> this file too
>

but with mouse, doesnt?

> [...]
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The misfortune of the wise is better than the prosperity of the fool.
> -- Epicurus
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCHv2] doc/demuxers: add some concat demuxer script examples

2016-01-26 Thread Tobias Rapp

On 25.01.2016 13:22, Nicolas George wrote:

Le decadi 30 nivôse, an CCXXIV, Tobias Rapp a écrit :

Attached patch adds some example scripts for the concat demuxer to the
documentation.


Well, I maintain the code, not really the documentation.


>From 5ffc11e8139476d18cd2eaa28338adb0dda80999 Mon Sep 17 00:00:00 2001
From: Tobias Rapp 
Date: Tue, 19 Jan 2016 15:42:33 +0100
Subject: [PATCH] doc/demuxers: add some concat demuxer script examples

Signed-off-by: Tobias Rapp 
---
  doc/demuxers.texi | 21 +
  1 file changed, 21 insertions(+)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index fb1e4fb..3900272 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -214,6 +214,27 @@ The default is 0.

  @end table

+@subsection Examples
+



+Example script which uses absolute filenames and includes some comments:


I am not sure that "which" is the most idiomatic here, "that" sound better,
but I am not a native speaker.


I can also avoid which/that by "itemize"-ing the examples similar to 
other example sections within the documentation. Attached an updated 
version of the patch.



+@example
+# my first filename
+file /mnt/share/file-1.wav
+# my second filename including whitespace
+file '/mnt/share/file 2.wav'
+# my third filename including whitespace plus single quote
+file '/mnt/share/file 3'\''.wav'
+@end example
+
+Example script which allows for input format auto-probing, uses safe filenames
+and sets the duration of the first file:
+@example
+ffconcat version 1.0
+file file-1.wav
+duration 20.0
+file 'file 2.wav'
+@end example
+
  @section flv

  Adobe Flash Video Format demuxer.


No objection apart from that.


Regards,
Tobias
>From 2faf6c05df62c69347091aa6254c2db796d19345 Mon Sep 17 00:00:00 2001
From: Tobias Rapp 
Date: Tue, 26 Jan 2016 09:02:51 +0100
Subject: [PATCH] doc/demuxers: add some concat demuxer script examples

Signed-off-by: Tobias Rapp 
---
 doc/demuxers.texi | 25 +
 1 file changed, 25 insertions(+)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index fb1e4fb..02cd041 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -214,6 +214,31 @@ The default is 0.
 
 @end table
 
+@subsection Examples
+
+@itemize
+@item
+Use absolute filenames and include some comments:
+@example
+# my first filename
+file /mnt/share/file-1.wav
+# my second filename including whitespace
+file '/mnt/share/file 2.wav'
+# my third filename including whitespace plus single quote
+file '/mnt/share/file 3'\''.wav'
+@end example
+
+@item
+Allow for input format auto-probing, use safe filenames and set the duration of
+the first file:
+@example
+ffconcat version 1.0
+file file-1.wav
+duration 20.0
+file 'file 2.wav'
+@end example
+@end itemize
+
 @section flv
 
 Adobe Flash Video Format demuxer.
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH] avfilter: add streamselect and astreamselect filter

2016-01-26 Thread Paul B Mahol
On 1/25/16, Paul B Mahol  wrote:
> On 1/21/16, Paul B Mahol  wrote:
>> Hi,
>> patch attached.
>>
>
> 2nd version attached.
>

3rd version attached.
From ec5246fc9d3275f8a12ae78b70ffea1a685bdfee Mon Sep 17 00:00:00 2001
From: Paul B Mahol 
Date: Mon, 18 Jan 2016 11:22:32 +0100
Subject: [PATCH] avfilter: add streamselect and astreamselect filter
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Clément Bœsch 
Signed-off-by: Paul B Mahol 
---
 Changelog|   1 +
 doc/filters.texi |  39 +
 libavfilter/Makefile |   2 +
 libavfilter/allfilters.c |   2 +
 libavfilter/f_streamselect.c | 353 +++
 libavfilter/version.h|   2 +-
 6 files changed, 398 insertions(+), 1 deletion(-)
 create mode 100644 libavfilter/f_streamselect.c

diff --git a/Changelog b/Changelog
index 6689951..fc62187 100644
--- a/Changelog
+++ b/Changelog
@@ -59,6 +59,7 @@ version :
 - afftfilt filter
 - convolution filter
 - libquvi support removed
+- streamselect video and astreamselect audio filter
 
 
 version 2.8:
diff --git a/doc/filters.texi b/doc/filters.texi
index 8545a2e..a2d4a51 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -11212,6 +11212,45 @@ stereo3d=abl:sbsr
 @end example
 @end itemize
 
+@section streamselect, astreamselect
+Select video or audio streams.
+
+The filter accepts the following options:
+
+@table @option
+@item inputs
+Set number of inputs. Default is 2.
+
+@item map
+Set input indexes to remap to outputs.
+@end table
+
+@subsection Commands
+
+The @code{streamselect} and @code{astreamselect} filter supports the following
+commands:
+
+@table @option
+@item map
+Set input indexes to remap to outputs.
+@end table
+
+@subsection Examples
+
+@itemize
+@item
+Select first 5 seconds 1st stream and rest of time 2nd stream:
+@example
+sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
+@end example
+
+@item
+Same as above, but for audio:
+@example
+asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
+@end example
+@end itemize
+
 @anchor{spp}
 @section spp
 
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index b93e5f2..2225c8a 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -57,6 +57,7 @@ OBJS-$(CONFIG_ASETTB_FILTER) += settb.o
 OBJS-$(CONFIG_ASHOWINFO_FILTER)  += af_ashowinfo.o
 OBJS-$(CONFIG_ASPLIT_FILTER) += split.o
 OBJS-$(CONFIG_ASTATS_FILTER) += af_astats.o
+OBJS-$(CONFIG_ASTREAMSELECT_FILTER)  += f_streamselect.o
 OBJS-$(CONFIG_ASYNCTS_FILTER)+= af_asyncts.o
 OBJS-$(CONFIG_ATEMPO_FILTER) += af_atempo.o
 OBJS-$(CONFIG_ATRIM_FILTER)  += trim.o
@@ -236,6 +237,7 @@ OBJS-$(CONFIG_SPLIT_FILTER)  += split.o
 OBJS-$(CONFIG_SPP_FILTER)+= vf_spp.o
 OBJS-$(CONFIG_SSIM_FILTER)   += vf_ssim.o dualinput.o framesync.o
 OBJS-$(CONFIG_STEREO3D_FILTER)   += vf_stereo3d.o
+OBJS-$(CONFIG_STREAMSELECT_FILTER)   += f_streamselect.o
 OBJS-$(CONFIG_SUBTITLES_FILTER)  += vf_subtitles.o
 OBJS-$(CONFIG_SUPER2XSAI_FILTER) += vf_super2xsai.o
 OBJS-$(CONFIG_SWAPUV_FILTER) += vf_swapuv.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 1d48970..eff5af9 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -78,6 +78,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(ASHOWINFO,  ashowinfo,  af);
 REGISTER_FILTER(ASPLIT, asplit, af);
 REGISTER_FILTER(ASTATS, astats, af);
+REGISTER_FILTER(ASTREAMSELECT,  astreamselect,  af);
 REGISTER_FILTER(ASYNCTS,asyncts,af);
 REGISTER_FILTER(ATEMPO, atempo, af);
 REGISTER_FILTER(ATRIM,  atrim,  af);
@@ -256,6 +257,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(SPP,spp,vf);
 REGISTER_FILTER(SSIM,   ssim,   vf);
 REGISTER_FILTER(STEREO3D,   stereo3d,   vf);
+REGISTER_FILTER(STREAMSELECT,   streamselect,   vf);
 REGISTER_FILTER(SUBTITLES,  subtitles,  vf);
 REGISTER_FILTER(SUPER2XSAI, super2xsai, vf);
 REGISTER_FILTER(SWAPUV, swapuv, vf);
diff --git a/libavfilter/f_streamselect.c b/libavfilter/f_streamselect.c
new file mode 100644
index 000..db46c99
--- /dev/null
+++ b/libavfilter/f_streamselect.c
@@ -0,0 +1,353 @@
+/*
+ * 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 th

[FFmpeg-devel] 1 bpp BMP sample with palette in the 'bmp' directory of the FATE test suite

2016-01-26 Thread Mats Peterson
I discovered a 1 bpp BMP file with a palette called 'test1.bmp' in the 
'bmp' directory of the FATE test suite. When converting this file with, 
say, "ffmpeg -i test1.bmp test.avi", the output file will use the colors 
of the palette in the BMP file, not black & white. Also, the pixel 
format used for the file is pal8, not monow. This leads me to believe we 
should use pal8 for raw 1 bpp video in AVI in rawdec.c as well, in spite 
of Microsoft's use of the word "monochrome". But then again, the pal8 to 
yuv420p conversion discrepancies, using 0x10 and 0xEB instead of 0x00 
and 0xFF as the output values, will have to get fixed, in order to pass 
the FATE test suite. This is nothing urgent, of course.


Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] 1 bpp BMP sample with palette in the 'bmp' directory of the FATE test suite

2016-01-26 Thread Mats Peterson

On 01/26/2016 10:42 AM, Mats Peterson wrote:

I discovered a 1 bpp BMP file with a palette called 'test1.bmp' in the
'bmp' directory of the FATE test suite. When converting this file with,
say, "ffmpeg -i test1.bmp test.avi", the output file will use the colors
of the palette in the BMP file, not black & white. Also, the pixel
format used for the file is pal8, not monow. This leads me to believe we
should use pal8 for raw 1 bpp video in AVI in rawdec.c as well, in spite
of Microsoft's use of the word "monochrome". But then again, the pal8 to
yuv420p conversion discrepancies, using 0x10 and 0xEB instead of 0x00
and 0xFF as the output values, will have to get fixed, in order to pass
the FATE test suite. This is nothing urgent, of course.

Mats



I should add that opening this file in Paint in Windows XP will show the 
colors properly, not just black & white.


Mats

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


Re: [FFmpeg-devel] 1 bpp BMP sample with palette in the 'bmp' directory of the FATE test suite

2016-01-26 Thread Paul B Mahol
On 1/26/16, Mats Peterson  wrote:
> On 01/26/2016 10:42 AM, Mats Peterson wrote:
>> I discovered a 1 bpp BMP file with a palette called 'test1.bmp' in the
>> 'bmp' directory of the FATE test suite. When converting this file with,
>> say, "ffmpeg -i test1.bmp test.avi", the output file will use the colors
>> of the palette in the BMP file, not black & white. Also, the pixel
>> format used for the file is pal8, not monow. This leads me to believe we
>> should use pal8 for raw 1 bpp video in AVI in rawdec.c as well, in spite
>> of Microsoft's use of the word "monochrome". But then again, the pal8 to
>> yuv420p conversion discrepancies, using 0x10 and 0xEB instead of 0x00
>> and 0xFF as the output values, will have to get fixed, in order to pass
>> the FATE test suite. This is nothing urgent, of course.
>>
>> Mats
>>
>
> I should add that opening this file in Paint in Windows XP will show the
> colors properly, not just black & white.
>

Who still use pal8 today? Only you.

> Mats
>
> ___
> 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] 1 bpp BMP sample with palette in the 'bmp' directory of the FATE test suite

2016-01-26 Thread Mats Peterson

On 01/26/2016 10:55 AM, Paul B Mahol wrote:

On 1/26/16, Mats Peterson  wrote:

On 01/26/2016 10:42 AM, Mats Peterson wrote:

I discovered a 1 bpp BMP file with a palette called 'test1.bmp' in the
'bmp' directory of the FATE test suite. When converting this file with,
say, "ffmpeg -i test1.bmp test.avi", the output file will use the colors
of the palette in the BMP file, not black & white. Also, the pixel
format used for the file is pal8, not monow. This leads me to believe we
should use pal8 for raw 1 bpp video in AVI in rawdec.c as well, in spite
of Microsoft's use of the word "monochrome". But then again, the pal8 to
yuv420p conversion discrepancies, using 0x10 and 0xEB instead of 0x00
and 0xFF as the output values, will have to get fixed, in order to pass
the FATE test suite. This is nothing urgent, of course.

Mats



I should add that opening this file in Paint in Windows XP will show the
colors properly, not just black & white.



Who still use pal8 today? Only you.

That wasn't very helpful was it? There are loads of old 1 bpp and 8 bpp 
files out there.


Mats

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


Re: [FFmpeg-devel] [PATCH] libavformat/rtsp: Fix rtsps, do not force tcp transport

2016-01-26 Thread Michael Niedermayer
On Thu, Jan 21, 2016 at 10:23:52AM +0100, Yannick Poirier wrote:
> 
> rtsp over ssl is not working. tls does not implement 
> prot->url_get_file_handle so ffurl_get_file_handle() fails.
> struct sockaddr_storage peer is initialized but not used, remove it.
> rtsps lower transport was set to TCP. Transport could be UDP. It permits to 
> use RTSPS + SRTP.
> 
> ---
>  libavformat/rtsp.c | 15 +--
>  1 file changed, 1 insertion(+), 14 deletions(-)

this patch doesnt apply cleanly

Applying: libavformat/rtsp: Fix rtsps, do not force tcp transport
Using index info to reconstruct a base tree...
error: patch failed: libavformat/rtsp.c:1651
error: libavformat/rtsp.c: patch does not apply
Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Cannot fall back to three-way merge.

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.


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


Re: [FFmpeg-devel] [PATCH] avformat/thp: implement seeking

2016-01-26 Thread Michael Niedermayer
On Tue, Jan 26, 2016 at 09:03:05AM +0100, Paul B Mahol wrote:
> On 1/26/16, Michael Niedermayer  wrote:
> > On Mon, Jan 25, 2016 at 11:02:35PM +0100, Paul B Mahol wrote:
> >> On 1/25/16, Michael Niedermayer  wrote:
> >> > On Mon, Jan 25, 2016 at 10:29:08PM +0100, Paul B Mahol wrote:
> >> >> On 1/25/16, Michael Niedermayer  wrote:
> >> >> > On Sun, Nov 22, 2015 at 12:58:51AM +0100, Paul B Mahol wrote:
> >> >> >> Signed-off-by: Paul B Mahol 
> >> >> >> ---
> >> >> >>  libavformat/thp.c | 44
> >> >> >> +---
> >> >> >>  1 file changed, 41 insertions(+), 3 deletions(-)
> >> >> >
> >> >> > confirmed to be working
> >> >>
> >> >> No, it doesnt always. AFAIK its not possible to fix.
> >> >
> >> > it worked with the thp files i had locally :(
> >> > where can i find a file with which it doesnt work ?
> >>
> >> https://www.dropbox.com/s/zr8034va0y6tfyy/KilllaKillOP.thp
> >
> > seeking (clicking right/left arrows in ffplay) seems to work with
> > this file too
> >
> 
> but with mouse, doesnt?

needs something like this:

diff --git a/libavformat/thp.c b/libavformat/thp.c
index 9d54219..38d67b8 100644
--- a/libavformat/thp.c
+++ b/libavformat/thp.c
@@ -223,7 +223,7 @@ static int thp_read_seek(AVFormatContext *s, int 
stream_index,
 if (stream_index != thp->video_stream_index)
 return -1;

-if (index >= 0 && index < st->nb_index_entries) {
+if (index >= 0 && index < st->nb_index_entries && 
st->index_entries[index].timestamp >= timestamp) {
 AVIndexEntry *e   = &st->index_entries[index];

 thp->next_frame   = e->pos;

OR


diff --git a/libavformat/thp.c b/libavformat/thp.c
index 9d54219..9892d61 100644
--- a/libavformat/thp.c
+++ b/libavformat/thp.c
@@ -218,7 +218,7 @@ static int thp_read_seek(AVFormatContext *s, int 
stream_index,
 {
 ThpDemuxContext *thp = s->priv_data;
 AVStream *st = s->streams[stream_index];
-int index = av_index_search_timestamp(st, timestamp, flags);
+int index = av_index_search_timestamp(st, timestamp, flags & 
~AVSEEK_FLAG_BACKWARD);

 if (stream_index != thp->video_stream_index)
 return -1;

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

The worst form of inequality is to try to make unequal things equal.
-- Aristotle


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


Re: [FFmpeg-devel] [PATCH 1/2] avutil: add P010 pixel format

2016-01-26 Thread Hendrik Leppkes
On Thu, Jan 7, 2016 at 8:17 PM, Michael Niedermayer
 wrote:
> On Thu, Jan 07, 2016 at 12:11:21PM +0100, Hendrik Leppkes wrote:
>> P010 is the 10-bit variant of NV12 (planar luma, packed chroma), using two
>> bytes per component to store 10-bit data plus 6-bit zeroes in the LSBs.
>> ---
>>  libavutil/pixdesc.c | 24 
>>  libavutil/pixfmt.h  |  4 
>>  2 files changed, 28 insertions(+)
>
> needs a minor version bump otherwise should be ok
>

Bump added, set pushed, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] diracdec: add support for field coding

2016-01-26 Thread Rostislav Pehlivanov
This commit adds support for field coding (instead of the traditional
frame coding). In this mode, two fields, each half height, are
transmitted. The decoder does not output a frame for the first field
(the top one since Dirac only supports top field first) but caches it
and interleaves the image during the second field.

Tested with both the unmerged native Dirac encoder and the reference
implementations, both work.

Signed-off-by: Rostislav Pehlivanov 
---
 libavcodec/dirac.c| 15 +++--
 libavcodec/dirac.h|  1 +
 libavcodec/diracdec.c | 59 +--
 3 files changed, 56 insertions(+), 19 deletions(-)

diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c
index 39df2a8..d19adcf 100644
--- a/libavcodec/dirac.c
+++ b/libavcodec/dirac.c
@@ -324,7 +324,7 @@ int av_dirac_parse_sequence_header(AVDiracSeqHeader **pdsh,
 {
 AVDiracSeqHeader *dsh;
 GetBitContext gb;
-unsigned video_format, picture_coding_mode;
+unsigned video_format;
 int ret;
 
 dsh = av_mallocz(sizeof(*dsh));
@@ -373,17 +373,8 @@ int av_dirac_parse_sequence_header(AVDiracSeqHeader **pdsh,
 if (ret < 0)
 goto fail;
 
-/* [DIRAC_STD] picture_coding_mode shall be 0 for fields and 1 for frames
- * currently only used to signal field coding */
-picture_coding_mode = svq3_get_ue_golomb(&gb);
-if (picture_coding_mode != 0) {
-if (log_ctx) {
-av_log(log_ctx, AV_LOG_ERROR, "Unsupported picture coding mode %d",
-   picture_coding_mode);
-}
-ret = AVERROR_INVALIDDATA;
-goto fail;
-}
+/* [DIRAC_STD] picture_coding_mode shall be 1 for fields and 0 for frames 
*/
+dsh->field_coding   = svq3_get_ue_golomb(&gb);
 
 *pdsh = dsh;
 return 0;
diff --git a/libavcodec/dirac.h b/libavcodec/dirac.h
index cb80fdc..447fafc 100644
--- a/libavcodec/dirac.h
+++ b/libavcodec/dirac.h
@@ -74,6 +74,7 @@ typedef struct AVDiracSeqHeader {
 
 uint8_t interlaced;
 uint8_t top_field_first;
+uint8_t field_coding;
 
 uint8_t frame_rate_index;   ///< index into dirac_frame_rate[]
 uint8_t aspect_ratio_index; ///< index into dirac_aspect_ratio[]
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index ca44e7b..2f320a4 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -161,6 +161,8 @@ typedef struct DiracContext {
 int dc_prediction;  /* has dc prediction */
 int globalmc_flag;  /* use global motion compensation*/
 int num_refs;   /* number of reference pictures  */
+int field_coding;   /* fields instead of frames  */
+int cur_field;  /* 0 -> progressive/top, 1 -> bottom */
 
 /* wavelet decoding */
 unsigned wavelet_depth; /* depth of the IDWT */
@@ -227,6 +229,7 @@ typedef struct DiracContext {
 dirac_weight_func weight_func;
 dirac_biweight_func biweight_func;
 
+AVFrame *prev_field;
 DiracFrame *current_picture;
 DiracFrame *ref_pics[2];
 
@@ -1838,13 +1841,21 @@ static int dirac_decode_frame_internal(DiracContext *s)
 return ret;
 
 if (!s->num_refs) { /* intra */
-for (y = 0; y < p->height; y += 16) {
-int idx = (s->bit_depth - 8) >> 1;
-ff_spatial_idwt_slice2(&d, y+16); /* decode */
-s->diracdsp.put_signed_rect_clamped[idx](frame + y*p->stride,
- p->stride,
- p->idwt_buf + 
y*p->idwt_stride,
- p->idwt_stride, 
p->width, 16);
+const int idx = (s->bit_depth - 8) >> 1;
+const int ostride = p->stride*(1 + s->field_coding);
+for (y = 0; y < p->height; y += 16)
+ff_spatial_idwt_slice2(&d, y+16);
+s->diracdsp.put_signed_rect_clamped[idx](frame + 
s->cur_field*p->stride,
+ ostride, p->idwt_buf,
+ p->idwt_stride, p->width,
+ p->height);
+if (s->field_coding && s->cur_field) { /* Copy the top field */
+int x, y;
+uint8_t *src = s->prev_field->data[comp];
+for (y = 0; y < p->height; y++) {
+for (x = 0; x < p->width*2; x++)
+frame[p->stride*y*2 + x] = src[p->stride*y*2 + x];
+}
 }
 } else { /* inter */
 int rowheight = p->ybsep*p->stride;
@@ -2070,6 +2081,10 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, 
const uint8_t *buf, int
 }
 
 ret = ff_set_dimensions(avctx, dsh->width, dsh->height);
+
+if (dsh->field_coding)

[FFmpeg-devel] [PATCH v2 1/2] ffmpeg_opt: Move the 'process manually set programs' block above 'process manually set metadata' in open_output_file().

2016-01-26 Thread Vittorio Gambaletta (VittGam)
Signed-off-by: Vittorio Gambaletta 
---
 ffmpeg_opt.c |  112 +-
 1 file changed, 56 insertions(+), 56 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 9b341cf..e03ad89 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -2358,6 +2358,62 @@ loop_end:
 }
 }
 
+/* process manually set programs */
+for (i = 0; i < o->nb_program; i++) {
+const char *p = o->program[i].u.str;
+int progid = i+1;
+AVProgram *program;
+
+while(*p) {
+const char *p2 = av_get_token(&p, ":");
+char *key;
+if (!p2)
+break;
+if(*p) p++;
+
+key = av_get_token(&p2, "=");
+if (!key || !*p2)
+break;
+p2++;
+
+if (!strcmp(key, "program_num"))
+progid = strtol(p2, NULL, 0);
+}
+
+program = av_new_program(oc, progid);
+
+p = o->program[i].u.str;
+while(*p) {
+const char *p2 = av_get_token(&p, ":");
+char *key;
+if (!p2)
+break;
+if(*p) p++;
+
+key = av_get_token(&p2, "=");
+if (!key) {
+av_log(NULL, AV_LOG_FATAL,
+   "No '=' character in program string %s.\n",
+   p2);
+exit_program(1);
+}
+if (!*p2)
+exit_program(1);
+p2++;
+
+if (!strcmp(key, "title")) {
+av_dict_set(&program->metadata, "title", p2, 0);
+} else if (!strcmp(key, "program_num")) {
+} else if (!strcmp(key, "st")) {
+int st_num = strtol(p2, NULL, 0);
+av_program_add_stream_index(oc, progid, st_num);
+} else {
+av_log(NULL, AV_LOG_FATAL, "Unknown program key %s.\n", key);
+exit_program(1);
+}
+}
+}
+
 /* process manually set metadata */
 for (i = 0; i < o->nb_metadata; i++) {
 AVDictionary **m;
@@ -2418,62 +2474,6 @@ loop_end:
 }
 }
 
-/* process manually set programs */
-for (i = 0; i < o->nb_program; i++) {
-const char *p = o->program[i].u.str;
-int progid = i+1;
-AVProgram *program;
-
-while(*p) {
-const char *p2 = av_get_token(&p, ":");
-char *key;
-if (!p2)
-break;
-if(*p) p++;
-
-key = av_get_token(&p2, "=");
-if (!key || !*p2)
-break;
-p2++;
-
-if (!strcmp(key, "program_num"))
-progid = strtol(p2, NULL, 0);
-}
-
-program = av_new_program(oc, progid);
-
-p = o->program[i].u.str;
-while(*p) {
-const char *p2 = av_get_token(&p, ":");
-char *key;
-if (!p2)
-break;
-if(*p) p++;
-
-key = av_get_token(&p2, "=");
-if (!key) {
-av_log(NULL, AV_LOG_FATAL,
-   "No '=' character in program string %s.\n",
-   p2);
-exit_program(1);
-}
-if (!*p2)
-exit_program(1);
-p2++;
-
-if (!strcmp(key, "title")) {
-av_dict_set(&program->metadata, "title", p2, 0);
-} else if (!strcmp(key, "program_num")) {
-} else if (!strcmp(key, "st")) {
-int st_num = strtol(p2, NULL, 0);
-av_program_add_stream_index(oc, progid, st_num);
-} else {
-av_log(NULL, AV_LOG_FATAL, "Unknown program key %s.\n", key);
-exit_program(1);
-}
-}
-}
-
 return 0;
 }
 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 2/2] ffmpeg_opt: Allow -metadata option to set metadata on programs.

2016-01-26 Thread Vittorio Gambaletta (VittGam)
Signed-off-by: Vittorio Gambaletta 
---
 doc/ffmpeg.texi |4 ++--
 ffmpeg_opt.c|7 +++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index a38a32e..7d3266a 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -339,8 +339,8 @@ see @ref{date syntax,,the Date section in the 
ffmpeg-utils(1) manual,ffmpeg-util
 Set a metadata key/value pair.
 
 An optional @var{metadata_specifier} may be given to set metadata
-on streams or chapters. See @code{-map_metadata} documentation for
-details.
+on streams, chapters or programs. See @code{-map_metadata}
+documentation for details.
 
 This option overrides metadata set with @code{-map_metadata}. It is
 also possible to delete metadata by using an empty value.
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index e03ad89..669976b 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -2466,6 +2466,13 @@ loop_end:
 }
 m = &oc->chapters[index]->metadata;
 break;
+case 'p':
+if (index < 0 || index >= oc->nb_programs) {
+av_log(NULL, AV_LOG_FATAL, "Invalid program index %d in 
metadata specifier.\n", index);
+exit_program(1);
+}
+m = &oc->programs[index]->metadata;
+break;
 default:
 av_log(NULL, AV_LOG_FATAL, "Invalid metadata specifier %s.\n", 
o->metadata[i].specifier);
 exit_program(1);
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] doc/filters: add an example to scale

2016-01-26 Thread James Darnley
On 2016-01-22 14:44, Michael Niedermayer wrote:
> On Fri, Jan 22, 2016 at 03:53:10AM +0100, James Darnley wrote:
>> Someone on IRC asked for a scale that would fit in a given box.  This is the
>> answer.  I couldn't see it in the existing examples so I thought I would add 
>> it.
>> ---
>>  doc/filters.texi | 6 ++
>>  1 file changed, 6 insertions(+)
> 
> LGTM
> 
> thx

Thanks Michael.

I nearly forgot about this.  If nobody else has any comments I will push
it later today.




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


Re: [FFmpeg-devel] [PATCH] doc/filters: add an example to scale

2016-01-26 Thread Vittorio Gambaletta (VittGam)

Hi,

On 26/01/2016 15:16:21 CET, James Darnley wrote:

On 2016-01-22 14:44, Michael Niedermayer wrote:

On Fri, Jan 22, 2016 at 03:53:10AM +0100, James Darnley wrote:

Someone on IRC asked for a scale that would fit in a given box.  This is the
answer.  I couldn't see it in the existing examples so I thought I would add it.
---
 doc/filters.texi | 6 ++
 1 file changed, 6 insertions(+)


LGTM

thx


Thanks Michael.

I nearly forgot about this.  If nobody else has any comments I will push
it later today.


Instead of a 720x720 box it could be a 720x576 box (to avoid confusion in
other usage cases where the box isn't square).

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


Re: [FFmpeg-devel] [PATCH] diracdec: add support for field coding

2016-01-26 Thread Carl Eugen Hoyos
Rostislav Pehlivanov  gmail.com> writes:

> -for (y = 0; y < p->height; y += 16) {

> -ff_spatial_idwt_slice2(&d, y+16); /* decode */

> +for (y = 0; y < p->height; y += 16)
> +ff_spatial_idwt_slice2(&d, y+16);

Sorry if it's just me but don't you agree that this is 
much more readable without the unneeded changes?
(Apart from git blame.)

> +if (s->field_coding && s->cur_field) { /* Copy the top field */
> +int x, y;
> +uint8_t *src = s->prev_field->data[comp];
> +for (y = 0; y < p->height; y++) {
> +for (x = 0; x < p->width*2; x++)
> +frame[p->stride*y*2 + x] = src[p->stride*y*2 + x];

Can't you avoid this?

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] avcodec: add Ulead DV Audio decoder

2016-01-26 Thread Carl Eugen Hoyos
Paul B Mahol  gmail.com> writes:

> patch attached.

Please mention the ticket number.

Thank you, Carl Eugen

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


Re: [FFmpeg-devel] [PATCH 2/2] dirac: implement a native Dirac HQ encoder

2016-01-26 Thread Carl Eugen Hoyos
Rostislav Pehlivanov  gmail.com> writes:

> This commit adds a new encoder capable of creating 
> BBC Dirac VC-2 HQ profile files.

Shouldn't the short name of this encoder be "vc2" while a 
future encoder with non-I frames would be called "dirac"?

> + * Copyright (C) 2016 Open Broadcast Systems Ltd.
> + * Author(C) 2016 Rostislav Pehlivanov  gmail.com>

If this can't be changed, please explain it:
Who is / are the copyright holder(s) of the new encoder?

Thank you, Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] diracdec: add support for field coding

2016-01-26 Thread Rostislav Pehlivanov
On 26 January 2016 at 14:45, Carl Eugen Hoyos  wrote:

> Rostislav Pehlivanov  gmail.com> writes:
>
> > -for (y = 0; y < p->height; y += 16) {
>
> > -ff_spatial_idwt_slice2(&d, y+16); /* decode */
>
> > +for (y = 0; y < p->height; y += 16)
> > +ff_spatial_idwt_slice2(&d, y+16);
>
> Sorry if it's just me but don't you agree that this is
> much more readable without the unneeded changes?
> (Apart from git blame.)
>

The space was removed so it doesn't waste a line.
The decode comment was removed because it was out of place. What happens
there is an inverse wavelet transform, but no decoding actually occurs
since every single coefficient has already been read.
The stride needs to get changed during interlacing (only on the output,
transforms are still done on half height) so there's no getting away from
actually changing the next line.
Moved the s->diracdsp.put_signed_rect_clamped outside the loop as it should
boost performance by a bit since it gets called only once instead of
height/16 times.
Really, the only single major change here is the
s->diracdsp.put_signed_rect_clamped having its stride doubled on interlaced
(required for this patch to work) and being moved outside the loop. And I'd
say sending a separate patch for moving it outside the loop and removing a
space and a wrong comment creates too much noise.


> > +if (s->field_coding && s->cur_field) { /* Copy the top field */
> > +int x, y;
> > +uint8_t *src = s->prev_field->data[comp];
> > +for (y = 0; y < p->height; y++) {
> > +for (x = 0; x < p->width*2; x++)
> > +frame[p->stride*y*2 + x] = src[p->stride*y*2 + x];
>
> Can't you avoid this?
>

Don't know how/if it's even possible. I need to store the field somewhere
and then copy it. I asked on IRC if it's even possible to reuse an AVFrame
from a previous frame but got suggested to just set up a ref frame and
unref it later, which is what I did.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] diracdec: add support for field coding

2016-01-26 Thread Hendrik Leppkes
On Tue, Jan 26, 2016 at 4:13 PM, Rostislav Pehlivanov
 wrote:
> On 26 January 2016 at 14:45, Carl Eugen Hoyos  wrote:
>
>> Rostislav Pehlivanov  gmail.com> writes:
>>
>> > -for (y = 0; y < p->height; y += 16) {
>>
>> > -ff_spatial_idwt_slice2(&d, y+16); /* decode */
>>
>> > +for (y = 0; y < p->height; y += 16)
>> > +ff_spatial_idwt_slice2(&d, y+16);
>>
>> Sorry if it's just me but don't you agree that this is
>> much more readable without the unneeded changes?
>> (Apart from git blame.)
>>
>
> The space was removed so it doesn't waste a line.
> The decode comment was removed because it was out of place. What happens
> there is an inverse wavelet transform, but no decoding actually occurs
> since every single coefficient has already been read.
> The stride needs to get changed during interlacing (only on the output,
> transforms are still done on half height) so there's no getting away from
> actually changing the next line.
> Moved the s->diracdsp.put_signed_rect_clamped outside the loop as it should
> boost performance by a bit since it gets called only once instead of
> height/16 times.
> Really, the only single major change here is the
> s->diracdsp.put_signed_rect_clamped having its stride doubled on interlaced
> (required for this patch to work) and being moved outside the loop. And I'd
> say sending a separate patch for moving it outside the loop and removing a
> space and a wrong comment creates too much noise.
>
>
>> > +if (s->field_coding && s->cur_field) { /* Copy the top field */
>> > +int x, y;
>> > +uint8_t *src = s->prev_field->data[comp];
>> > +for (y = 0; y < p->height; y++) {
>> > +for (x = 0; x < p->width*2; x++)
>> > +frame[p->stride*y*2 + x] = src[p->stride*y*2 + x];
>>
>> Can't you avoid this?
>>
>
> Don't know how/if it's even possible. I need to store the field somewhere
> and then copy it. I asked on IRC if it's even possible to reuse an AVFrame
> from a previous frame but got suggested to just set up a ref frame and
> unref it later, which is what I did.

Can't you just decode into your temporary frame without copying the field?
ie. first decode the top field in there, then the bottom field, and
then output the whole thing.

That would avoid a costly copy.

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


Re: [FFmpeg-devel] [PATCH] lavc/rawdec: Use AV_PIX_FMT_PAL8 for 1 bpp raw video in AVI

2016-01-26 Thread Mats Peterson

On 01/26/2016 11:43 AM, Mats Peterson wrote:

Michael, the 'test1.bmp' file in the 'bmp' directory in the FATE test
suite contains a palette with green and blue colors, and when opening it
in Paint in Windows XP, it will be displayed with the colors in the
palette, not just black & white. This leads me to believe we should use
pal8 and not monow for raw 1 bpp video in AVI after all.

Please see the attached "test suite", it contains a README file with
further information.

This patch can't be applied until the raw yuv420p output differences
between using monow and pal8 as the source (output values being 0x10 and
0xEB for pal8, and 0x00 and 0xFF for monow) are solved. Or if you just
rewrite the 1 bpp test in some way.

Mats



From https://en.wikipedia.org/wiki/BMP_file_format#Pixel_format:

"The 1-bit per pixel (1bpp) format supports 2 distinct colors, (for 
example: black and white). The pixel values are stored in each bit, with 
the first (left-most) pixel in the most-significant bit of the first 
byte.[5] Each bit is an index into a table of 2 colors. An unset bit 
will refer to the first color table entry, and a set bit will refer to 
the last (second) color table entry."


I don't know whether this Wikipedia article has a lot of authority 
really, but please note the "for example black and white".


Mats

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


Re: [FFmpeg-devel] Avid DNxHR / UK DPP

2016-01-26 Thread John Warburton
On 25 Jan 2016 23:04, "Kieran Kunhya"  wrote:
>
> If they are considering VC-5 (Cineform) basically point them to this:
>
https://medium.com/@kierank_/reverse-engineering-the-gopro-cineform-codec-7411312bfe1c
>
> tl;dr The VC-5 document isn't enough to implement things in the
> real-world (like many useless SMPTE documents).

Thanks for letting me know. I read your reverse-engineering saga. At the
moment, the DPP workflow guidance is codec-agnostic and does not involve
delivery specifications. My influence is probably negligible (and I do not
speak for them at all) but I'll do my best to encourage delivery codecs for
which source code is readily available under an open licence and in FFmpeg
e.g. VC-2.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/rawdec: Use AV_PIX_FMT_PAL8 for 1 bpp raw video in AVI

2016-01-26 Thread Mats Peterson

On 01/26/2016 04:48 PM, Mats Peterson wrote:

 From https://en.wikipedia.org/wiki/BMP_file_format#Pixel_format:

"The 1-bit per pixel (1bpp) format supports 2 distinct colors, (for
example: black and white). The pixel values are stored in each bit, with
the first (left-most) pixel in the most-significant bit of the first
byte.[5] Each bit is an index into a table of 2 colors. An unset bit
will refer to the first color table entry, and a set bit will refer to
the last (second) color table entry."

I don't know whether this Wikipedia article has a lot of authority
really, but please note the "for example black and white".

Mats



From 
https://msdn.microsoft.com/en-us/library/windows/desktop/dd318229%28v=vs.85%29.aspx:


"If biCompression equals BI_RGB and the bitmap uses 8 bpp or less, the 
bitmap has a color table immediatelly following the BITMAPINFOHEADER 
structure. The color table consists of an array of RGBQUAD values. The 
size of the array is given by the biClrUsed member. If biClrUsed is 
zero, the array contains the maximum number of colors for the given 
bitdepth; that is, 2^biBitCount colors."


Nothing about "monochrome" here.

Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavc/mjpegdec: speed up scan data copy

2016-01-26 Thread Matthieu Bouron
From: Matthieu Bouron 

---

From random 3264x2448 jpegs, scan data copy on a Nexus5 goes from [15, 28]ms to 
[3, 12]ms.

---
 libavcodec/mjpegdec.c | 43 +--
 1 file changed, 33 insertions(+), 10 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 863738d..9a501d2 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1917,24 +1917,47 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
 /* unescape buffer of SOS, use special treatment for JPEG-LS */
 if (start_code == SOS && !s->ls) {
 const uint8_t *src = *buf_ptr;
+const uint8_t *ptr = src;
 uint8_t *dst = s->buffer;
 
-while (src < buf_end) {
-uint8_t x = *(src++);
+#define copy_data_segment(skipped) do {   \
+ssize_t length = (ptr - src) - (skipped); \
+if (length > 0) { \
+memcpy(dst, src, length); \
+dst += length;\
+src = ptr;\
+} \
+} while (0)
+
+if (s->avctx->codec_id == AV_CODEC_ID_THP) {
+ptr = buf_end;
+copy_data_segment(0);
+} else {
+while (ptr < buf_end) {
+uint8_t x = *(ptr++);
 
-*(dst++) = x;
-if (s->avctx->codec_id != AV_CODEC_ID_THP) {
 if (x == 0xff) {
-while (src < buf_end && x == 0xff)
-x = *(src++);
+ssize_t skipped = -1;
+while (ptr < buf_end && x == 0xff) {
+x = *(ptr++);
+skipped++;
+}
 
-if (x >= 0xd0 && x <= 0xd7)
-*(dst++) = x;
-else if (x)
-break;
+if (skipped > 0)
+copy_data_segment(skipped);
+
+if (x < 0xd0 || x > 0xd7) {
+copy_data_segment(1);
+if (x)
+break;
+}
 }
 }
+if (src < ptr)
+copy_data_segment(0);
 }
+#undef copy_data_segment
+
 *unescaped_buf_ptr  = s->buffer;
 *unescaped_buf_size = dst - s->buffer;
 memset(s->buffer + *unescaped_buf_size, 0,
-- 
2.7.0

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_crop: make it possible to use frame metadata when cropping

2016-01-26 Thread Michael Niedermayer
On Fri, Jan 22, 2016 at 04:34:27PM +, Paul B Mahol wrote:
> Hi,
> 
> updated version attached.

>  doc/filters.texi  |6 
>  libavfilter/vf_crop.c |   64 
> ++
>  2 files changed, 55 insertions(+), 15 deletions(-)
> 4ec7972e3bee86a096936628e32a18dabd0a1690  
> 0001-avfilter-vf_crop-make-it-possible-to-use-frame-metad.patch
> From 4a4d760c78f16e8ddeab65a0fc6532059bf13750 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol 
> Date: Sun, 17 Jan 2016 20:14:55 +0100
> Subject: [PATCH] avfilter/vf_crop: make it possible to use frame metadata when
>  cropping

can you add a fate test for this ?

also maybe the metadata values could be made available in the
expressions,
and the expressions then be set to default to use the metadata
when its enabled
that would allow using modified metadata like a rectangle enlarged by
2 pixel or such



[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire


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


Re: [FFmpeg-devel] [PATCH v2 2/2] ffmpeg_opt: Allow -metadata option to set metadata on programs.

2016-01-26 Thread Michael Niedermayer
On Tue, Jan 26, 2016 at 03:13:09PM +0100, Vittorio Gambaletta (VittGam) wrote:
> Signed-off-by: Vittorio Gambaletta 
> ---
>  doc/ffmpeg.texi |4 ++--
>  ffmpeg_opt.c|7 +++
>  2 files changed, 9 insertions(+), 2 deletions(-)

both patches applied

maybe you want to add a fate test for this

thanks

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

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.


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


Re: [FFmpeg-devel] [PATCH] doc/filters: add an example to scale

2016-01-26 Thread Vittorio Gambaletta (VittGam)

Hi,

On 26/01/2016 15:20:22 CET, Vittorio Gambaletta (VittGam) wrote:

Hi,

On 26/01/2016 15:16:21 CET, James Darnley wrote:

On 2016-01-22 14:44, Michael Niedermayer wrote:

On Fri, Jan 22, 2016 at 03:53:10AM +0100, James Darnley wrote:

Someone on IRC asked for a scale that would fit in a given box.  This is the
answer.  I couldn't see it in the existing examples so I thought I would add it.
---
 doc/filters.texi | 6 ++
 1 file changed, 6 insertions(+)


LGTM

thx


Thanks Michael.

I nearly forgot about this.  If nobody else has any comments I will push
it later today.


Instead of a 720x720 box it could be a 720x576 box (to avoid confusion in
other usage cases where the box isn't square).


That is, I'm using this to fit the video in a 720x576 box:

scale='width=min(720\,576*dar):height=min(576\,720/dar)'

Also, I'm using this to fit the video in a 720x576 box that has a forced 4:3
aspect ratio (its native aspect ratio is 5:4):

scale='width=min(720\,720/4*3*dar):height=min(576\,576*4/3/dar)'

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


Re: [FFmpeg-devel] [PATCH v2 2/2] ffmpeg_opt: Allow -metadata option to set metadata on programs.

2016-01-26 Thread Vittorio Gambaletta (VittGam)

Hi,

On 26/01/2016 17:37:56 CET, Michael Niedermayer wrote:

On Tue, Jan 26, 2016 at 03:13:09PM +0100, Vittorio Gambaletta (VittGam) wrote:

Signed-off-by: Vittorio Gambaletta 
---
 doc/ffmpeg.texi |4 ++--
 ffmpeg_opt.c|7 +++
 2 files changed, 9 insertions(+), 2 deletions(-)


both patches applied

maybe you want to add a fate test for this

thanks


You're welcome!

I'm now going to have a look at FATE.

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


Re: [FFmpeg-devel] [PATCH] lavc/mjpegdec: speed up scan data copy

2016-01-26 Thread Michael Niedermayer
On Tue, Jan 26, 2016 at 05:15:37PM +0100, Matthieu Bouron wrote:
> From: Matthieu Bouron 
> 
> ---
> 
> From random 3264x2448 jpegs, scan data copy on a Nexus5 goes from [15, 28]ms 
> to [3, 12]ms.

breaks https://trac.ffmpeg.org/raw-attachment/ticket/1527/24bpp.mov

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

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato


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


Re: [FFmpeg-devel] [PATCH v2 2/2] ffmpeg_opt: Allow -metadata option to set metadata on programs.

2016-01-26 Thread Michael Niedermayer
On Tue, Jan 26, 2016 at 05:54:26PM +0100, Vittorio Gambaletta (VittGam) wrote:
> Hi,
> 
> On 26/01/2016 17:37:56 CET, Michael Niedermayer wrote:
> >On Tue, Jan 26, 2016 at 03:13:09PM +0100, Vittorio Gambaletta (VittGam) 
> >wrote:
> >>Signed-off-by: Vittorio Gambaletta 
> >>---
> >> doc/ffmpeg.texi |4 ++--
> >> ffmpeg_opt.c|7 +++
> >> 2 files changed, 9 insertions(+), 2 deletions(-)
> >
> >both patches applied
> >
> >maybe you want to add a fate test for this
> >
> >thanks
> 
> You're welcome!
> 
> I'm now going to have a look at FATE.

thx

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

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


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


Re: [FFmpeg-devel] [PATCH] doc/filters: add an example to scale

2016-01-26 Thread James Darnley
On 2016-01-26 17:53, Vittorio Gambaletta (VittGam) wrote:
> Hi,
> 
> On 26/01/2016 15:20:22 CET, Vittorio Gambaletta (VittGam) wrote:
>> Hi,
>>
>> On 26/01/2016 15:16:21 CET, James Darnley wrote:
>>> On 2016-01-22 14:44, Michael Niedermayer wrote:
 On Fri, Jan 22, 2016 at 03:53:10AM +0100, James Darnley wrote:
> Someone on IRC asked for a scale that would fit in a given box. 
> This is the
> answer.  I couldn't see it in the existing examples so I thought I
> would add it.
> ---
>  doc/filters.texi | 6 ++
>  1 file changed, 6 insertions(+)

 LGTM

 thx
>>>
>>> Thanks Michael.
>>>
>>> I nearly forgot about this.  If nobody else has any comments I will push
>>> it later today.
>>
>> Instead of a 720x720 box it could be a 720x576 box (to avoid confusion in
>> other usage cases where the box isn't square).

I might change that.

> That is, I'm using this to fit the video in a 720x576 box:
> 
> scale='width=min(720\,576*dar):height=min(576\,720/dar)'
> 
> Also, I'm using this to fit the video in a 720x576 box that has a forced
> 4:3
> aspect ratio (its native aspect ratio is 5:4):
> 
> scale='width=min(720\,720/4*3*dar):height=min(576\,576*4/3/dar)'

I might add another example from yours as it might be clearer than my
if-branch way.  I'll read the other examples again first.

Thanks.




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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_crop: make it possible to use frame metadata when cropping

2016-01-26 Thread wm4
On Fri, 22 Jan 2016 16:34:27 +
Paul B Mahol  wrote:

> Hi,
> 
> updated version attached.

I maintain that dynamic format reconfiguration in libavfilter is
semi-broken and needs more work.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Avid DNxHR / UK DPP

2016-01-26 Thread John Warburton
Gentlemen,

I'm at DPP conference, in the room. Start of UHD delivery standards for UK
just announced. Now on website, we are told.

H.264 codec,
AS-11 encapsulation for MXF,
HLG and SMPTE 2084 both supported for HDR,
WCG framework supported,
Long-GOP in H.264. But I-frame only option for post-delivery requirements.

Tests to be done on high frame rate, live delivery and object-based audio.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec: add Ulead DV Audio decoder

2016-01-26 Thread Paul B Mahol
On 1/26/16, Carl Eugen Hoyos  wrote:
> Paul B Mahol  gmail.com> writes:
>
>> patch attached.
>
> Please mention the ticket number.

If that's all needed I will apply patch soon.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Avid DNxHR / UK DPP

2016-01-26 Thread Kevin Wheatley
On Tue, Jan 26, 2016 at 5:30 PM, John Warburton  wrote:
> I'm at DPP conference, in the room. Start of UHD delivery standards for UK
> just announced. Now on website, we are told.

https://www.digitalproductionpartnership.co.uk/what-we-do/technical-standards/

http://dpp-assets.s3.amazonaws.com/wp-content/uploads/2016/01/TechnicalDeliverySupplementUHDDPP.pdf

is the template for broadcasters to fill in the blanks.

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


Re: [FFmpeg-devel] [PATCH 1/2] avutil: add P010 pixel format

2016-01-26 Thread Wang Bin
Shall we add nv15 like other nv formats in pixfmt.h?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/vf_crop: make it possible to use frame metadata when cropping

2016-01-26 Thread Stefano Sabatini
On date Sunday 2016-01-17 20:15:45 +0100, Paul B Mahol encoded:
> Signed-off-by: Paul B Mahol 
> ---
>  doc/filters.texi  |  6 ++
>  libavfilter/vf_crop.c | 54 
> +++
>  2 files changed, 48 insertions(+), 12 deletions(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index f4bda6a..aee4e66 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -4621,6 +4621,11 @@ This expression is evaluated per-frame.
>  If set to 1 will force the output display aspect ratio
>  to be the same of the input, by changing the output sample aspect
>  ratio. It defaults to 0.
> +

> +@item metadata
> +If set to 1 it will use frame metadata instead to obtain all parameters.
> +To make use of this feature you need to start @ref{cropdetect} filter before
> +this filter.

Suggestion: to make this more extensible, allow to set the metadata
fields to read, for example so that you can have something like:
metadata=facedetect or metadata=cropdetect.

[...]
-- 
FFmpeg = Frenzy and Freak Most Proud Enlightening Guru
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/vf_crop: make it possible to use frame metadata when cropping

2016-01-26 Thread Paul B Mahol
On 1/26/16, Stefano Sabatini  wrote:
> On date Sunday 2016-01-17 20:15:45 +0100, Paul B Mahol encoded:
>> Signed-off-by: Paul B Mahol 
>> ---
>>  doc/filters.texi  |  6 ++
>>  libavfilter/vf_crop.c | 54
>> +++
>>  2 files changed, 48 insertions(+), 12 deletions(-)
>>
>> diff --git a/doc/filters.texi b/doc/filters.texi
>> index f4bda6a..aee4e66 100644
>> --- a/doc/filters.texi
>> +++ b/doc/filters.texi
>> @@ -4621,6 +4621,11 @@ This expression is evaluated per-frame.
>>  If set to 1 will force the output display aspect ratio
>>  to be the same of the input, by changing the output sample aspect
>>  ratio. It defaults to 0.
>> +
>
>> +@item metadata
>> +If set to 1 it will use frame metadata instead to obtain all parameters.
>> +To make use of this feature you need to start @ref{cropdetect} filter
>> before
>> +this filter.
>
> Suggestion: to make this more extensible, allow to set the metadata
> fields to read, for example so that you can have something like:
> metadata=facedetect or metadata=cropdetect.

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


Re: [FFmpeg-devel] [PATCH] lavc/mjpegdec: speed up scan data copy

2016-01-26 Thread Matthieu Bouron
On Tue, Jan 26, 2016 at 6:04 PM, Michael Niedermayer  wrote:

> On Tue, Jan 26, 2016 at 05:15:37PM +0100, Matthieu Bouron wrote:
> > From: Matthieu Bouron 
> >
> > ---
> >
> > From random 3264x2448 jpegs, scan data copy on a Nexus5 goes from [15,
> 28]ms to [3, 12]ms.
>
> breaks https://trac.ffmpeg.org/raw-attachment/ticket/1527/24bpp.mov
>

Thanks for finding this.
Fixed in the attached patch.

[...]
From d0a2808be8393dc7c2d813d08fc0e4518d0f2bd9 Mon Sep 17 00:00:00 2001
From: Matthieu Bouron 
Date: Tue, 26 Jan 2016 17:15:37 +0100
Subject: [PATCH] lavc/mjpegdec: speed up scan data copy

---
 libavcodec/mjpegdec.c | 50 --
 1 file changed, 40 insertions(+), 10 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 863738d..ada607d 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1917,24 +1917,54 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
 /* unescape buffer of SOS, use special treatment for JPEG-LS */
 if (start_code == SOS && !s->ls) {
 const uint8_t *src = *buf_ptr;
+const uint8_t *ptr = src;
 uint8_t *dst = s->buffer;
 
-while (src < buf_end) {
-uint8_t x = *(src++);
+#define copy_data_segment(skip) do {   \
+ssize_t length = (ptr - src) - (skip); \
+if (length > 0) { \
+memcpy(dst, src, length); \
+dst += length;\
+src = ptr;\
+} \
+} while (0)
+
+if (s->avctx->codec_id == AV_CODEC_ID_THP) {
+ptr = buf_end;
+copy_data_segment(0);
+} else {
+while (ptr < buf_end) {
+uint8_t x = *(ptr++);
 
-*(dst++) = x;
-if (s->avctx->codec_id != AV_CODEC_ID_THP) {
 if (x == 0xff) {
-while (src < buf_end && x == 0xff)
-x = *(src++);
+ssize_t skip = 0;
+while (ptr < buf_end && x == 0xff) {
+x = *(ptr++);
+skip++;
+}
 
-if (x >= 0xd0 && x <= 0xd7)
-*(dst++) = x;
-else if (x)
-break;
+/* 0xFF, 0xFF, ... */
+if (skip > 1) {
+copy_data_segment(skip);
+
+/* decrement src as it is equal to ptr after the
+ * copy_data_segment macro and we might want to
+ * copy the current value of x later on */
+src--;
+}
+
+if (x < 0xd0 || x > 0xd7) {
+copy_data_segment(1);
+if (x)
+break;
+}
 }
 }
+if (src < ptr)
+copy_data_segment(0);
 }
+#undef copy_data_segment
+
 *unescaped_buf_ptr  = s->buffer;
 *unescaped_buf_size = dst - s->buffer;
 memset(s->buffer + *unescaped_buf_size, 0,
-- 
2.7.0

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


[FFmpeg-devel] [PATCH v3] vaapi_h264enc: Add Hardware Accelerated H.264 Encoder based on VAAPI

2016-01-26 Thread hamza
From: "bryan.chr...@mediafire.com" 

This commit adds a hardware accelerated H.264 encoder which utilizes
libva (open source implementation of VA-API). Information about libva
is available at: https://en.wikipedia.org/wiki/Video_Acceleration_API
This encoder is only availbale on linux and supported hardware which
can be viewed at:
https://en.wikipedia.org/wiki/Video_Acceleration_API#Supported_hardware_and_drivers

If libva is installed then the encoder will be automatically enabled.
---
This is the 3rd version of the patch. The subject of the first two patch
emails was:
libi264: Add Hardware Accelerated H.264 Encoder based on libVA

Bryan Christ  is reponsible for maintaining all the
files related to this patch. This patch is being submitted on his behalf.

Changes for v3:
   - name of the encoder has been changed from libi264 to vaapi_h264enc to
 make it more generic
   - all the changes recommended by Michael Niedermayer, compn, James Almer,
 Hendrik Leppkes, Carl Eugen Hoyos, Will Kelleher have been incorporated

 Changelog   |1 +
 MAINTAINERS |1 +
 configure   |8 +-
 libavcodec/Makefile |1 +
 libavcodec/allcodecs.c  |1 +
 libavcodec/vaapi_display.c  |  124 
 libavcodec/vaapi_display.h  |   80 +++
 libavcodec/vaapi_display_drm.c  |   98 +++
 libavcodec/vaapi_display_x11.c  |  179 +
 libavcodec/vaapi_h264enc.c  | 1349 +++
 libavcodec/vaapi_h264enc.h  |  111 +++
 libavcodec/vaapi_h264enc_paramset.c |  425 +++
 libavcodec/vaapi_h264enc_paramset.h |   81 +++
 libavcodec/version.h|2 +-
 14 files changed, 2459 insertions(+), 2 deletions(-)
 create mode 100644 libavcodec/vaapi_display.c
 create mode 100644 libavcodec/vaapi_display.h
 create mode 100644 libavcodec/vaapi_display_drm.c
 create mode 100644 libavcodec/vaapi_display_x11.c
 create mode 100644 libavcodec/vaapi_h264enc.c
 create mode 100644 libavcodec/vaapi_h264enc.h
 create mode 100644 libavcodec/vaapi_h264enc_paramset.c
 create mode 100644 libavcodec/vaapi_h264enc_paramset.h

diff --git a/Changelog b/Changelog
index d9c2ea8..1852910 100644
--- a/Changelog
+++ b/Changelog
@@ -49,6 +49,7 @@ version :
 - VAAPI VP9 hwaccel
 - audio high-order multiband parametric equalizer
 - automatic bitstream filtering
+- H.264 hwaccelerated encoding through VAAPI
 
 
 version 2.8:
diff --git a/MAINTAINERS b/MAINTAINERS
index 9add13d..7cead7c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -203,6 +203,7 @@ Codecs:
   libcelt_dec.c Nicolas George
   libdirac* David Conrad
   libgsm.c  Michel Bardiaux
+  vaapi_h264enc*, vaapi_display*Bryan Christ
   libkvazaar.c  Arttu Yl??-Outinen
   libopenjpeg.c Jaikrishnan Menon
   libopenjpegenc.c  Michael Bradshaw
diff --git a/configure b/configure
index da74ccd..cdd9a9b 100755
--- a/configure
+++ b/configure
@@ -265,6 +265,7 @@ External library support:
   --enable-libwavpack  enable wavpack encoding via libwavpack [no]
   --enable-libwebp enable WebP encoding via libwebp [no]
   --enable-libx264 enable H.264 encoding via x264 [no]
+#  --enable-vaapienc-h264   enable H.264 encoding via VAAPI [autodetect]
   --enable-libx265 enable HEVC encoding via x265 [no]
   --enable-libxavs enable AVS encoding via xavs [no]
   --enable-libxcb  enable X11 grabbing using XCB [autodetect]
@@ -1972,6 +1973,7 @@ HAVE_LIST="
 section_data_rel_ro
 texi2html
 threads
+vaapi_drm
 vaapi_x11
 vdpau_x11
 xlib
@@ -2658,7 +2660,6 @@ libwebp_anim_encoder_deps="libwebp"
 libx262_encoder_deps="libx262"
 libx264_encoder_deps="libx264"
 libx264rgb_encoder_deps="libx264"
-libx264rgb_encoder_select="libx264_encoder"
 libx265_encoder_deps="libx265"
 libxavs_encoder_deps="libxavs"
 libxvid_encoder_deps="libxvid"
@@ -2668,6 +2669,7 @@ libzvbi_teletext_decoder_deps="libzvbi"
 nvenc_encoder_deps="nvenc"
 nvenc_h264_encoder_deps="nvenc"
 nvenc_hevc_encoder_deps="nvenc"
+vaapi_h264_encoder_deps="vaapi swscale"
 
 # demuxers / muxers
 ac3_demuxer_select="ac3_parser"
@@ -5734,6 +5736,10 @@ enabled vdpau && enabled xlib &&
 prepend ffmpeg_libs $($ldflags_filter "-lvdpau") &&
 enable vdpau_x11
 
+enabled vaapi &&
+check_lib2 "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm &&
+enable vaapi_drm
+
 # Funny iconv installations are not unusual, so check it after all flags have 
been set
 disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv 
-liconv || disable iconv
 
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 0717d0a..2d2f0b5 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -847,6 +847,7 @@ OBJS-$(CONFIG_LIBWEBP_ENCODER)+= 
libwebpenc_com

Re: [FFmpeg-devel] [FFmpeg-cvslog] build: use a link instead of changing current directory when compiling

2016-01-26 Thread Michael Niedermayer
On Mon, Jan 25, 2016 at 08:51:32PM +0100, Andreas Cadhalpun wrote:
> ffmpeg | branch: master | Andreas Cadhalpun 
>  | Mon Jan 25 01:42:23 2016 +0100| 
> [b46aae093634271931395d65f422f4b2a23112d3] | committer: Andreas Cadhalpun
> 
> build: use a link instead of changing current directory when compiling
> 
> If links don't work, fall back to using the full source path as was
> previously done.
> 
> This should fix build failures with MSVC.
> 
> Reviewed-by: Hendrik Leppkes 
> Signed-off-by: Andreas Cadhalpun 
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b46aae093634271931395d65f422f4b2a23112d3
> ---

if you have a "src" directory this results in:
./configure
rm: cannot remove `src': Is a directory
ln: `src/.': cannot overwrite directory


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

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


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


Re: [FFmpeg-devel] [PATCH] avformat/flvenc: copyts in FLV muxer

2016-01-26 Thread Michael Niedermayer
On Mon, Jan 25, 2016 at 07:46:11PM +0100, Michael Niedermayer wrote:
> On Mon, Jan 25, 2016 at 02:43:40PM +0200, Ivan wrote:
> > The purpose of this patch is to preserve timestamps when using ffmpeg for 
> > publishing RTMP streams, e.g. ffmpeg -i rtmp://source/stream -f flv 
> > rtmp://target/stream.
> > There is a setting "copyts" for that purpose. Unfortunately it doesn't work 
> > with FLV muxer because it has its own timestamp correction which makes 
> > global setting "copyts" ineffective.
> > 
> > This patch removes timestamp correction in FLV muxer. This means FLV will 
> > rely on ffmpeg timestamp correction which makes it possible to use copyts.
> 
> indeed, avoid_negative_ts should handle this
> i intend to apply this, unless someone sees a case for which this
> code is still needed ?

applied

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus


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


[FFmpeg-devel] [PATCH] libavutil/mastering_display_metadata.h: change fields to be rationals as this is how they are typically coded.

2016-01-26 Thread Neil Birkbeck
From: "Vittorio Gambaletta (VittGam)" 

(this structure is not referenced anywhere yet)

Signed-off-by: Neil Birkbeck 
---
 libavutil/mastering_display_metadata.h | 10 ++
 libavutil/version.h|  3 +--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/libavutil/mastering_display_metadata.h 
b/libavutil/mastering_display_metadata.h
index 781c1fd..936533f 100644
--- a/libavutil/mastering_display_metadata.h
+++ b/libavutil/mastering_display_metadata.h
@@ -22,6 +22,8 @@
 #define AVUTIL_MASTERING_DISPLAY_METADATA_H
 
 #include "frame.h"
+#include "rational.h"
+
 
 /**
  * Mastering display metadata capable of representing the color volume of
@@ -37,22 +39,22 @@ typedef struct AVMasteringDisplayMetadata {
 /**
  * CIE 1931 xy chromaticity coords of color primaries (r, g, b order).
  */
-float display_primaries[3][2];
+AVRational display_primaries[3][2];
 
 /**
  * CIE 1931 xy chromaticity coords of white point.
  */
-float white_point[2];
+AVRational white_point[2];
 
 /**
  * Min luminance of mastering display (cd/m^2).
  */
-float min_luminance;
+AVRational min_luminance;
 
 /**
  * Max luminance of mastering display (cd/m^2).
  */
-float max_luminance;
+AVRational max_luminance;
 
 /**
  * Flag indicating whether the display primaries (and white point) are set.
diff --git a/libavutil/version.h b/libavutil/version.h
index 42f7cde..d63696d 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -65,7 +65,7 @@
 
 #define LIBAVUTIL_VERSION_MAJOR  55
 #define LIBAVUTIL_VERSION_MINOR  15
-#define LIBAVUTIL_VERSION_MICRO 100
+#define LIBAVUTIL_VERSION_MICRO 101
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
@@ -126,4 +126,3 @@
  */
 
 #endif /* AVUTIL_VERSION_H */
-
-- 
2.7.0.rc3.207.g0ac5344

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


Re: [FFmpeg-devel] [PATCH] lavc/mjpegdec: speed up scan data copy

2016-01-26 Thread Michael Niedermayer
On Tue, Jan 26, 2016 at 08:49:06PM +0100, Matthieu Bouron wrote:
> On Tue, Jan 26, 2016 at 6:04 PM, Michael Niedermayer  > wrote:
> 
> > On Tue, Jan 26, 2016 at 05:15:37PM +0100, Matthieu Bouron wrote:
> > > From: Matthieu Bouron 
> > >
> > > ---
> > >
> > > From random 3264x2448 jpegs, scan data copy on a Nexus5 goes from [15,
> > 28]ms to [3, 12]ms.
> >
> > breaks https://trac.ffmpeg.org/raw-attachment/ticket/1527/24bpp.mov
> >
> 
> Thanks for finding this.
> Fixed in the attached patch.
> 
> [...]

>  mjpegdec.c |   50 --
>  1 file changed, 40 insertions(+), 10 deletions(-)
> 9335d6703c59c78c861a3e3099866159fc68afe6  
> 0001-lavc-mjpegdec-speed-up-scan-data-copy.patch
> From d0a2808be8393dc7c2d813d08fc0e4518d0f2bd9 Mon Sep 17 00:00:00 2001
> From: Matthieu Bouron 
> Date: Tue, 26 Jan 2016 17:15:37 +0100
> Subject: [PATCH] lavc/mjpegdec: speed up scan data copy

seems to work with the files i tried

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


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


Re: [FFmpeg-devel] [PATCH] libavutil/mastering_display_metadata.h: change fields to be rationals as this is how they are typically coded.

2016-01-26 Thread Vittorio Gambaletta (VittGam)

Hi,

On 26/01/2016 22:09:02 CET, Neil Birkbeck wrote:

From: "Vittorio Gambaletta (VittGam)" 


This is not from me...

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


Re: [FFmpeg-devel] [PATCH] libavutil/mastering_display_metadata.h: change fields to be rationals as this is how they are typically coded.

2016-01-26 Thread Neil Birkbeck
Some sort of squash fail. Apologies.

On Tue, Jan 26, 2016 at 1:13 PM, Vittorio Gambaletta (VittGam) <
ffmpeg-...@vittgam.net> wrote:

> Hi,
>
> On 26/01/2016 22:09:02 CET, Neil Birkbeck wrote:
>
>> From: "Vittorio Gambaletta (VittGam)" 
>>
>
> This is not from me...
>
> Cheers,
> Vittorio
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [FFmpeg-cvslog] build: use a link instead of changing current directory when compiling

2016-01-26 Thread Andreas Cadhalpun
On 26.01.2016 21:28, Michael Niedermayer wrote:
> On Mon, Jan 25, 2016 at 08:51:32PM +0100, Andreas Cadhalpun wrote:
>> ffmpeg | branch: master | Andreas Cadhalpun 
>>  | Mon Jan 25 01:42:23 2016 +0100| 
>> [b46aae093634271931395d65f422f4b2a23112d3] | committer: Andreas Cadhalpun
>>
>> build: use a link instead of changing current directory when compiling
>>
>> If links don't work, fall back to using the full source path as was
>> previously done.
>>
>> This should fix build failures with MSVC.
>>
>> Reviewed-by: Hendrik Leppkes 
>> Signed-off-by: Andreas Cadhalpun 
>>
>>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b46aae093634271931395d65f422f4b2a23112d3
>> ---
> 
> if you have a "src" directory this results in:
> ./configure
> rm: cannot remove `src': Is a directory
> ln: `src/.': cannot overwrite directory

I guess you'd like to keep the src directory in that case.
Attached is a patch falling back to using the full path then.

Best regards,
Andreas

>From 72b2b0c9533d96b778be4c96a418b22075f1d39a Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun 
Date: Tue, 26 Jan 2016 22:54:01 +0100
Subject: [PATCH] configure: fall back to using full path if src is a directory

Signed-off-by: Andreas Cadhalpun 
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 73d4dcf..0c2746b 100755
--- a/configure
+++ b/configure
@@ -4707,7 +4707,7 @@ link_name=$(mktemp -u $TMPDIR/name_)
 mkdir "$link_dest"
 $ln_s "$link_dest" "$link_name"
 touch "$link_dest/test_file"
-if [ -e "$link_name/test_file" ]; then
+if [ ! -d src ] && [ -e "$link_name/test_file" ]; then
 # create link to source path
 [ -e src ] && rm src
 $ln_s "$source_path" src
-- 
2.7.0.rc3

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


Re: [FFmpeg-devel] [PATCH] avcodec: only warn about hwaccel with frame threads

2016-01-26 Thread Andreas Cadhalpun
On 25.01.2016 00:53, Hendrik Leppkes wrote:
> On Sat, Jan 23, 2016 at 3:52 PM, Andreas Cadhalpun
>  wrote:
>> On 23.01.2016 15:10, Hendrik Leppkes wrote:
>>> On Sat, Jan 23, 2016 at 2:45 PM, Ronald S. Bultje  
>>> wrote:
 Both of you keep shouting from one side of the room to the other without
 trying to actually converge to a point that might somehow be mutually
 acceptable. I'm getting very grumbly here.

>>>
>>> I'm not trying to be unreasonable here, all I'm asking for at this
>>> point is to make sure the new vp9 hwaccel doesn't break spectacularly
>>> when MT is turned on before its allowed back.
>>
>> OK, that would be fine with me.
>>
>> Do you agree that the attached patch is sufficient for this?
>>
> 
> YUV420P will not remain the only format available for hwaccel, I
> already have some work pending to allow Profile2/10-bit as well, so
> the check should be further out.

OK. Though if Ronald manages to (hopefully soon) find a solution for
automatically throttling the hwaccel threads to 1, this check will be
removed again anyway.

> It would also log every time the function executes, no matter if
> hwaccel is requested or not, unfortunately I don't see a way to fix
> that nicely since the decoder doesn't know if the user is going to
> activate hwaccel.

Indeed. But since that is anyway logged in setup_hwaccel there
is not really much need for another warning here. I've thus reduced
the log level to verbose. Attached is an updated patch.

Best regards,
Andreas
>From 8171981c467d2e67daa8cfd44edd65e2570edc80 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun 
Date: Sat, 23 Jan 2016 15:48:30 +0100
Subject: [PATCH] vp9: skip hwaccel whith threading

It was implemented in a way incompatible with threading.

Signed-off-by: Andreas Cadhalpun 
---
 libavcodec/vp9.c | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 1e98e88..39f25d2 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -255,16 +255,21 @@ static int update_size(AVCodecContext *ctx, int w, int h)
 if ((res = ff_set_dimensions(ctx, w, h)) < 0)
 return res;
 
-if (s->pix_fmt == AV_PIX_FMT_YUV420P) {
+if (ctx->active_thread_type & FF_THREAD_FRAME) {
+av_log(ctx, AV_LOG_VERBOSE,
+   "Skipping vp9 hwaccel, because it is not compatible with threading.\n");
+} else {
+if (s->pix_fmt == AV_PIX_FMT_YUV420P) {
 #if CONFIG_VP9_DXVA2_HWACCEL
-*fmtp++ = AV_PIX_FMT_DXVA2_VLD;
+*fmtp++ = AV_PIX_FMT_DXVA2_VLD;
 #endif
 #if CONFIG_VP9_D3D11VA_HWACCEL
-*fmtp++ = AV_PIX_FMT_D3D11VA_VLD;
+*fmtp++ = AV_PIX_FMT_D3D11VA_VLD;
 #endif
 #if CONFIG_VP9_VAAPI_HWACCEL
-*fmtp++ = AV_PIX_FMT_VAAPI;
+*fmtp++ = AV_PIX_FMT_VAAPI;
 #endif
+}
 }
 
 *fmtp++ = s->pix_fmt;
-- 
2.7.0.rc3

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


Re: [FFmpeg-devel] [PATCH] libavutil/mastering_display_metadata.h: change fields to be rationals as this is how they are typically coded.

2016-01-26 Thread Vittorio Gambaletta (VittGam)

On 26/01/2016 23:05:22 CET, Neil Birkbeck wrote:

Some sort of squash fail. Apologies.


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


Re: [FFmpeg-devel] [FFmpeg-cvslog] avcodec: add Ulead DV audio decoder

2016-01-26 Thread Andreas Cadhalpun
On 26.01.2016 23:17, Paul B Mahol wrote:
> ffmpeg | branch: master | Paul B Mahol  | Mon Jan 25 
> 21:54:17 2016 +0100| [e9e623369d7ba330ab8157157e956cb71d8058b5] | committer: 
> Paul B Mahol
> 
> avcodec: add Ulead DV audio decoder
> 
> Fixes #1564.
> 
> Signed-off-by: Paul B Mahol 

Leaving a little bit more time for review would have been nice.

> diff --git a/libavcodec/dvaudiodec.c b/libavcodec/dvaudiodec.c
> new file mode 100644
> index 000..84db509
> --- /dev/null
> +++ b/libavcodec/dvaudiodec.c
> @@ -0,0 +1,144 @@
[...]
> +static int decode_frame(AVCodecContext *avctx, void *data,
> +int *got_frame_ptr, AVPacket *pkt)
> +{
> +DVAudioContext *s = avctx->priv_data;
> +AVFrame *frame = data;
> +const uint8_t *src = pkt->data;
> +int16_t *dst;
> +int ret, i;
> +
> +if (pkt->size != s->block_size)
> +return AVERROR_INVALIDDATA;
> +
> +frame->nb_samples = dv_get_audio_sample_count(pkt->data + 244, 
> s->is_pal);
> +if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
> +return ret;
> +dst = (int16_t *)frame->data[0];
> +
> +for (i = 0; i < frame->nb_samples; i++) {

Maybe this should be 'i < frame->nb_samples / 2'?

> +   const uint8_t *v = &src[s->shuffle[i]];
> +
> +   if (s->is_12bit) {
> +   *dst++ = dv_audio_12to16((v[0] << 4) | ((v[2] >> 4) & 0x0f));
> +   *dst++ = dv_audio_12to16((v[1] << 4) | ((v[2] >> 0) & 0x0f));
> +   } else {
> +   *dst++ = AV_RB16(&v[0]);

Because otherwise this can cause out of bounds writes.

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


Re: [FFmpeg-devel] [FFmpeg-cvslog] avcodec: add Ulead DV audio decoder

2016-01-26 Thread Paul B Mahol
On 1/26/16, Andreas Cadhalpun  wrote:
> On 26.01.2016 23:17, Paul B Mahol wrote:
>> ffmpeg | branch: master | Paul B Mahol  | Mon Jan 25
>> 21:54:17 2016 +0100| [e9e623369d7ba330ab8157157e956cb71d8058b5] |
>> committer: Paul B Mahol
>>
>> avcodec: add Ulead DV audio decoder
>>
>> Fixes #1564.
>>
>> Signed-off-by: Paul B Mahol 
>
> Leaving a little bit more time for review would have been nice.
>
>> diff --git a/libavcodec/dvaudiodec.c b/libavcodec/dvaudiodec.c
>> new file mode 100644
>> index 000..84db509
>> --- /dev/null
>> +++ b/libavcodec/dvaudiodec.c
>> @@ -0,0 +1,144 @@
> [...]
>> +static int decode_frame(AVCodecContext *avctx, void *data,
>> +int *got_frame_ptr, AVPacket *pkt)
>> +{
>> +DVAudioContext *s = avctx->priv_data;
>> +AVFrame *frame = data;
>> +const uint8_t *src = pkt->data;
>> +int16_t *dst;
>> +int ret, i;
>> +
>> +if (pkt->size != s->block_size)
>> +return AVERROR_INVALIDDATA;
>> +
>> +frame->nb_samples = dv_get_audio_sample_count(pkt->data + 244,
>> s->is_pal);
>> +if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
>> +return ret;
>> +dst = (int16_t *)frame->data[0];
>> +
>> +for (i = 0; i < frame->nb_samples; i++) {
>
> Maybe this should be 'i < frame->nb_samples / 2'?

Nope.

>
>> +   const uint8_t *v = &src[s->shuffle[i]];
>> +
>> +   if (s->is_12bit) {
>> +   *dst++ = dv_audio_12to16((v[0] << 4) | ((v[2] >> 4) & 0x0f));
>> +   *dst++ = dv_audio_12to16((v[1] << 4) | ((v[2] >> 0) & 0x0f));
>> +   } else {
>> +   *dst++ = AV_RB16(&v[0]);
>
> Because otherwise this can cause out of bounds writes.

Audio is always stereo. Valgrind shows nothing.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [FFmpeg-cvslog] avcodec: add Ulead DV audio decoder

2016-01-26 Thread Andreas Cadhalpun
On 26.01.2016 23:33, Paul B Mahol wrote:
> On 1/26/16, Andreas Cadhalpun  wrote:
>> On 26.01.2016 23:17, Paul B Mahol wrote:
>>> ffmpeg | branch: master | Paul B Mahol  | Mon Jan 25
>>> 21:54:17 2016 +0100| [e9e623369d7ba330ab8157157e956cb71d8058b5] |
>>> committer: Paul B Mahol
>>>
>>> avcodec: add Ulead DV audio decoder
>>>
>>> Fixes #1564.
>>>
>>> Signed-off-by: Paul B Mahol 
>>
>> Leaving a little bit more time for review would have been nice.
>>
>>> diff --git a/libavcodec/dvaudiodec.c b/libavcodec/dvaudiodec.c
>>> new file mode 100644
>>> index 000..84db509
>>> --- /dev/null
>>> +++ b/libavcodec/dvaudiodec.c
>>> @@ -0,0 +1,144 @@
>> [...]
>>> +static int decode_frame(AVCodecContext *avctx, void *data,
>>> +int *got_frame_ptr, AVPacket *pkt)
>>> +{
>>> +DVAudioContext *s = avctx->priv_data;
>>> +AVFrame *frame = data;
>>> +const uint8_t *src = pkt->data;
>>> +int16_t *dst;
>>> +int ret, i;
>>> +
>>> +if (pkt->size != s->block_size)
>>> +return AVERROR_INVALIDDATA;
>>> +
>>> +frame->nb_samples = dv_get_audio_sample_count(pkt->data + 244,
>>> s->is_pal);
>>> +if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
>>> +return ret;
>>> +dst = (int16_t *)frame->data[0];
>>> +
>>> +for (i = 0; i < frame->nb_samples; i++) {
>>
>> Maybe this should be 'i < frame->nb_samples / 2'?
> 
> Nope.
> 
>>
>>> +   const uint8_t *v = &src[s->shuffle[i]];
>>> +
>>> +   if (s->is_12bit) {
>>> +   *dst++ = dv_audio_12to16((v[0] << 4) | ((v[2] >> 4) & 0x0f));
>>> +   *dst++ = dv_audio_12to16((v[1] << 4) | ((v[2] >> 0) & 0x0f));
>>> +   } else {
>>> +   *dst++ = AV_RB16(&v[0]);
>>
>> Because otherwise this can cause out of bounds writes.
> 
> Audio is always stereo.

Thanks for quickly pushing a fix.

Best regards,
Andreas

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


Re: [FFmpeg-devel] [PATCH] svq1enc: fix out of bounds reads

2016-01-26 Thread Andreas Cadhalpun
On 26.01.2016 02:46, Michael Niedermayer wrote:
> On Tue, Jan 26, 2016 at 01:04:05AM +0100, Andreas Cadhalpun wrote:
>>  svq1enc.c |7 +--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>> 303a9f08a561047395172ac4f7abbc63a78c9021  
>> 0001-svq1enc-fix-out-of-bounds-reads.patch
>> From 5168bee94d1e7e09ebfcfe2bdab94430d4366cb2 Mon Sep 17 00:00:00 2001
>> From: Andreas Cadhalpun 
>> Date: Thu, 21 Jan 2016 22:36:36 +0100
>> Subject: [PATCH] svq1enc: fix out of bounds reads
>>
>> level can be 5, but there are only four codebooks.
>>
>> Fixes ubsan runtime error: index 5 out of bounds for type 'int8_t
>> [4][96]'
>>
>> Signed-off-by: Andreas Cadhalpun 
> 
> should be ok

Pushed.

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


[FFmpeg-devel] [PATCH 0/2] libx265: allow 4:2:2, 4:4:4, and 12-bit encoding

2016-01-26 Thread Stephen Hutchinson
Was having some issues with git-sendemail, so I just
decided to resend the patches with the amended
commit messages and the adjusted API version check
vs. the older set.

Stephen Hutchinson (2):
  libx265: Remove experimental flag when encoding 4:2:2 and 4:4:4
  libx265: Enable 12-bit encoding

 configure|  4 ++--
 libavcodec/libx265.c | 28 +++-
 2 files changed, 21 insertions(+), 11 deletions(-)

-- 
2.1.4

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


[FFmpeg-devel] [PATCH 1/2] libx265: Remove experimental flag when encoding 4:2:2 and 4:4:4

2016-01-26 Thread Stephen Hutchinson
4:2:2 and 4:4:4 support in the HEVC standard was approved in
October 2014 as part of HEVC Version 2 and published in
January 2015:

http://www.itu.int/ITU-T/recommendations/rec.aspx?rec=12296
http://www.itu.int/rec/T-REC-H.265-201410-S
https://hevc.hhi.fraunhofer.de/rext
---
 libavcodec/libx265.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index a1770fa..4c36f4c 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -82,14 +82,6 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
 if (!ctx->api)
 ctx->api = x265_api_get(0);
 
-if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL &&
-!av_pix_fmt_desc_get(avctx->pix_fmt)->log2_chroma_w) {
-av_log(avctx, AV_LOG_ERROR,
-   "4:2:2 and 4:4:4 support is not fully defined for HEVC yet. "
-   "Set -strict experimental to encode anyway.\n");
-return AVERROR(ENOSYS);
-}
-
 ctx->params = ctx->api->param_alloc();
 if (!ctx->params) {
 av_log(avctx, AV_LOG_ERROR, "Could not allocate x265 param 
structure.\n");
-- 
2.1.4

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


[FFmpeg-devel] [PATCH 2/2] libx265: Enable 12-bit encoding

2016-01-26 Thread Stephen Hutchinson
The configure detection is bumped to X265_BUILD >= 68,
since API version 68 corresponds with the x265 1.8
release tarball. The warnings inside x265 about
12-bit being experimental were removed prior to API
version 72 a short time later.  At this time of
writing, X265_BUILD is at version 80.

12-bit support in the HEVC standard was approved in
October 2014 as part of HEVC Version 2 and published
in January 2015:

http://www.itu.int/ITU-T/recommendations/rec.aspx?rec=12296
http://www.itu.int/rec/T-REC-H.265-201410-S
https://hevc.hhi.fraunhofer.de/rext
---
 configure|  4 ++--
 libavcodec/libx265.c | 20 +++-
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index e5cd88e..966183b 100755
--- a/configure
+++ b/configure
@@ -5553,8 +5553,8 @@ enabled libx264   && { use_pkg_config x264 
"stdint.h x264.h" x264_encode
  { check_cpp_condition x264.h "X264_MPEG2" &&
enable libx262; }
 enabled libx265   && require_pkg_config x265 x265.h x265_api_get &&
- { check_cpp_condition x265.h "X265_BUILD >= 57" ||
-   die "ERROR: libx265 version must be >= 57."; }
+ { check_cpp_condition x265.h "X265_BUILD >= 68" ||
+   die "ERROR: libx265 version must be >= 68."; }
 enabled libxavs   && require libxavs xavs.h xavs_encoder_encode -lxavs
 enabled libxvid   && require libxvid xvid.h xvid_global -lxvidcore
 enabled libzimg   && require_pkg_config zimg zimg.h 
zimg_get_api_version
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 4c36f4c..68c7fba 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -146,14 +146,17 @@ static av_cold int libx265_encode_init(AVCodecContext 
*avctx)
 switch (avctx->pix_fmt) {
 case AV_PIX_FMT_YUV420P:
 case AV_PIX_FMT_YUV420P10:
+case AV_PIX_FMT_YUV420P12:
 ctx->params->internalCsp = X265_CSP_I420;
 break;
 case AV_PIX_FMT_YUV422P:
 case AV_PIX_FMT_YUV422P10:
+case AV_PIX_FMT_YUV422P12:
 ctx->params->internalCsp = X265_CSP_I422;
 break;
 case AV_PIX_FMT_YUV444P:
 case AV_PIX_FMT_YUV444P10:
+case AV_PIX_FMT_YUV444P12:
 ctx->params->internalCsp = X265_CSP_I444;
 break;
 }
@@ -318,6 +321,16 @@ static const enum AVPixelFormat x265_csp_eight[] = {
 AV_PIX_FMT_NONE
 };
 
+static const enum AVPixelFormat x265_csp_ten[] = {
+AV_PIX_FMT_YUV420P,
+AV_PIX_FMT_YUV422P,
+AV_PIX_FMT_YUV444P,
+AV_PIX_FMT_YUV420P10,
+AV_PIX_FMT_YUV422P10,
+AV_PIX_FMT_YUV444P10,
+AV_PIX_FMT_NONE
+};
+
 static const enum AVPixelFormat x265_csp_twelve[] = {
 AV_PIX_FMT_YUV420P,
 AV_PIX_FMT_YUV422P,
@@ -325,13 +338,18 @@ static const enum AVPixelFormat x265_csp_twelve[] = {
 AV_PIX_FMT_YUV420P10,
 AV_PIX_FMT_YUV422P10,
 AV_PIX_FMT_YUV444P10,
+AV_PIX_FMT_YUV420P12,
+AV_PIX_FMT_YUV422P12,
+AV_PIX_FMT_YUV444P12,
 AV_PIX_FMT_NONE
 };
 
 static av_cold void libx265_encode_init_csp(AVCodec *codec)
 {
-if (x265_api_get(10))
+if (x265_api_get(12))
 codec->pix_fmts = x265_csp_twelve;
+else if (x265_api_get(10))
+codec->pix_fmts = x265_csp_ten;
 else if (x265_api_get(8))
 codec->pix_fmts = x265_csp_eight;
 }
-- 
2.1.4

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


Re: [FFmpeg-devel] [PATCH] avcodec: only warn about hwaccel with frame threads

2016-01-26 Thread Ronald S. Bultje
Hi,

On Tue, Jan 26, 2016 at 5:23 PM, Andreas Cadhalpun <
andreas.cadhal...@googlemail.com> wrote:

> On 25.01.2016 00:53, Hendrik Leppkes wrote:
> > On Sat, Jan 23, 2016 at 3:52 PM, Andreas Cadhalpun
> >  wrote:
> >> On 23.01.2016 15:10, Hendrik Leppkes wrote:
> >>> On Sat, Jan 23, 2016 at 2:45 PM, Ronald S. Bultje 
> wrote:
>  Both of you keep shouting from one side of the room to the other
> without
>  trying to actually converge to a point that might somehow be mutually
>  acceptable. I'm getting very grumbly here.
> 
> >>>
> >>> I'm not trying to be unreasonable here, all I'm asking for at this
> >>> point is to make sure the new vp9 hwaccel doesn't break spectacularly
> >>> when MT is turned on before its allowed back.
> >>
> >> OK, that would be fine with me.
> >>
> >> Do you agree that the attached patch is sufficient for this?
> >>
> >
> > YUV420P will not remain the only format available for hwaccel, I
> > already have some work pending to allow Profile2/10-bit as well, so
> > the check should be further out.
>
> OK. Though if Ronald manages to (hopefully soon) find a solution for
> automatically throttling the hwaccel threads to 1, this check will be
> removed again anyway.
>
> > It would also log every time the function executes, no matter if
> > hwaccel is requested or not, unfortunately I don't see a way to fix
> > that nicely since the decoder doesn't know if the user is going to
> > activate hwaccel.
>
> Indeed. But since that is anyway logged in setup_hwaccel there
> is not really much need for another warning here. I've thus reduced
> the log level to verbose. Attached is an updated patch.


This patch still disables hwaccel instead of disabling threading. This
isn't gonna work. Please wait until my patch is finished.

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


Re: [FFmpeg-devel] [PATCH] avcodec: only warn about hwaccel with frame threads

2016-01-26 Thread Andreas Cadhalpun
Hi Ronald,

On 27.01.2016 01:16, Ronald S. Bultje wrote:
> On Tue, Jan 26, 2016 at 5:23 PM, Andreas Cadhalpun <
> andreas.cadhal...@googlemail.com> wrote:
> This patch still disables hwaccel instead of disabling threading.

Yes.

> This isn't gonna work.

It will work at least as well as FFmpeg 2.8 did (which didn't have
the vp9 hwaccel).

> Please wait until my patch is finished.

Do you think that will happen in the coming days?

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


Re: [FFmpeg-devel] [PATCH] libavutil/mastering_display_metadata.h: change fields to be rationals as this is how they are typically coded.

2016-01-26 Thread Neil Birkbeck
Patch with corrected "From:" is attached.

On Tue, Jan 26, 2016 at 2:28 PM, Vittorio Gambaletta (VittGam)
 wrote:
> On 26/01/2016 23:05:22 CET, Neil Birkbeck wrote:
>>
>> Some sort of squash fail. Apologies.
>
>
> No problem!
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
From f6c9ccc0899c10faffb98b224affc081a523b1ca Mon Sep 17 00:00:00 2001
From: Neil Birkbeck 
Date: Tue, 26 Jan 2016 14:14:20 -0800
Subject: [PATCH] libavutil/mastering_display_metadata.h: change fields to be
 rationals as this is how they are typically coded.

(this structure is not referenced anywhere yet)

Signed-off-by: Neil Birkbeck 
---
 libavutil/mastering_display_metadata.h | 10 ++
 libavutil/version.h|  3 +--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/libavutil/mastering_display_metadata.h b/libavutil/mastering_display_metadata.h
index 781c1fd..936533f 100644
--- a/libavutil/mastering_display_metadata.h
+++ b/libavutil/mastering_display_metadata.h
@@ -22,6 +22,8 @@
 #define AVUTIL_MASTERING_DISPLAY_METADATA_H
 
 #include "frame.h"
+#include "rational.h"
+
 
 /**
  * Mastering display metadata capable of representing the color volume of
@@ -37,22 +39,22 @@ typedef struct AVMasteringDisplayMetadata {
 /**
  * CIE 1931 xy chromaticity coords of color primaries (r, g, b order).
  */
-float display_primaries[3][2];
+AVRational display_primaries[3][2];
 
 /**
  * CIE 1931 xy chromaticity coords of white point.
  */
-float white_point[2];
+AVRational white_point[2];
 
 /**
  * Min luminance of mastering display (cd/m^2).
  */
-float min_luminance;
+AVRational min_luminance;
 
 /**
  * Max luminance of mastering display (cd/m^2).
  */
-float max_luminance;
+AVRational max_luminance;
 
 /**
  * Flag indicating whether the display primaries (and white point) are set.
diff --git a/libavutil/version.h b/libavutil/version.h
index 42f7cde..d63696d 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -65,7 +65,7 @@
 
 #define LIBAVUTIL_VERSION_MAJOR  55
 #define LIBAVUTIL_VERSION_MINOR  15
-#define LIBAVUTIL_VERSION_MICRO 100
+#define LIBAVUTIL_VERSION_MICRO 101
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
@@ -126,4 +126,3 @@
  */
 
 #endif /* AVUTIL_VERSION_H */
-
-- 
2.7.0.rc3.207.g0ac5344

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


Re: [FFmpeg-devel] [PATCH v3] vaapi_h264enc: Add Hardware Accelerated H.264 Encoder based on VAAPI

2016-01-26 Thread Michael Niedermayer
On Tue, Jan 26, 2016 at 03:23:43PM +0500, ha...@mayartech.com wrote:
> From: "bryan.chr...@mediafire.com" 
> 
> This commit adds a hardware accelerated H.264 encoder which utilizes
> libva (open source implementation of VA-API). Information about libva
> is available at: https://en.wikipedia.org/wiki/Video_Acceleration_API
> This encoder is only availbale on linux and supported hardware which
> can be viewed at:
> https://en.wikipedia.org/wiki/Video_Acceleration_API#Supported_hardware_and_drivers
> 
> If libva is installed then the encoder will be automatically enabled.
> ---
> This is the 3rd version of the patch. The subject of the first two patch
> emails was:
> libi264: Add Hardware Accelerated H.264 Encoder based on libVA
> 
> Bryan Christ  is reponsible for maintaining all the
> files related to this patch. This patch is being submitted on his behalf.
> 
> Changes for v3:
>- name of the encoder has been changed from libi264 to vaapi_h264enc to
>  make it more generic
>- all the changes recommended by Michael Niedermayer, compn, James Almer,
>  Hendrik Leppkes, Carl Eugen Hoyos, Will Kelleher have been incorporated

breaks build

make distclean ; ./configure && make -j12
CC  libavcodec/vaapi_h264enc_paramset.o
In file included from libavcodec/vaapi_h264enc.c:23:0:
libavcodec/vaapi_h264enc.h:25:28: fatal error: va/va_enc_h264.h: No such file 
or directory
compilation terminated.
CC  libavcodec/vaapi_mpeg2.o
In file included from libavcodec/vaapi_h264enc_paramset.c:24:0:
libavcodec/vaapi_h264enc_paramset.h:25:28: fatal error: va/va_enc_h264.h: No 
such file or directory
compilation terminated.
CC  libavcodec/vaapi_mpeg4.o
make: *** [libavcodec/vaapi_h264enc.o] Error 1
make: *** Waiting for unfinished jobs
make: *** [libavcodec/vaapi_h264enc_paramset.o] Error 1

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

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


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


Re: [FFmpeg-devel] [FFmpeg-cvslog] build: use a link instead of changing current directory when compiling

2016-01-26 Thread Michael Niedermayer
On Tue, Jan 26, 2016 at 11:07:43PM +0100, Andreas Cadhalpun wrote:
> On 26.01.2016 21:28, Michael Niedermayer wrote:
> > On Mon, Jan 25, 2016 at 08:51:32PM +0100, Andreas Cadhalpun wrote:
> >> ffmpeg | branch: master | Andreas Cadhalpun 
> >>  | Mon Jan 25 01:42:23 2016 +0100| 
> >> [b46aae093634271931395d65f422f4b2a23112d3] | committer: Andreas Cadhalpun
> >>
> >> build: use a link instead of changing current directory when compiling
> >>
> >> If links don't work, fall back to using the full source path as was
> >> previously done.
> >>
> >> This should fix build failures with MSVC.
> >>
> >> Reviewed-by: Hendrik Leppkes 
> >> Signed-off-by: Andreas Cadhalpun 
> >>
> >>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b46aae093634271931395d65f422f4b2a23112d3
> >> ---
> > 
> > if you have a "src" directory this results in:
> > ./configure
> > rm: cannot remove `src': Is a directory
> > ln: `src/.': cannot overwrite directory
> 
> I guess you'd like to keep the src directory in that case.
> Attached is a patch falling back to using the full path then.

well, not sure what is best, i already deleted the directory
it could mess up greping too depending on how one does it
the patch is fine, iam also fine if no change or another change is
pushed

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

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


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


Re: [FFmpeg-devel] [PATCH 1/2] lavf/segment: add support for specifying clock time offset

2016-01-26 Thread Stefano Sabatini
On date Monday 2016-01-18 21:56:29 +0100, Marton Balint encoded:
> Signed-off-by: Marton Balint 
> ---
>  doc/muxers.texi   | 10 ++
>  libavformat/segment.c | 11 ++-
>  2 files changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/muxers.texi b/doc/muxers.texi
> index a308d3d..c304221 100644
> --- a/doc/muxers.texi
> +++ b/doc/muxers.texi
> @@ -1100,6 +1100,16 @@ to create files at 12:00 o'clock, 12:15, 12:30, etc.
>  
>  Default value is "0".
>  
> +@item segment_clocktime_offset @var{duration}

> +By setting this option you can delay the segment splitting times with the
> +specified duration when using @option{segment_atclocktime}.
 
Nit:

Delay the segment splitting times with the specified duration when
using @option{segment_atclocktime}.
 
> +For example with @option{segment_time} set to "900" and
> +@option{segment_clocktime_offset} set to "300" this makes it possible to
> +create files at 12:05, 12:20, 12:35, etc.
> +
> +Default value is "0".
> +
>  @item segment_time_delta @var{delta}
>  Specify the accuracy time when selecting the start time for a
>  segment, expressed as a duration specification. Default value is "0".
> diff --git a/libavformat/segment.c b/libavformat/segment.c
> index 0c1f633..bf7a8fc 100644
> --- a/libavformat/segment.c
> +++ b/libavformat/segment.c
> @@ -82,6 +82,7 @@ typedef struct SegmentContext {
>  int   list_size;   ///< number of entries for the segment list file
>  
>  int use_clocktime;///< flag to cut segments at regular clock time
> +int64_t clocktime_offset; //< clock offset for cutting the segments at 
> regular clock time
>  int64_t last_val;  ///< remember last time for wrap around detection
>  int64_t last_cut;  ///< remember last cut
>  int cut_pending;
> @@ -633,6 +634,13 @@ static int seg_write_header(AVFormatContext *s)
> seg->time_str);
>  return ret;
>  }
> +if (seg->use_clocktime) {

> +if (seg->time <= 0) {
> +av_log(s, AV_LOG_ERROR, "Invalid segment_time\n");

Nit: "Invalid negative segment_time with segment_atclocktime option set\n"

> +return AVERROR(EINVAL);
> +}
> +seg->clocktime_offset = seg->time - (seg->clocktime_offset % 
> seg->time);
> +}
>  }
>  
>  if (seg->format_options_str) {
> @@ -775,7 +783,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket 
> *pkt)
>  time_t sec = avgt / 100;
>  localtime_r(&sec, &ti);
>  usecs = (int64_t)(ti.tm_hour * 3600 + ti.tm_min * 60 + 
> ti.tm_sec) * 100 + (avgt % 100);
> -wrapped_val = usecs % seg->time;
> +wrapped_val = (usecs + seg->clocktime_offset) % seg->time;
>  if (seg->last_cut != usecs && wrapped_val < seg->last_val) {
>  seg->cut_pending = 1;
>  seg->last_cut = usecs;
> @@ -926,6 +934,7 @@ static const AVOption options[] = {
>  { "hls", "Apple HTTP Live Streaming compatible", 0, AV_OPT_TYPE_CONST, 
> {.i64=LIST_TYPE_M3U8 }, INT_MIN, INT_MAX, E, "list_type" },
>  
>  { "segment_atclocktime",  "set segment to be cut at clocktime",  
> OFFSET(use_clocktime), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, E},
> +{ "segment_clocktime_offset", "set segment clocktime offset",
> OFFSET(clocktime_offset), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, 86400, E},

86400=> I think the maximum value must be expressed in microseconds

>  { "segment_time",  "set segment duration",   
> OFFSET(time_str),AV_OPT_TYPE_STRING, {.str = NULL},  0, 0,   E },
>  { "segment_time_delta","set approximation value used for the segment 
> times", OFFSET(time_delta), AV_OPT_TYPE_DURATION, {.i64 = 0}, 0, 0, E },
>  { "segment_times", "set segment split time points",  
> OFFSET(times_str),AV_OPT_TYPE_STRING,{.str = NULL},  0, 0,   E },

[...]
-- 
FFmpeg = Fancy and Fierce Minimalistic Puritan Exciting Glue
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavformat/network: use defined constant in poll

2016-01-26 Thread Zhao Zhili
From: Zhao Zhili 

---
 libavformat/network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/network.c b/libavformat/network.c
index 7a326d2..2fb1c8b 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -75,7 +75,7 @@ int ff_network_wait_fd(int fd, int write)
 int ev = write ? POLLOUT : POLLIN;
 struct pollfd p = { .fd = fd, .events = ev, .revents = 0 };
 int ret;
-ret = poll(&p, 1, 100);
+ret = poll(&p, 1, POLLING_TIME);
 return ret < 0 ? ff_neterrno() : p.revents & (ev | POLLERR | POLLHUP)
? 0 : AVERROR(EAGAIN);
 }

-- 
1.9.1
From da24b50d7167adf4181da375b9c300936fb5de99 Mon Sep 17 00:00:00 2001
From: Zhao Zhili 
Date: Wed, 27 Jan 2016 11:00:17 +0800
Subject: [PATCH] libavformat/network: use defined constant in poll

---
 libavformat/network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/network.c b/libavformat/network.c
index 7a326d2..2fb1c8b 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -75,7 +75,7 @@ int ff_network_wait_fd(int fd, int write)
 int ev = write ? POLLOUT : POLLIN;
 struct pollfd p = { .fd = fd, .events = ev, .revents = 0 };
 int ret;
-ret = poll(&p, 1, 100);
+ret = poll(&p, 1, POLLING_TIME);
 return ret < 0 ? ff_neterrno() : p.revents & (ev | POLLERR | POLLHUP) ? 0 : AVERROR(EAGAIN);
 }
 
-- 
1.9.1

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