Re: [FFmpeg-devel] [PATCH 2/2] ffmpeg: copy trailing_padding when using -acodec copy

2016-09-13 Thread James Almer
On 8/15/2016 5:13 PM, Jon Toohill wrote:
> ---
>  ffmpeg.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index bae515d..49a1b03 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -3001,6 +3001,7 @@ static int transcode_init(void)
>  enc_ctx->audio_service_type = dec_ctx->audio_service_type;
>  enc_ctx->block_align= dec_ctx->block_align;
>  enc_ctx->initial_padding= dec_ctx->delay;
> +enc_ctx->trailing_padding   = dec_ctx->trailing_padding;
>  enc_ctx->profile= dec_ctx->profile;
>  #if FF_API_AUDIOENC_DELAY
>  enc_ctx->delay  = dec_ctx->delay;

This was apparently forgotten, so applied.

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


[FFmpeg-devel] [PATCH] doc/muxers: add flv muxer document into doc/muxers

2016-09-13 Thread Steven Liu



0001-doc-muxers-add-flv-muxer-document-into-doc-muxers.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] avformat/flvenc: add no_sequence_end flags for flvflags

2016-09-13 Thread Steven Liu
2016-09-14 10:00 GMT+08:00 Michael Niedermayer :

> On Wed, Sep 14, 2016 at 09:42:48AM +0800, Steven Liu wrote:
> > 2016-09-14 8:31 GMT+08:00 Michael Niedermayer :
> >
> > > On Tue, Sep 13, 2016 at 10:10:40PM +0800, Steven Liu wrote:
> > > [...]
> > > >  flvenc.c |   18 +++---
> > > >  1 file changed, 11 insertions(+), 7 deletions(-)
> > > > 42fedcf3213941fce3f2c0a6ea879002e178fa75
> 0002-avformat-flvenc-add-no_
> > > sequence_end-flags-for-flvfla.patch
> > > > From c0297aa790e72b14bd01fcb5862e66636bc43400 Mon Sep 17 00:00:00
> 2001
> > > > From: Steven Liu 
> > > > Date: Tue, 13 Sep 2016 22:03:59 +0800
> > > > Subject: [PATCH 2/2] avformat/flvenc: add no_sequence_end flags for
> > > flvflags
> > > >
> > > > when split flv file by flv format at first, and cat flvs file
> > > > into one flv file, the flv sequence end is be used,
> > > > then the whole flv have many flv sequence end TAG.
> > > > this flags can give user an option to ignore write sequence end TAG
> > > >
> > > > Signed-off-by: Steven Liu 
> > > > ---
> > > >  libavformat/flvenc.c | 18 +++---
> > > >  1 file changed, 11 insertions(+), 7 deletions(-)
> > >
> > > missing update to docs/
> > >
> > >
> > > >
> > > > diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
> > > > index a3623f8..9e95b8d 100644
> > > > --- a/libavformat/flvenc.c
> > > > +++ b/libavformat/flvenc.c
> > > > @@ -63,6 +63,7 @@ static const AVCodecTag flv_audio_codec_ids[] = {
> > > >
> > > >  typedef enum {
> > > >  FLV_AAC_SEQ_HEADER_DETECT = (1 << 0),
> > > > +FLV_NO_SEQUENCE_END = (1 << 1),
> > > >  } FLVFlags;
> > > >
> > > >  typedef struct FLVContext {
> > > > @@ -527,13 +528,15 @@ static int flv_write_trailer(AVFormatContext
> *s)
> > > >  FLVContext *flv = s->priv_data;
> > > >  int i;
> > > >
> > > > -/* Add EOS tag */
> > > > -for (i = 0; i < s->nb_streams; i++) {
> > > > -AVCodecParameters *par = s->streams[i]->codecpar;
> > > > -FLVStreamContext *sc = s->streams[i]->priv_data;
> > > > -if (par->codec_type == AVMEDIA_TYPE_VIDEO &&
> > > > -(par->codec_id == AV_CODEC_ID_H264 || par->codec_id
> ==
> > > AV_CODEC_ID_MPEG4))
> > > > -put_avc_eos_tag(pb, sc->last_ts);
> > > > +if (flv->flags & FLV_NO_SEQUENCE_END == 0) {
> > >
> > > please add a (), that makes greping for order or precedenc bugs much
> > > easier
> > >
> > > [...]
> > >
> >
> > Hi Michael,
> >
> >   I found the flvenc has no document  in doc/muxers,
> >   can i update this patch first, and update the second for refine the
> > flvenc doc?
>
> IIRC, ok
>
> patch update:
check if the flvenc in no sequence mode, and give the debug message for it.


0001-avformat-flvenc-add-no_sequence_end-flags-for-flvfla.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] avformat/flvenc: add no_sequence_end flags for flvflags

2016-09-13 Thread Michael Niedermayer
On Wed, Sep 14, 2016 at 09:42:48AM +0800, Steven Liu wrote:
> 2016-09-14 8:31 GMT+08:00 Michael Niedermayer :
> 
> > On Tue, Sep 13, 2016 at 10:10:40PM +0800, Steven Liu wrote:
> > [...]
> > >  flvenc.c |   18 +++---
> > >  1 file changed, 11 insertions(+), 7 deletions(-)
> > > 42fedcf3213941fce3f2c0a6ea879002e178fa75  0002-avformat-flvenc-add-no_
> > sequence_end-flags-for-flvfla.patch
> > > From c0297aa790e72b14bd01fcb5862e66636bc43400 Mon Sep 17 00:00:00 2001
> > > From: Steven Liu 
> > > Date: Tue, 13 Sep 2016 22:03:59 +0800
> > > Subject: [PATCH 2/2] avformat/flvenc: add no_sequence_end flags for
> > flvflags
> > >
> > > when split flv file by flv format at first, and cat flvs file
> > > into one flv file, the flv sequence end is be used,
> > > then the whole flv have many flv sequence end TAG.
> > > this flags can give user an option to ignore write sequence end TAG
> > >
> > > Signed-off-by: Steven Liu 
> > > ---
> > >  libavformat/flvenc.c | 18 +++---
> > >  1 file changed, 11 insertions(+), 7 deletions(-)
> >
> > missing update to docs/
> >
> >
> > >
> > > diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
> > > index a3623f8..9e95b8d 100644
> > > --- a/libavformat/flvenc.c
> > > +++ b/libavformat/flvenc.c
> > > @@ -63,6 +63,7 @@ static const AVCodecTag flv_audio_codec_ids[] = {
> > >
> > >  typedef enum {
> > >  FLV_AAC_SEQ_HEADER_DETECT = (1 << 0),
> > > +FLV_NO_SEQUENCE_END = (1 << 1),
> > >  } FLVFlags;
> > >
> > >  typedef struct FLVContext {
> > > @@ -527,13 +528,15 @@ static int flv_write_trailer(AVFormatContext *s)
> > >  FLVContext *flv = s->priv_data;
> > >  int i;
> > >
> > > -/* Add EOS tag */
> > > -for (i = 0; i < s->nb_streams; i++) {
> > > -AVCodecParameters *par = s->streams[i]->codecpar;
> > > -FLVStreamContext *sc = s->streams[i]->priv_data;
> > > -if (par->codec_type == AVMEDIA_TYPE_VIDEO &&
> > > -(par->codec_id == AV_CODEC_ID_H264 || par->codec_id ==
> > AV_CODEC_ID_MPEG4))
> > > -put_avc_eos_tag(pb, sc->last_ts);
> > > +if (flv->flags & FLV_NO_SEQUENCE_END == 0) {
> >
> > please add a (), that makes greping for order or precedenc bugs much
> > easier
> >
> > [...]
> >
> 
> Hi Michael,
> 
>   I found the flvenc has no document  in doc/muxers,
>   can i update this patch first, and update the second for refine the
> flvenc doc?

IIRC, ok

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

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


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


Re: [FFmpeg-devel] [PATCH] lavfi: VAAPI video processing filter

2016-09-13 Thread Jun Zhao


On 2016/9/14 6:06, Mark Thompson wrote:
> WIP.
> ---
> On 05/09/16 02:52, Jun Zhao wrote:
>> On 2016/8/31 6:48, Mark Thompson wrote:
>>> On 30/08/16 09:00, Jun Zhao wrote:
 v3 : fix sharpless mapping issue
 v2 : fix filter support flag check logic issue
>>>
>>> Hi,
>>>
>>> A general remark to start: vf_scale_vaapi is named to be a scaling filter 
>>> (i.e. it replaces vf_scale/swscale for AV_PIX_FMT_VAAPI) - is this 
>>> therefore really the right place to be adding other operations unrelated to 
>>> scaling?
>>>
>>> Do use-cases for these operations actually make sense to add here rather 
>>> than in a separate filter?  (I'm not sure what the answer to this should be 
>>> - I would definitely argue that the deinterlacer should be a separate 
>>> filter, but these other operations are unclear.)
>>>
>>>
>>
>> As you know, VPP use the pipeline mode, split the 
>> scale/denoise/sharpness/... in 
>> different filter maybe is not good idea, I guess nobody want to call 
>> vaRenderPicture()/
>> vaEndpicture/... again and again in 
>> vf_scale_vaapi.c/vf_denosie_vaapi.c/vf_sharpness_vaapi.c/...
> 
> How about something like this, then?  It adds a new filter to do the video 
> processing, while leaving the scale filter as-is.

Can we merge the vpp scale/the other vpp filters in one AVFilter, e,g 
vf_postprocess_vaapi.c. 
If we split the scale/the other vpp filters, I guess maybe have some 
performance issue,
when merge the scale/the other vpp filters in one AVFilter, only once surface 
copy ,
 
1 input surface-> 1 output surface // once copy for 
scale/de-noise/sharpness/...

but if split them, it's will lead to twice surface copy in some case. 

1 input surface -> 1 output surface -> 2 output surface // 1st copy for 
scale, 2nd
// copy for the 
other vaapi filters

Anyway, need to more test for this.

> 
> Implements denoise, sharpen and all of the colour balance controls; lightly 
> tested but seems working on i965/Skylake.
> 
> Outstanding issues:
> * The name is not very good, but I can't think of anything better.
> * Needs more testing.
> * Some error recovery is missing.
> * Documentation.
> * Reuses the surface pool from the input hw_frames_ctx - is anything going to 
> object to that?
> * Can't order the filters applied - does that matter?
> * Sharpness + anything else aborts inside the i965 driver, other combinations 
> work - should vaQueryVideoProcPipelineCaps() detect that, or is there some 
> other way to get it?

I think i965 driver guys will fix this issue:)

> 
> Thanks,
> 
> - Mark
> 
> 
>  libavfilter/Makefile   |   1 +
>  libavfilter/allfilters.c   |   1 +
>  libavfilter/vf_process_vaapi.c | 597 
> +
>  3 files changed, 599 insertions(+)
>  create mode 100644 libavfilter/vf_process_vaapi.c
> 
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 5cd10fa..10ffa78 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -239,6 +239,7 @@ OBJS-$(CONFIG_PIXDESCTEST_FILTER)+= 
> vf_pixdesctest.o
>  OBJS-$(CONFIG_PP_FILTER) += vf_pp.o
>  OBJS-$(CONFIG_PP7_FILTER)+= vf_pp7.o
>  OBJS-$(CONFIG_PREWITT_FILTER)+= vf_convolution.o
> +OBJS-$(CONFIG_PROCESS_VAAPI_FILTER)  += vf_process_vaapi.o
>  OBJS-$(CONFIG_PSNR_FILTER)   += vf_psnr.o dualinput.o 
> framesync.o
>  OBJS-$(CONFIG_PULLUP_FILTER) += vf_pullup.o
>  OBJS-$(CONFIG_QP_FILTER) += vf_qp.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index 47d95f5..0684aef 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -255,6 +255,7 @@ void avfilter_register_all(void)
>  REGISTER_FILTER(PP, pp, vf);
>  REGISTER_FILTER(PP7,pp7,vf);
>  REGISTER_FILTER(PREWITT,prewitt,vf);
> +REGISTER_FILTER(PROCESS_VAAPI,  process_vaapi,  vf);
>  REGISTER_FILTER(PSNR,   psnr,   vf);
>  REGISTER_FILTER(PULLUP, pullup, vf);
>  REGISTER_FILTER(QP, qp, vf);
> diff --git a/libavfilter/vf_process_vaapi.c b/libavfilter/vf_process_vaapi.c
> new file mode 100644
> index 000..25701a0
> --- /dev/null
> +++ b/libavfilter/vf_process_vaapi.c
> @@ -0,0 +1,597 @@
> +/*
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for mor

Re: [FFmpeg-devel] [PATCH 2/2] avformat/flvenc: add no_sequence_end flags for flvflags

2016-09-13 Thread Steven Liu
2016-09-14 8:31 GMT+08:00 Michael Niedermayer :

> On Tue, Sep 13, 2016 at 10:10:40PM +0800, Steven Liu wrote:
> [...]
> >  flvenc.c |   18 +++---
> >  1 file changed, 11 insertions(+), 7 deletions(-)
> > 42fedcf3213941fce3f2c0a6ea879002e178fa75  0002-avformat-flvenc-add-no_
> sequence_end-flags-for-flvfla.patch
> > From c0297aa790e72b14bd01fcb5862e66636bc43400 Mon Sep 17 00:00:00 2001
> > From: Steven Liu 
> > Date: Tue, 13 Sep 2016 22:03:59 +0800
> > Subject: [PATCH 2/2] avformat/flvenc: add no_sequence_end flags for
> flvflags
> >
> > when split flv file by flv format at first, and cat flvs file
> > into one flv file, the flv sequence end is be used,
> > then the whole flv have many flv sequence end TAG.
> > this flags can give user an option to ignore write sequence end TAG
> >
> > Signed-off-by: Steven Liu 
> > ---
> >  libavformat/flvenc.c | 18 +++---
> >  1 file changed, 11 insertions(+), 7 deletions(-)
>
> missing update to docs/
>
>
> >
> > diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
> > index a3623f8..9e95b8d 100644
> > --- a/libavformat/flvenc.c
> > +++ b/libavformat/flvenc.c
> > @@ -63,6 +63,7 @@ static const AVCodecTag flv_audio_codec_ids[] = {
> >
> >  typedef enum {
> >  FLV_AAC_SEQ_HEADER_DETECT = (1 << 0),
> > +FLV_NO_SEQUENCE_END = (1 << 1),
> >  } FLVFlags;
> >
> >  typedef struct FLVContext {
> > @@ -527,13 +528,15 @@ static int flv_write_trailer(AVFormatContext *s)
> >  FLVContext *flv = s->priv_data;
> >  int i;
> >
> > -/* Add EOS tag */
> > -for (i = 0; i < s->nb_streams; i++) {
> > -AVCodecParameters *par = s->streams[i]->codecpar;
> > -FLVStreamContext *sc = s->streams[i]->priv_data;
> > -if (par->codec_type == AVMEDIA_TYPE_VIDEO &&
> > -(par->codec_id == AV_CODEC_ID_H264 || par->codec_id ==
> AV_CODEC_ID_MPEG4))
> > -put_avc_eos_tag(pb, sc->last_ts);
> > +if (flv->flags & FLV_NO_SEQUENCE_END == 0) {
>
> please add a (), that makes greping for order or precedenc bugs much
> easier
>
> [...]
>

Hi Michael,

  I found the flvenc has no document  in doc/muxers,
  can i update this patch first, and update the second for refine the
flvenc doc?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] mpeg12dec fix up DVD caption handling

2016-09-13 Thread Michael Niedermayer
On Tue, Sep 13, 2016 at 10:08:06AM -0700, Jonathan Campbell wrote:
> 
> 
> On 09/12/2016 07:58 PM, Michael Niedermayer wrote:
> > On Mon, Sep 12, 2016 at 06:19:43PM -0700, Jonathan Campbell wrote:
> >>
> >>
> >> On 09/12/2016 04:56 PM, Michael Niedermayer wrote:
> >>> On Mon, Sep 12, 2016 at 03:28:24PM -0700, Jonathan Campbell wrote:
>  These patches fix up the DVD caption handling in mpeg12dec.c to better 
>  handle odd cases.
>  It's based on code I've written elsewhere to handle captions.
>  While it's common for these packets to contain 15 frames worth and start 
>  on the odd field there are also DVDs that start on even field or even 
>  encode extra fields and switch starting fields.
>  Part of the patch is to document comprehensively the format of the DVD 
>  caption packet.
> 
>  Jonathan Campbell
> >>>
>   mpeg12dec.c |   27 ++-
>   1 file changed, 26 insertions(+), 1 deletion(-)
>  a839a0d0e9000ab140f6aef9dee9577f242462bf  
>  0001-add-comments-documenting-the-format-of-the-DVD-CC-us.patch
>  From 9213012c7d8ceef2af43fe3c218b1b50728e8f80 Mon Sep 17 00:00:00 2001
>  From: Jonathan Campbell 
>  Date: Mon, 12 Sep 2016 12:34:48 -0700
>  Subject: [PATCH 1/2] add comments documenting the format of the DVD CC
>   user-data packet. this is to aid development and maintenance of that 
>  code.
> 
>  ---
>   libavcodec/mpeg12dec.c | 27 ++-
>   1 file changed, 26 insertions(+), 1 deletion(-)
> 
>  diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
>  index 204a578..522621a 100644
>  --- a/libavcodec/mpeg12dec.c
>  +++ b/libavcodec/mpeg12dec.c
>  @@ -2262,7 +2262,32 @@ static int mpeg_decode_a53_cc(AVCodecContext 
>  *avctx,
>   return 1;
>   } else if (buf_size >= 11 &&
>  p[0] == 'C' && p[1] == 'C' && p[2] == 0x01 && p[3] == 
>  0xf8) {
>  -/* extract DVD CC data */
>  +/* extract DVD CC data
> >>>
>  + * for more information see: 
>  [https://en.wikipedia.org/wiki/EIA-608#DVD_GOP_User_Data_Insertion]
> >>>
> >>> wikipedia is not a good reference, in fact its not even a
> >>> constant reference without a revission. wikipedia can massivly change
> >>> and may at times, especially with niche areas be just wrong, the link
> >>> itself also wont always work possibly
> >>>
> >>> Please use the specifications itself, H.262 is public, its the 4th
> >>> link when searching for H.262 with google for example (wikipedia
> >>> refers to H.262 IIUC)
> >>>
> >>> [...]
> >>>
> >>>
> >>>
> >>> ___
> >>> ffmpeg-devel mailing list
> >>> ffmpeg-devel@ffmpeg.org
> >>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>>
> >> Updated patch set, removes Wikipedia link.
> >>
> >> I see that H.262 specs are free on the web, but I can't find the part that 
> >> describes the DVD-style H.262 user data packets that this code handles.
> >>
> >> But the structure as described has been reliable when tested against my 
> >> DVD library.
> > 
> > applied the docs and wiki removial stashed
> > 
> > please dont send multiple patches per mail it makes keeping track of
> > what needs a review hard both with MUAs as well as patchwork
> > 
> > [...]
> > 
> > 
> > 
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > 
> Makes sense.
> 
> Would running git format-patch >patchfile work to submit it as one patch or 
> do I need to squash it into one patch?
> 
> Do I need to resubmit anything?

yes, please resbmit the remaining patch/changes with any comments
from everyone taken care of or with explanation why not

thx

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

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


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


Re: [FFmpeg-devel] [PATCH] avfilter/drawutils: allow drawing opaque text on transparent background

2016-09-13 Thread Michael Niedermayer
On Wed, Sep 14, 2016 at 01:38:20AM +0200, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
> Fixes #3302.
> ---
>  libavfilter/drawutils.c   | 7 ---
>  libavfilter/drawutils.h   | 1 +
>  libavfilter/vf_drawtext.c | 2 +-
>  3 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
> index f6760be..905eaa3 100644
> --- a/libavfilter/drawutils.c
> +++ b/libavfilter/drawutils.c
> @@ -211,10 +211,11 @@ int ff_draw_init(FFDrawContext *draw, enum 
> AVPixelFormat format, unsigned flags)
>  draw->desc  = desc;
>  draw->format= format;
>  draw->nb_planes = nb_planes;
> +draw->flags = flags;
>  memcpy(draw->pixelstep, pixelstep, sizeof(draw->pixelstep));
>  draw->hsub[1] = draw->hsub[2] = draw->hsub_max = desc->log2_chroma_w;
>  draw->vsub[1] = draw->vsub[2] = draw->vsub_max = desc->log2_chroma_h;
> -for (i = 0; i < (desc->nb_components - !!(desc->flags & 
> AV_PIX_FMT_FLAG_ALPHA)); i++)
> +for (i = 0; i < (desc->nb_components - !!(desc->flags & 
> AV_PIX_FMT_FLAG_ALPHA && !(flags & 1))); i++)
>  draw->comp_mask[desc->comp[i].plane] |=
>  1 << desc->comp[i].offset;
>  return 0;
> @@ -452,7 +453,7 @@ void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor 
> *color,
>  /* 0x101 * alpha is in the [ 2 ; 0x1001] range */
>  alpha = 0x101 * color->rgba[3] + 0x2;
>  }
> -nb_planes = draw->nb_planes - !!(draw->desc->flags & 
> AV_PIX_FMT_FLAG_ALPHA);
> +nb_planes = draw->nb_planes - !!(draw->desc->flags & 
> AV_PIX_FMT_FLAG_ALPHA && !(draw->flags & 1));
>  nb_planes += !nb_planes;
>  for (plane = 0; plane < nb_planes; plane++) {
>  nb_comp = draw->pixelstep[plane];
> @@ -630,7 +631,7 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor 
> *color,
>  } else {
>  alpha = (0x101 * color->rgba[3] + 0x2) >> 8;
>  }
> -nb_planes = draw->nb_planes - !!(draw->desc->flags & 
> AV_PIX_FMT_FLAG_ALPHA);
> +nb_planes = draw->nb_planes - !!(draw->desc->flags & 
> AV_PIX_FMT_FLAG_ALPHA && !(draw->flags & 1));
>  nb_planes += !nb_planes;
>  for (plane = 0; plane < nb_planes; plane++) {
>  nb_comp = draw->pixelstep[plane];
> diff --git a/libavfilter/drawutils.h b/libavfilter/drawutils.h
> index 1fb3e4f..11ec97a 100644
> --- a/libavfilter/drawutils.h
> +++ b/libavfilter/drawutils.h
> @@ -55,6 +55,7 @@ typedef struct FFDrawContext {
>  uint8_t vsub[MAX_PLANES];  /*< vertical subsampling */
>  uint8_t hsub_max;
>  uint8_t vsub_max;
> +unsigned flags;
>  } FFDrawContext;
>  
>  typedef struct FFDrawColor {
> diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
> index 214aef0..996c26d 100644
> --- a/libavfilter/vf_drawtext.c
> +++ b/libavfilter/vf_drawtext.c
> @@ -730,7 +730,7 @@ static int config_input(AVFilterLink *inlink)
>  DrawTextContext *s = ctx->priv;
>  int ret;
>  
> -ff_draw_init(&s->dc, inlink->format, 0);
> +ff_draw_init(&s->dc, inlink->format, 1);

the docs need an update they say "No flags currently defined."
also a named identifer would be more descriptive than 1


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

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


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


Re: [FFmpeg-devel] [PATCH 2/2] avformat/flvenc: add no_sequence_end flags for flvflags

2016-09-13 Thread Michael Niedermayer
On Tue, Sep 13, 2016 at 10:10:40PM +0800, Steven Liu wrote:
[...]
>  flvenc.c |   18 +++---
>  1 file changed, 11 insertions(+), 7 deletions(-)
> 42fedcf3213941fce3f2c0a6ea879002e178fa75  
> 0002-avformat-flvenc-add-no_sequence_end-flags-for-flvfla.patch
> From c0297aa790e72b14bd01fcb5862e66636bc43400 Mon Sep 17 00:00:00 2001
> From: Steven Liu 
> Date: Tue, 13 Sep 2016 22:03:59 +0800
> Subject: [PATCH 2/2] avformat/flvenc: add no_sequence_end flags for flvflags
> 
> when split flv file by flv format at first, and cat flvs file
> into one flv file, the flv sequence end is be used,
> then the whole flv have many flv sequence end TAG.
> this flags can give user an option to ignore write sequence end TAG
> 
> Signed-off-by: Steven Liu 
> ---
>  libavformat/flvenc.c | 18 +++---
>  1 file changed, 11 insertions(+), 7 deletions(-)

missing update to docs/


> 
> diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
> index a3623f8..9e95b8d 100644
> --- a/libavformat/flvenc.c
> +++ b/libavformat/flvenc.c
> @@ -63,6 +63,7 @@ static const AVCodecTag flv_audio_codec_ids[] = {
>  
>  typedef enum {
>  FLV_AAC_SEQ_HEADER_DETECT = (1 << 0),
> +FLV_NO_SEQUENCE_END = (1 << 1),
>  } FLVFlags;
>  
>  typedef struct FLVContext {
> @@ -527,13 +528,15 @@ static int flv_write_trailer(AVFormatContext *s)
>  FLVContext *flv = s->priv_data;
>  int i;
>  
> -/* Add EOS tag */
> -for (i = 0; i < s->nb_streams; i++) {
> -AVCodecParameters *par = s->streams[i]->codecpar;
> -FLVStreamContext *sc = s->streams[i]->priv_data;
> -if (par->codec_type == AVMEDIA_TYPE_VIDEO &&
> -(par->codec_id == AV_CODEC_ID_H264 || par->codec_id == 
> AV_CODEC_ID_MPEG4))
> -put_avc_eos_tag(pb, sc->last_ts);
> +if (flv->flags & FLV_NO_SEQUENCE_END == 0) {

please add a (), that makes greping for order or precedenc bugs much
easier

[...]

-- 
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 1/2] avformat/flvenc: add FLVFlags for flvflags options

2016-09-13 Thread Michael Niedermayer
On Tue, Sep 13, 2016 at 10:09:48PM +0800, Steven Liu wrote:
> add FLVFlags type, be used to add new FLVFlags options
> 
> Signed-off-by: Steven Liu 
> ---
>  libavformat/flvenc.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.


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


Re: [FFmpeg-devel] [PATCH] avfilter/drawutils: allow drawing opaque text on transparent background

2016-09-13 Thread Paul B Mahol
On 9/14/16, Paul B Mahol  wrote:
> Signed-off-by: Paul B Mahol 
> ---
> Fixes #3302.
> ---
>  libavfilter/drawutils.c   | 7 ---
>  libavfilter/drawutils.h   | 1 +
>  libavfilter/vf_drawtext.c | 2 +-
>  3 files changed, 6 insertions(+), 4 deletions(-)
>

Also fixes #3571.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] doc/muxers: add hls_segment_size option document

2016-09-13 Thread Steven Liu
2016-09-14 7:34 GMT+08:00 Lou Logan :

> On Wed, 14 Sep 2016 07:16:32 +0800, Steven Liu wrote:
>
> > and make an sample introduce how to use hls_segment_size.
> >
> > Signed-off-by: LiuQi 
> > ---
> >  doc/muxers.texi | 11 +++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/doc/muxers.texi b/doc/muxers.texi
> > index ccf8ea1..9b1f717 100644
> > --- a/doc/muxers.texi
> > +++ b/doc/muxers.texi
> > @@ -410,6 +410,17 @@ ffmpeg in.nut -hls_segment_filename 'file%03d.ts'
> > out.m3u8
> >  This example will produce the playlist, @file{out.m3u8}, and segment
> files:
> >  @file{file000.ts}, @file{file001.ts}, @file{file002.ts}, etc.
> >
> > +@item hls_segment_size @var{max_seg_size}
> > +Set the segments maximum size. Useful to reduce segment files numbers,
> > packaging
> > +some segment files in one file, and keep playlist segments as normal,
> [...]
>
> It appears your mail client may have introduced line breaks resulting
> in a patch that is unable to be applied.
>
> Did you use "git format-patch" or "git send-email"?
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Hi Lou Logan,

  What about this patch?


0001-doc-muxers-add-hls_segment_size-option-document.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter/drawutils: allow drawing opaque text on transparent background

2016-09-13 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
Fixes #3302.
---
 libavfilter/drawutils.c   | 7 ---
 libavfilter/drawutils.h   | 1 +
 libavfilter/vf_drawtext.c | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index f6760be..905eaa3 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -211,10 +211,11 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat 
format, unsigned flags)
 draw->desc  = desc;
 draw->format= format;
 draw->nb_planes = nb_planes;
+draw->flags = flags;
 memcpy(draw->pixelstep, pixelstep, sizeof(draw->pixelstep));
 draw->hsub[1] = draw->hsub[2] = draw->hsub_max = desc->log2_chroma_w;
 draw->vsub[1] = draw->vsub[2] = draw->vsub_max = desc->log2_chroma_h;
-for (i = 0; i < (desc->nb_components - !!(desc->flags & 
AV_PIX_FMT_FLAG_ALPHA)); i++)
+for (i = 0; i < (desc->nb_components - !!(desc->flags & 
AV_PIX_FMT_FLAG_ALPHA && !(flags & 1))); i++)
 draw->comp_mask[desc->comp[i].plane] |=
 1 << desc->comp[i].offset;
 return 0;
@@ -452,7 +453,7 @@ void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor 
*color,
 /* 0x101 * alpha is in the [ 2 ; 0x1001] range */
 alpha = 0x101 * color->rgba[3] + 0x2;
 }
-nb_planes = draw->nb_planes - !!(draw->desc->flags & 
AV_PIX_FMT_FLAG_ALPHA);
+nb_planes = draw->nb_planes - !!(draw->desc->flags & AV_PIX_FMT_FLAG_ALPHA 
&& !(draw->flags & 1));
 nb_planes += !nb_planes;
 for (plane = 0; plane < nb_planes; plane++) {
 nb_comp = draw->pixelstep[plane];
@@ -630,7 +631,7 @@ void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color,
 } else {
 alpha = (0x101 * color->rgba[3] + 0x2) >> 8;
 }
-nb_planes = draw->nb_planes - !!(draw->desc->flags & 
AV_PIX_FMT_FLAG_ALPHA);
+nb_planes = draw->nb_planes - !!(draw->desc->flags & AV_PIX_FMT_FLAG_ALPHA 
&& !(draw->flags & 1));
 nb_planes += !nb_planes;
 for (plane = 0; plane < nb_planes; plane++) {
 nb_comp = draw->pixelstep[plane];
diff --git a/libavfilter/drawutils.h b/libavfilter/drawutils.h
index 1fb3e4f..11ec97a 100644
--- a/libavfilter/drawutils.h
+++ b/libavfilter/drawutils.h
@@ -55,6 +55,7 @@ typedef struct FFDrawContext {
 uint8_t vsub[MAX_PLANES];  /*< vertical subsampling */
 uint8_t hsub_max;
 uint8_t vsub_max;
+unsigned flags;
 } FFDrawContext;
 
 typedef struct FFDrawColor {
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 214aef0..996c26d 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -730,7 +730,7 @@ static int config_input(AVFilterLink *inlink)
 DrawTextContext *s = ctx->priv;
 int ret;
 
-ff_draw_init(&s->dc, inlink->format, 0);
+ff_draw_init(&s->dc, inlink->format, 1);
 ff_draw_color(&s->dc, &s->fontcolor,   s->fontcolor.rgba);
 ff_draw_color(&s->dc, &s->shadowcolor, s->shadowcolor.rgba);
 ff_draw_color(&s->dc, &s->bordercolor, s->bordercolor.rgba);
-- 
2.5.0

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


Re: [FFmpeg-devel] [PATCH] doc/muxers: add hls_segment_size option document

2016-09-13 Thread Lou Logan
On Wed, 14 Sep 2016 07:16:32 +0800, Steven Liu wrote:

> and make an sample introduce how to use hls_segment_size.
> 
> Signed-off-by: LiuQi 
> ---
>  doc/muxers.texi | 11 +++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/doc/muxers.texi b/doc/muxers.texi
> index ccf8ea1..9b1f717 100644
> --- a/doc/muxers.texi
> +++ b/doc/muxers.texi
> @@ -410,6 +410,17 @@ ffmpeg in.nut -hls_segment_filename 'file%03d.ts'
> out.m3u8
>  This example will produce the playlist, @file{out.m3u8}, and segment files:
>  @file{file000.ts}, @file{file001.ts}, @file{file002.ts}, etc.
> 
> +@item hls_segment_size @var{max_seg_size}
> +Set the segments maximum size. Useful to reduce segment files numbers,
> packaging
> +some segment files in one file, and keep playlist segments as normal,
[...]

It appears your mail client may have introduced line breaks resulting
in a patch that is unable to be applied.

Did you use "git format-patch" or "git send-email"?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] doc/muxers: add hls_segment_size option document

2016-09-13 Thread Steven Liu
and make an sample introduce how to use hls_segment_size.

Signed-off-by: LiuQi 
---
 doc/muxers.texi | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index ccf8ea1..9b1f717 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -410,6 +410,17 @@ ffmpeg in.nut -hls_segment_filename 'file%03d.ts'
out.m3u8
 This example will produce the playlist, @file{out.m3u8}, and segment files:
 @file{file000.ts}, @file{file001.ts}, @file{file002.ts}, etc.

+@item hls_segment_size @var{max_seg_size}
+Set the segments maximum size. Useful to reduce segment files numbers,
packaging
+some segment files in one file, and keep playlist segments as normal,
+Support hls m3u8 @code{#EXT-X-BYTERANGE} in @code{#EXT-X-VERSION:4},
+@var{max_seg_size} is used in bytes format:
+@example
+ffmpeg in.nut -hls_segment_size 200 out.m3u8
+@end example
+every segment files size is 200 bytes, and one segment file have some
segments info
+in @file{out.m3u8}.
+
 @item use_localtime
 Use strftime on @var{filename} to expand the segment filename with
localtime.
 The segment number (%d) is not available in this mode.
-- 
2.7.4 (Apple Git-66)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments

2016-09-13 Thread Steven Liu
2016-09-14 2:53 GMT+08:00 Moritz Barsnick :

> On Tue, Sep 13, 2016 at 11:25:39 +0800, Steven Liu wrote:
> > +int byterange_mode = hls->flags & (HLS_SINGLE_FILE) ||
> hls->max_seg_size > 0;
>  ^   ^
> Why the bracket?
>
> > +av_log(oc, AV_LOG_ERROR, "Invalid segment filename
> template '%s' you can try use -use_localtime 1 with it\n", c->basename);
> Rather:
>av_log(oc, AV_LOG_ERROR, "Invalid segment filename
> template '%s', you can try to use -use_localtime 1 with it\n", c->basename);
>
> > +{"hls_segment_size", "set maximum size per segment file, (Byte)",
> OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, 0, INT_MAX, E},
>{"hls_segment_size", "set maximum size per segment file (in
> bytes)",  OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, 0,
> INT_MAX, E},
>
> This isn't a flag, right? Perhaps you shouldn't be putting the option
> between the flags' lines (but probably still as the final option).
>
I shall update patch :-)

>
> The value of 0 seems to have a special meaning. Is this documented
>
I cannot understand "The value of 0 seems to have a special meaning" ,
it will not set value when unuse hls_segment_size, so give it value of 0.
is that a problem?

> anywhere? In other words: You should also update doc/muxers.texi. (I
> can help with the grammar of the wording.)
>
patch will come soon :-D

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


[FFmpeg-devel] [PATCH] lavfi: VAAPI video processing filter

2016-09-13 Thread Mark Thompson
WIP.
---
On 05/09/16 02:52, Jun Zhao wrote:
> On 2016/8/31 6:48, Mark Thompson wrote:
>> On 30/08/16 09:00, Jun Zhao wrote:
>>> v3 : fix sharpless mapping issue
>>> v2 : fix filter support flag check logic issue
>>
>> Hi,
>>
>> A general remark to start: vf_scale_vaapi is named to be a scaling filter 
>> (i.e. it replaces vf_scale/swscale for AV_PIX_FMT_VAAPI) - is this therefore 
>> really the right place to be adding other operations unrelated to scaling?
>>
>> Do use-cases for these operations actually make sense to add here rather 
>> than in a separate filter?  (I'm not sure what the answer to this should be 
>> - I would definitely argue that the deinterlacer should be a separate 
>> filter, but these other operations are unclear.)
>>
>>
> 
> As you know, VPP use the pipeline mode, split the scale/denoise/sharpness/... 
> in 
> different filter maybe is not good idea, I guess nobody want to call 
> vaRenderPicture()/
> vaEndpicture/... again and again in 
> vf_scale_vaapi.c/vf_denosie_vaapi.c/vf_sharpness_vaapi.c/...

How about something like this, then?  It adds a new filter to do the video 
processing, while leaving the scale filter as-is.

Implements denoise, sharpen and all of the colour balance controls; lightly 
tested but seems working on i965/Skylake.

Outstanding issues:
* The name is not very good, but I can't think of anything better.
* Needs more testing.
* Some error recovery is missing.
* Documentation.
* Reuses the surface pool from the input hw_frames_ctx - is anything going to 
object to that?
* Can't order the filters applied - does that matter?
* Sharpness + anything else aborts inside the i965 driver, other combinations 
work - should vaQueryVideoProcPipelineCaps() detect that, or is there some 
other way to get it?

Thanks,

- Mark


 libavfilter/Makefile   |   1 +
 libavfilter/allfilters.c   |   1 +
 libavfilter/vf_process_vaapi.c | 597 +
 3 files changed, 599 insertions(+)
 create mode 100644 libavfilter/vf_process_vaapi.c

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 5cd10fa..10ffa78 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -239,6 +239,7 @@ OBJS-$(CONFIG_PIXDESCTEST_FILTER)+= 
vf_pixdesctest.o
 OBJS-$(CONFIG_PP_FILTER) += vf_pp.o
 OBJS-$(CONFIG_PP7_FILTER)+= vf_pp7.o
 OBJS-$(CONFIG_PREWITT_FILTER)+= vf_convolution.o
+OBJS-$(CONFIG_PROCESS_VAAPI_FILTER)  += vf_process_vaapi.o
 OBJS-$(CONFIG_PSNR_FILTER)   += vf_psnr.o dualinput.o 
framesync.o
 OBJS-$(CONFIG_PULLUP_FILTER) += vf_pullup.o
 OBJS-$(CONFIG_QP_FILTER) += vf_qp.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 47d95f5..0684aef 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -255,6 +255,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(PP, pp, vf);
 REGISTER_FILTER(PP7,pp7,vf);
 REGISTER_FILTER(PREWITT,prewitt,vf);
+REGISTER_FILTER(PROCESS_VAAPI,  process_vaapi,  vf);
 REGISTER_FILTER(PSNR,   psnr,   vf);
 REGISTER_FILTER(PULLUP, pullup, vf);
 REGISTER_FILTER(QP, qp, vf);
diff --git a/libavfilter/vf_process_vaapi.c b/libavfilter/vf_process_vaapi.c
new file mode 100644
index 000..25701a0
--- /dev/null
+++ b/libavfilter/vf_process_vaapi.c
@@ -0,0 +1,597 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include 
+
+#include 
+#include 
+
+#include "libavutil/avassert.h"
+#include "libavutil/hwcontext.h"
+#include "libavutil/hwcontext_vaapi.h"
+#include "libavutil/mem.h"
+#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
+
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+
+typedef struct ProcessVAAPIContext {
+const AVClass *class;
+
+AVVAAPIDeviceContext *hwctx;
+AVBufferRef *device_ref;
+
+int va_ids_set;
+VAConfigID  va_config;
+VAContextID va_context;
+
+AVBufferRef   *frames_ref;
+AVHWFramesContext *frames;
+
+int denoise;
+VAProcFilterCap denoise_caps;
+
+int sharpness;
+VAProcFilterCap sharpness_c

Re: [FFmpeg-devel] mpeg12dec fix up DVD caption handling

2016-09-13 Thread Jonathan Campbell


On 09/13/2016 12:42 PM, Moritz Barsnick wrote:
> On Mon, Sep 12, 2016 at 18:19:43 -0700, Jonathan Campbell wrote:
>> Subject: [PATCH 2/7] read caption words field-wise, count properly and limit
>>  to cc_count. transfer each CC word taking into consideration immediate CC
>>  field bit or for DVDs that don't use it, keep track according to first field
>>  specified at start of DVD caption packet.
> 
> We're apparently missing patches 3 to 6 of 7?

In the branch I wrote these patches, I wrote a quick proof-of-concept program 
to read, dump, and decode the A53 caption side data from the AVFrame to help 
confirm that the data was read correctly from various MPEG and VOB files on my 
hard drive. That code was patches 3 to 6 and not relevant to what I posted 
therefore not included.

You can look at that program on Github if you like: 
https://github.com/joncampbell123/FFmpeg/commit/98ce62db24d0d537d9ae99610c67d7caa09a0a0c.patch

> 
> Anyways, commit messages should consist of a first line as summary (not
> too long) with a prefix such as "lavc/mpeg12dec: ", then an empty line
> separating the following optional, but possibly verbose commit
> explanation or continuation. Don't try to squeeze mulitple sentences
> into the commit line. (Check other commits for reference.)

Good idea. Will do.

> 
>> +if ((p[i] & 0xfe) != 0xfe) {
>> +av_log(avctx, AV_LOG_DEBUG, "cc_count is too large (%u > 
>> %u) or junk data in DVD caption packet",(unsigned 
>> int)caption_block_count,(unsigned int)cc_count);
> 
> I don't see the need to cast ints to unsigned ints for printing. Either
> just print with %d, or use unsigned ints in the first place if you
> never (ever) need negative values.

That's true. I'm used to using printf() against library structures that may or 
may not use unsigned int or unsigned long.

> 
>> +/* if the source actually uses the caption_odd_field 
>> bit, then use that to determine the field.
>> + * else, toggle between fields to keep track for DVDs 
>> where p[0] == 0xFF at all times. */
> 
> Very nitpicky: If you use full sentences ending in a period, then also
> begin them with capitals, like writing proper text. Else my eyes hurt.
> (Or: Else it's hard finding the beginning.)

Will fix.

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

Should I make these changes and resubmit them? (except for the documentation 
patch which I saw)

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


Re: [FFmpeg-devel] lavd API discussion

2016-09-13 Thread Paul B Mahol
On 9/13/16, Josh de Kock  wrote:
> Hi all,
>
> So I know that not as many people use lavd, but I just wanted to ask a
> couple questions about the lavd/lavf APIs (but mostly about lavd), maybe
> fuel some thought about potentially developing/evolving the lavd API
> further.
>
> 1. What is the real difference between lavf and lavd?
>
> Both lavf and lavd use AVInputFormat and AVOutputFormat, and from what I
> can see, there is no real difference from lavd/lavf apart from their
> folder names, and the general types of formats which they contain.
>
> 2. Does lavd need to be extended?
>
> So I can see where the original idea may have come from for
> lavd--something which can interface with devices, similar to lavf but
> not quite as 'passive'. Except it stayed as 'passive' as lavf, whereas
> an 'active' lavd may have been able to take commands and interface with
> devices with I/O as one might need. For instance with something like a
> camera, you may need to pause, zoom-in, zoom-out, etc. Or an old tape
> camcorder could take rewind, or fast-forward commands. And I'm sure
> there are a lot more instances you can think of where input or output to
> a 'device' outside of video, audio, subtitles, etc would be useful.
>
> If I'm mistaken, then please point it out, I'm still learning about the
> code-base. (And if this discussion has happened before, please link me
> to it, I couldn't find anything, but I may have just been searching for
> the wrong thing).

Some people dislike lavd, mostly because thay do not need/use it.

I'm all for improving API and making it more useful, so it can be reused
by ffplay for example.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] lavd API discussion

2016-09-13 Thread Josh de Kock

Hi all,

So I know that not as many people use lavd, but I just wanted to ask a 
couple questions about the lavd/lavf APIs (but mostly about lavd), maybe 
fuel some thought about potentially developing/evolving the lavd API 
further.


1. What is the real difference between lavf and lavd?

Both lavf and lavd use AVInputFormat and AVOutputFormat, and from what I 
can see, there is no real difference from lavd/lavf apart from their 
folder names, and the general types of formats which they contain.


2. Does lavd need to be extended?

So I can see where the original idea may have come from for 
lavd--something which can interface with devices, similar to lavf but 
not quite as 'passive'. Except it stayed as 'passive' as lavf, whereas 
an 'active' lavd may have been able to take commands and interface with 
devices with I/O as one might need. For instance with something like a 
camera, you may need to pause, zoom-in, zoom-out, etc. Or an old tape 
camcorder could take rewind, or fast-forward commands. And I'm sure 
there are a lot more instances you can think of where input or output to 
a 'device' outside of video, audio, subtitles, etc would be useful.


If I'm mistaken, then please point it out, I'm still learning about the 
code-base. (And if this discussion has happened before, please link me 
to it, I couldn't find anything, but I may have just been searching for 
the wrong thing).


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


Re: [FFmpeg-devel] [PATCH] avfilter/af_amerge: allow merging 1 input only

2016-09-13 Thread Marton Balint


On Sat, 10 Sep 2016, Nicolas George wrote:


Le decadi 20 fructidor, an CCXXIV, Marton Balint a écrit :

Useful when the amerge filter parameters are generated from a script based on
the number of input streams, by allowing 1 input it does not have to be handled
specially.

The split filter also allows 1 output, so it is more consistent to allow
merging 1 input as well.


LGTM.



Thanks, applied.

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


[FFmpeg-devel] [PATCH] libavformat/webm_chunk: Option to specify HTTP header

2016-09-13 Thread Vignesh Venkatasubramanian
Add an option to specify HTTP header in the WebM Chunk Muxer (this
works the same way as the 'method' parameter in the HLS muxer).

Signed-off-by: Vignesh Venkatasubramanian 
---
 libavformat/webm_chunk.c | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c
index bfcde78..4c22c45 100644
--- a/libavformat/webm_chunk.c
+++ b/libavformat/webm_chunk.c
@@ -50,6 +50,7 @@ typedef struct WebMChunkContext {
 char *header_filename;
 int chunk_duration;
 int chunk_index;
+char *http_method;
 uint64_t duration_written;
 int prev_pts;
 AVOutputFormat *oformat;
@@ -112,6 +113,7 @@ static int webm_chunk_write_header(AVFormatContext *s)
 AVFormatContext *oc = NULL;
 int ret;
 int i;
+AVDictionary *options = NULL;
 
 // DASH Streams can only have either one track per file.
 if (s->nb_streams != 1) { return AVERROR_INVALIDDATA; }
@@ -128,7 +130,10 @@ static int webm_chunk_write_header(AVFormatContext *s)
 ret = get_chunk_filename(s, 1, oc->filename);
 if (ret < 0)
 return ret;
-ret = s->io_open(s, &oc->pb, oc->filename, AVIO_FLAG_WRITE, NULL);
+if (wc->http_method)
+av_dict_set(&options, "method", wc->http_method, 0);
+ret = s->io_open(s, &oc->pb, oc->filename, AVIO_FLAG_WRITE, &options);
+av_dict_free(&options);
 if (ret < 0)
 return ret;
 
@@ -166,6 +171,7 @@ static int chunk_end(AVFormatContext *s)
 uint8_t *buffer;
 AVIOContext *pb;
 char filename[MAX_FILENAME_SIZE];
+AVDictionary *options = NULL;
 
 if (wc->chunk_start_index == wc->chunk_index)
 return 0;
@@ -175,13 +181,16 @@ static int chunk_end(AVFormatContext *s)
 ret = get_chunk_filename(s, 0, filename);
 if (ret < 0)
 goto fail;
-ret = s->io_open(s, &pb, filename, AVIO_FLAG_WRITE, NULL);
+if (wc->http_method)
+av_dict_set(&options, "method", wc->http_method, 0);
+ret = s->io_open(s, &pb, filename, AVIO_FLAG_WRITE, &options);
 if (ret < 0)
 goto fail;
 avio_write(pb, buffer, buffer_size);
 ff_format_io_close(s, &pb);
 oc->pb = NULL;
 fail:
+av_dict_free(&options);
 av_free(buffer);
 return (ret < 0) ? ret : 0;
 }
@@ -243,6 +252,7 @@ static const AVOption options[] = {
 { "chunk_start_index",  "start index of the chunk", 
OFFSET(chunk_start_index), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, 
AV_OPT_FLAG_ENCODING_PARAM },
 { "header", "filename of the header where the initialization data will be 
written", OFFSET(header_filename), AV_OPT_TYPE_STRING, { 0 }, 0, 0, 
AV_OPT_FLAG_ENCODING_PARAM },
 { "audio_chunk_duration", "duration of each chunk in milliseconds", 
OFFSET(chunk_duration), AV_OPT_TYPE_INT, {.i64 = 5000}, 0, INT_MAX, 
AV_OPT_FLAG_ENCODING_PARAM },
+{ "http_method", "set the HTTP method", OFFSET(http_method), 
AV_OPT_TYPE_STRING, {.str = NULL},  0, 0, AV_OPT_FLAG_ENCODING_PARAM },
 { NULL },
 };
 
-- 
2.8.0.rc3.226.g39d4020

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


Re: [FFmpeg-devel] mpeg12dec fix up DVD caption handling

2016-09-13 Thread Moritz Barsnick
On Mon, Sep 12, 2016 at 18:19:43 -0700, Jonathan Campbell wrote:
> Subject: [PATCH 2/7] read caption words field-wise, count properly and limit
>  to cc_count. transfer each CC word taking into consideration immediate CC
>  field bit or for DVDs that don't use it, keep track according to first field
>  specified at start of DVD caption packet.

We're apparently missing patches 3 to 6 of 7?

Anyways, commit messages should consist of a first line as summary (not
too long) with a prefix such as "lavc/mpeg12dec: ", then an empty line
separating the following optional, but possibly verbose commit
explanation or continuation. Don't try to squeeze mulitple sentences
into the commit line. (Check other commits for reference.)

> +if ((p[i] & 0xfe) != 0xfe) {
> +av_log(avctx, AV_LOG_DEBUG, "cc_count is too large (%u > %u) 
> or junk data in DVD caption packet",(unsigned 
> int)caption_block_count,(unsigned int)cc_count);

I don't see the need to cast ints to unsigned ints for printing. Either
just print with %d, or use unsigned ints in the first place if you
never (ever) need negative values.

> +/* if the source actually uses the caption_odd_field 
> bit, then use that to determine the field.
> + * else, toggle between fields to keep track for DVDs 
> where p[0] == 0xFF at all times. */

Very nitpicky: If you use full sentences ending in a period, then also
begin them with capitals, like writing proper text. Else my eyes hurt.
(Or: Else it's hard finding the beginning.)
;-)

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


Re: [FFmpeg-devel] calculation of probe score

2016-09-13 Thread Dave Rice
Hi Carl,

> On Sep 13, 2016, at 2:57 PM, Carl Eugen Hoyos  wrote:
> 
> 2016-09-12 19:47 GMT+02:00 Monique Lassere :
>> Trying to dig as deeply as possible into ffprobe's probe score
>> and how it is calculated.
> 
> Is there a use case that could be interesting to us?

I think the use case if for when an archive accepts a large diverse collection 
for preservation to access probe_score per file. A lower probe_score may 
indicate that the file is broken, misnamed, mis-categorized, which could mean 
that creation of derivatives or long-term handling may need closer review.

In a related conversation about probe score I tested 2000+ random files and 
made this histogram: rate of occurrence, format name and probe_score.

149 "matroska,webm",100
672 "mov,mp4,m4a,3gp,3g2,mj2",100
  1 aac,1
  1 aac,25
  1 adp,25
 15 aiff,100
  4 asf,100
  8 avi,100
919 caf,100
 45 dv,75
  2 ea,100
  1 flac,1
  1 flac,13
  4 flac,50
  8 flv,100
  3 mp3,25
 90 mp3,51
  9 mpeg,26
  8 mpeg,52
  1 mpegts,50
  1 mpegvideo,12
 13 mpegvideo,51
 11 mxf,100
  1 ogg,100
  2 rm,100
  1 swf,100
  5 swf,26
 92 wav,99

So for instance perhaps worth a closer look at the mpegvideo with score of 12 
or the flac file with score of 1(!), before moving the file into long term 
storage.

> Or a bug you want to tell us about?
> 
> [...]
> 
>> 2. Secondly, does the probe score relate to the container format only?
> 
> As Michael said, yes.
> Note that some containers (like H.264 Annex B or ADTS) correspond
> to a codec, so for containers that "allow" random codecs (like mpeg
> streams) the same probe functions that allow detecting formats can
> be used to detect codecs.

[...]

Best Regards,
Dave Rice

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


Re: [FFmpeg-devel] calculation of probe score

2016-09-13 Thread Carl Eugen Hoyos
2016-09-12 19:47 GMT+02:00 Monique Lassere :
> Trying to dig as deeply as possible into ffprobe's probe score
> and how it is calculated.

Is there a use case that could be interesting to us?

Or a bug you want to tell us about?

[...]

> 2. Secondly, does the probe score relate to the container format only?

As Michael said, yes.
Note that some containers (like H.264 Annex B or ADTS) correspond
to a codec, so for containers that "allow" random codecs (like mpeg
streams) the same probe functions that allow detecting formats can
be used to detect codecs.

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


Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments

2016-09-13 Thread Moritz Barsnick
On Tue, Sep 13, 2016 at 11:25:39 +0800, Steven Liu wrote:
> +int byterange_mode = hls->flags & (HLS_SINGLE_FILE) || hls->max_seg_size 
> > 0;
 ^   ^
Why the bracket?

> +av_log(oc, AV_LOG_ERROR, "Invalid segment filename template 
> '%s' you can try use -use_localtime 1 with it\n", c->basename);
Rather:
   av_log(oc, AV_LOG_ERROR, "Invalid segment filename template 
'%s', you can try to use -use_localtime 1 with it\n", c->basename);

> +{"hls_segment_size", "set maximum size per segment file, (Byte)",  
> OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, 0, INT_MAX, E},
   {"hls_segment_size", "set maximum size per segment file (in bytes)",  
OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, 0, INT_MAX, E},

This isn't a flag, right? Perhaps you shouldn't be putting the option
between the flags' lines (but probably still as the final option).

The value of 0 seems to have a special meaning. Is this documented
anywhere? In other words: You should also update doc/muxers.texi. (I
can help with the grammar of the wording.)

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


Re: [FFmpeg-devel] [VDD2016] Technical Discussion Results

2016-09-13 Thread Ronald S. Bultje
Hi,

On Mon, Sep 12, 2016 at 6:01 AM, Paul B Mahol  wrote:

> On 9/12/16, Thilo Borgmann  wrote:
> > Hi,
> >
> > these are the resulting notes we've taken during the FFmpeg technical
> > discussion
> > during VDD 2016. We've ended up with two slides on the board and compn
> took
> > pictures of them. You can find them here:
> >
> > https://drive.google.com/drive/folders/0B53tgCAS2uUnVUpZN0U1WDE0MzQ?
> usp=sharing
> >
> > Additional info:
> >
> > - There were two more job offers compn forgotto write down. One from
> Alex at
> > Comcast to implement a perceptional video filter in lavfi for 4K, along
> with
> > mcdeint and denoise filters. Contact compn to get more information about
> > this.
> > Also Kodi is looking for python plugin developers. Compn also thinks that
> > they
> > are looking for Android devs, too.
> >
> > - The group working on ffv1 specification said they've also opportunities
> > for
> > work. However you've to contact the commission members at archivist
> > conferences.
> > I think we haven't got a list of these conferences, though.
> >
> > All the rest is on the slides, more or less in shape. In case anyone has
> > interest in going for one of these tasks and/or want to start a
> discussion,
> > feel
> > free to do so by posting to the mailing list.
>
> What means 'Real World Metric filters', 'RGB levels' and 'waveforms'?


The real world metric filters refers to a hypothetical, yet-to-be-written
libavfilter wrapper for Netflix' VMAF perceptual metric [1]. It would work
like vf_ssim or vf_psnr, but use VMAF. Output of individual metrics that
(in aggregate) make up VMAF would be interesting also.

Ronald

[1] https://github.com/Netflix/vmaf/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf: add avformat_transfer_internal_stream_timing_info() and use it in ffmpeg

2016-09-13 Thread James Almer
On 9/13/2016 2:42 PM, Clément Bœsch wrote:
> On Tue, Sep 13, 2016 at 02:36:46PM -0300, James Almer wrote:
> [...]
>>> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
>>> index 74915a1..389d985 100644
>>> --- a/libavformat/avformat.h
>>> +++ b/libavformat/avformat.h
>>> @@ -2894,6 +2894,27 @@ int av_apply_bitstream_filters(AVCodecContext 
>>> *codec, AVPacket *pkt,
>>> AVBitStreamFilterContext *bsfc);
>>>  #endif
>>>  
>>> +enum AVTimebaseCopyFrom {
>>
>> AVTimebaseSource? CopySource? CopyFrom sounds kinda weird.
>>
> 
> Sure, anything you prefer
> 
>>> +AVFMT_TBCF_AUTO = -1,
>>> +AVFMT_TBCF_DECODER,
>>> +AVFMT_TBCF_DEMUXER,
>>> +AVFMT_TBCF_R_FRAMERATE,
>>
>> What's the deal with r_frame_rate anyway? There's an FF_API define for it as
>> if it were deprecated, yet the field is not tagged as such and said define is
>> not wrapping all its uses.
>>
> 
> I have no idea. Should I drop it from the public enum and keep the ==2
> hack in the function until we find a clean way?

You could also wrap the enum inside a FF_API_R_FRAME_RATE check, i guess.
But in any case i was just wondering why the field (or the functionality)
is supposedly deprecated but not really. Your code is fine as is.

> 
>> LGTM with or without taking the above nit into consideration. Thanks a lot.
>>
> 
> Thanks for the review
> 

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


Re: [FFmpeg-devel] [VDD2016] Technical Discussion Results

2016-09-13 Thread Mayank Agarwal
Hi,

I am interested to join any of the tasks.

Regards
Mayank

On Mon, Sep 12, 2016 at 3:28 PM, Thilo Borgmann 
wrote:

> Hi,
>
> these are the resulting notes we've taken during the FFmpeg technical
> discussion
> during VDD 2016. We've ended up with two slides on the board and compn took
> pictures of them. You can find them here:
>
> https://drive.google.com/drive/folders/0B53tgCAS2uUnVUpZN0U1WDE0MzQ?
> usp=sharing
>
> Additional info:
>
> - There were two more job offers compn forgotto write down. One from Alex
> at
> Comcast to implement a perceptional video filter in lavfi for 4K, along
> with
> mcdeint and denoise filters. Contact compn to get more information about
> this.
> Also Kodi is looking for python plugin developers. Compn also thinks that
> they
> are looking for Android devs, too.
>
> - The group working on ffv1 specification said they've also opportunities
> for
> work. However you've to contact the commission members at archivist
> conferences.
> I think we haven't got a list of these conferences, though.
>
> All the rest is on the slides, more or less in shape. In case anyone has
> interest in going for one of these tasks and/or want to start a
> discussion, feel
> free to do so by posting to the mailing list.
>
> -Thilo
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf: add avformat_transfer_internal_stream_timing_info() and use it in ffmpeg

2016-09-13 Thread Clément Bœsch
On Tue, Sep 13, 2016 at 02:36:46PM -0300, James Almer wrote:
[...]
> > diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> > index 74915a1..389d985 100644
> > --- a/libavformat/avformat.h
> > +++ b/libavformat/avformat.h
> > @@ -2894,6 +2894,27 @@ int av_apply_bitstream_filters(AVCodecContext 
> > *codec, AVPacket *pkt,
> > AVBitStreamFilterContext *bsfc);
> >  #endif
> >  
> > +enum AVTimebaseCopyFrom {
> 
> AVTimebaseSource? CopySource? CopyFrom sounds kinda weird.
> 

Sure, anything you prefer

> > +AVFMT_TBCF_AUTO = -1,
> > +AVFMT_TBCF_DECODER,
> > +AVFMT_TBCF_DEMUXER,
> > +AVFMT_TBCF_R_FRAMERATE,
> 
> What's the deal with r_frame_rate anyway? There's an FF_API define for it as
> if it were deprecated, yet the field is not tagged as such and said define is
> not wrapping all its uses.
> 

I have no idea. Should I drop it from the public enum and keep the ==2
hack in the function until we find a clean way?

> LGTM with or without taking the above nit into consideration. Thanks a lot.
> 

Thanks for the review

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


Re: [FFmpeg-devel] [PATCH] lavf: add avformat_transfer_internal_stream_timing_info() and use it in ffmpeg

2016-09-13 Thread James Almer
On 9/13/2016 5:44 AM, Clément Bœsch wrote:
> From: Clément Bœsch 
> 
> In lavf we have access to st->internal->avctx so it's a better place
> than in ffmpeg*.c and will allow moving to codecpar.
> ---
>  doc/APIchanges |  4 
>  ffmpeg.c   | 52 --
>  libavformat/avformat.h | 21 +
>  libavformat/utils.c| 61 
> ++
>  libavformat/version.h  |  4 ++--
>  5 files changed, 92 insertions(+), 50 deletions(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 7ac809c..158a0b2 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,10 @@ libavutil: 2015-08-28
>  
>  API changes, most recent first:
>  
> +2016-09-xx - xxx - lavf 57.49.100 - avformat.h
> +  Add avformat_transfer_internal_stream_timing_info helper to help with 
> stream
> +  copy.
> +
>  2016-08-29 - 4493390 - lavfi 6.58.100 - avfilter.h
>Add AVFilterContext.nb_threads.
>  
> diff --git a/ffmpeg.c b/ffmpeg.c
> index d858407..b16b4ad 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -2909,57 +2909,13 @@ static int transcode_init(void)
>  enc_ctx->bits_per_coded_sample  = dec_ctx->bits_per_coded_sample;
>  enc_ctx->bits_per_raw_sample= dec_ctx->bits_per_raw_sample;
>  
> -enc_ctx->time_base = ist->st->time_base;
> -/*
> - * Avi is a special case here because it supports variable fps 
> but
> - * having the fps and timebase differe significantly adds quite 
> some
> - * overhead
> - */
> -if(!strcmp(oc->oformat->name, "avi")) {
> -if ( copy_tb<0 && ist->st->r_frame_rate.num
> -   && av_q2d(ist->st->r_frame_rate) >= 
> av_q2d(ist->st->avg_frame_rate)
> -   && 0.5/av_q2d(ist->st->r_frame_rate) > 
> av_q2d(ist->st->time_base)
> -   && 0.5/av_q2d(ist->st->r_frame_rate) > 
> av_q2d(dec_ctx->time_base)
> -   && av_q2d(ist->st->time_base) < 1.0/500 && 
> av_q2d(dec_ctx->time_base) < 1.0/500
> - || copy_tb==2){
> -enc_ctx->time_base.num = ist->st->r_frame_rate.den;
> -enc_ctx->time_base.den = 2*ist->st->r_frame_rate.num;
> -enc_ctx->ticks_per_frame = 2;
> -} else if (   copy_tb<0 && 
> av_q2d(dec_ctx->time_base)*dec_ctx->ticks_per_frame > 
> 2*av_q2d(ist->st->time_base)
> - && av_q2d(ist->st->time_base) < 1.0/500
> -|| copy_tb==0){
> -enc_ctx->time_base = dec_ctx->time_base;
> -enc_ctx->time_base.num *= dec_ctx->ticks_per_frame;
> -enc_ctx->time_base.den *= 2;
> -enc_ctx->ticks_per_frame = 2;
> -}
> -} else if(!(oc->oformat->flags & AVFMT_VARIABLE_FPS)
> -  && strcmp(oc->oformat->name, "mov") && 
> strcmp(oc->oformat->name, "mp4") && strcmp(oc->oformat->name, "3gp")
> -  && strcmp(oc->oformat->name, "3g2") && 
> strcmp(oc->oformat->name, "psp") && strcmp(oc->oformat->name, "ipod")
> -  && strcmp(oc->oformat->name, "f4v")
> -) {
> -if(   copy_tb<0 && dec_ctx->time_base.den
> -&& 
> av_q2d(dec_ctx->time_base)*dec_ctx->ticks_per_frame > 
> av_q2d(ist->st->time_base)
> -&& av_q2d(ist->st->time_base) < 1.0/500
> -   || copy_tb==0){
> -enc_ctx->time_base = dec_ctx->time_base;
> -enc_ctx->time_base.num *= dec_ctx->ticks_per_frame;
> -}
> -}
> -if (   enc_ctx->codec_tag == AV_RL32("tmcd")
> -&& dec_ctx->time_base.num < dec_ctx->time_base.den
> -&& dec_ctx->time_base.num > 0
> -&& 121LL*dec_ctx->time_base.num > dec_ctx->time_base.den) {
> -enc_ctx->time_base = dec_ctx->time_base;
> -}
> -
>  if (!ost->frame_rate.num)
>  ost->frame_rate = ist->framerate;
> -if(ost->frame_rate.num)
> -enc_ctx->time_base = av_inv_q(ost->frame_rate);
> +ost->st->avg_frame_rate = ost->frame_rate;
>  
> -av_reduce(&enc_ctx->time_base.num, &enc_ctx->time_base.den,
> -enc_ctx->time_base.num, enc_ctx->time_base.den, 
> INT_MAX);
> +ret = avformat_transfer_internal_stream_timing_info(oc->oformat, 
> ost->st, ist->st, copy_tb);
> +if (ret < 0)
> +return ret;
>  
>  if (ist->st->nb_side_data) {
>  ost->st->side_data = av_realloc_array(NULL, 
> ist->st->nb_side_data,
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 74915a1..389d985 100644
> --- a/libav

Re: [FFmpeg-devel] mpeg12dec fix up DVD caption handling

2016-09-13 Thread Jonathan Campbell


On 09/12/2016 07:58 PM, Michael Niedermayer wrote:
> On Mon, Sep 12, 2016 at 06:19:43PM -0700, Jonathan Campbell wrote:
>>
>>
>> On 09/12/2016 04:56 PM, Michael Niedermayer wrote:
>>> On Mon, Sep 12, 2016 at 03:28:24PM -0700, Jonathan Campbell wrote:
 These patches fix up the DVD caption handling in mpeg12dec.c to better 
 handle odd cases.
 It's based on code I've written elsewhere to handle captions.
 While it's common for these packets to contain 15 frames worth and start 
 on the odd field there are also DVDs that start on even field or even 
 encode extra fields and switch starting fields.
 Part of the patch is to document comprehensively the format of the DVD 
 caption packet.

 Jonathan Campbell
>>>
  mpeg12dec.c |   27 ++-
  1 file changed, 26 insertions(+), 1 deletion(-)
 a839a0d0e9000ab140f6aef9dee9577f242462bf  
 0001-add-comments-documenting-the-format-of-the-DVD-CC-us.patch
 From 9213012c7d8ceef2af43fe3c218b1b50728e8f80 Mon Sep 17 00:00:00 2001
 From: Jonathan Campbell 
 Date: Mon, 12 Sep 2016 12:34:48 -0700
 Subject: [PATCH 1/2] add comments documenting the format of the DVD CC
  user-data packet. this is to aid development and maintenance of that code.

 ---
  libavcodec/mpeg12dec.c | 27 ++-
  1 file changed, 26 insertions(+), 1 deletion(-)

 diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
 index 204a578..522621a 100644
 --- a/libavcodec/mpeg12dec.c
 +++ b/libavcodec/mpeg12dec.c
 @@ -2262,7 +2262,32 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
  return 1;
  } else if (buf_size >= 11 &&
 p[0] == 'C' && p[1] == 'C' && p[2] == 0x01 && p[3] == 
 0xf8) {
 -/* extract DVD CC data */
 +/* extract DVD CC data
>>>
 + * for more information see: 
 [https://en.wikipedia.org/wiki/EIA-608#DVD_GOP_User_Data_Insertion]
>>>
>>> wikipedia is not a good reference, in fact its not even a
>>> constant reference without a revission. wikipedia can massivly change
>>> and may at times, especially with niche areas be just wrong, the link
>>> itself also wont always work possibly
>>>
>>> Please use the specifications itself, H.262 is public, its the 4th
>>> link when searching for H.262 with google for example (wikipedia
>>> refers to H.262 IIUC)
>>>
>>> [...]
>>>
>>>
>>>
>>> ___
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel@ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>
>> Updated patch set, removes Wikipedia link.
>>
>> I see that H.262 specs are free on the web, but I can't find the part that 
>> describes the DVD-style H.262 user data packets that this code handles.
>>
>> But the structure as described has been reliable when tested against my DVD 
>> library.
> 
> applied the docs and wiki removial stashed
> 
> please dont send multiple patches per mail it makes keeping track of
> what needs a review hard both with MUAs as well as patchwork
> 
> [...]
> 
> 
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
Makes sense.

Would running git format-patch >patchfile work to submit it as one patch or do 
I need to squash it into one patch?

Do I need to resubmit anything?

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


Re: [FFmpeg-devel] [PATCH] ffplay: convert ffplay to use SDL2

2016-09-13 Thread James Almer
On 9/12/2016 3:58 PM, Josh de Kock wrote:
> From: Marton Balint 
> 
> Depends on the other SDL patches.
> 
> Signed-off-by: Josh de Kock 
> ---
>  configure |   6 +-
>  ffplay.c  | 594 
> ++
>  2 files changed, 249 insertions(+), 351 deletions(-)

Tested on Windows (compiled with mingw-w64) and works fine.

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


Re: [FFmpeg-devel] [PATCH 2/2] lavf/utils: sync MOV-like formats with the muxers found in lavf/movenc

2016-09-13 Thread Michael Niedermayer
On Tue, Sep 13, 2016 at 10:51:26AM +0200, Clément Bœsch wrote:
> From: Clément Bœsch 
> 
> ---
>  libavformat/utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index acb781e..35f13c1 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -5315,7 +5315,7 @@ int avformat_transfer_internal_stream_timing_info(const 
> AVOutputFormat *ofmt,
>  enc_ctx->ticks_per_frame = 2;
>  }
>  } else if (!(ofmt->flags & AVFMT_VARIABLE_FPS)
> -   && !av_match_name(ofmt->name, "mov,mp4,3g2,psp,ipod,f4v")) {
> +   && !av_match_name(ofmt->name, 
> "mov,3gp,mp4,psp,3g2,ipod,ismv,f4v")) {
>  if (copy_tb == AVFMT_TBCF_AUTO && dec_ctx->time_base.den
>  && av_q2d(dec_ctx->time_base)*dec_ctx->ticks_per_frame > 
> av_q2d(ist->time_base)
>  && av_q2d(ist->time_base) < 1.0/500

LGTM

thx

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

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


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


Re: [FFmpeg-devel] [PATCH] vf_colorspace: Add BT-names for gamma22/28 transfer option

2016-09-13 Thread Ronald S. Bultje
Hi,

On Mon, Sep 12, 2016 at 1:46 PM, Ronald S. Bultje 
wrote:

> Hi,
>
> On Mon, Sep 12, 2016 at 1:44 PM, Vittorio Giovara <
> vittorio.giov...@gmail.com> wrote:
>
>> Allows to use values returned from API and from ffprobe directly.
>>
>> Signed-off-by: Vittorio Giovara 
>> ---
>>  libavfilter/vf_colorspace.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
>> index 45fd917..b9ecb5f 100644
>> --- a/libavfilter/vf_colorspace.c
>> +++ b/libavfilter/vf_colorspace.c
>> @@ -1055,7 +1055,9 @@ static const AVOption colorspace_options[] = {
>>OFFSET(user_trc),   AV_OPT_TYPE_INT, { .i64 =
>> AVCOL_TRC_UNSPECIFIED },
>>AVCOL_TRC_RESERVED0, AVCOL_TRC_NB - 1, FLAGS, "trc" },
>>  ENUM("bt709",AVCOL_TRC_BT709,"trc"),
>> +ENUM("bt470m",   AVCOL_TRC_GAMMA22,  "trc"),
>>  ENUM("gamma22",  AVCOL_TRC_GAMMA22,  "trc"),
>> +ENUM("bt470bg",  AVCOL_TRC_GAMMA28,  "trc"),
>>  ENUM("gamma28",  AVCOL_TRC_GAMMA28,  "trc"),
>>  ENUM("smpte170m",AVCOL_TRC_SMPTE170M,"trc"),
>>  ENUM("smpte240m",AVCOL_TRC_SMPTE240M,"trc"),
>> --
>> 2.9.3
>
>
> OK.
>

Pushed.

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


[FFmpeg-devel] [PATCH 2/2] avformat/flvenc: add no_sequence_end flags for flvflags

2016-09-13 Thread Steven Liu
when split flv file by flv format at first, and cat flvs file
into one flv file, the flv sequence end is be used,
then the whole flv have many flv sequence end TAG.
this flags can give user an option to ignore write sequence end TAG

Signed-off-by: Steven Liu 
---
 libavformat/flvenc.c | 18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index a3623f8..9e95b8d 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -63,6 +63,7 @@ static const AVCodecTag flv_audio_codec_ids[] = {

 typedef enum {
 FLV_AAC_SEQ_HEADER_DETECT = (1 << 0),
+FLV_NO_SEQUENCE_END = (1 << 1),
 } FLVFlags;

 typedef struct FLVContext {
@@ -527,13 +528,15 @@ static int flv_write_trailer(AVFormatContext *s)
 FLVContext *flv = s->priv_data;
 int i;

-/* Add EOS tag */
-for (i = 0; i < s->nb_streams; i++) {
-AVCodecParameters *par = s->streams[i]->codecpar;
-FLVStreamContext *sc = s->streams[i]->priv_data;
-if (par->codec_type == AVMEDIA_TYPE_VIDEO &&
-(par->codec_id == AV_CODEC_ID_H264 || par->codec_id ==
AV_CODEC_ID_MPEG4))
-put_avc_eos_tag(pb, sc->last_ts);
+if (flv->flags & FLV_NO_SEQUENCE_END == 0) {
+/* Add EOS tag */
+for (i = 0; i < s->nb_streams; i++) {
+AVCodecParameters *par = s->streams[i]->codecpar;
+FLVStreamContext *sc = s->streams[i]->priv_data;
+if (par->codec_type == AVMEDIA_TYPE_VIDEO &&
+(par->codec_id == AV_CODEC_ID_H264 || par->codec_id ==
AV_CODEC_ID_MPEG4))
+put_avc_eos_tag(pb, sc->last_ts);
+}
 }

 file_size = avio_tell(pb);
@@ -723,6 +726,7 @@ static int flv_write_packet(AVFormatContext *s,
AVPacket *pkt)
 static const AVOption options[] = {
 { "flvflags", "FLV muxer flags", offsetof(FLVContext, flags),
AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
 { "aac_seq_header_detect", "Put AAC sequence header based on stream
data", 0, AV_OPT_TYPE_CONST, {.i64 = FLV_AAC_SEQ_HEADER_DETECT}, INT_MIN,
INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
+{ "no_sequence_end", "disable sequence end for FLV", 0,
AV_OPT_TYPE_CONST, {.i64 = FLV_NO_SEQUENCE_END}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
 { NULL },
 };

--
2.7.4 (Apple Git-66)


0002-avformat-flvenc-add-no_sequence_end-flags-for-flvfla.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2] avformat/flvenc: add FLVFlags for flvflags options

2016-09-13 Thread Steven Liu
add FLVFlags type, be used to add new FLVFlags options

Signed-off-by: Steven Liu 
---
 libavformat/flvenc.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index ccbcf64..a3623f8 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -61,6 +61,10 @@ static const AVCodecTag flv_audio_codec_ids[] = {
 { AV_CODEC_ID_NONE,   0 }
 };

+typedef enum {
+FLV_AAC_SEQ_HEADER_DETECT = (1 << 0),
+} FLVFlags;
+
 typedef struct FLVContext {
 AVClass *av_class;
 int reserved;
@@ -364,7 +368,7 @@ static void flv_write_codec_header(AVFormatContext* s,
AVCodecParameters* par) {
 avio_w8(pb, get_audio_flags(s, par));
 avio_w8(pb, 0); // AAC sequence header

-if (!par->extradata_size && flv->flags & 1) {
+if (!par->extradata_size && flv->flags &
FLV_AAC_SEQ_HEADER_DETECT) {
 PutBitContext pbc;
 int samplerate_index;
 int channels = flv->audio_par->channels
@@ -718,7 +722,7 @@ static int flv_write_packet(AVFormatContext *s,
AVPacket *pkt)

 static const AVOption options[] = {
 { "flvflags", "FLV muxer flags", offsetof(FLVContext, flags),
AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
-{ "aac_seq_header_detect", "Put AAC sequence header based on stream
data", 0, AV_OPT_TYPE_CONST, {.i64 = 1}, INT_MIN, INT_MAX,
AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
+{ "aac_seq_header_detect", "Put AAC sequence header based on stream
data", 0, AV_OPT_TYPE_CONST, {.i64 = FLV_AAC_SEQ_HEADER_DETECT}, INT_MIN,
INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
 { NULL },
 };

--
2.7.4 (Apple Git-66)


0001-avformat-flvenc-add-FLVFlags-for-flvflags-options.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] lavf/mov: fix parsing QuickTime meta after the first track

2016-09-13 Thread Michael Niedermayer
On Mon, Sep 12, 2016 at 09:02:25PM -0500, Rodger Combs wrote:
> 
> > On Sep 10, 2016, at 05:10, Michael Niedermayer  
> > wrote:
> > 
> > On Fri, Sep 09, 2016 at 08:06:39PM -0500, Rodger Combs wrote:
> >> I'm not entirely sure why found_hdlr_mdta existed to begin with, so cc-ing
> >> Tinglin Liu (who originally wrote the patch) and Derek Buitenhuis (who 
> >> signed
> >> off on it) hoping for some background. If these checks actually do have a
> >> purpose, then the `type == MKTAG('m','d','t','a')` check should be moved
> >> to before the `c->fc->nb_streams < 1` check instead of inside it.
> >> ---
> >> libavformat/isom.h |  1 -
> >> libavformat/mov.c  | 10 +++---
> >> 2 files changed, 3 insertions(+), 8 deletions(-)
> > 
> > This seems to change
> > "handler_name: sound handler" to
> > "handler_name: ilst handler"
> > 
> > for http://samples.ffmpeg.org/MPEG-4/replaygain/sample.mp4
> > 
> > is that intended ?
> 
> Hmm, this looks like a consequence of the `handler_name` key being provided 
> in multiple places on the same track, but I'm not sure `handler_name` is ever 
> meaningful to the consumer to begin with, so I'm not sure if this matters?

no idea
iam not objecting to the patch, just pointing out what i found

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Does the universe only have a finite lifespan? No, its going to go on
forever, its just that you wont like living in it. -- Hiranya Peiri


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


Re: [FFmpeg-devel] [PATCH 1/2] lavf/utils: simplify matching MOV-like formats

2016-09-13 Thread Michael Niedermayer
On Tue, Sep 13, 2016 at 11:00:27AM +0200, Clément Bœsch wrote:
> On Tue, Sep 13, 2016 at 10:51:25AM +0200, Clément Bœsch wrote:
> > From: Clément Bœsch 
> > 
> > ---
> >  libavformat/utils.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > index 92a29ae..acb781e 100644
> > --- a/libavformat/utils.c
> > +++ b/libavformat/utils.c
> > @@ -5315,9 +5315,7 @@ int 
> > avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt,
> >  enc_ctx->ticks_per_frame = 2;
> >  }
> >  } else if (!(ofmt->flags & AVFMT_VARIABLE_FPS)
> > -   && strcmp(ofmt->name, "mov") && strcmp(ofmt->name, "mp4") 
> > && strcmp(ofmt->name, "3gp")
> > -   && strcmp(ofmt->name, "3g2") && strcmp(ofmt->name, "psp") 
> > && strcmp(ofmt->name, "ipod")
> > -   && strcmp(ofmt->name, "f4v")) {
> > +   && !av_match_name(ofmt->name, "mov,mp4,3g2,psp,ipod,f4v")) {
> 
> forgot to add 3gp, which means the next commit is all about adding ismv

LGTM without missing parts


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

Those who are best at talking, realize last or never when they are wrong.


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


Re: [FFmpeg-devel] [PATCH] lavf: add avformat_transfer_internal_stream_timing_info() and use it in ffmpeg

2016-09-13 Thread Michael Niedermayer
On Tue, Sep 13, 2016 at 10:44:02AM +0200, Clément Bœsch wrote:
> From: Clément Bœsch 
> 
> In lavf we have access to st->internal->avctx so it's a better place
> than in ffmpeg*.c and will allow moving to codecpar.
> ---
>  doc/APIchanges |  4 
>  ffmpeg.c   | 52 --
>  libavformat/avformat.h | 21 +
>  libavformat/utils.c| 61 
> ++
>  libavformat/version.h  |  4 ++--
>  5 files changed, 92 insertions(+), 50 deletions(-)

LGTM, maybe give others a day or so to comment before pushing

thx

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

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato


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


Re: [FFmpeg-devel] calculation of probe score

2016-09-13 Thread Michael Niedermayer
On Mon, Sep 12, 2016 at 12:47:40PM -0500, Monique Lassere wrote:
> Hi, all,
> 
> Trying to dig as deeply as possible into ffprobe's probe score and how it
> is calculated. AVProbeData

>  contains a lot

This is the doxy for 2.2 not the latest FFmpeg


> of specific information about the tags and signatures ffprobe uses to
> identify various formats. However, I have noticed some issues that
> AVProbeData does not seem to address (in my novice ability to read C):
> 

> 1. Even if ffprobe does not find a codec ID for a given stream, it can
> still attempt to identify the stream. What type of information does ffprobe
> use to guess the stream?

The information provided by the specific demuxer


> 
> 2. Secondly, does the probe score relate to the container format only? From

yes unless i misunderstand your question


> my look at AVProbeData and the test results I've gotten, that's what it
> looks like: an example is a report from a Matroska file with an identified
> H.264 encoding (lacking an identifiable tag) achieving a score of 100, and
> many others. Therefore, it seems like ffprobe only returns a lower probe
> score if data is missing from the container format.
> 
> Thanks for any thoughts or input.
> 
> Best,
> 
> Monique Lassere
> 
> M.S. Candidate in Library & Information Science, UIUC
> Graduate Assistant at Research & Information Services
> Graduate Hourly at the Rare Book & Manuscript Library
> Format Registry Manager at Digital Bedrock
> LinkedIn  || 847-361-0047
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire


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


Re: [FFmpeg-devel] [PATCH 1/2] lavf/utils: simplify matching MOV-like formats

2016-09-13 Thread Clément Bœsch
On Tue, Sep 13, 2016 at 10:51:25AM +0200, Clément Bœsch wrote:
> From: Clément Bœsch 
> 
> ---
>  libavformat/utils.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 92a29ae..acb781e 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -5315,9 +5315,7 @@ int avformat_transfer_internal_stream_timing_info(const 
> AVOutputFormat *ofmt,
>  enc_ctx->ticks_per_frame = 2;
>  }
>  } else if (!(ofmt->flags & AVFMT_VARIABLE_FPS)
> -   && strcmp(ofmt->name, "mov") && strcmp(ofmt->name, "mp4") && 
> strcmp(ofmt->name, "3gp")
> -   && strcmp(ofmt->name, "3g2") && strcmp(ofmt->name, "psp") && 
> strcmp(ofmt->name, "ipod")
> -   && strcmp(ofmt->name, "f4v")) {
> +   && !av_match_name(ofmt->name, "mov,mp4,3g2,psp,ipod,f4v")) {

forgot to add 3gp, which means the next commit is all about adding ismv

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


[FFmpeg-devel] [PATCH 2/2] lavf/utils: sync MOV-like formats with the muxers found in lavf/movenc

2016-09-13 Thread Clément Bœsch
From: Clément Bœsch 

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

diff --git a/libavformat/utils.c b/libavformat/utils.c
index acb781e..35f13c1 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -5315,7 +5315,7 @@ int avformat_transfer_internal_stream_timing_info(const 
AVOutputFormat *ofmt,
 enc_ctx->ticks_per_frame = 2;
 }
 } else if (!(ofmt->flags & AVFMT_VARIABLE_FPS)
-   && !av_match_name(ofmt->name, "mov,mp4,3g2,psp,ipod,f4v")) {
+   && !av_match_name(ofmt->name, 
"mov,3gp,mp4,psp,3g2,ipod,ismv,f4v")) {
 if (copy_tb == AVFMT_TBCF_AUTO && dec_ctx->time_base.den
 && av_q2d(dec_ctx->time_base)*dec_ctx->ticks_per_frame > 
av_q2d(ist->time_base)
 && av_q2d(ist->time_base) < 1.0/500
-- 
2.9.3

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


[FFmpeg-devel] [PATCH 1/2] lavf/utils: simplify matching MOV-like formats

2016-09-13 Thread Clément Bœsch
From: Clément Bœsch 

---
 libavformat/utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 92a29ae..acb781e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -5315,9 +5315,7 @@ int avformat_transfer_internal_stream_timing_info(const 
AVOutputFormat *ofmt,
 enc_ctx->ticks_per_frame = 2;
 }
 } else if (!(ofmt->flags & AVFMT_VARIABLE_FPS)
-   && strcmp(ofmt->name, "mov") && strcmp(ofmt->name, "mp4") && 
strcmp(ofmt->name, "3gp")
-   && strcmp(ofmt->name, "3g2") && strcmp(ofmt->name, "psp") && 
strcmp(ofmt->name, "ipod")
-   && strcmp(ofmt->name, "f4v")) {
+   && !av_match_name(ofmt->name, "mov,mp4,3g2,psp,ipod,f4v")) {
 if (copy_tb == AVFMT_TBCF_AUTO && dec_ctx->time_base.den
 && av_q2d(dec_ctx->time_base)*dec_ctx->ticks_per_frame > 
av_q2d(ist->time_base)
 && av_q2d(ist->time_base) < 1.0/500
-- 
2.9.3

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


[FFmpeg-devel] 2 small patches on top of the avformat_transfer_internal_stream_timing_info() patch

2016-09-13 Thread Clément Bœsch
$subj

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


[FFmpeg-devel] [PATCH] lavf: add avformat_transfer_internal_stream_timing_info() and use it in ffmpeg

2016-09-13 Thread Clément Bœsch
From: Clément Bœsch 

In lavf we have access to st->internal->avctx so it's a better place
than in ffmpeg*.c and will allow moving to codecpar.
---
 doc/APIchanges |  4 
 ffmpeg.c   | 52 --
 libavformat/avformat.h | 21 +
 libavformat/utils.c| 61 ++
 libavformat/version.h  |  4 ++--
 5 files changed, 92 insertions(+), 50 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 7ac809c..158a0b2 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-09-xx - xxx - lavf 57.49.100 - avformat.h
+  Add avformat_transfer_internal_stream_timing_info helper to help with stream
+  copy.
+
 2016-08-29 - 4493390 - lavfi 6.58.100 - avfilter.h
   Add AVFilterContext.nb_threads.
 
diff --git a/ffmpeg.c b/ffmpeg.c
index d858407..b16b4ad 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2909,57 +2909,13 @@ static int transcode_init(void)
 enc_ctx->bits_per_coded_sample  = dec_ctx->bits_per_coded_sample;
 enc_ctx->bits_per_raw_sample= dec_ctx->bits_per_raw_sample;
 
-enc_ctx->time_base = ist->st->time_base;
-/*
- * Avi is a special case here because it supports variable fps but
- * having the fps and timebase differe significantly adds quite 
some
- * overhead
- */
-if(!strcmp(oc->oformat->name, "avi")) {
-if ( copy_tb<0 && ist->st->r_frame_rate.num
-   && av_q2d(ist->st->r_frame_rate) >= 
av_q2d(ist->st->avg_frame_rate)
-   && 0.5/av_q2d(ist->st->r_frame_rate) > 
av_q2d(ist->st->time_base)
-   && 0.5/av_q2d(ist->st->r_frame_rate) > 
av_q2d(dec_ctx->time_base)
-   && av_q2d(ist->st->time_base) < 1.0/500 && 
av_q2d(dec_ctx->time_base) < 1.0/500
- || copy_tb==2){
-enc_ctx->time_base.num = ist->st->r_frame_rate.den;
-enc_ctx->time_base.den = 2*ist->st->r_frame_rate.num;
-enc_ctx->ticks_per_frame = 2;
-} else if (   copy_tb<0 && 
av_q2d(dec_ctx->time_base)*dec_ctx->ticks_per_frame > 
2*av_q2d(ist->st->time_base)
- && av_q2d(ist->st->time_base) < 1.0/500
-|| copy_tb==0){
-enc_ctx->time_base = dec_ctx->time_base;
-enc_ctx->time_base.num *= dec_ctx->ticks_per_frame;
-enc_ctx->time_base.den *= 2;
-enc_ctx->ticks_per_frame = 2;
-}
-} else if(!(oc->oformat->flags & AVFMT_VARIABLE_FPS)
-  && strcmp(oc->oformat->name, "mov") && 
strcmp(oc->oformat->name, "mp4") && strcmp(oc->oformat->name, "3gp")
-  && strcmp(oc->oformat->name, "3g2") && 
strcmp(oc->oformat->name, "psp") && strcmp(oc->oformat->name, "ipod")
-  && strcmp(oc->oformat->name, "f4v")
-) {
-if(   copy_tb<0 && dec_ctx->time_base.den
-&& 
av_q2d(dec_ctx->time_base)*dec_ctx->ticks_per_frame > av_q2d(ist->st->time_base)
-&& av_q2d(ist->st->time_base) < 1.0/500
-   || copy_tb==0){
-enc_ctx->time_base = dec_ctx->time_base;
-enc_ctx->time_base.num *= dec_ctx->ticks_per_frame;
-}
-}
-if (   enc_ctx->codec_tag == AV_RL32("tmcd")
-&& dec_ctx->time_base.num < dec_ctx->time_base.den
-&& dec_ctx->time_base.num > 0
-&& 121LL*dec_ctx->time_base.num > dec_ctx->time_base.den) {
-enc_ctx->time_base = dec_ctx->time_base;
-}
-
 if (!ost->frame_rate.num)
 ost->frame_rate = ist->framerate;
-if(ost->frame_rate.num)
-enc_ctx->time_base = av_inv_q(ost->frame_rate);
+ost->st->avg_frame_rate = ost->frame_rate;
 
-av_reduce(&enc_ctx->time_base.num, &enc_ctx->time_base.den,
-enc_ctx->time_base.num, enc_ctx->time_base.den, 
INT_MAX);
+ret = avformat_transfer_internal_stream_timing_info(oc->oformat, 
ost->st, ist->st, copy_tb);
+if (ret < 0)
+return ret;
 
 if (ist->st->nb_side_data) {
 ost->st->side_data = av_realloc_array(NULL, 
ist->st->nb_side_data,
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 74915a1..389d985 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2894,6 +2894,27 @@ int av_apply_bitstream_filters(AVCodecContext *codec, 
AVPacket *pkt,
AVBitStreamFilterContext *bsfc);
 #endif
 
+enum AVTimebaseCopyFrom {
+AVFMT_TBCF_AUTO = -1,
+   

Re: [FFmpeg-devel] [PATCH] lavf/matroska: expose stream encoding as global side-data

2016-09-13 Thread Michael Niedermayer
Hi

On Mon, Sep 12, 2016 at 09:45:14PM -0500, Rodger Combs wrote:
> Some demuxers can't handle Matroska compression, so this lets API users
> check if a file uses it and determine whether those players will fail.

I think this should be usig AV_OPT_FLAG_READONLY instead of side data

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

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein


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


Re: [FFmpeg-devel] Strategy to optimally playback audio & video

2016-09-13 Thread Matthieu Beghin
Ok. Thanks for your replies. Keeping the audio in separate files is an idea, 
but I’d like to be able to work directly with a movie, without recompression.
I found a solution to my problem: when the audio thread needs data, I read all 
packets but I only decompress audio packets, video packets are pushed in a 
queue and decompressed later from the graphic engine thread.
Thanks and sorry for posting at the wrong place !
Matt

> On 13 Sep 2016, at 00:10, Sven C. Dack  wrote:
> 
> On 11/09/16 20:37, Matthieu Beghin wrote:
>> I see various solutions:
>> 
>>  1- I could put in cache more than one second of audio and video and I 
>> should be ok, but with 4k movies, keeping 30 frames could imply using a huge 
>> amount of memory and I would like to avoid that.
>>  2- I could open the file twice, one for video and one for audio, but I 
>> would use even more RAM and it would decrease performances because parsing 
>> the file twice
>>  3- I could avoid decoding video frames if I’m missing audio data but that 
>> would imply seeking back after to get a clean video frame (so decoding again 
>> from previous keyframe), so I think that’s not a option at all.
>>  4- Any better option ?
>> 
> 
> Keep audio and video in separate files. YouTube seems to be doing this for 
> their 4K videos.
> 
> If you cannot cache the video for long then cache the audio so it can cause 
> less of a problem.
> 
> Divide and conquer...
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] lavf/matroska: expose stream encoding as global side-data

2016-09-13 Thread Hendrik Leppkes
On Tue, Sep 13, 2016 at 4:45 AM, Rodger Combs  wrote:
> Some demuxers can't handle Matroska compression, so this lets API users
> check if a file uses it and determine whether those players will fail.
>
> Currently only exports the first encoding; the format technically supports
> multiple, but I can't find an example of this and lavf doesn't support it.


I'm not really a fan of having a global side data thats specific to
one format, and not even useful beyond conveying information to a user
(which a log message could do). Can't you just export a string in
metadata or something? That way it ends up self-contained in matroska.

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