Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: creation of hls variant streams with master playlist in a single hlsenc instance

2017-11-16 Thread Bang He
how to use the feature

On Thu, Nov 16, 2017 at 5:10 PM, 刘歧  wrote:

>
> > 在 2017年11月16日,17:01,Dixit, Vishwanath  写道:
> >
> >
> >
> >> On 11/16/17, 12:09 PM, "刘歧"  wrote:
> >>
> >>   FATE test passed:  Ubuntu, OS X, qemu+MIPS Linux,  wine MingW,
> qemu+ARM Linux, Thanks.
> >>
> >> +if (p) {
> >>   +strcpy(extension, p);
> >>   What about use av_strlcpy ?
> >>
> >> +while (q < varstr + strlen(varstr)) {
> >>  +if (!strncmp(q, "a:", 2) || !strncmp(q, "v:", 2) ||
> >>  +!strncmp(q, "s:", 2))
> >>  What about use av_strcasecmp ?
> >>
> >> +} else {
> >>   +av_log(s, AV_LOG_ERROR, "Invalid keyval %s\n",
> keyval);
> >>   +return -1;
> >>   What about use return AVERROR(EINVAL)?
> >>
> >> +} else {
> >>  +av_log(s, AV_LOG_ERROR, "Unable to map stream at
> %s\n", keyval);
> >>  +return -1;
> >>  same as above.
> >>
> >> +strrchr(master_url, '\\');
> >>   +if (p) {
> >>   +base_len = abs(p - master_url);
> >>   use FFABS
> >>
> >>  +if (strncmp(master_url, media_url, base_len)) {
> >>  use av_strcasecmp
> >
> > I have made updates for all the review comments. Please find the updated
> patch set in the attachment.
> >
> >
> > <0001-avformat-hlsenc-creation-of-hls-variant-streams-in-a.patch><0002-
> avformat-hlsenc-creation-of-hls-master-playlist-file.
> patch><0003-tests-fate-addition-of-test-case-for-hls-
> variant-str.patch>___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> Patchset LGTM, i will apply these patch after 24 hours if there have no
> objections
>
> Thanks
>
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffmpeg: add return value check to suppress the build warning.

2017-11-22 Thread Bang He
is it necessary to check AVERROR_EOF?

On Thu, Nov 23, 2017 at 1:14 PM, Jun Zhao  wrote:

>
>
> On 2017/11/23 11:00, Carl Eugen Hoyos wrote:
> > 2017-11-20 10:07 GMT+01:00 刘歧 :
> >
> >> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> >> index babd85f7bc..0c16e75ab0 100644
> >> --- a/fftools/ffmpeg.c
> >> +++ b/fftools/ffmpeg.c
> >> @@ -220,13 +220,18 @@ static void sub2video_push_ref(InputStream *ist,
> int64_t pts)
> >>  {
> >>  AVFrame *frame = ist->sub2video.frame;
> >>  int i;
> >> +int ret;
> >>
> >>  av_assert1(frame->data[0]);
> >>  ist->sub2video.last_pts = frame->pts = pts;
> >> -for (i = 0; i < ist->nb_filters; i++)
> >> -av_buffersrc_add_frame_flags(ist->filters[i]->filter, frame,
> >> - AV_BUFFERSRC_FLAG_KEEP_REF |
> >> - AV_BUFFERSRC_FLAG_PUSH);
> >> +for (i = 0; i < ist->nb_filters; i++) {
> >> +ret = av_buffersrc_add_frame_flags(ist->filters[i]->filter,
> frame,
> >> +   AV_BUFFERSRC_FLAG_KEEP_REF |
> >> +   AV_BUFFERSRC_FLAG_PUSH);
> >> +if (ret != AVERROR_EOF && ret < 0)
> >> +av_log(NULL, AV_LOG_WARNING, "Error while add the frame to
> buffer source(%s).\n",
> > Nicolas had a comment about this change:
> > http://ffmpeg.org/pipermail/ffmpeg-devel/2017-February/207015.html
> >
> > Carl Eugen
> I didn't know you have submitted a similar patch and Nicolas had some
> comments about the change
> before this mail, will update the warning/error message as the comments.
> Tks.
> > ___
> > 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 mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH V2] lavc/vp8: Fix HWAccel VP8 decoder can't support resolution change.

2017-12-05 Thread Bang He
what is V1 and V2?

On Tue, Dec 5, 2017 at 11:03 AM, Jun Zhao  wrote:

> ping ?
>
> On 2017/11/30 7:53, Jun Zhao wrote:
> > V2: fix the V1 lead to webp crash issue.
>
> ___
> 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] avfilter/formats: fix wrong function name in error message

2017-12-05 Thread Bang He
I prefer option 1). and microsoft vc++ uspport __FUNCTION__

On Tue, Dec 5, 2017 at 1:42 PM, Jun Zhao  wrote:

>
>
> On 2017/12/5 2:32, Michael Niedermayer wrote:
> > On Mon, Dec 04, 2017 at 11:07:11AM +0100, Hendrik Leppkes wrote:
> >> On Mon, Dec 4, 2017 at 10:53 AM, Moritz Barsnick 
> wrote:
> >>> On Mon, Dec 04, 2017 at 13:02:20 +0800, Jun Zhao wrote:
>  Use perdefined micro __FUNCTION__ rather than hard coding function
> name
>  to fix wrong function name in error message.
> >>> AFAICT, "__FUNCTION__" is a C99 feature and thereby not supported by
> >>> ffmpeg style. Or should it be? (It might be "supported by all compilers
> >>> we care about".)
> >>>
> >>> http://ffmpeg.org/developer.html#C-language-features
> >>>
> >> __FUNCTION__ is not C99, its a compiler extension (which is understood
> >> by GCC and some other compilers). __func__ is the C99 keyword.
> >> Its likely that not all compilers we currently support would have
> >> __func__, if they all have __FUNCTION__ however I cannot tell.
> > There are some matches for __FUNCTION__ in git, so i wonder if all
> > compilers we support do support it
> So now we have 2 option:
>
> 1). Find a ways to get the current function on different platforms in
> C90,
> https://stackoverflow.com/questions/7008485/func-or-
> function-or-manual-const-char-id
> have some information for this way. (lot of #if defined )
> 2). Just remove __FUNCTION__ from the code. Total 5 __FUNCTION__ in
> source code when grep the code.
>
> Personally, I prefer option 2 than option 1, any comments?
> >
> > [...]
> >
> >
> > ___
> > 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 mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/libx265.c - Add named option to set profile

2017-12-05 Thread Bang He
i approve

On Tue, Dec 5, 2017 at 5:22 PM, Gyan Doshi  wrote:

>
> On 12/5/2017 2:33 PM, Hendrik Leppkes wrote:
>
>>
>> Please just name the option "profile" to stay consistent with all the
>> other encoders.
>>
>
> Revised patch attached.
>
> ___
> 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] avcodec/libx265.c - Add named option to set profile

2017-12-05 Thread Bang He
can it list profiles and levels?

On Wed, Dec 6, 2017 at 6:38 AM, Lou Logan  wrote:

> On Tue, 5 Dec 2017 19:46:09 +0530
> Gyan Doshi  wrote:
>
> > From 13ad80871978fe7e5837863e0e2f7b7d6b356155 Mon Sep 17 00:00:00 2001
> > From: Gyan Doshi 
> > Date: Tue, 5 Dec 2017 13:17:53 +0530
> > Subject: [PATCH] avcodec/libx265 - Add named option to set profile
> >
> > Adds call to x265_param_apply_profile after x265_param_parse.
> > Added as private option since HEVC profiles other than
> > Main, Main 10 and MSP in AVCodecContext are consolidated in a single
> > constant.
> > ---
> >  libavcodec/libx265.c | 9 +
> >  libavcodec/version.h | 2 +-
> >  2 files changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
> > index 4456e300f2..4058deac1c 100644
> > --- a/libavcodec/libx265.c
> > +++ b/libavcodec/libx265.c
> > @@ -45,6 +45,7 @@ typedef struct libx265Context {
> >  int   forced_idr;
> >  char *preset;
> >  char *tune;
> > +char *profile;
> >  char *x265_opts;
> >  } libx265Context;
> >
> > @@ -220,6 +221,13 @@ static av_cold int libx265_encode_init(AVCodecContext
> *avctx)
> >  }
> >  }
> >
> > +if (ctx->profile) {
> > +if (ctx->api->param_apply_profile(ctx->params, ctx->profile) <
> 0) {
> > +av_log(avctx, AV_LOG_ERROR, "Invalid or incompatible
> profile set : %s.\n", ctx->profile);
>
> Nit: change "set :" to "set:".
>
> Would it be possible to list the profiles with x265_profile_names
> similar to what is done for libx264?
> ___
> 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 24/29] avcodec/qsv: remove YUVJ pixel format usage

2017-12-12 Thread Bang He
hi, why need to remove this format?

On Sun, Dec 10, 2017 at 9:14 PM, Paul B Mahol  wrote:

> Signed-off-by: Paul B Mahol 
> ---
>  libavcodec/qsv.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
> index 250b4e61e3..6eee40a222 100644
> --- a/libavcodec/qsv.c
> +++ b/libavcodec/qsv.c
> @@ -171,7 +171,6 @@ int ff_qsv_map_pixfmt(enum AVPixelFormat format,
> uint32_t *fourcc)
>  {
>  switch (format) {
>  case AV_PIX_FMT_YUV420P:
> -case AV_PIX_FMT_YUVJ420P:
>  case AV_PIX_FMT_NV12:
>  *fourcc = MFX_FOURCC_NV12;
>  return AV_PIX_FMT_NV12;
> --
> 2.11.0
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] ffmpeg have program decoding ACC ltam audo stream

2017-09-28 Thread Bang He
how to download the ts file

TS file  http://www99.zippyshare.com/v/UwxzRccM/file.html

On Fri, Sep 29, 2017 at 9:50 AM,  wrote:

> Thanks Carl;
>
> But the first audio track - Stream #0:4[0x3a2](zho): Audio: aac_latm
> (HE-AAC) ([17][0][0][0] / 0x0011), 48000 Hz, 5.1, fltp
>
> Produce funny audio sound
>
> Thanks
>
>
> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of
> Carl Eugen Hoyos
> Sent: Thursday, September 28, 2017 10:45 PM
> To: FFmpeg development discussions and patches 
> Subject: Re: [FFmpeg-devel] ffmpeg have program decoding ACC ltam audo
> stream
>
> 2017-09-28 6:09 GMT+02:00  :
>
> > TS file  http://www99.zippyshare.com/v/UwxzRccM/file.html
>
> Thank you for the sample.
>
> Damaged transport streams show all kind of messages, but the sample can be
> decoded.
>
> Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH][RFC]lavu/mem: Allow allocations close to max_alloc_size with av_fast_realloc()

2018-01-02 Thread Bang He
what is the mean:   min_size + min_size / 16 + 32

On Tue, Jan 2, 2018 at 9:00 AM, Carl Eugen Hoyos  wrote:

> 2018-01-02 1:14 GMT+01:00 Michael Niedermayer :
> > On Mon, Jan 01, 2018 at 11:10:57PM +0100, Carl Eugen Hoyos wrote:
> >> Hi!
> >>
> >> Similar reason as last mem.c patch: av_fast_realloc() can currently
> >> fail in situations where the allocation is possible and allowed.
> >> The patch does not change behaviour for the failure case, if this is
> >> wanted, it should be done separately.
> >>
> >> Please comment, Carl Eugen
> >
> >>  mem.c |5 -
> >>  1 file changed, 4 insertions(+), 1 deletion(-)
> >> 7529e1d584c62ece463f4461279ea6e3973162c9  0001-lavu-mem-Allow-
> allocations-close-to-max_alloc_size-w.patch
> >> From ac69f4e8402f7c7ee6df09c0450354e2bb900e5a Mon Sep 17 00:00:00 2001
> >> From: Carl Eugen Hoyos 
> >> Date: Mon, 1 Jan 2018 23:04:58 +0100
> >> Subject: [PATCH] lavu/mem: Allow allocations close to max_alloc_size
> with
> >>  av_fast_realloc().
> >>
> >> ---
> >>  libavutil/mem.c |5 -
> >>  1 file changed, 4 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/libavutil/mem.c b/libavutil/mem.c
> >> index 0729e1d..934987f 100644
> >> --- a/libavutil/mem.c
> >> +++ b/libavutil/mem.c
> >> @@ -466,7 +466,10 @@ void *av_fast_realloc(void *ptr, unsigned int
> *size, size_t min_size)
> >>  if (min_size <= *size)
> >>  return ptr;
> >>
> >> -min_size = FFMAX(min_size + min_size / 16 + 32, min_size);
> >> +if (min_size > (max_alloc_size - 32))
> >> +return NULL;
> >
> > This failure mode differs from the existing in what it does with *size
>
> New patch attached.
>
> Thank you, Carl Eugen
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v4] lavc/audiotoolboxenc: fix noise in encoded audio

2018-01-02 Thread Bang He
maybe you should  return 1, not return ret

On Wed, Jan 3, 2018 at 12:54 PM,  wrote:

> From: Jiejun Zhang 
>
> This fixes #6940
>
> Although undocumented, AudioToolbox seems to require the data supplied
> by the callback (i.e. ffat_encode_callback) being unchanged until the
> next time the callback is called. In the old implementation, the
> AVBuffer backing the frame is recycled after the frame is freed, and
> somebody else (maybe the decoder) will write into the AVBuffer and
> change the data. AudioToolbox then encodes some wrong data and noise
> is produced. Retaining a frame reference solves this problem.
> ---
>  libavcodec/audiotoolboxenc.c | 14 ++
>  1 file changed, 14 insertions(+)
>
> diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
> index 71885d1530..4d8130af96 100644
> --- a/libavcodec/audiotoolboxenc.c
> +++ b/libavcodec/audiotoolboxenc.c
> @@ -48,6 +48,8 @@ typedef struct ATDecodeContext {
>  AudioFrameQueue afq;
>  int eof;
>  int frame_size;
> +
> +AVFrame* encoding_frame;
>  } ATDecodeContext;
>
>  static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile)
> @@ -442,6 +444,10 @@ static av_cold int ffat_init_encoder(AVCodecContext
> *avctx)
>
>  ff_af_queue_init(avctx, &at->afq);
>
> +at->encoding_frame = av_frame_alloc();
> +if (!at->encoding_frame)
> +return AVERROR(ENOMEM);
> +
>  return 0;
>  }
>
> @@ -453,6 +459,7 @@ static OSStatus ffat_encode_callback(AudioConverterRef
> converter, UInt32 *nb_pac
>  AVCodecContext *avctx = inctx;
>  ATDecodeContext *at = avctx->priv_data;
>  AVFrame *frame;
> +int ret;
>
>  if (!at->frame_queue.available) {
>  if (at->eof) {
> @@ -475,6 +482,12 @@ static OSStatus ffat_encode_callback(AudioConverterRef
> converter, UInt32 *nb_pac
>  if (*nb_packets > frame->nb_samples)
>  *nb_packets = frame->nb_samples;
>
> +av_frame_unref(at->encoding_frame);
> +if ((ret = av_frame_ref(at->encoding_frame, frame)) < 0) {
> +*nb_packets = 0;
> +return ret;
> +}
> +
>  ff_bufqueue_add(avctx, &at->used_frame_queue, frame);
>
>  return 0;
> @@ -565,6 +578,7 @@ static av_cold int ffat_close_encoder(AVCodecContext
> *avctx)
>  ff_bufqueue_discard_all(&at->frame_queue);
>  ff_bufqueue_discard_all(&at->used_frame_queue);
>  ff_af_queue_close(&at->afq);
> +av_frame_free(&at->encoding_frame);
>  return 0;
>  }
>
> --
> 2.14.3 (Apple Git-98)
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 4/4] avfilter: use a mutex instead of atomics in avfilter_register()

2018-01-04 Thread Bang He
i think we do not need lock. and we need keep on the last codec pointer.



On Fri, Jan 5, 2018 at 2:28 AM, wm4  wrote:

> On Thu,  4 Jan 2018 15:19:04 -0300
> James Almer  wrote:
>
> > Signed-off-by: James Almer 
> > ---
> > With this, the last users of libavutil's atomic wrappers are dealt
> > with.
>
> Technically, you need to lock when reading the next pointers too? Don't
> know if that actually matters.
> ___
> 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 1/6] fate: add atrac3p conversion test

2018-01-05 Thread Bang He
On Wed, Jan 3, 2018 at 5:24 AM, Michael Niedermayer 
wrote:

> On Sun, Dec 31, 2017 at 05:46:02PM +0800, mi...@brew.sh wrote:
> > From: Misty De Meo 
> >
> > ---
> >  tests/fate/atrac.mak | 4 
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/tests/fate/atrac.mak b/tests/fate/atrac.mak
> > index acf79a539c..1707373890 100644
> > --- a/tests/fate/atrac.mak
> > +++ b/tests/fate/atrac.mak
> > @@ -31,6 +31,10 @@ FATE_ATRAC3P += fate-atrac3p-2
> >  fate-atrac3p-2: CMD = pcm -i $(TARGET_SAMPLES)/atrac3p/
> sonateno14op27-2-cut.aa3
> >  fate-atrac3p-2: REF = $(SAMPLES)/atrac3p/sonateno14op27-2-cut.pcm
> >
> > +FATE_ATRAC3P += fate-atrac3p-3
> > +fate-atrac3p-3: CMD = pcm -i $(TARGET_SAMPLES)/atrac3p/bgm01.at3
> > +fate-atrac3p-3: REF = $(SAMPLES)/atrac3p/bgm01.s16
>
> the reference file is a bit big but test works andf LGTM
>
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The educated differ from the uneducated as much as the living from the
> dead. -- Aristotle
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
how to run the test?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/7] avformat: add url field to AVFormatContext

2018-01-07 Thread Bang He
On Sun, Jan 7, 2018 at 4:50 AM, Marton Balint  wrote:

> This will replace the 1024 character limited filename field. Compatiblity
> for
> output contexts are provided by copying filename field to URL if URL is
> unset
> and by providing an internal function for muxers to set both url and
> filename
> at once.
>
> Signed-off-by: Marton Balint 
> ---
>  doc/APIchanges |  3 +++
>  libavformat/avformat.h | 15 +++
>  libavformat/internal.h |  7 +++
>  libavformat/mux.c  | 11 ++-
>  libavformat/utils.c| 14 ++
>  libavformat/version.h  |  2 +-
>  6 files changed, 50 insertions(+), 2 deletions(-)
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index d66c842521..4a91b7460a 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,9 @@ libavutil: 2017-10-21
>
>  API changes, most recent first:
>
> +2018-xx-xx - xxx - lavf 58.4.100 - avformat.h
> +  Add url field to AVFormatContext and add ff_format_set_url helper
> function.
> +
>  2018-01-xx - xxx - lavfi 7.11.101 - avfilter.h
>Deprecate avfilter_link_get_channels(). Use
> av_buffersink_get_channels().
>
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 4f2798a871..9fa25abd90 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -1391,6 +1391,21 @@ typedef struct AVFormatContext {
>  char filename[1024];
>
>  /**
> + * input or output URL. Unlike the old filename field, this field has
> no
> + * length restriction.
> + *
> + * - demuxing: set by avformat_open_input(), initialized to an empty
> + * string if url parameter was NULL in
> avformat_open_input().
> + * - muxing: may be set by the caller before calling
> avformat_write_header()
> + *   (or avformat_init_output() if that is called first) to a
> string
> + *   which is freeable by av_free(). Set to an empty string
> if it
> + *   was NULL in avformat_init_output().
> + *
> + * Freed by libavformat in avformat_free_context().
> + */
> +char *url;
> +
> +/**
>   * Position of the first frame of the component, in
>   * AV_TIME_BASE fractional seconds. NEVER set this value directly:
>   * It is deduced from the AVStream values.
> diff --git a/libavformat/internal.h b/libavformat/internal.h
> index 0cd0556dc7..1e2a3e05a1 100644
> --- a/libavformat/internal.h
> +++ b/libavformat/internal.h
> @@ -696,4 +696,11 @@ int ff_interleaved_peek(AVFormatContext *s, int
> stream,
>  int ff_lock_avformat(void);
>  int ff_unlock_avformat(void);
>
> +/**
> + * Set AVFormatContext url field to the provided pointer. The pointer must
> + * point to a valid string. The existing url field is freed if necessary.
> Also
> + * set the legacy filename field to the same string which was provided in
> url.
> + */
> +void ff_format_set_url(AVFormatContext *s, char *url);
> +
>  #endif /* AVFORMAT_INTERNAL_H */
> diff --git a/libavformat/mux.c b/libavformat/mux.c
> index ea9f13fdf5..de63f2ca25 100644
> --- a/libavformat/mux.c
> +++ b/libavformat/mux.c
> @@ -186,8 +186,12 @@ int avformat_alloc_output_context2(AVFormatContext
> **avctx, AVOutputFormat *ofor
>  } else
>  s->priv_data = NULL;
>
> -if (filename)
> +if (filename) {
>  av_strlcpy(s->filename, filename, sizeof(s->filename));
> +if (!(s->url = av_strdup(filename)))
> +goto nomem;
> +
> +}
>  *avctx = s;
>  return 0;
>  nomem:
> @@ -251,6 +255,11 @@ static int init_muxer(AVFormatContext *s,
> AVDictionary **options)
>  (ret = av_opt_set_dict2(s->priv_data, &tmp,
> AV_OPT_SEARCH_CHILDREN)) < 0)
>  goto fail;
>
> +if (!s->url && !(s->url = av_strdup(s->filename))) {
> +ret = AVERROR(ENOMEM);
> +goto fail;
> +}
> +
>  #if FF_API_LAVF_AVCTX
>  FF_DISABLE_DEPRECATION_WARNINGS
>  if (s->nb_streams && s->streams[0]->codec->flags &
> AV_CODEC_FLAG_BITEXACT) {
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 2185a6f05b..fdfd3a088d 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -551,6 +551,11 @@ int avformat_open_input(AVFormatContext **ps, const
> char *filename,
>  if ((ret = av_opt_set_dict(s, &tmp)) < 0)
>  goto fail;
>
> +if (!(s->url = av_strdup(filename ? filename : ""))) {
> +ret = AVERROR(ENOMEM);
> +goto fail;
> +}
> +
>  av_strlcpy(s->filename, filename ? filename : "",
> sizeof(s->filename));
>  if ((ret = init_input(s, filename, &tmp)) < 0)
>  goto fail;
> @@ -4357,6 +4362,7 @@ void avformat_free_context(AVFormatContext *s)
>  av_freep(&s->streams);
>  flush_packet_queue(s);
>  av_freep(&s->internal);
> +av_freep(&s->url);
>  av_free(s);
>  }
>
> @@ -5624,3 +5630,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  return st->internal->avctx->time_base;
>  #endif
>  }
> +
> +void ff_format_set_url(AVFormatContext *s, char *url)
> +{
> +av_assert

Re: [FFmpeg-devel] [PATCH]: Change Stack Frame Limit in Cuda Context

2018-01-25 Thread Bang He
On Thu, Jan 25, 2018 at 7:44 AM, Ben Chang  wrote:

> Hi,
>
> Please help review this patch to reduce stack frame size per GPU thread.
> The default allocation size per thread (1024 bytes) is excessive and can be
> reduced to 128 bytes based on nvidia cuda kernel compilation statistics.
> This should help with reducing video memory usage per cuda context.
>
> Thanks,
> Ben
>
> 
> ---
> This email message is for the sole use of the intended recipient(s) and
> may contain
> confidential information.  Any unauthorized review, use, disclosure or
> distribution
> is prohibited.  If you are not the intended recipient, please contact the
> sender by
> reply email and destroy all copies of the original message.
> 
> ---
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> how to test your patch?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 9/9] avcodec/mips: [loongson] optimize vp8 decoding in vp8dsp.

2018-07-11 Thread Bang He
On Wed, Jul 11, 2018 at 5:46 PM, Shiyou Yin 
wrote:

> From: gxw 
>
> Optimize vp8 loop filter with mmi, four functions optimized:
> 1. ff_vp8_h_loop_filter8uv_mmi.
> 2. ff_vp8_v_loop_filter8uv_mmi.
> 3. ff_vp8_h_loop_filter16_mmi.
> 4. ff_vp8_v_loop_filter16_mmi.
>
> Vp8 decoding speed improved about 50%(from 73fps to 110fps, Tested on
> loongson 3A3000).
>
> Change-Id: Iba567c7ab4c6a284b5e8ccbc567575448a508350
> Signed-off-by: gxw 
>
>
what is  loongson?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] 2nd ping

2022-04-24 Thread Bang He
look good for me

On Thu, Apr 21, 2022 at 9:55 PM MCC CS  wrote:

> It would be great if anyone who reads this could review this small patch
> (original:
> https://ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295351.html):
>
> This is a repost of the patch by Chris Snowhill who originally sent this
> patch
> on 31 December - which didn't receive any replies. As you can see
> on https://trac.ffmpeg.org/ticket/9564 the patch is needed and works
> perfectly.
>
> I have rebased it and recompiled it.
>
> Original commit description:
>
> Monterey needs mBytesPerFrame and mBytesPerPacket to be set, and I'm
> surprised this didn't break any previous system versions.
>
> Fixes bug #9564: Cannot decode xHE-AAC with audiotoolbox (aac_at) on
> Mac OS Monterey. Fixes likely bug that none of the AudioToolbox
> decoders work on Monterey.
> ---
> libavcodec/audiotoolboxdec.c | 5 +
> 1 file changed, 5 insertions(+)
>
> diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
> index b8d0e868f7..daccf4abf8 100644
> --- a/libavcodec/audiotoolboxdec.c
> +++ b/libavcodec/audiotoolboxdec.c
> @@ -375,6 +375,11 @@ static av_cold int ffat_create_decoder(AVCodecContext
> *avctx,
>  avctx->ch_layout.order   = AV_CHANNEL_ORDER_UNSPEC;
>  avctx->ch_layout.nb_channels = out_format.mChannelsPerFrame =
> in_format.mChannelsPerFrame;
>
> +out_format.mBytesPerFrame =
> +out_format.mChannelsPerFrame * (out_format.mBitsPerChannel / 8);
> +out_format.mBytesPerPacket =
> +out_format.mBytesPerFrame * out_format.mFramesPerPacket;
> +
>  if (avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_QT)
>  in_format.mFramesPerPacket = 64;
>
> --
> 2.35.1
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avformat/movenc: Support alpha channel for AVIF

2022-05-18 Thread Bang He
some error happened:

On Thu, May 19, 2022 at 5:56 AM Vignesh Venkatasubramanian <
vigneshv-at-google@ffmpeg.org> wrote:

> AVIF specification allows for alpha channel as an auxillary item (in
> case of still images) or as an auxillary track (in case of animated
> images).  Add support for both of these. The AVIF muxer will take
> exactly two streams (when alpha is present) as input (first one being
> the YUV planes and the second one being the alpha plane).
>
> The input has to come from two different images (one of it color and
> the other one being alpha), or it can come from a single file
> source with the alpha channel extracted using the "alphaextract"
> filter.
>
> Example using alphaextract:
> ffmpeg -i rgba.png -filter_complex "[0:v]alphaextract[a]" -map 0 -map
> "[a]" -still-picture 1 avif_with_alpha.avif
>
> Example using two sources (first source can be in any pixel format and
> the second source has to be in monochrome grey pixel format):
> ffmpeg -i color.avif -i grey.avif -map 0 -map 1 -c copy
> avif_with_alpha.avif
>
> The generated files pass the compliance checks in Compliance Warden:
> https://github.com/gpac/ComplianceWarden
>
> libavif (the reference avif library) is able to decode the files
> generated using this patch.
>
> They also play back properly (with transparent background) in:
> 1) Chrome
> 2) Firefox (only still AVIF, no animation support)
>
> Signed-off-by: Vignesh Venkatasubramanian 
> ---
>  libavformat/movenc.c | 185 +--
>  libavformat/movenc.h |   4 +-
>  2 files changed, 128 insertions(+), 61 deletions(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index de971f94e8..00e42b7abb 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -2852,7 +2852,7 @@ static int mov_write_hdlr_tag(AVFormatContext *s,
> AVIOContext *pb, MOVTrack *tra
>  hdlr = (track->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0";
>  if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
>  if (track->mode == MODE_AVIF) {
> -hdlr_type = "pict";
> +hdlr_type = (track == &mov->tracks[0]) ? "pict" : "auxv";
>  descr = "PictureHandler";
>  } else {
>  hdlr_type = "vide";
> @@ -2940,57 +2940,83 @@ static int mov_write_iloc_tag(AVIOContext *pb,
> MOVMuxContext *mov, AVFormatConte
>  avio_wb32(pb, 0); /* Version & flags */
>  avio_w8(pb, (4 << 4) + 4); /* offset_size(4) and length_size(4) */
>  avio_w8(pb, 0); /* base_offset_size(4) and reserved(4) */
> -avio_wb16(pb, 1); /* item_count */
> +avio_wb16(pb, s->nb_streams); /* item_count */
>
> -avio_wb16(pb, 1); /* item_id */
> -avio_wb16(pb, 0); /* data_reference_index */
> -avio_wb16(pb, 1); /* extent_count */
> -mov->avif_extent_pos = avio_tell(pb);
> -avio_wb32(pb, 0); /* extent_offset (written later) */
> -// For animated AVIF, we simply write the first packet's size.
> -avio_wb32(pb, mov->avif_extent_length); /* extent_length */
> +for (int i = 0; i < s->nb_streams; i++) {
> +avio_wb16(pb, i + 1); /* item_id */
> +avio_wb16(pb, 0); /* data_reference_index */
> +avio_wb16(pb, 1); /* extent_count */
> +mov->avif_extent_pos[i] = avio_tell(pb);
> +avio_wb32(pb, 0); /* extent_offset (written later) */
> +// For animated AVIF, we simply write the first packet's size.
> +avio_wb32(pb, mov->avif_extent_length[i]); /* extent_length */
> +}
>
>  return update_size(pb, pos);
>  }
>
>  static int mov_write_iinf_tag(AVIOContext *pb, MOVMuxContext *mov,
> AVFormatContext *s)
>  {
> -int64_t infe_pos;
>  int64_t iinf_pos = avio_tell(pb);
>  avio_wb32(pb, 0); /* size */
>  ffio_wfourcc(pb, "iinf");
>  avio_wb32(pb, 0); /* Version & flags */
> -avio_wb16(pb, 1); /* entry_count */
> +avio_wb16(pb, s->nb_streams); /* entry_count */
>
> -infe_pos = avio_tell(pb);
> -avio_wb32(pb, 0); /* size */
> -ffio_wfourcc(pb, "infe");
> -avio_w8(pb, 0x2); /* Version */
> -avio_wb24(pb, 0); /* flags */
> -avio_wb16(pb, 1); /* item_id */
> -avio_wb16(pb, 0); /* item_protection_index */
> -avio_write(pb, "av01", 4); /* item_type */
> -avio_write(pb, "Color\0", 6); /* item_name */
> -update_size(pb, infe_pos);
> +for (int i = 0; i < s->nb_streams; i++) {
> +int64_t infe_pos = avio_tell(pb);
> +avio_wb32(pb, 0); /* size */
> +ffio_wfourcc(pb, "infe");
> +avio_w8(pb, 0x2); /* Version */
> +avio_wb24(pb, 0); /* flags */
> +avio_wb16(pb, i + 1); /* item_id */
> +avio_wb16(pb, 0); /* item_protection_index */
> +avio_write(pb, "av01", 4); /* item_type */
> +avio_write(pb, !i ? "Color\0" : "Alpha\0", 6); /* item_name */
> +update_size(pb, infe_pos);
> +}
>
>  return update_size(pb, iinf_pos);
>  }
>
> -static int mov_write_ispe_tag(AVIOContext *pb, MOVMuxC

Re: [FFmpeg-devel] [PATCH] avformat/movenc: Support alpha channel for AVIF

2022-05-18 Thread Bang He
error happened:

./ffmpeg -i alpha.png -filter_complex [0:v]alphaextract[a] -map 0 -map [a]
-still-picture 1 avif_with_alpha.avif
ffmpeg version N-106936-gff5ea89da2 Copyright (c) 2000-2022 the FFmpeg
developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
  configuration: --disable-ffplay --disable-ffprobe --enable-gpl
--enable-nonfree --prefix=/home/bang/Desktop/out
  libavutil  57. 24.101 / 57. 24.101
  libavcodec 59. 28.100 / 59. 28.100
  libavformat59. 24.100 / 59. 24.100
  libavdevice59.  6.100 / 59.  6.100
  libavfilter 8. 38.100 /  8. 38.100
  libswscale  6.  6.100 /  6.  6.100
  libswresample   4.  6.100 /  4.  6.100
  libpostproc56.  5.100 / 56.  5.100
Unrecognized option 'still-picture'.
Error splitting the argument list: Option not found

On Thu, May 19, 2022 at 5:56 AM Vignesh Venkatasubramanian <
vigneshv-at-google@ffmpeg.org> wrote:

> AVIF specification allows for alpha channel as an auxillary item (in
> case of still images) or as an auxillary track (in case of animated
> images).  Add support for both of these. The AVIF muxer will take
> exactly two streams (when alpha is present) as input (first one being
> the YUV planes and the second one being the alpha plane).
>
> The input has to come from two different images (one of it color and
> the other one being alpha), or it can come from a single file
> source with the alpha channel extracted using the "alphaextract"
> filter.
>
> Example using alphaextract:
> ffmpeg -i rgba.png -filter_complex "[0:v]alphaextract[a]" -map 0 -map
> "[a]" -still-picture 1 avif_with_alpha.avif
>
> Example using two sources (first source can be in any pixel format and
> the second source has to be in monochrome grey pixel format):
> ffmpeg -i color.avif -i grey.avif -map 0 -map 1 -c copy
> avif_with_alpha.avif
>
> The generated files pass the compliance checks in Compliance Warden:
> https://github.com/gpac/ComplianceWarden
>
> libavif (the reference avif library) is able to decode the files
> generated using this patch.
>
> They also play back properly (with transparent background) in:
> 1) Chrome
> 2) Firefox (only still AVIF, no animation support)
>
> Signed-off-by: Vignesh Venkatasubramanian 
> ---
>  libavformat/movenc.c | 185 +--
>  libavformat/movenc.h |   4 +-
>  2 files changed, 128 insertions(+), 61 deletions(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index de971f94e8..00e42b7abb 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -2852,7 +2852,7 @@ static int mov_write_hdlr_tag(AVFormatContext *s,
> AVIOContext *pb, MOVTrack *tra
>  hdlr = (track->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0";
>  if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
>  if (track->mode == MODE_AVIF) {
> -hdlr_type = "pict";
> +hdlr_type = (track == &mov->tracks[0]) ? "pict" : "auxv";
>  descr = "PictureHandler";
>  } else {
>  hdlr_type = "vide";
> @@ -2940,57 +2940,83 @@ static int mov_write_iloc_tag(AVIOContext *pb,
> MOVMuxContext *mov, AVFormatConte
>  avio_wb32(pb, 0); /* Version & flags */
>  avio_w8(pb, (4 << 4) + 4); /* offset_size(4) and length_size(4) */
>  avio_w8(pb, 0); /* base_offset_size(4) and reserved(4) */
> -avio_wb16(pb, 1); /* item_count */
> +avio_wb16(pb, s->nb_streams); /* item_count */
>
> -avio_wb16(pb, 1); /* item_id */
> -avio_wb16(pb, 0); /* data_reference_index */
> -avio_wb16(pb, 1); /* extent_count */
> -mov->avif_extent_pos = avio_tell(pb);
> -avio_wb32(pb, 0); /* extent_offset (written later) */
> -// For animated AVIF, we simply write the first packet's size.
> -avio_wb32(pb, mov->avif_extent_length); /* extent_length */
> +for (int i = 0; i < s->nb_streams; i++) {
> +avio_wb16(pb, i + 1); /* item_id */
> +avio_wb16(pb, 0); /* data_reference_index */
> +avio_wb16(pb, 1); /* extent_count */
> +mov->avif_extent_pos[i] = avio_tell(pb);
> +avio_wb32(pb, 0); /* extent_offset (written later) */
> +// For animated AVIF, we simply write the first packet's size.
> +avio_wb32(pb, mov->avif_extent_length[i]); /* extent_length */
> +}
>
>  return update_size(pb, pos);
>  }
>
>  static int mov_write_iinf_tag(AVIOContext *pb, MOVMuxContext *mov,
> AVFormatContext *s)
>  {
> -int64_t infe_pos;
>  int64_t iinf_pos = avio_tell(pb);
>  avio_wb32(pb, 0); /* size */
>  ffio_wfourcc(pb, "iinf");
>  avio_wb32(pb, 0); /* Version & flags */
> -avio_wb16(pb, 1); /* entry_count */
> +avio_wb16(pb, s->nb_streams); /* entry_count */
>
> -infe_pos = avio_tell(pb);
> -avio_wb32(pb, 0); /* size */
> -ffio_wfourcc(pb, "infe");
> -avio_w8(pb, 0x2); /* Version */
> -avio_wb24(pb, 0); /* flags */
> -avio_wb16(pb, 1); /* item_id */
> -avio_wb16(pb, 0); /* item_protection_index */
> -avi