Re: [FFmpeg-devel] [PATCH] doc/filters: Add ascii graphics to clarify what the currently implemented tinterlace modes do

2014-12-04 Thread tim nicholson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/12/14 17:13, Michael Niedermayer wrote:
 On Tue, Dec 02, 2014 at 05:02:49PM +, tim nicholson wrote:
 On 02/12/14 15:33, Michael Niedermayer wrote:
 Signed-off-by: Michael Niedermayer michae...@gmx.at
 ---
  doc/filters.texi |  131 
 ++
  1 file changed, 131 insertions(+)

 diff --git a/doc/filters.texi b/doc/filters.texi
 index 8c16c7a..0ea3955 100644
 --- a/doc/filters.texi
 +++ b/doc/filters.texi
 @@ -8537,33 +8537,164 @@ Available values are:
  @item merge, 0
  Move odd frames into the upper field, even into the lower field,
  generating a double height frame at half frame rate.
 +@example
 + -- time
 +Input:
 +Frame 1 Frame 2 Frame 3 Frame 4
 +
 +1   2   3   4
 +1   2   3   4
 +1   2   3   4
 +1   2   3   4
 +
 +Output:
 +1   3
 +2   4
 +1   3
 +2   4
 +1   3
 +2   4
 +1   3
 +2   4
 [..]

 I find the ascii graphic style of the interlace filter more
 understandable
 
 how do you suggest above (and the other modes) would be documented
 in that style ?
 

Sorry for the delayed reply ISP issue...

I think the main difference is going left to right, not top to bottom
for input to output, this then matches not only interlace but the
general filtergraph descriptions.

I will try and see if I can give an example if you like.

 
 [...]

- -- 
Tim.
Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBAgAGBQJUgBpMAAoJEAwL/ESLC/yDxkEH/1hWM5A1P3V3cz2XH3pF01/0
64e4A9RRx0BpX0pDHqik9aVNQtL+qSBFYkkQGPn8smTdqWEQXfIe/lWQSXODj95T
+/Un1V33cxnPznJnTCfxrZEKuYbEQYehyuasGcgzq/L0CIYamGJmuWZ4feZKQ0Vk
ZdCAs/ygX9igc7V+41UG5dQu6n+nhIwAkOAJBiGkeVMKu76YH19fF/G4TO7tYczn
GbVgKfu78LK8cZZOWl3w42EO7aF98TeG6q29jQsiDABLNa8JocIVmxaijbaIEJ3R
2Eb5yzCeyZadgOrenRzF9iR0W4JvlXK2Expqr15SISRjVJ4L8AjZqs6nPOsraHY=
=KKl4
-END PGP SIGNATURE-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/tinterlace: merge code with interlace

2014-12-04 Thread tim nicholson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 03/12/14 13:08, Michael Niedermayer wrote:
 On Tue, Dec 02, 2014 at 07:43:47PM +0100, Clément Bœsch wrote:
 ---
 After this commit, interlace doesn't behave the same if the input frames
 are already interlaced. Does anyone wants me to keep this behaviour?
 
 probably best if its kept but can be forced enabled/disabled with
 an option. these interlacing flags on the input can be wrong
 

+1

 otherwise LGTM
 
 [...]



- -- 
Tim.
Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBAgAGBQJUgBvNAAoJEAwL/ESLC/yDOmMH/3U73HxpvOsW4QwvfBDQFeD0
dMqyo9NgZFUzsNLptORc9ifRXQrDpxvhkmhPtqpCgpgLBV+E88VyXCEo+QPrq8AY
l617h6Wb/FbRHT4opYTfU2DsSgdNKalAZacrckY1dGFNEACQRg04n8jGkbyK5gu/
1YXFknMic92Vq29uwPrymrmvcGyWtjj2goTL/6ikVbAdFGQ6dks21PR412YUqk6z
BcVuWXxXv9HZft2pfE1edcT3FEqiJL/iKZmzq91i6vzkyS5xeHXkLgCNc+P3NfOx
pPvKl4lFhRFMh4OTxVT82EqUvrFovgH3bRXXocQeIxuzf+BXzrkVZOSMPjtoG1o=
=bJWr
-END PGP SIGNATURE-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/tinterlace: merge code with interlace

2014-12-04 Thread tim nicholson
On 02/12/14 18:43, Clément Bœsch wrote:
 ---
 After this commit, interlace doesn't behave the same if the input frames
 are already interlaced. Does anyone wants me to keep this behaviour?
 
 Also, the PTS adjustments might be different, but I didn't follow the
 current discussions about it so I can't tell what people want.
 ---
  libavfilter/Makefile|   2 +-
  libavfilter/interlace.h |  58 -
  libavfilter/tinterlace.h|   5 +-
  libavfilter/vf_interlace.c  | 250 
 
  libavfilter/vf_tinterlace.c |  44 +++
  libavfilter/x86/Makefile|   2 +-
  libavfilter/x86/vf_interlace_init.c |  47 ---
  7 files changed, 49 insertions(+), 359 deletions(-)
  delete mode 100644 libavfilter/interlace.h
  delete mode 100644 libavfilter/vf_interlace.c
  delete mode 100644 libavfilter/x86/vf_interlace_init.c
 
 [..]

The docs will need updating to remove the vf_interlace entry and add the
lp filter options. Maybe that is the time to merge the ascii art
graphics and add Michael's additional mode ones as well?


-- 
Tim.
Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/tinterlace: merge code with interlace

2014-12-04 Thread Clément Bœsch
On Thu, Dec 04, 2014 at 09:31:47AM +, tim nicholson wrote:
 On 02/12/14 18:43, Clément Bœsch wrote:
  ---
  After this commit, interlace doesn't behave the same if the input frames
  are already interlaced. Does anyone wants me to keep this behaviour?
  
  Also, the PTS adjustments might be different, but I didn't follow the
  current discussions about it so I can't tell what people want.
  ---
   libavfilter/Makefile|   2 +-
   libavfilter/interlace.h |  58 -
   libavfilter/tinterlace.h|   5 +-
   libavfilter/vf_interlace.c  | 250 
  
   libavfilter/vf_tinterlace.c |  44 +++
   libavfilter/x86/Makefile|   2 +-
   libavfilter/x86/vf_interlace_init.c |  47 ---
   7 files changed, 49 insertions(+), 359 deletions(-)
   delete mode 100644 libavfilter/interlace.h
   delete mode 100644 libavfilter/vf_interlace.c
   delete mode 100644 libavfilter/x86/vf_interlace_init.c
  
  [..]
 
 The docs will need updating to remove the vf_interlace entry and add the
 lp filter options. Maybe that is the time to merge the ascii art
 graphics and add Michael's additional mode ones as well?
 

None of the filter disappear and their options don't change. It's just
code refactoring.

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH 2/2] RELEASE: Bump

2014-12-04 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 08:15:20PM -0800, Timothy Gu wrote:
 Signed-off-by: Timothy Gu timothyg...@gmail.com
 ---
  RELEASE | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

applied

thanks

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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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


[FFmpeg-devel] Fix bug for POWER LE: libavcodec/ppc/vp8dsp_altivec.c

2014-12-04 Thread rongyan
Hi,
We propose this patch to fix vp8 bugs for POWER8 little endian. Functions 
put_vp8_epel_h_altivec_core(), puta_vp8_epel_v_altivec_core(), and 
put_vp8_pixels16_altivec() are fixed.
The passed test cases change from  2296/2328 to 2328/2328.
 

 
Thanks for your review.

 Rong Yan
  
  --
  The world has enough for everyone's need, but not enough for everyone's greed.

0001-avcodec-ppc-vp8dsp_altivec.c-POWER-LE-support-put_vp.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Fix bug for POWER LE: avcodec/ppc/vc1dsp_altivec.c

2014-12-04 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 02:06:34PM +0800, rongyan wrote:
 Hi,
 We propose this patch to fix vc1 bugs for POWER8 little endian. Function 
 vc1_inv_trans_8x4_altivec() is fixed.
 The passed test cases change from  2296/2328 to 2303/2328‍.
  
 ‍‍
  
 Thanks for your review.
 Rong Yan
   
   --
   The world has enough for everyone's need, but not enough for everyone's 
 greed.


  vc1dsp_altivec.c |   13 ++---
  1 file changed, 10 insertions(+), 3 deletions(-)
 ea32c44c9e3b4d879c2e4bd854c42755fe0b131b  
 0001-avcodec-ppc-vc1dsp_altivec-POWER-LE-support-vc1_inv_.patch
 From 97126a766f2825bfec198dc9ffe0d98d453f6689 Mon Sep 17 00:00:00 2001
 From: Rong Yan rongyan...@gmail.com
 Date: Thu, 4 Dec 2014 05:51:30 +
 Subject: [PATCH] avcodec/ppc/vc1dsp_altivec: POWER LE support
  vc1_inv_trans_8x4_altivec() add marcos GET_TMP2()

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH 2/2] Adding closed caption decoder

2014-12-04 Thread Nicolas George
Le quartidi 14 frimaire, an CCXXIII, Anshul a écrit :
 It would be valid, c708 is backward compatible as far as
 I have seen while working with ccextractor.
 C708 is made in such a way that people dont have to throw there older TV
 sets or device.
 if any decoder is not able to decode c708 part, even then they can get
 correct subtitle.

So if I understand you correctly, the format could have kept the same name,
just as when Matroska adds a new codec name, and the name is only relevant
as an indication of what a decoder is capable of handling.

 Yes while doing that only I realized,  if we use i then cc must be in
 first stream.
 When I had multiple stream(with audio), then I was not able to map subcc
 to my video stream.
 using stream_idx , we are saying that if we can use  out0+subcc and
 out1+subcc.
 i logic fails when there is audio in 1st stream, there was no way i 
 could get the subtitle
 if my first stream is not the one where closed caption are present.

I will look more closely into it.

In the meantime, you may want to have a look at this one:

http://samples.ffmpeg.org/MPEG2/subcc/ClosedCaptions/subccItalic.mpg

I see quite a few subcc packets, but the decoder does not output anything.
Furthermore, I do not see any ASS styling in the decoder, that would be a
good test case.

More comments to come.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH 2/2] Adding closed caption decoder

2014-12-04 Thread Kieran Kunhya
 Furthermore, I do not see any ASS styling in the decoder, that would be a
 good test case.

Captions shouldn't be ASS styled - they should be styled as per the
specification (see VLC).

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


Re: [FFmpeg-devel] [PATCH 2/2] Adding closed caption decoder

2014-12-04 Thread Clément Bœsch
On Thu, Dec 04, 2014 at 11:32:40AM +, Kieran Kunhya wrote:
  Furthermore, I do not see any ASS styling in the decoder, that would be a
  good test case.
 
 Captions shouldn't be ASS styled - they should be styled as per the
 specification (see VLC).
 

I'd be surprised if you can't get close to the intended rendering with ASS
markup.

What style do you think wouldn't be supported?

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH 2/2] Adding closed caption decoder

2014-12-04 Thread Nicolas George
Le quartidi 14 frimaire, an CCXXIII, Kieran Kunhya a écrit :
 Captions shouldn't be ASS styled - they should be styled as per the
 specification (see VLC).

You are certainly right, but we are talking about a decoder, and FFmpeg's
internal format for decoded text subtitles is still ASS. If something in the
specification can say italic (seeing the file name, I guess it is
possible), then the decoder must output proper {\i1} and {\i0} tags, and
same for bold, colors, whatever exists in the spec.

Or am I missing something?

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] lavfi: add tdiff filter

2014-12-04 Thread Stefano Sabatini
On date Sunday 2014-11-23 14:57:41 +0100, Clément Bœsch encoded:
 On Sun, Nov 23, 2014 at 02:50:51PM +0100, Stefano Sabatini wrote:
  On date Sunday 2014-11-23 02:01:16 +0100, Clément Bœsch encoded:
   On Sat, Nov 22, 2014 at 11:44:29PM +0100, Stefano Sabatini wrote:
TODO: bump minor
---
 Changelog|   1 +
 doc/filters.texi |   4 ++
 libavfilter/Makefile |   1 +
 libavfilter/allfilters.c |   1 +
 libavfilter/vf_tdiff.c   | 131 
+++
 5 files changed, 138 insertions(+)
 create mode 100644 libavfilter/vf_tdiff.c

   
  
   What about adding a tblend in vf_blend.c instead?
  
  What do you exactly mean? tdiff works with a single input, blend with
  two inputs.
 
 That's the point: make another filter with temporal dimension in blend.
 Blend filter has many features such as doing something more than diff
 and having threading. The main function takes 2 frames so just add the
 glue code around to take the previous and the current frame instead.
 
 That's just a suggestion, maybe the other functions don't make much sense.
 Feel free to ignore.

Uh, what about this?
-- 
FFmpeg = Frightening Faithless Martial Powerful Evil Goblin
From c805460ceb04ec2da3f607e69067f4cc710c0613 Mon Sep 17 00:00:00 2001
From: Stefano Sabatini stefa...@gmail.com
Date: Thu, 4 Dec 2014 12:27:53 +0100
Subject: [PATCH] lavfi: add tblend filter

---
 libavfilter/Makefile |  1 +
 libavfilter/allfilters.c |  1 +
 libavfilter/vf_blend.c   | 73 +++-
 3 files changed, 74 insertions(+), 1 deletion(-)

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index d41a52e..d1be7e3 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -187,6 +187,7 @@ OBJS-$(CONFIG_STEREO3D_FILTER)   += vf_stereo3d.o
 OBJS-$(CONFIG_SUBTITLES_FILTER)  += vf_subtitles.o
 OBJS-$(CONFIG_SUPER2XSAI_FILTER) += vf_super2xsai.o
 OBJS-$(CONFIG_SWAPUV_FILTER) += vf_swapuv.o
+OBJS-$(CONFIG_TBLEND_FILTER) += vf_blend.o
 OBJS-$(CONFIG_TDIFF_FILTER)  += vf_tdiff.o
 OBJS-$(CONFIG_TELECINE_FILTER)   += vf_telecine.o
 OBJS-$(CONFIG_THUMBNAIL_FILTER)  += vf_thumbnail.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index f13f82d..e8914cc 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -202,6 +202,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(SUBTITLES,  subtitles,  vf);
 REGISTER_FILTER(SUPER2XSAI, super2xsai, vf);
 REGISTER_FILTER(SWAPUV, swapuv, vf);
+REGISTER_FILTER(TBLEND, tblend, vf);
 REGISTER_FILTER(TDIFF,  tdiff,  vf);
 REGISTER_FILTER(TELECINE,   telecine,   vf);
 REGISTER_FILTER(THUMBNAIL,  thumbnail,  vf);
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index 8bf19ff..3c1572c 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -95,6 +95,8 @@ typedef struct {
 double all_opacity;
 
 FilterParams params[4];
+int tblend;
+AVFrame *prev_frame;/* only used with tblend */
 } BlendContext;
 
 #define OFFSET(x) offsetof(BlendContext, x)
@@ -285,7 +287,8 @@ static AVFrame *blend_frame(AVFilterContext *ctx, AVFrame *top_buf,
 ctx-internal-execute(ctx, filter_slice, td, NULL, FFMIN(outh, ctx-graph-nb_threads));
 }
 
-av_frame_free(top_buf);
+if (!b-tblend)
+av_frame_free(top_buf);
 
 return dst_buf;
 }
@@ -295,6 +298,8 @@ static av_cold int init(AVFilterContext *ctx)
 BlendContext *b = ctx-priv;
 int ret, plane;
 
+b-tblend = !strcmp(ctx-filter-name, tblend);
+
 for (plane = 0; plane  FF_ARRAY_ELEMS(b-params); plane++) {
 FilterParams *param = b-params[plane];
 
@@ -412,6 +417,8 @@ static av_cold void uninit(AVFilterContext *ctx)
 int i;
 
 ff_dualinput_uninit(b-dinput);
+av_freep(b-prev_frame);
+
 for (i = 0; i  FF_ARRAY_ELEMS(b-params); i++)
 av_expr_free(b-params[i].e);
 }
@@ -463,3 +470,67 @@ AVFilter ff_vf_blend = {
 .priv_class= blend_class,
 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS,
 };
+
+static int tblend_config_output(AVFilterLink *outlink)
+{
+AVFilterContext *ctx = outlink-src;
+AVFilterLink *inlink = ctx-inputs[0];
+BlendContext *b = ctx-priv;
+const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink-format);
+
+b-hsub = pix_desc-log2_chroma_w;
+b-vsub = pix_desc-log2_chroma_h;
+b-nb_planes = av_pix_fmt_count_planes(inlink-format);
+outlink-flags |= FF_LINK_FLAG_REQUEST_LOOP;
+
+return 0;
+}
+
+static int tblend_filter_frame(AVFilterLink *inlink, AVFrame *frame)
+{
+BlendContext *b = inlink-dst-priv;
+AVFilterLink *outlink = inlink-dst-outputs[0];
+
+if (b-prev_frame) {
+AVFrame *out = 

Re: [FFmpeg-devel] [PATCH 3/3] lavc/libxvid: workaround for bug in libxvidcore

2014-12-04 Thread Clément Bœsch
On Thu, Dec 04, 2014 at 12:39:29AM +0100, Lukasz Marek wrote:
 On 24.11.2014 01:17, Lukasz Marek wrote:
 libxvidcore calculate number of threads basing on video height.
 If height is small enough it allocates 0 bytes long memory and
 writes to it.
 Setting thread_count to 0 uses 1 thread and skips bugged code.
 
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
   libavcodec/libxvid.c | 11 +++
   1 file changed, 11 insertions(+)
 
 diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
 index 70d52b9..efe7b8a 100644
 --- a/libavcodec/libxvid.c
 +++ b/libavcodec/libxvid.c
 @@ -471,6 +471,17 @@ static av_cold int xvid_encode_init(AVCodecContext 
 *avctx)
   xvid_enc_create.num_zones = 0;
 
   xvid_enc_create.num_threads = avctx-thread_count;
 +/* workaround for a bug in libxvidcore */
 +if (avctx-height  18) {
 +if (avctx-thread_count  2) {
 +xvid_enc_create.num_threads = 0;
 +} else {
 +av_log(avctx, AV_LOG_ERROR,
 +   Too small height for threads  1.);
 +ret = AVERROR(EINVAL);
 +goto fail;
 +}
 +}
 
   xvid_enc_create.plugins = plugins;
   xvid_enc_create.num_plugins = 0;
 
 
 Please comment this patch. xvid accepted fix for it.

Can you add a version check, or at least a comment saying what versions
are affected by this?

 Personally I don't care, but when configured correctly ffmpeg is using not
 allocated memory via external library.
 I just don't know if keep it or just forget about it.

-- 
Clément B.


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


[FFmpeg-devel] [PATCH] Incorrect aspect ratio in MPEG2 essence

2014-12-04 Thread Erik Johansson
Hi,

Setting setting sample_aspect_ratio in AVContext does not produce the
expected aspect index value in the MPEG2 sequence header.

Problem seems to be around line 263 in mpeg12enc.c. Setting the
sample_aspect_ratio to 16/9 leads the current error minimization
routine to determine that

error -= (1LL32)*(221/100)*(1080/1920)

is smaller than

error -= (1LL32)*(16/9)*(1080/1920)

thus picking aspect index value 4 rather than 3.

Proposed fix in attached patch.

-- 
Erik Johansson


mpeg2_aspect.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] Adding closed caption decoder

2014-12-04 Thread Nicolas George
Le quartidi 14 frimaire, an CCXXIII, Anshul a écrit :
 Yes while doing that only I realized,  if we use i then cc must be in
 first stream.
 When I had multiple stream(with audio), then I was not able to map subcc
 to my video stream.
 using stream_idx , we are saying that if we can use  out0+subcc and
 out1+subcc.
 i logic fails when there is audio in 1st stream, there was no way i 
 could get the subtitle
 if my first stream is not the one where closed caption are present.

I tested various combinations, and I find it works with my i version and
not with your stream_idx version. You can try this:

http://samples.ffmpeg.org/MPEG2/subcc/ClosedCaptions/Starship_Troopers.vob
http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket1482/NCIS.wtv

st=~/tmp/samples/Starship_Troopers_with_subcc.vob
ncis=~/tmp/samples/NCIS_with_subcc_stream.wtv
input=movie=${st}:s=0+1[out0+subcc][out1];movie=${ncis}:s=2+0[out2+subcc][out3]
function prefix { sed s/^/$1 : / }

./ffmpeg_g -loglevel error -f lavfi -i $input -y \
  -map 0:s:0 -f srt (prefix 1_) \
  -map 0:s:1 -f srt (prefix _2)

(the captions in ALL CAPS are from ST, the other ones from NCIS)

The mapping logic is this:

- ${st}:s=0+1[out0+subcc][out1]: take stream #0 (video) and #1 (audio)
  from ${st} and make them stream #0 and #1 for the device.

- ${ncis}:s=2+0[out2+subcc][out3]: take stream #2 (video) and #0 (audio)
  from ${ncis} and make them stream #2 and #3 for the device.

- out0+subcc: output stream #0 (video from $st) has CC, make it the first
  extra stream, i.e. #4 for the device.

- out2+subcc: output stream #2 (video from $ncis) has CC, make it the next
  extra stream, i.e. #5 for the device.

- -map 0:s:0: take the first subtitle stream, i.e. #4, i.e. CC for #2,
  i.e. CC for video from $st.

- -map 0:s:1: take the second subtitle stream, i.e. #5.

In other words:

  lavfi:4 = CC for lavfi:0 = CC for st:0
  lavfi:5 = CC for lavfi:2 = CC for ncis:2

CC streams are created in output stream index order, or, in other words, in
order of their X index in outX+subcc.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] web: Update Bower dependencies

2014-12-04 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 08:56:11PM -0800, Timothy Gu wrote:
 On Tue, Nov 25, 2014 at 7:50 PM, Timothy Gu timothyg...@gmail.com wrote:
  Also explicitly add jQuery as a dependency. It is copied from the Makefile.
 
  Signed-off-by: Timothy Gu timothyg...@gmail.com
  ---
   bower.json|   9 +-
   htdocs/css/bootstrap.min.css  |   4 +-
   htdocs/css/font-awesome.min.css   |   4 +-
   htdocs/fonts/FontAwesome.otf  | Bin 75188 - 85908 bytes
   htdocs/fonts/fontawesome-webfont.eot  | Bin 72449 - 56006 bytes
   htdocs/fonts/fontawesome-webfont.svg  | 942 
  +-
   htdocs/fonts/fontawesome-webfont.ttf  | Bin 141564 - 112160 bytes
   htdocs/fonts/fontawesome-webfont.woff | Bin 83760 - 65452 bytes
   htdocs/js/bootstrap.min.js|   5 +-
   9 files changed, 491 insertions(+), 473 deletions(-)
 
 Ping.

Applying: web: Update Bower dependencies
fatal: corrupt patch at line 273

patching file bower.json
patching file htdocs/css/bootstrap.min.css
patch:  malformed patch at line 46:  
tgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html
 
input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html
 
input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em
 .625em .75em;margin:0 2px;border:1px solid 
silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH 4/4] style: Update from ffmpeg-web

2014-12-04 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 09:34:11PM -0800, Timothy Gu wrote:
 Signed-off-by: Timothy Gu timothyg...@gmail.com
 ---
 
 Forgot this one
 
 --
  doc/style.min.css | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applying: style: Update from ffmpeg-web
fatal: corrupt patch at line 31

[...]
-- 
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


[FFmpeg-devel] [PATCH] lavd/lavfi: allow to extract subcc.

2014-12-04 Thread Nicolas George
Signed-off-by: Nicolas George geo...@nsup.org
---
 doc/indevs.texi | 14 
 libavdevice/lavfi.c | 92 +
 2 files changed, 99 insertions(+), 7 deletions(-)


Correctly rebased today, with some extra doc.

If the decoder is applied before this patch, then we can change the example
to output SRT or ASS, this would be even better.


diff --git a/doc/indevs.texi b/doc/indevs.texi
index ad823ab..abc4cc3 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -495,6 +495,14 @@ generated by the device.
 The first unlabelled output is automatically assigned to the out0
 label, but all the others need to be specified explicitly.
 
+The suffix +subcc can be appended to the output label to create an extra
+stream with the closed captions packets attached to that output
+(experimental; only for EIA-608 / CEA-708 for now).
+The subcc streams are created after all the normal streams, in the order of
+the corresponding stream.
+For example, if there is out19+subcc, out7+subcc and up to out42, the
+stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
+
 If not specified defaults to the filename specified for the input
 device.
 
@@ -541,6 +549,12 @@ Read an audio stream and a video stream and play it back 
with
 ffplay -f lavfi movie=test.avi[out0];amovie=test.wav[out1]
 @end example
 
+@item
+Dump decoded frames to images and closed captions to a file (experimental):
+@example
+ffmpeg -f lavfi -i movie=test.ts[out0+subcc] -map v frame%08d.png -map s -c 
copy -f rawvideo subcc.bin
+@end example
+
 @end itemize
 
 @section libcdio
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 1398ece..d0e6bf5 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -51,7 +51,10 @@ typedef struct {
 int *sink_stream_map;
 int *sink_eof;
 int *stream_sink_map;
+int *sink_stream_subcc_map;
 AVFrame *decoded_frame;
+int nb_sinks;
+AVPacket subcc_packet;
 } LavfiContext;
 
 static int *create_all_formats(int n)
@@ -82,6 +85,7 @@ av_cold static int lavfi_read_close(AVFormatContext *avctx)
 av_freep(lavfi-sink_stream_map);
 av_freep(lavfi-sink_eof);
 av_freep(lavfi-stream_sink_map);
+av_freep(lavfi-sink_stream_subcc_map);
 av_freep(lavfi-sinks);
 avfilter_graph_free(lavfi-graph);
 av_frame_free(lavfi-decoded_frame);
@@ -89,6 +93,27 @@ av_cold static int lavfi_read_close(AVFormatContext *avctx)
 return 0;
 }
 
+static int create_subcc_streams(AVFormatContext *avctx)
+{
+LavfiContext *lavfi = avctx-priv_data;
+AVStream *st;
+int stream_idx, sink_idx;
+
+for (stream_idx = 0; stream_idx  lavfi-nb_sinks; stream_idx++) {
+sink_idx = lavfi-stream_sink_map[stream_idx];
+if (lavfi-sink_stream_subcc_map[sink_idx]) {
+lavfi-sink_stream_subcc_map[sink_idx] = avctx-nb_streams;
+if (!(st = avformat_new_stream(avctx, NULL)))
+return AVERROR(ENOMEM);
+st-codec-codec_id = AV_CODEC_ID_EIA_608;
+st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE;
+} else {
+lavfi-sink_stream_subcc_map[sink_idx] = -1;
+}
+}
+return 0;
+}
+
 av_cold static int lavfi_read_header(AVFormatContext *avctx)
 {
 LavfiContext *lavfi = avctx-priv_data;
@@ -153,6 +178,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
 
 /* count the outputs */
 for (n = 0, inout = output_links; inout; n++, inout = inout-next);
+lavfi-nb_sinks = n;
 
 if (!(lavfi-sink_stream_map = av_malloc(sizeof(int) * n)))
 FAIL(AVERROR(ENOMEM));
@@ -160,6 +186,8 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
 FAIL(AVERROR(ENOMEM));
 if (!(lavfi-stream_sink_map = av_malloc(sizeof(int) * n)))
 FAIL(AVERROR(ENOMEM));
+if (!(lavfi-sink_stream_subcc_map = av_malloc(sizeof(int) * n)))
+FAIL(AVERROR(ENOMEM));
 
 for (i = 0; i  n; i++)
 lavfi-stream_sink_map[i] = -1;
@@ -167,14 +195,22 @@ av_cold static int lavfi_read_header(AVFormatContext 
*avctx)
 /* parse the output link names - they need to be of the form out0, out1, 
...
  * create a mapping between them and the streams */
 for (i = 0, inout = output_links; inout; i++, inout = inout-next) {
-int stream_idx;
-if (!strcmp(inout-name, out))
-stream_idx = 0;
-else if (sscanf(inout-name, out%d\n, stream_idx) != 1) {
+int stream_idx = 0, suffix = 0, use_subcc = 0;
+sscanf(inout-name, out%n%d%n, suffix, stream_idx, suffix);
+if (!suffix) {
 av_log(avctx,  AV_LOG_ERROR,
Invalid outpad name '%s'\n, inout-name);
 FAIL(AVERROR(EINVAL));
 }
+if (inout-name[suffix]) {
+if (!strcmp(inout-name + suffix, +subcc)) {
+use_subcc = 1;
+} else {
+av_log(avctx,  AV_LOG_ERROR,
+   Invalid outpad suffix '%s'\n, 

Re: [FFmpeg-devel] [PATCH] avfilter/tinterlace: merge code with interlace

2014-12-04 Thread tim nicholson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/12/14 09:59, Clément Bœsch wrote:
 On Thu, Dec 04, 2014 at 09:31:47AM +, tim nicholson wrote:
 On 02/12/14 18:43, Clément Bœsch wrote:
 ---
 After this commit, interlace doesn't behave the same if the input frames
 are already interlaced. Does anyone wants me to keep this behaviour?

 Also, the PTS adjustments might be different, but I didn't follow the
 current discussions about it so I can't tell what people want.
 ---
  libavfilter/Makefile|   2 +-
  libavfilter/interlace.h |  58 -
  libavfilter/tinterlace.h|   5 +-
  libavfilter/vf_interlace.c  | 250 
 
  libavfilter/vf_tinterlace.c |  44 +++
  libavfilter/x86/Makefile|   2 +-
  libavfilter/x86/vf_interlace_init.c |  47 ---
  7 files changed, 49 insertions(+), 359 deletions(-)
  delete mode 100644 libavfilter/interlace.h
  delete mode 100644 libavfilter/vf_interlace.c
  delete mode 100644 libavfilter/x86/vf_interlace_init.c

 [..]

 The docs will need updating to remove the vf_interlace entry and add the
 lp filter options. Maybe that is the time to merge the ascii art
 graphics and add Michael's additional mode ones as well?

 
 None of the filter disappear and their options don't change. It's just
 code refactoring.

Sorry misread it only looking at the diff. I thought there was a
funtionality merger as well as per the irc discussion.

 [..]


- -- 
Tim.
Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBAgAGBQJUgFaLAAoJEAwL/ESLC/yDRGkH/j2ZXp+JcWgfvTIG5+/U5Nrk
uDA9Gpn+QQKQHjaF+AHCL8d1KPmXlnKgbha2r9V4EBHiSyZDTNOcio9T0IvY+YDG
wbnTuCSV6SaBgm8LvKrvB2B/OC4aMFoP8aYyE10Ghqkd2HHG7jGcctPrlAIdmvpP
K6VbHFP+RKuvQLvQPX2SPigcGvUQV566azYguzum82k4CV4+kwugUCDNgGeds8rO
ySy/DoeTai0cm5A+PA3ojKMaWkuZt5AN6WFFGcYvamwLDa/WZfK8SlcpvPZoH9y9
9DYizi3PDOfyojpXKoMsi6n3zRpKJ9x7TETA+hUZ8mcJDxnhCvFhYIDeQXrt8LY=
=m1ni
-END PGP SIGNATURE-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] Adding closed caption decoder

2014-12-04 Thread Anshul Maheshwari
On Thu, Dec 4, 2014 at 5:43 PM, Nicolas George geo...@nsup.org wrote:

 Le quartidi 14 frimaire, an CCXXIII, Anshul a écrit :
  Yes while doing that only I realized,  if we use i then cc must be in
  first stream.
  When I had multiple stream(with audio), then I was not able to map subcc
  to my video stream.
  using stream_idx , we are saying that if we can use  out0+subcc and
  out1+subcc.
  i logic fails when there is audio in 1st stream, there was no way i
  could get the subtitle
  if my first stream is not the one where closed caption are present.

 I tested various combinations, and I find it works with my i version and
 not with your stream_idx version. You can try this:

 http://samples.ffmpeg.org/MPEG2/subcc/ClosedCaptions/Starship_Troopers.vob
 http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket1482/NCIS.wtv

 st=~/tmp/samples/Starship_Troopers_with_subcc.vob
 ncis=~/tmp/samples/NCIS_with_subcc_stream.wtv

 input=movie=${st}:s=0+1[out0+subcc][out1];movie=${ncis}:s=2+0[out2+subcc][out3]
 function prefix { sed s/^/$1 : / }

 ./ffmpeg_g -loglevel error -f lavfi -i $input -y \
   -map 0:s:0 -f srt (prefix 1_) \
   -map 0:s:1 -f srt (prefix _2)

 (the captions in ALL CAPS are from ST, the other ones from NCIS)

 The mapping logic is this:

 - ${st}:s=0+1[out0+subcc][out1]: take stream #0 (video) and #1 (audio)
   from ${st} and make them stream #0 and #1 for the device.

 - ${ncis}:s=2+0[out2+subcc][out3]: take stream #2 (video) and #0 (audio)
   from ${ncis} and make them stream #2 and #3 for the device.

 - out0+subcc: output stream #0 (video from $st) has CC, make it the first
   extra stream, i.e. #4 for the device.

 - out2+subcc: output stream #2 (video from $ncis) has CC, make it the
 next
   extra stream, i.e. #5 for the device.

 - -map 0:s:0: take the first subtitle stream, i.e. #4, i.e. CC for #2,
   i.e. CC for video from $st.

 - -map 0:s:1: take the second subtitle stream, i.e. #5.

 In other words:

   lavfi:4 = CC for lavfi:0 = CC for st:0
   lavfi:5 = CC for lavfi:2 = CC for ncis:2

 CC streams are created in output stream index order, or, in other words, in
 order of their X index in outX+subcc.

 Regards,

 --
   Nicolas George

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

 Yes your logic is working fine when you know where is video stream and
where is audio stream.
while with stream_idx, even if I you dont know where is video and audio it
works.
but seeing so may of your use case, I feel you are right,

I think there should be some more way of specifying 0+1, we should also
able to specify 0v+0a
means 1st video and 1st audio in stream.
other wise there are lots of chances of wrong mapping. In my particular use
case I take input from rtp.
and the guys does not have any standard for 1st will be video or audio.

As you said before as per stephan's comment you are making stricter
parsing, please consider something like 0v + 0a.

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


Re: [FFmpeg-devel] [PATCH] avfilter/tinterlace: merge code with interlace

2014-12-04 Thread Clément Bœsch
On Thu, Dec 04, 2014 at 12:41:47PM +, tim nicholson wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 On 04/12/14 09:59, Clément Bœsch wrote:
  On Thu, Dec 04, 2014 at 09:31:47AM +, tim nicholson wrote:
  On 02/12/14 18:43, Clément Bœsch wrote:
  ---
  After this commit, interlace doesn't behave the same if the input frames
  are already interlaced. Does anyone wants me to keep this behaviour?
 
  Also, the PTS adjustments might be different, but I didn't follow the
  current discussions about it so I can't tell what people want.
  ---
   libavfilter/Makefile|   2 +-
   libavfilter/interlace.h |  58 -
   libavfilter/tinterlace.h|   5 +-
   libavfilter/vf_interlace.c  | 250 
  
   libavfilter/vf_tinterlace.c |  44 +++
   libavfilter/x86/Makefile|   2 +-
   libavfilter/x86/vf_interlace_init.c |  47 ---
   7 files changed, 49 insertions(+), 359 deletions(-)
   delete mode 100644 libavfilter/interlace.h
   delete mode 100644 libavfilter/vf_interlace.c
   delete mode 100644 libavfilter/x86/vf_interlace_init.c
 
  [..]
 
  The docs will need updating to remove the vf_interlace entry and add the
  lp filter options. Maybe that is the time to merge the ascii art
  graphics and add Michael's additional mode ones as well?
 
  
  None of the filter disappear and their options don't change. It's just
  code refactoring.
 
 Sorry misread it only looking at the diff. I thought there was a
 funtionality merger as well as per the irc discussion.
 

There are 2 functional changes, which is why I haven't pushed yet:
 - the do nothing with already interlaced frame behaviour from
   vf_interlace is not kept
 - the PTS adjustments might not be the same so I might need to set the
   exact_tb flag internally if it's vf_interlace to copy the behaviour
   (but I need confirmation from the people who are using this filter)

[...]

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH 2/2] Adding closed caption decoder

2014-12-04 Thread Nicolas George
Le quartidi 14 frimaire, an CCXXIII, Anshul Maheshwari a écrit :
 while with stream_idx, even if I you dont know where is video and audio it
 works.

I do not think so, I suspect it only worked by chance. You may as well end
up trying to extract subcc from audio, or in a completely random order.

 I think there should be some more way of specifying 0+1, we should also
 able to specify 0v+0a

In the s= option you mean? This is the realm of the movie filter, this is
completely unrelated, and it is already possible as 0:v; unfortunately,
due to the comma character, it falls into escaping hell.

(Have to go for now.)

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] Fix bug for POWER LE: libavcodec/ppc/vp8dsp_altivec.c

2014-12-04 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 06:48:18PM +0800, rongyan wrote:
 Hi,
 We propose this patch to fix vp8 bugs for POWER8 little endian. Functions 
 put_vp8_epel_h_altivec_core(), puta_vp8_epel_v_altivec_core(), and 
 put_vp8_pixels16_altivec() are fixed.
 The passed test cases change from  2296/2328 to 2328/2328.
  
 
  
 Thanks for your review.
 
  Rong Yan
   
   --
   The world has enough for everyone's need, but not enough for everyone's 
 greed.


  vp8dsp_altivec.c |   86 
 +++
  1 file changed, 49 insertions(+), 37 deletions(-)
 ad171a45e64517a1bfc0fda49ae14d778003c248  
 0001-avcodec-ppc-vp8dsp_altivec.c-POWER-LE-support-put_vp.patch
 From b1b4001cfed4d42f9fafb2364a3f935cc9a5b340 Mon Sep 17 00:00:00 2001
 From: Rong Yan rongyan...@gmail.com
 Date: Thu, 4 Dec 2014 10:34:02 +
 Subject: [PATCH] avcodec/ppc/vp8dsp_altivec.c: POWER LE support
  put_vp8_epel_h_altivec_core() put_vp8_epel_v_altivec_core()
  put_vp8_pixels16_altivec() add marcos GET_PIXHL() GET_OUTER() LOAD_HL()

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


[FFmpeg-devel] revised patches for dv profile

2014-12-04 Thread Steve Jiekak

- fixed defect with invalid framerate
- included libavformat\dvenc.c in second patch

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


[FFmpeg-devel] [PATCH 1/2] add av_dv_codec_profile2 : uses framerate to select best matching profile. default on first matching profile

2014-12-04 Thread Steve Jiekak
Signed-off-by: Steve Jiekak devaure...@gmail.com
---
 doc/APIchanges  |3 +++
 libavcodec/dv_profile.c |   24 ++--
 libavcodec/dv_profile.h |6 ++
 libavcodec/version.h|2 +-
 4 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 66b1278..df87465 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2014-08-09
 
 API changes, most recent first:
 
+2014-12-04 - xxx - lavc 56.14.100 - dv_profile.h
+  Add av_dv_codec_profile2().
+
  8 - FFmpeg 2.5 was cut here  8 -
 
 2014-11-21 - ab922f9 - lavu 54.15.100 - dict.h
diff --git a/libavcodec/dv_profile.c b/libavcodec/dv_profile.c
index b301cbf..e336e08 100644
--- a/libavcodec/dv_profile.c
+++ b/libavcodec/dv_profile.c
@@ -315,15 +315,35 @@ const AVDVProfile *av_dv_codec_profile(int width, int 
height,
enum AVPixelFormat pix_fmt)
 {
 #if CONFIG_DVPROFILE
+return av_dv_codec_profile2(width, height, pix_fmt, (AVRational){0, 0});
+#endif
+
+return NULL;
+}
+
+const AVDVProfile *av_dv_codec_profile2(int width, int height,
+   enum AVPixelFormat pix_fmt,
+   AVRational frame_rate)
+{
+const AVDVProfile *p = NULL;
+#if CONFIG_DVPROFILE
 int i;
+/* frame rate is necessary to select between 720p50 and 720p60 profiles */
+int invalid_framerate = frame_rate.num == 0 || frame_rate.den == 0;
 
 for (i = 0; i  FF_ARRAY_ELEMS(dv_profiles); i++)
 if (height  == dv_profiles[i].height  
 pix_fmt == dv_profiles[i].pix_fmt 
 width   == dv_profiles[i].width)
-return dv_profiles[i];
+{
+if( invalid_framerate || av_div_q(dv_profiles[i].time_base, 
frame_rate).num == 1 )
+return dv_profiles[i];
+
+if(!p)
+p = dv_profiles[i];
+}
 #endif
 
-return NULL;
+return p;
 }
 
diff --git a/libavcodec/dv_profile.h b/libavcodec/dv_profile.h
index d4437c9..d22ad26 100644
--- a/libavcodec/dv_profile.h
+++ b/libavcodec/dv_profile.h
@@ -83,4 +83,10 @@ const AVDVProfile *av_dv_frame_profile(const AVDVProfile 
*sys,
  */
 const AVDVProfile *av_dv_codec_profile(int width, int height, enum 
AVPixelFormat pix_fmt);
 
+/**
+ * Get a DV profile for the provided stream parameters.
+ * The frame rate is used as a best-effort parameter.
+ */
+const AVDVProfile *av_dv_codec_profile2(int width, int height, enum 
AVPixelFormat pix_fmt, AVRational frame_rate);
+
 #endif /* AVCODEC_DV_PROFILE_H */
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 23443ed..ef439d6 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 #include libavutil/version.h
 
 #define LIBAVCODEC_VERSION_MAJOR 56
-#define LIBAVCODEC_VERSION_MINOR  13
+#define LIBAVCODEC_VERSION_MINOR  14
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-- 
1.7.0.4

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


Re: [FFmpeg-devel] [PATCH] doc/filters: Add ascii graphics to clarify what the currently implemented tinterlace modes do

2014-12-04 Thread Clément Bœsch
On Thu, Dec 04, 2014 at 04:03:00PM +, tim nicholson wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 On 04/12/14 08:24, tim nicholson wrote:
  On 02/12/14 17:13, Michael Niedermayer wrote:
  On Tue, Dec 02, 2014 at 05:02:49PM +, tim nicholson wrote:
  On 02/12/14 15:33, Michael Niedermayer wrote:
  Signed-off-by: Michael Niedermayer michae...@gmx.at
  ---
   doc/filters.texi |  131 
  ++
   1 file changed, 131 insertions(+)
 
  diff --git a/doc/filters.texi b/doc/filters.texi
  index 8c16c7a..0ea3955 100644
  --- a/doc/filters.texi
  +++ b/doc/filters.texi
  @@ -8537,33 +8537,164 @@ Available values are:
   @item merge, 0
   Move odd frames into the upper field, even into the lower field,
   generating a double height frame at half frame rate.
  +@example
  + -- time
  +Input:
  +Frame 1 Frame 2 Frame 3 Frame 4
  +
  +1   2   3   4
  +1   2   3   4
  +1   2   3   4
  +1   2   3   4
  +
  +Output:
  +1   3
  +2   4
  +1   3
  +2   4
  +1   3
  +2   4
  +1   3
  +2   4
  [..]
 
  I find the ascii graphic style of the interlace filter more
  understandable
  
  how do you suggest above (and the other modes) would be documented
  in that style ?
  
  
  Sorry for the delayed reply ISP issue...
  
  I think the main difference is going left to right, not top to bottom
  for input to output, this then matches not only interlace but the
  general filtergraph descriptions.
  
  I will try and see if I can give an example if you like.
  
 
 Attached, follows style of existing interlace filter ascii art.
 
  
  [...]
 
 - -- 
 Tim.
 Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2
 
 iQEcBAEBAgAGBQJUgIWzAAoJEAwL/ESLC/yDGVMIAL/B/xLvAMPYUUW63RHxTiCP
 XQpKYKtfsFR6+QaC+pql1WSl8mYvlFRJUYLOm6ESd9JS72gLv6UTs1rLdITKaRdo
 SkSVLBWiVAdY8nzjNESjxWnolelM1JzcEopnfqT1hcxeGnyAx+IMHBd3pW0+r/6U
 F1BSnTM3yCELBvS/t7d4ZlpZkw4IDO2Lx0qseKi6CvQA/8ehfP9TcRbfdVgotcTf
 4zorBilGKhZgaqpftxz8Kxbcldv/xrCczBOWVbB3sZRp4A6zLI9Xuc1c2hIyOia9
 EbvHOPmyEBBKdoa31aK8pjFf8gqXF4pM+ZbeaYfR00/WRJC2PbB+tKBQIXXNX4M=
 =cLiK
 -END PGP SIGNATURE-

 From 365723f7bae6bd5e233f6c5550826cd9aeb956f2 Mon Sep 17 00:00:00 2001
 From: Tim Nicholson tim.nichol...@bbc.co.uk
 Date: Thu, 4 Dec 2014 15:55:59 +
 Subject: [PATCH] doc/filters: Add ascii graphics to clarify what the currently
  implemented tinterlace modes do
 
 Signed-off-by: Tim Nicholson tim.nichol...@bbc.co.uk
 ---
  doc/filters.texi | 151 
 +++
  1 file changed, 151 insertions(+)
 
 diff --git a/doc/filters.texi b/doc/filters.texi
 index 8c16c7a..01f1f63 100644
 --- a/doc/filters.texi
 +++ b/doc/filters.texi
 @@ -8537,26 +8537,116 @@ Available values are:
  @item merge, 0
  Move odd frames into the upper field, even into the lower field,
  generating a double height frame at half frame rate.
 +@example
 +   OriginalOriginal New Frame
 +   Frame 'j'  Frame 'j+1'
 +  ==  ===   ==
 +Line 0     Frame 'j'   Line 0
 +Line 0     Frame 'j+1' Line 1
 +Line 1 -   Frame 'j'   Line 2
 +Line 1     Frame 'j+1' Line 3
 +Line 2     Frame 'j'   Line 4
 +Line 2     Frame 'j+1' Line 5
 +Line 3 -   Frame 'j'   Line 6
 +Line 3     Frame 'j+1' Line 7
 +@end example
  
  @item drop_odd, 1
  Only output even frames, odd frames are dropped, generating a frame with
  unchanged height at half frame rate.
 +@example
 +   OriginalOriginal New Frame
 +   Frame 'j'  Frame 'j+1'
 +  ==  ===   ==
 +Line 0
 +Line 0     Frame 'j+1' Line 0
 +Line 1
 +Line 1     Frame 'j+1' Line 1
 +Line 2
 +Line 2     Frame 'j+1' Line 2
 +Line 3
 +Line 3     Frame 'j+1' Line 3
 +@end example
  
  @item drop_even, 2
  Only output odd frames, even frames are dropped, generating a frame with
  unchanged height at half frame rate.
 +@example
 +   OriginalOriginal New Frame
 +   Frame 'j'  Frame 'j+1'
 +  ==  ===   ==
 +Line 0     Frame 'j'   Line 0
 +Line 0
 +Line 1 -   Frame 

Re: [FFmpeg-devel] [PATCH 4/4] avcodec/pngdec: use memcpy instead of byte loops for P frames.

2014-12-04 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 03:28:32PM +0100, Benoit Fouet wrote:
 Hi,
 
 Le 03/12/2014 14:31, Benoit Fouet a écrit :
 Rely on the way memcpy is optimized for one's system instead of looping
 on a byte buffer for buffer copies to handle P frames.
 ---
   libavcodec/pngdec.c | 25 +
   1 file changed, 13 insertions(+), 12 deletions(-)
 
 diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
 index 7e7b285..e6b7593 100644
 --- a/libavcodec/pngdec.c
 +++ b/libavcodec/pngdec.c
 @@ -884,8 +884,7 @@ static int handle_p_frame_apng(AVCodecContext *avctx, 
 PNGDecContext *s,
   ff_thread_await_progress(s-previous_picture, INT_MAX, 0);
   for (j = 0; j  s-y_offset; j++) {
 -for (i = 0; i  ls; i++)
 -pd[i] = pd_last[i];
 +memcpy(pd, pd_last, ls);
   pd  += s-image_linesize;
   pd_last += s-image_linesize;
   }
 @@ -907,8 +906,9 @@ static int handle_p_frame_apng(AVCodecContext *avctx, 
 PNGDecContext *s,
   }
   for (j = s-y_offset; j  s-y_offset + s-cur_h; j++) {
 -for (i = 0; i  s-x_offset * s-bpp; i++)
 -pd[i] = pd_last[i];
 +i = s-x_offset * s-bpp;
 +if (i)
 +memcpy(pd, pd_last, i);
   for (; i  (s-x_offset + s-cur_w) * s-bpp; i += s-bpp) {
   uint8_t alpha = pd[i+ai];
 @@ -930,26 +930,27 @@ static int handle_p_frame_apng(AVCodecContext *avctx, 
 PNGDecContext *s,
   break;
   }
   }
 -for (; i  ls; i++)
 -pd[i] = pd_last[i];
 +if (ls - i)
 +memcpy(pd+i, pd_last+i, ls - i);
   pd  += s-image_linesize;
   pd_last += s-image_linesize;
   pd_last_region += s-image_linesize;
   }
   } else {
   for (j = s-y_offset; j  s-y_offset + s-cur_h; j++) {
 -for (i = 0; i  s-x_offset * s-bpp; i++)
 -pd[i] = pd_last[i];
 -for (i = (s-x_offset + s-cur_w) * s-bpp; i  ls; i++)
 -pd[i] = pd_last[i];
 +int end_offset = (s-x_offset + s-cur_w) * s-bpp;
 +int end_len= ls - end_offset;
 +if (s-x_offset)
 +memcpy(pd, pd_last, s-x_offset * s-bpp);
 +if (end_len)
 +memcpy(pd+end_offset, pd_last+end_offset, end_len);
   pd  += s-image_linesize;
   pd_last += s-image_linesize;
   }
   }
   for (j = s-y_offset + s-cur_h; j  s-height; j++) {
 -for (i = 0; i  ls; i++)
 -pd[i] = pd_last[i];
 +memcpy(pd, pd_last, ls);
   pd  += s-image_linesize;
   pd_last += s-image_linesize;
   }
 
 Unless there is some more remarks on this one, I think it can be
 applied too.

applied

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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


Re: [FFmpeg-devel] [PATCH] Incorrect aspect ratio in MPEG2 essence

2014-12-04 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 01:11:08PM +0100, Erik Johansson wrote:
 Hi,
 
 Setting setting sample_aspect_ratio in AVContext does not produce the
 expected aspect index value in the MPEG2 sequence header.
 
 Problem seems to be around line 263 in mpeg12enc.c. Setting the
 sample_aspect_ratio to 16/9 leads the current error minimization
 routine to determine that
 
 error -= (1LL32)*(221/100)*(1080/1920)
 
 is smaller than
 
 error -= (1LL32)*(16/9)*(1080/1920)
 
 thus picking aspect index value 4 rather than 3.
 
 Proposed fix in attached patch.

how can this bug be reproduced ?

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH] doc/filters: Add ascii graphics to clarify what the currently implemented tinterlace modes do

2014-12-04 Thread tim nicholson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/12/14 16:09, Clément Bœsch wrote:
 [..]
 
 This representation requires way more efforts to me to understand than the
 one from Michael...
 

Just shows how different minds think/work ;)

As the saying goes, one man's meat is another man's poison.

I was going for consistency with current work (which I happened to find
clear) and I liked having the extra detail of line numbers.

 [...]

- -- 
Tim.
Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBAgAGBQJUgJJlAAoJEAwL/ESLC/yDmdQH/1BHNlTjS9omO0g28P7+TAXu
vpGI7kUxJWFH7txUHhRNf33lHbFFmYdKeb/lIfuiPFXvOtUgeTnmARf8RPIN82e4
7LPFIuN9BFuu78GpyjY/ZEQOUhsT8WK/5c/xWzgJDTo87WsqmQcZe1TuJW945U16
mEZnPfCoYnV4OO/Bu68FJjEMHX4MafIB5VKxhK28/6ymbSJl5v8h9uyFzEZ3TZgF
48bSSYNM4T1KwkJPQsDN+0X5YXeAjA+ZTbB1K5qBQAOZYY4Qj2oCSetl09G6XynG
FjeYUxsDCwI97/+x2i+0K6UIBj9Ey/iJRUat1QP4F1FoHQKz5WHpMN5/4XYblU0=
=ulRP
-END PGP SIGNATURE-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] web: Update Bower dependencies

2014-12-04 Thread db0 company
Did you check that the latest versions of the dependencies still make
the website look the same?
I remember having retro-compatibility issues with Bootstrap in the
past, but that was a long time ago, so it's probably OK.

-- 
db0 - Deby Barbara Lepage
  http://db0.fr/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] imc: make issue non-fatal

2014-12-04 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 12:04:50AM +0100, Christophe Gisquet wrote:
 Until a noticeably distorted output or crash is reported, it's better
 ignoring the error, as this results in better output on the affected
 samples. (ticket #3886)
 
 On the other hand, I have a hard time understanding the purpose of
 that check. I would have expected maybe get_bits_count(q-gb) 
 cw_len, but the next parsing step, inverse_quant_coeff, does not even
 check what's left.
 
 -- 
 Christophe

  imc.c |   15 ++-
  1 file changed, 6 insertions(+), 9 deletions(-)
 4334ed60bfabb1f4679940664aeece3d4274a22a  0001-imc-make-issue-non-fatal.patch
 From 90b5642bd53b24f66f1c36c070b4c490dd72a6cf Mon Sep 17 00:00:00 2001
 From: Christophe Gisquet christophe.gisq...@gmail.com
 Date: Wed, 3 Dec 2014 23:52:52 +0100
 Subject: [PATCH] imc: make issue non-fatal
 
 The faulty samples actually sound fine when ignoring this issue.
 
 For ticket #3886, more samples are decoded.

applied

also i see at least one bug in the original code, will fix it

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- 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 2/2] replaced av_dv_codec_profile by av_dv_codec_profile2 in encoder and dv muxers

2014-12-04 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 02:48:15PM +0100, Steve Jiekak wrote:
 Signed-off-by: Steve Jiekak devaure...@gmail.com
 ---
  libavcodec/dvenc.c  |2 +-
  libavformat/dv.c|4 ++--
  libavformat/dvenc.c |3 ++-
  3 files changed, 5 insertions(+), 4 deletions(-)

applied

thx

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

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.


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


Re: [FFmpeg-devel] [PATCH 1/2] add av_dv_codec_profile2 : uses framerate to select best matching profile. default on first matching profile

2014-12-04 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 02:48:14PM +0100, Steve Jiekak wrote:
 Signed-off-by: Steve Jiekak devaure...@gmail.com
 ---
  doc/APIchanges  |3 +++
  libavcodec/dv_profile.c |   24 ++--
  libavcodec/dv_profile.h |6 ++
  libavcodec/version.h|2 +-
  4 files changed, 32 insertions(+), 3 deletions(-)

applied

thanks

[...]
-- 
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] web: Update Bower dependencies

2014-12-04 Thread Timothy Gu
On Thu, Dec 4, 2014 at 4:22 AM, Michael Niedermayer michae...@gmx.at wrote:
 On Wed, Dec 03, 2014 at 08:56:11PM -0800, Timothy Gu wrote:
 On Tue, Nov 25, 2014 at 7:50 PM, Timothy Gu timothyg...@gmail.com wrote:
  Also explicitly add jQuery as a dependency. It is copied from the Makefile.
 
  Signed-off-by: Timothy Gu timothyg...@gmail.com
  ---
   bower.json|   9 +-
   htdocs/css/bootstrap.min.css  |   4 +-
   htdocs/css/font-awesome.min.css   |   4 +-
   htdocs/fonts/FontAwesome.otf  | Bin 75188 - 85908 bytes
   htdocs/fonts/fontawesome-webfont.eot  | Bin 72449 - 56006 bytes
   htdocs/fonts/fontawesome-webfont.svg  | 942 
  +-
   htdocs/fonts/fontawesome-webfont.ttf  | Bin 141564 - 112160 bytes
   htdocs/fonts/fontawesome-webfont.woff | Bin 83760 - 65452 bytes
   htdocs/js/bootstrap.min.js|   5 +-
   9 files changed, 491 insertions(+), 473 deletions(-)

 Ping.

 Applying: web: Update Bower dependencies
 fatal: corrupt patch at line 273

 patching file bower.json
 patching file htdocs/css/bootstrap.min.css

It's probably just your mail client, as I tried applying the mail and
it applies cleanly.

Trying again with MIME attachment.

You can also merge it from https://github.com/TimothyGu/ffmpeg-web.git
branch master.

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


Re: [FFmpeg-devel] [PATCH] web: Update Bower dependencies

2014-12-04 Thread Timothy Gu
On Thu, Dec 4, 2014 at 9:07 AM, db0 company db0comp...@gmail.com wrote:
 Did you check that the latest versions of the dependencies still make
 the website look the same?

I did, and it's OK.

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


Re: [FFmpeg-devel] [PATCH] web: Update Bower dependencies

2014-12-04 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 12:55:05PM -0800, Timothy Gu wrote:
 And with patch

 From 51ff20706034f2d74e32a643727c71f404aeebaa Mon Sep 17 00:00:00 2001
 From: Timothy Gu timothyg...@gmail.com
 Date: Tue, 25 Nov 2014 19:50:06 -0800
 Subject: [PATCH] web: Update Bower dependencies
 
 Also explicitly add jQuery as a dependency. It is copied from the Makefile.

applied

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH] libavformat/mxfdec.c refactor resolving MultiDescriptor and remove essence group hack

2014-12-04 Thread Tomas Härdin
On Tue, 2014-12-02 at 16:43 -0800, Mark Reid wrote:
 I think this is a better way to deal with single frame essence data then my
 previous way.
 
 ---
  libavformat/mxfdec.c | 62 
 
  1 file changed, 38 insertions(+), 24 deletions(-)
 
 diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
 index 0c88a8a..6c104b9 100644
 --- a/libavformat/mxfdec.c
 +++ b/libavformat/mxfdec.c
 @@ -1508,6 +1508,32 @@ static MXFPackage* 
 mxf_resolve_source_package(MXFContext *mxf, UID package_uid)
  return NULL;
  }
  
 +static MXFDescriptor* mxf_resolve_multidescriptor(MXFContext *mxf, 
 MXFDescriptor *descriptor, int track_id)
 +{
 +MXFDescriptor *sub_descriptor = NULL;
 +int i;
 +
 +if (!descriptor)
 +return NULL;
 +
 +if (descriptor-type == MultipleDescriptor) {
 +for (i = 0; i  descriptor-sub_descriptors_count; i++) {
 +sub_descriptor = mxf_resolve_strong_ref(mxf, 
 descriptor-sub_descriptors_refs[i], Descriptor);
 +
 +if (!sub_descriptor) {
 +av_log(mxf-fc, AV_LOG_ERROR, could not resolve sub 
 descriptor strong ref\n);
 +continue;
 +}
 +if (sub_descriptor-linked_track_id == track_id) {
 +return sub_descriptor;
 +}
 +}
 +} else if (descriptor-type == Descriptor)
 +return descriptor;
 +
 +return NULL;
 +}
 +
  static MXFStructuralComponent* mxf_resolve_essence_group_choice(MXFContext 
 *mxf, MXFEssenceGroup *essence_group)
  {
  MXFStructuralComponent *component = NULL;
 @@ -1529,12 +1555,8 @@ static MXFStructuralComponent* 
 mxf_resolve_essence_group_choice(MXFContext *mxf,
  continue;
  
  descriptor = mxf_resolve_strong_ref(mxf, package-descriptor_ref, 
 Descriptor);
 -if (descriptor){
 -/* HACK: force the duration of the component to match the 
 duration of the descriptor */
 -if (descriptor-duration != AV_NOPTS_VALUE)
 -component-duration = descriptor-duration;
 +if (descriptor)
  return component;
 -}
  }
  return NULL;
  }
 @@ -1735,7 +1757,17 @@ static int mxf_parse_structural_metadata(MXFContext 
 *mxf)
  }
  st-id = source_track-track_id;
  st-priv_data = source_track;
 -source_track-original_duration = st-duration = component-duration;
 +
 +source_package-descriptor = mxf_resolve_strong_ref(mxf, 
 source_package-descriptor_ref, AnyType);
 +descriptor = mxf_resolve_multidescriptor(mxf, 
 source_package-descriptor, source_track-track_id);
 +
 +/* A SourceClip from a EssenceGroup may only be a single frame of 
 essence data. The clips duration is then how many
 + * frames its suppose to repeat for. Descriptor-duration, if 
 present, contains the real duration of the essence data */
 +if (descriptor  descriptor-duration != AV_NOPTS_VALUE)
 +source_track-original_duration = st-duration = 
 FFMIN(descriptor-duration, component-duration);
 +else
 +source_track-original_duration = st-duration = 
 component-duration;
 +
  if (st-duration == -1)
  st-duration = AV_NOPTS_VALUE;
  st-start_time = component-start_position;
 @@ -1758,24 +1790,6 @@ static int mxf_parse_structural_metadata(MXFContext 
 *mxf)
  codec_ul = mxf_get_codec_ul(ff_mxf_data_definition_uls, 
 source_track-sequence-data_definition_ul);
  st-codec-codec_type = codec_ul-id;
  
 -source_package-descriptor = mxf_resolve_strong_ref(mxf, 
 source_package-descriptor_ref, AnyType);
 -if (source_package-descriptor) {
 -if (source_package-descriptor-type == MultipleDescriptor) {
 -for (j = 0; j  
 source_package-descriptor-sub_descriptors_count; j++) {
 -MXFDescriptor *sub_descriptor = 
 mxf_resolve_strong_ref(mxf, 
 source_package-descriptor-sub_descriptors_refs[j], Descriptor);
 -
 -if (!sub_descriptor) {
 -av_log(mxf-fc, AV_LOG_ERROR, could not resolve sub 
 descriptor strong ref\n);
 -continue;
 -}
 -if (sub_descriptor-linked_track_id == 
 source_track-track_id) {
 -descriptor = sub_descriptor;
 -break;
 -}
 -}
 -} else if (source_package-descriptor-type == Descriptor)
 -descriptor = source_package-descriptor;
 -}
  if (!descriptor) {
  av_log(mxf-fc, AV_LOG_INFO, source track %d: stream %d, no 
 descriptor found\n, source_track-track_id, st-index);
  continue;


Seems alright..

/Tomas


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

[FFmpeg-devel] parallelization over outputs

2014-12-04 Thread Daniel Oberhoff
Hello,

I was wondering if ffmpeg parallelizes over outputs, i.e. if I have one input, 
but multiple outputs, with different codecs and/or filters, since these outputs 
are independent from each other they could be rendered/encoded in different 
threads (or thread groups), is this the case?

Best

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


Re: [FFmpeg-devel] [PATCH 3/3] lavc/libxvid: workaround for bug in libxvidcore

2014-12-04 Thread Lukasz Marek

On 04.12.2014 12:42, Clément Bœsch wrote:

On Thu, Dec 04, 2014 at 12:39:29AM +0100, Lukasz Marek wrote:

On 24.11.2014 01:17, Lukasz Marek wrote:

libxvidcore calculate number of threads basing on video height.
If height is small enough it allocates 0 bytes long memory and
writes to it.
Setting thread_count to 0 uses 1 thread and skips bugged code.

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
  libavcodec/libxvid.c | 11 +++
  1 file changed, 11 insertions(+)

diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
index 70d52b9..efe7b8a 100644
--- a/libavcodec/libxvid.c
+++ b/libavcodec/libxvid.c
@@ -471,6 +471,17 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
  xvid_enc_create.num_zones = 0;

  xvid_enc_create.num_threads = avctx-thread_count;
+/* workaround for a bug in libxvidcore */
+if (avctx-height  18) {
+if (avctx-thread_count  2) {
+xvid_enc_create.num_threads = 0;
+} else {
+av_log(avctx, AV_LOG_ERROR,
+   Too small height for threads  1.);
+ret = AVERROR(EINVAL);
+goto fail;
+}
+}

  xvid_enc_create.plugins = plugins;
  xvid_enc_create.num_plugins = 0;



Please comment this patch. xvid accepted fix for it.


Can you add a version check, or at least a comment saying what versions
are affected by this?


Added a check. it was introduced in 1.3.0 and still present in 1.3.3. 
Next should be fixed.


From 1bfe00284fdb3dba072147df1efce03c7d29dd35 Mon Sep 17 00:00:00 2001
From: Lukasz Marek lukasz.m.lu...@gmail.com
Date: Mon, 24 Nov 2014 01:12:06 +0100
Subject: [PATCH] lavc/libxvid: workaround for bug in libxvidcore

libxvidcore calculate number of threads basing on video height.
If height is small enough it allocates 0 bytes long memory and
writes to it.
Setting thread_count to 0 uses 1 thread and skips bugged code.

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
 libavcodec/libxvid.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
index 046d2f7..64572da 100644
--- a/libavcodec/libxvid.c
+++ b/libavcodec/libxvid.c
@@ -471,6 +471,19 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
 xvid_enc_create.num_zones = 0;
 
 xvid_enc_create.num_threads = avctx-thread_count;
+#if (XVID_VERSION = 0x010303)  (XVID_VERSION = 0x010300)
+/* workaround for a bug in libxvidcore */
+if (avctx-height = 16) {
+if (avctx-thread_count  2) {
+xvid_enc_create.num_threads = 0;
+} else {
+av_log(avctx, AV_LOG_ERROR,
+   Too small height for threads  1.);
+ret = AVERROR(EINVAL);
+goto fail;
+}
+}
+#endif
 
 xvid_enc_create.plugins = plugins;
 xvid_enc_create.num_plugins = 0;
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH] libavformat/mxfdec.c refactor resolving MultiDescriptor and remove essence group hack

2014-12-04 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 11:11:48PM +0100, Tomas Härdin wrote:
 On Tue, 2014-12-02 at 16:43 -0800, Mark Reid wrote:
  I think this is a better way to deal with single frame essence data then my
  previous way.
  
  ---
   libavformat/mxfdec.c | 62 
  
   1 file changed, 38 insertions(+), 24 deletions(-)
  
  diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
  index 0c88a8a..6c104b9 100644
  --- a/libavformat/mxfdec.c
  +++ b/libavformat/mxfdec.c
  @@ -1508,6 +1508,32 @@ static MXFPackage* 
  mxf_resolve_source_package(MXFContext *mxf, UID package_uid)
   return NULL;
   }
   
  +static MXFDescriptor* mxf_resolve_multidescriptor(MXFContext *mxf, 
  MXFDescriptor *descriptor, int track_id)
  +{
  +MXFDescriptor *sub_descriptor = NULL;
  +int i;
  +
  +if (!descriptor)
  +return NULL;
  +
  +if (descriptor-type == MultipleDescriptor) {
  +for (i = 0; i  descriptor-sub_descriptors_count; i++) {
  +sub_descriptor = mxf_resolve_strong_ref(mxf, 
  descriptor-sub_descriptors_refs[i], Descriptor);
  +
  +if (!sub_descriptor) {
  +av_log(mxf-fc, AV_LOG_ERROR, could not resolve sub 
  descriptor strong ref\n);
  +continue;
  +}
  +if (sub_descriptor-linked_track_id == track_id) {
  +return sub_descriptor;
  +}
  +}
  +} else if (descriptor-type == Descriptor)
  +return descriptor;
  +
  +return NULL;
  +}
  +
   static MXFStructuralComponent* mxf_resolve_essence_group_choice(MXFContext 
  *mxf, MXFEssenceGroup *essence_group)
   {
   MXFStructuralComponent *component = NULL;
  @@ -1529,12 +1555,8 @@ static MXFStructuralComponent* 
  mxf_resolve_essence_group_choice(MXFContext *mxf,
   continue;
   
   descriptor = mxf_resolve_strong_ref(mxf, package-descriptor_ref, 
  Descriptor);
  -if (descriptor){
  -/* HACK: force the duration of the component to match the 
  duration of the descriptor */
  -if (descriptor-duration != AV_NOPTS_VALUE)
  -component-duration = descriptor-duration;
  +if (descriptor)
   return component;
  -}
   }
   return NULL;
   }
  @@ -1735,7 +1757,17 @@ static int mxf_parse_structural_metadata(MXFContext 
  *mxf)
   }
   st-id = source_track-track_id;
   st-priv_data = source_track;
  -source_track-original_duration = st-duration = 
  component-duration;
  +
  +source_package-descriptor = mxf_resolve_strong_ref(mxf, 
  source_package-descriptor_ref, AnyType);
  +descriptor = mxf_resolve_multidescriptor(mxf, 
  source_package-descriptor, source_track-track_id);
  +
  +/* A SourceClip from a EssenceGroup may only be a single frame of 
  essence data. The clips duration is then how many
  + * frames its suppose to repeat for. Descriptor-duration, if 
  present, contains the real duration of the essence data */
  +if (descriptor  descriptor-duration != AV_NOPTS_VALUE)
  +source_track-original_duration = st-duration = 
  FFMIN(descriptor-duration, component-duration);
  +else
  +source_track-original_duration = st-duration = 
  component-duration;
  +
   if (st-duration == -1)
   st-duration = AV_NOPTS_VALUE;
   st-start_time = component-start_position;
  @@ -1758,24 +1790,6 @@ static int mxf_parse_structural_metadata(MXFContext 
  *mxf)
   codec_ul = mxf_get_codec_ul(ff_mxf_data_definition_uls, 
  source_track-sequence-data_definition_ul);
   st-codec-codec_type = codec_ul-id;
   
  -source_package-descriptor = mxf_resolve_strong_ref(mxf, 
  source_package-descriptor_ref, AnyType);
  -if (source_package-descriptor) {
  -if (source_package-descriptor-type == MultipleDescriptor) {
  -for (j = 0; j  
  source_package-descriptor-sub_descriptors_count; j++) {
  -MXFDescriptor *sub_descriptor = 
  mxf_resolve_strong_ref(mxf, 
  source_package-descriptor-sub_descriptors_refs[j], Descriptor);
  -
  -if (!sub_descriptor) {
  -av_log(mxf-fc, AV_LOG_ERROR, could not resolve 
  sub descriptor strong ref\n);
  -continue;
  -}
  -if (sub_descriptor-linked_track_id == 
  source_track-track_id) {
  -descriptor = sub_descriptor;
  -break;
  -}
  -}
  -} else if (source_package-descriptor-type == Descriptor)
  -descriptor = source_package-descriptor;
  -}
   if (!descriptor) {
   av_log(mxf-fc, AV_LOG_INFO, source track %d: stream %d, no 
  descriptor found\n, source_track-track_id, st-index);
   continue;
 
 
 Seems 

Re: [FFmpeg-devel] [PATCH 2/2] lavc/options: fix leaks in avcodec_copy_context

2014-12-04 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 12:54:30AM +0100, Lukasz Marek wrote:
 On 27.11.2014 04:17, Michael Niedermayer wrote:
 On Thu, Nov 27, 2014 at 12:43:57AM +0100, Lukasz Marek wrote:
 On 24.11.2014 05:16, Lukasz Marek wrote:
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
   libavcodec/options.c | 23 +++
   1 file changed, 11 insertions(+), 12 deletions(-)
 
 diff --git a/libavcodec/options.c b/libavcodec/options.c
 index 7f9fb07..8ba997c 100644
 --- a/libavcodec/options.c
 +++ b/libavcodec/options.c
 @@ -190,6 +190,11 @@ int avcodec_copy_context(AVCodecContext *dest, const 
 AVCodecContext *src)
   }
 
   av_opt_free(dest);
 +av_freep(dest-rc_override);
 +av_freep(dest-intra_matrix);
 +av_freep(dest-inter_matrix);
 +av_freep(dest-extradata);
 +av_freep(dest-subtitle_header);
 
   memcpy(dest, src, sizeof(*dest));
   av_opt_copy(dest, src);
 @@ -205,13 +210,7 @@ int avcodec_copy_context(AVCodecContext *dest, const 
 AVCodecContext *src)
   dest-slice_offset= NULL;
   dest-hwaccel = NULL;
   dest-internal= NULL;
 -
 -/* reallocate values that should be allocated separately */
 -dest-extradata   = NULL;
 -dest-intra_matrix= NULL;
 -dest-inter_matrix= NULL;
 -dest-rc_override = NULL;
 -dest-subtitle_header = NULL;
 
 
 This should stay. Updated version attched
 
 
   options.c |   16 +++-
   1 file changed, 11 insertions(+), 5 deletions(-)
 971d1769e50d2e853d7359003f8c924092a96e6b  
 0001-lavc-options-fix-leaks-in-avcodec_copy_context.patch
  From 722d7e837093212d6e6e6b17814ed408300d25a6 Mon Sep 17 00:00:00 2001
 From: Lukasz Marek lukasz.m.lu...@gmail.com
 Date: Thu, 27 Nov 2014 00:41:16 +0100
 Subject: [PATCH] lavc/options: fix leaks in avcodec_copy_context
 
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
   libavcodec/options.c | 16 +++-
   1 file changed, 11 insertions(+), 5 deletions(-)
 
 breaks make fate-lavf-yuv4mpeg
 
 --- ./tests/ref/lavf/yuv4mpeg   2014-11-26 20:04:48.466295490 +0100
 +++ tests/data/fate/lavf-yuv4mpeg   2014-11-27 04:16:07.234916526 +0100
 @@ -1,2 +0,0 @@
 -ec8178cb152f9cdbfd9cb724d977db2e *./tests/data/lavf/lavf.y4m
 -3801808 ./tests/data/lavf/lavf.y4m
 Test lavf-yuv4mpeg failed. Look at tests/data/fate/lavf-yuv4mpeg.err for 
 details.
 make: *** [fate-lavf-yuv4mpeg] Error 139
 
 I will rerun whole fate, but I assume I can push it if nothing fails?
 The one mentioned above is OK.

ok

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

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data


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


[FFmpeg-devel] [PATCH 1/3] avformat/hlsenc: added segment filename template

2014-12-04 Thread Christian Suloway
Signed-off-by: Christian Suloway csulo...@globaleagleent.com
---
 libavformat/hlsenc.c | 87 +---
 1 file changed, 69 insertions(+), 18 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index e13f438..0a48919 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -33,7 +33,7 @@
 #include internal.h
 
 typedef struct HLSSegment {
-char filename[1024];
+char *filename;
 double duration; /* in seconds */
 int64_t pos;
 int64_t size;
@@ -73,14 +73,23 @@ typedef struct HLSContext {
 HLSSegment *segments;
 HLSSegment *last_segment;
 
+char *dirname;
 char *basename;
 char *baseurl;
 char *format_options_str;
 AVDictionary *format_options;
 
+char *segment_filename;
+
 AVIOContext *pb;
 } HLSContext;
 
+static void hls_free_segment(HLSSegment *en)
+{
+av_freep(en-filename);
+av_freep(en);
+}
+
 static int hls_mux_init(AVFormatContext *s)
 {
 HLSContext *hls = s-priv_data;
@@ -119,7 +128,9 @@ static int hls_append_segment(HLSContext *hls, double 
duration, int64_t pos,
 if (!en)
 return AVERROR(ENOMEM);
 
-av_strlcpy(en-filename, av_basename(hls-avf-filename), 
sizeof(en-filename));
+en-filename = av_strdup(hls-avf-filename);
+if (!en-filename)
+return AVERROR(ENOMEM);
 
 en-duration = duration;
 en-pos  = pos;
@@ -136,7 +147,7 @@ static int hls_append_segment(HLSContext *hls, double 
duration, int64_t pos,
 if (hls-max_nb_segments  hls-nb_entries = hls-max_nb_segments) {
 en = hls-segments;
 hls-segments = en-next;
-av_free(en);
+hls_free_segment(en);
 } else
 hls-nb_entries++;
 
@@ -152,7 +163,7 @@ static void hls_free_segments(HLSContext *hls)
 while(p) {
 en = p;
 p = p-next;
-av_free(en);
+hls_free_segment(en);
 }
 }
 
@@ -186,6 +197,7 @@ static int hls_window(AVFormatContext *s, int last)
sequence);
 
 for (en = hls-segments; en; en = en-next) {
+
 avio_printf(hls-pb, #EXTINF:%f,\n, en-duration);
 if (hls-flags  HLS_SINGLE_FILE)
  avio_printf(hls-pb, #EXT-X-BYTERANGE:%PRIi64@%PRIi64\n,
@@ -208,6 +220,8 @@ static int hls_start(AVFormatContext *s)
 HLSContext *c = s-priv_data;
 AVFormatContext *oc = c-avf;
 int err = 0;
+int filename_size;
+char *filename;
 
 if (c-flags  HLS_SINGLE_FILE)
 av_strlcpy(oc-filename, c-basename,
@@ -220,8 +234,18 @@ static int hls_start(AVFormatContext *s)
 }
 c-number++;
 
-if ((err = avio_open2(oc-pb, oc-filename, AVIO_FLAG_WRITE,
-  s-interrupt_callback, NULL))  0)
+filename_size = strlen(c-dirname) + strlen(oc-filename) + 1;
+filename = av_malloc(filename_size);
+if (!filename)
+return AVERROR(ENOMEM);
+*filename = '\0';
+av_strlcat(filename, c-dirname, filename_size);
+av_strlcat(filename, oc-filename, filename_size);
+
+err = avio_open2(oc-pb, filename, AVIO_FLAG_WRITE,
+ s-interrupt_callback, NULL);
+av_free(filename);
+if (err  0)
 return err;
 
 if (oc-oformat-priv_class  oc-priv_data)
@@ -237,15 +261,13 @@ static int hls_write_header(AVFormatContext *s)
 char *p;
 const char *pattern = %d.ts;
 AVDictionary *options = NULL;
-int basename_size = strlen(s-filename) + strlen(pattern) + 1;
+int basename_size;
+char *basename;
 
 hls-sequence   = hls-start_sequence;
 hls-recording_time = hls-time * AV_TIME_BASE;
 hls-start_pts  = AV_NOPTS_VALUE;
 
-if (hls-flags  HLS_SINGLE_FILE)
-pattern = .ts;
-
 if (hls-format_options_str) {
 ret = av_dict_parse_string(hls-format_options, 
hls-format_options_str, =, :, 0);
 if (ret  0) {
@@ -270,21 +292,45 @@ static int hls_write_header(AVFormatContext *s)
 goto fail;
 }
 
-hls-basename = av_malloc(basename_size);
-
-if (!hls-basename) {
+hls-dirname = av_strdup(s-filename);
+if (!hls-dirname) {
 ret = AVERROR(ENOMEM);
 goto fail;
 }
 
-strcpy(hls-basename, s-filename);
+basename = (char *)av_basename(hls-dirname);
 
-p = strrchr(hls-basename, '.');
+if (hls-segment_filename) {
+hls-basename = av_strdup(av_basename(hls-segment_filename));
+if (!hls-basename) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
+if (strlen(hls-basename) != strlen(hls-segment_filename)) {
+av_log(hls, AV_LOG_ERROR, invalid segment filename %s\n,
+  hls-segment_filename);
+ret = AVERROR(EINVAL);
+goto fail;
+}
+} else {
+if (hls-flags  HLS_SINGLE_FILE)
+pattern = .ts;
 
-if (p)
-*p = '\0';
+basename_size = strlen(basename) + strlen(pattern) + 1;
+hls-basename = av_malloc(basename_size);
+  

[FFmpeg-devel] [PATCH 3/3] avformat/hlsenc: added HLS encryption

2014-12-04 Thread Christian Suloway
HLS encryption with key URL  key containing file specified with
-hls_key_info_file (key info updates when modified). Option for IV from
segment number or random generation (-hls_random_iv).

Signed-off-by: Christian Suloway csulo...@globaleagleent.com
---
 libavformat/hlsenc.c | 225 +--
 1 file changed, 218 insertions(+), 7 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 11817a9..c7bd1be 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -33,16 +33,23 @@
 #include libavutil/avstring.h
 #include libavutil/opt.h
 #include libavutil/log.h
+#include libavutil/lfg.h
+#include libavutil/random_seed.h
 
 #include avformat.h
 #include internal.h
 
+#define BLOCKSIZE 16
+
 typedef struct HLSSegment {
 char *filename;
 double duration; /* in seconds */
 int64_t pos;
 int64_t size;
 
+char *key_uri;
+char *iv_string;
+
 struct HLSSegment *next;
 } HLSSegment;
 
@@ -88,12 +95,25 @@ typedef struct HLSContext {
 
 char *segment_filename;
 
+char *key_info_file;
+int random_iv;
+int encrypt;
+
+char *key_file;
+char *key_uri;
+char *key_string;
+char *iv_string;
+
+AVLFG *lfg;
+
 AVIOContext *pb;
 } HLSContext;
 
 static void hls_free_segment(HLSSegment *en)
 {
 av_freep(en-filename);
+av_freep(en-key_uri);
+av_freep(en-iv_string);
 av_freep(en);
 }
 
@@ -143,6 +163,137 @@ static int hls_delete_old_segments(HLSContext *hls) {
 return 0;
 }
 
+static int hls_encryption_init(AVFormatContext *s)
+{
+HLSContext *hls = s-priv_data;
+
+hls-key_file = NULL;
+hls-key_uri = NULL;
+hls-key_string = NULL;
+hls-iv_string = NULL;
+
+if (hls-key_info_file) {
+hls-encrypt = 1;
+} else {
+hls-encrypt = 0;
+return 0;
+}
+
+if (hls-random_iv) {
+hls-lfg = av_malloc(sizeof(AVLFG));
+av_lfg_init(hls-lfg, av_get_random_seed());
+} else
+hls-lfg = NULL;
+
+return 0;
+}
+
+static int hls_encryption_start(HLSContext *hls) {
+
+uint8_t *iv = NULL;
+int ret, i, j, rotate_iv = 0;
+unsigned int u;
+AVIOContext *pb = NULL;
+AVIOContext *dyn_buf = NULL;
+uint8_t buf[1024], *tmp;
+char *p, *tstr, *saveptr = NULL;
+char key[BLOCKSIZE], *key_string;
+
+if ((ret = avio_open(pb, hls-key_info_file, AVIO_FLAG_READ))  0) {
+av_log(hls, AV_LOG_ERROR, error opening key info file %s\n,
+  hls-key_info_file);
+return ret;
+}
+ret = avio_open_dyn_buf(dyn_buf);
+if (ret  0) {
+avio_closep(pb);
+return ret;
+}
+
+while ((ret = avio_read(pb, buf, sizeof(buf)))  0)
+avio_write(dyn_buf, buf, ret);
+avio_w8(dyn_buf, 0);
+avio_closep(pb);
+
+if ((ret = avio_close_dyn_buf(dyn_buf, tmp))  0)
+return ret;
+
+p = tmp;
+if (!(tstr = av_strtok(p, \n, saveptr)) || !*tstr) {
+av_log(hls, AV_LOG_ERROR, no key URL specified in key info file %s\n,
+  hls-key_info_file);
+return AVERROR(EINVAL);
+}
+p = NULL;
+av_free(hls-key_uri);
+hls-key_uri = av_strdup(tstr);
+if (!hls-key_uri)
+return AVERROR(ENOMEM);
+if (!(tstr = av_strtok(p, \n, saveptr)) || !*tstr) {
+av_log(hls, AV_LOG_ERROR, no key file specified in key info file 
%s\n,
+  hls-key_info_file);
+return AVERROR(EINVAL);
+}
+av_free(hls-key_file);
+hls-key_file = av_strdup(tstr);
+if (!hls-key_file)
+return AVERROR(ENOMEM);
+av_free(tmp);
+
+if ((ret = avio_open(pb, hls-key_file, AVIO_FLAG_READ))  0) {
+av_log(hls, AV_LOG_ERROR, error opening key file %s\n,
+  hls-key_file);
+return ret;
+}
+
+ret = avio_read(pb, key, sizeof(key));
+avio_closep(pb);
+if (ret  sizeof(key)) {
+av_log(hls, AV_LOG_ERROR, error reading key file %s\n,
+  hls-key_file);
+return ret;
+}
+
+key_string = av_mallocz(BLOCKSIZE*2 + 1);
+if (!key_string)
+return AVERROR(ENOMEM);
+ff_data_to_hex(key_string, key, BLOCKSIZE, 0);
+if (!hls-key_string || strncmp(key_string, hls-key_string, BLOCKSIZE*2)) 
{
+av_free(hls-key_string);
+hls-key_string = key_string;
+rotate_iv = 1;
+} else {
+av_free(key_string);
+}
+
+if (!hls-random_iv) {
+iv = av_mallocz(BLOCKSIZE);
+if (!iv)
+return AVERROR(ENOMEM);
+for (i = 0; i  8; i++)
+iv[BLOCKSIZE - 1 - i ] = (hls-sequence  i*8)  0xff;
+} else if (!hls-iv_string || rotate_iv) {
+iv = av_malloc(BLOCKSIZE);
+if (!iv)
+return AVERROR(ENOMEM);
+for (i = 0; i  BLOCKSIZE/4; i++) {
+u = av_lfg_get(hls-lfg);
+for (j = 0; j  4; j++)
+iv[i*4 + j] = 

[FFmpeg-devel] [PATCH 2/3] avformat/hlsenc: added segment file deletion

2014-12-04 Thread Christian Suloway
Option removes segments no longer in playlist when older than playlist + 
segment duration

Signed-off-by: Christian Suloway csulo...@globaleagleent.com
---
 libavformat/hlsenc.c | 72 
 1 file changed, 67 insertions(+), 5 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 0a48919..11817a9 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -19,8 +19,13 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include config.h
 #include float.h
 #include stdint.h
+#if HAVE_UNISTD_H
+#include unistd.h
+#endif
+#include stdio.h
 
 #include libavutil/avassert.h
 #include libavutil/mathematics.h
@@ -58,6 +63,7 @@ typedef struct HLSContext {
 float time;// Set by a private option.
 int max_nb_segments;   // Set by a private option.
 int  wrap; // Set by a private option.
+int delete_segments;
 uint32_t flags;// enum HLSFlags
 
 int allowcache;
@@ -72,6 +78,7 @@ typedef struct HLSContext {
 
 HLSSegment *segments;
 HLSSegment *last_segment;
+HLSSegment *old_segments;
 
 char *dirname;
 char *basename;
@@ -90,6 +97,52 @@ static void hls_free_segment(HLSSegment *en)
 av_freep(en);
 }
 
+static int hls_delete_old_segments(HLSContext *hls) {
+
+HLSSegment *segment, *previous_segment = NULL;
+float playlist_duration = 0.0f;
+int path_size;
+char *path;
+
+segment = hls-segments;
+while (segment) {
+playlist_duration += segment-duration;
+segment = segment-next;
+}
+
+segment = hls-old_segments;
+while (segment) {
+playlist_duration -= segment-duration;
+previous_segment = segment;
+segment = segment-next;
+if (playlist_duration = 0.0f) {
+previous_segment-next = NULL;
+break;
+}
+}
+
+while (segment) {
+av_log(hls, AV_LOG_DEBUG, deleting old segment %s\n,
+  segment-filename);
+path_size = strlen(hls-dirname) + strlen(segment-filename) + 1;
+path = av_malloc(path_size);
+if (!path)
+return AVERROR(ENOMEM);
+av_strlcpy(path, hls-dirname, path_size);
+av_strlcat(path, segment-filename, path_size);
+if (unlink(path)  0) {
+av_log(hls, AV_LOG_ERROR, failed to delete old segment %s: %s\n,
+ path, strerror(errno));
+}
+av_free(path);
+previous_segment = segment;
+segment = segment-next;
+hls_free_segment(previous_segment);
+}
+
+return 0;
+}
+
 static int hls_mux_init(AVFormatContext *s)
 {
 HLSContext *hls = s-priv_data;
@@ -124,6 +177,7 @@ static int hls_append_segment(HLSContext *hls, double 
duration, int64_t pos,
   int64_t size)
 {
 HLSSegment *en = av_malloc(sizeof(*en));
+int ret;
 
 if (!en)
 return AVERROR(ENOMEM);
@@ -147,7 +201,14 @@ static int hls_append_segment(HLSContext *hls, double 
duration, int64_t pos,
 if (hls-max_nb_segments  hls-nb_entries = hls-max_nb_segments) {
 en = hls-segments;
 hls-segments = en-next;
-hls_free_segment(en);
+
+if (en  hls-delete_segments  !hls-wrap) {
+en-next = hls-old_segments;
+hls-old_segments = en;
+if ((ret = hls_delete_old_segments(hls))  0)
+return ret;
+} else
+hls_free_segment(en);
 } else
 hls-nb_entries++;
 
@@ -156,9 +217,9 @@ static int hls_append_segment(HLSContext *hls, double 
duration, int64_t pos,
 return 0;
 }
 
-static void hls_free_segments(HLSContext *hls)
+static void hls_free_segments(HLSSegment *p)
 {
-HLSSegment *p = hls-segments, *en;
+HLSSegment *en;
 
 while(p) {
 en = p;
@@ -197,7 +258,6 @@ static int hls_window(AVFormatContext *s, int last)
sequence);
 
 for (en = hls-segments; en; en = en-next) {
-
 avio_printf(hls-pb, #EXTINF:%f,\n, en-duration);
 if (hls-flags  HLS_SINGLE_FILE)
  avio_printf(hls-pb, #EXT-X-BYTERANGE:%PRIi64@%PRIi64\n,
@@ -442,7 +502,8 @@ static int hls_write_trailer(struct AVFormatContext *s)
 hls-avf = NULL;
 hls_window(s, 1);
 
-hls_free_segments(hls);
+hls_free_segments(hls-segments);
+hls_free_segments(hls-old_segments);
 av_free(hls-dirname);
 
 avio_close(hls-pb);
@@ -458,6 +519,7 @@ static const AVOption options[] = {
 {hls_list_size, set maximum number of playlist entries,  
OFFSET(max_nb_segments),AV_OPT_TYPE_INT,{.i64 = 5}, 0, INT_MAX, E},
 {hls_ts_options,set hls mpegts list of options for the container format 
used for hls, OFFSET(format_options_str), AV_OPT_TYPE_STRING, {.str = NULL},  
0, 0,E},
 {hls_wrap,  set number after which the index wraps,  OFFSET(wrap), 
   AV_OPT_TYPE_INT,{.i64 = 0}, 0, 

Re: [FFmpeg-devel] [PATCH] lavc/options: don't copy priv context when it is not AVOption object

2014-12-04 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 12:50:06AM +0100, Lukasz Marek wrote:
 On 03.12.2014 01:28, Michael Niedermayer wrote:
 On Wed, Dec 03, 2014 at 01:24:55AM +0100, Lukasz Marek wrote:
 On 03.12.2014 01:15, Michael Niedermayer wrote:
 On Wed, Dec 03, 2014 at 12:06:47AM +0100, Lukasz Marek wrote:
 This prevents potential crash when opt API is used without a class.
 
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
   libavcodec/options.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libavcodec/options.c b/libavcodec/options.c
 index 7f9fb07..42ef754 100644
 --- a/libavcodec/options.c
 +++ b/libavcodec/options.c
 @@ -196,7 +196,7 @@ int avcodec_copy_context(AVCodecContext *dest, const 
 AVCodecContext *src)
 
   dest-priv_data   = orig_priv_data;
 
 -if (orig_priv_data)
 +if (orig_priv_data  src-codec  src-codec-priv_class)
   av_opt_copy(orig_priv_data, src-priv_data);
 
 
  src-codec-priv_class --- LGTM
 the src-codec check is probably ok too but is it NULL ever ?
 
 after avcodec_alloc_context3(NULL)?
 IIRC there was a patch recently that set codec in
 avcodec_alloc_context3 (via avcodec_get_context_defaults3) when
 provided. Maybe after that it is not so common case. But still when
 allocated with NULL then you have NULL there. src context doesn't
 have to be open neither.
 
 ok
 
 I'm sorry for doing a mess recently regarding this damn
 avcodec_copy_context function. I'm sending updated patch.
 I will send in a moment patchset with test for it.
 The test doesn't cover everything (it is kinda hard to test it), but
 it should cover options management.
 Just to clear, I will ping in one more in a moment and don't bother
 with any other atm :)
 

  options.c |5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
 2667b09ea91f32396f7151900b5fa24a8bcabfef  
 0001-lavc-options-don-t-copy-priv-context-when-it-is-not-.patch
 From d8884452f3bd0af45e459c7c2b2549b7a225ed4d Mon Sep 17 00:00:00 2001
 From: Lukasz Marek lukasz.m.lu...@gmail.com
 Date: Tue, 2 Dec 2014 23:24:15 +0100
 Subject: [PATCH] lavc/options: don't copy priv context when it is not AVOption
  object
 
 This prevents potential crash when opt API is used without a class.

LGTM

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin


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


[FFmpeg-devel] [PATCH] Fixed PNG decoding with Paeth filter for RGBA 64-bits.

2014-12-04 Thread Dominique Leroux
Found and fixed an artifact in the last column of decoded RGBA 64-bits PNG 
images.

The code was dealing with a SIMD-optimized version of the function without 
taking into account that we can have RGB/RGBA images that are respectively 6 or 
8  bytes per pixel (not just 3 or 4).

Dominique


0001-Fixed-PNG-decoding-with-Paeth-filter-for-RGBA-64-bit.patch
Description: 0001-Fixed-PNG-decoding-with-Paeth-filter-for-RGBA-64-bit.patch
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] avformat/hlsenc: added segment filename template

2014-12-04 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 05:05:24PM -0600, Christian Suloway wrote:
 Signed-off-by: Christian Suloway csulo...@globaleagleent.com
 ---
  libavformat/hlsenc.c | 87 
 +---
  1 file changed, 69 insertions(+), 18 deletions(-)

missing documentation


 
 diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
 index e13f438..0a48919 100644
 --- a/libavformat/hlsenc.c
 +++ b/libavformat/hlsenc.c
 @@ -33,7 +33,7 @@
  #include internal.h
  
  typedef struct HLSSegment {

 -char filename[1024];
 +char *filename;

this looks unrelated


  double duration; /* in seconds */
  int64_t pos;
  int64_t size;

 @@ -73,14 +73,23 @@ typedef struct HLSContext {
  HLSSegment *segments;
  HLSSegment *last_segment;
  
 +char *dirname;
  char *basename;
  char *baseurl;
  char *format_options_str;

why is the dirname needed for allowing the user to set the template ?
[...]

 @@ -186,6 +197,7 @@ static int hls_window(AVFormatContext *s, int last)
 sequence);
  
  for (en = hls-segments; en; en = en-next) {
 +
  avio_printf(hls-pb, #EXTINF:%f,\n, en-duration);
  if (hls-flags  HLS_SINGLE_FILE)
   avio_printf(hls-pb, #EXT-X-BYTERANGE:%PRIi64@%PRIi64\n,

stray change

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

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- 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 3/3] lavc/libxvid: workaround for bug in libxvidcore

2014-12-04 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 11:33:03PM +0100, Lukasz Marek wrote:
 On 04.12.2014 12:42, Clément Bœsch wrote:
 On Thu, Dec 04, 2014 at 12:39:29AM +0100, Lukasz Marek wrote:
 On 24.11.2014 01:17, Lukasz Marek wrote:
 libxvidcore calculate number of threads basing on video height.
 If height is small enough it allocates 0 bytes long memory and
 writes to it.
 Setting thread_count to 0 uses 1 thread and skips bugged code.
 
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
   libavcodec/libxvid.c | 11 +++
   1 file changed, 11 insertions(+)
 
 diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
 index 70d52b9..efe7b8a 100644
 --- a/libavcodec/libxvid.c
 +++ b/libavcodec/libxvid.c
 @@ -471,6 +471,17 @@ static av_cold int xvid_encode_init(AVCodecContext 
 *avctx)
   xvid_enc_create.num_zones = 0;
 
   xvid_enc_create.num_threads = avctx-thread_count;
 +/* workaround for a bug in libxvidcore */
 +if (avctx-height  18) {
 +if (avctx-thread_count  2) {
 +xvid_enc_create.num_threads = 0;
 +} else {
 +av_log(avctx, AV_LOG_ERROR,
 +   Too small height for threads  1.);
 +ret = AVERROR(EINVAL);
 +goto fail;
 +}
 +}
 
   xvid_enc_create.plugins = plugins;
   xvid_enc_create.num_plugins = 0;
 
 
 Please comment this patch. xvid accepted fix for it.
 
 Can you add a version check, or at least a comment saying what versions
 are affected by this?
 
 Added a check. it was introduced in 1.3.0 and still present in
 1.3.3. Next should be fixed.
 

  libxvid.c |   13 +
  1 file changed, 13 insertions(+)
 de82e17a2e509e21ce8384d913a9394f80b8537d  
 0001-lavc-libxvid-workaround-for-bug-in-libxvidcore.patch
 From 1bfe00284fdb3dba072147df1efce03c7d29dd35 Mon Sep 17 00:00:00 2001
 From: Lukasz Marek lukasz.m.lu...@gmail.com
 Date: Mon, 24 Nov 2014 01:12:06 +0100
 Subject: [PATCH] lavc/libxvid: workaround for bug in libxvidcore
 
 libxvidcore calculate number of threads basing on video height.
 If height is small enough it allocates 0 bytes long memory and
 writes to it.
 Setting thread_count to 0 uses 1 thread and skips bugged code.
 
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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