Re: [FFmpeg-devel] [PATCH v3 2/5] avformat/matroskadec: Parse dvcC/dvvC block additional mapping
On Sat, Sep 25, 2021 at 11:58 PM quietvoid wrote: > > The parsing was implemented in a new dovi_isom file for the > unification of the mov/mpegts DOVI parsing into one function, in a following > patch. > > Most of the Matroska elements implementation was done by Plex developers. > > Signed-off-by: quietvoid > --- > libavformat/Makefile | 2 +- > libavformat/dovi_isom.c | 80 +++ > libavformat/dovi_isom.h | 29 ++ > libavformat/matroskadec.c | 15 > 4 files changed, 125 insertions(+), 1 deletion(-) > create mode 100644 libavformat/dovi_isom.c > create mode 100644 libavformat/dovi_isom.h > > diff --git a/libavformat/Makefile b/libavformat/Makefile > index c45caa3eed..61a1fecf6c 100644 > --- a/libavformat/Makefile > +++ b/libavformat/Makefile > @@ -313,7 +313,7 @@ OBJS-$(CONFIG_M4V_MUXER) += rawenc.o > OBJS-$(CONFIG_MATROSKA_DEMUXER) += matroskadec.o matroska.o \ > flac_picture.o isom_tags.o > rmsipr.o \ > oggparsevorbis.o vorbiscomment.o > \ > -qtpalette.o replaygain.o > +qtpalette.o replaygain.o > dovi_isom.o > OBJS-$(CONFIG_MATROSKA_MUXER)+= matroskaenc.o matroska.o \ > av1.o avc.o hevc.o isom_tags.o \ > flacenc_header.o avlanguage.o \ > diff --git a/libavformat/dovi_isom.c b/libavformat/dovi_isom.c > new file mode 100644 > index 00..2c0a49c993 > --- /dev/null > +++ b/libavformat/dovi_isom.c > @@ -0,0 +1,80 @@ > +/* > + * DOVI ISO Media common code > + * Copyright (c) 2021 quietvoid > + * > + * 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 "libavutil/dovi_meta.h" > + > +#include "avformat.h" > +#include "dovi_isom.h" > + > +int ff_isom_parse_dvcc_dvvc(AVFormatContext *s, AVStream *st, const uint8_t > *buf_ptr, uint64_t size) > +{ > +uint32_t buf; > +AVDOVIDecoderConfigurationRecord *dovi; > +size_t dovi_size; > +int ret; > + > +if (size > (1 << 30) || size < 4) > +return AVERROR_INVALIDDATA; > + > +dovi = av_dovi_alloc(&dovi_size); > +if (!dovi) > +return AVERROR(ENOMEM); > + > +dovi->dv_version_major = *buf_ptr++;// 8 bits > +dovi->dv_version_minor = *buf_ptr++;// 8 bits > + > +buf = *buf_ptr++ << 8; > +buf |= *buf_ptr++; > + > +dovi->dv_profile= (buf >> 9) & 0x7f;// 7 bits > +dovi->dv_level = (buf >> 3) & 0x3f;// 6 bits > +dovi->rpu_present_flag = (buf >> 2) & 0x01;// 1 bit > +dovi->el_present_flag = (buf >> 1) & 0x01;// 1 bit > +dovi->bl_present_flag = buf & 0x01;// 1 bit > + > +// Has enough remaining data > +if (size >= 5) { > +dovi->dv_bl_signal_compatibility_id = ((*buf_ptr++) >> 4) & 0x0f; // > 4 bits > +} else { > +// 0 stands for None > +// Dolby Vision V1.2.93 profiles and levels > +dovi->dv_bl_signal_compatibility_id = 0; > +} > + > +ret = av_stream_add_side_data(st, AV_PKT_DATA_DOVI_CONF, > + (uint8_t *)dovi, dovi_size); > +if (ret < 0) { > +av_free(dovi); > +return ret; > +} > + > +av_log(s, AV_LOG_TRACE, "DOVI, version: %d.%d, profile: %d, level: %d, " > + "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n", > + dovi->dv_version_major, dovi->dv_version_minor, > + dovi->dv_profile, dovi->dv_level, > + dovi->rpu_present_flag, > + dovi->el_present_flag, > + dovi->bl_present_flag, > + dovi->dv_bl_signal_compatibility_id > +); > + > +return 0; > +} > diff --git a/libavformat/dovi_isom.h b/libavformat/dovi_isom.h > new file mode 100644 > index 00..4c313046a7 > --- /dev/null > +++ b/libavformat/dovi_isom.h > @@ -0,0 +1,29 @@ > +/* > + * DOVI ISO Media common code > + * Copyright (c) 2021 quietvoid > + * > + * This file is part of FFmpeg. > + * > + * FFmpeg is free software; you can redistribute it and/or >
Re: [FFmpeg-devel] [PATCH 1] avfilter/vf_avgblur: switch to faster algorithm
On Sun, Sep 26, 2021 at 4:11 PM Paul B Mahol wrote: > > Signed-off-by: Paul B Mahol > --- > libavfilter/vf_avgblur.c | 311 ++ > tests/ref/fate/filter-refcmp-psnr-yuv | 80 +++ > 2 files changed, 211 insertions(+), 180 deletions(-) > > diff --git a/libavfilter/vf_avgblur.c b/libavfilter/vf_avgblur.c > index 3e222a43fa..a838285bb4 100644 > --- a/libavfilter/vf_avgblur.c > +++ b/libavfilter/vf_avgblur.c > @@ -20,6 +20,7 @@ > * SOFTWARE. > */ > > +#include "libavutil/avassert.h" > #include "libavutil/imgutils.h" > #include "libavutil/opt.h" > #include "libavutil/pixdesc.h" > @@ -36,13 +37,15 @@ typedef struct AverageBlurContext { > int planes; > > int depth; > +int max; > +int area; > int planewidth[4]; > int planeheight[4]; > -float *buffer; > +void *buffer; > +uint16_t lut[256 * 256 * 256]; > int nb_planes; > > -int (*filter_horizontally)(AVFilterContext *ctx, void *arg, int jobnr, > int nb_jobs); > -int (*filter_vertically)(AVFilterContext *ctx, void *arg, int jobnr, int > nb_jobs); > +int (*filter[2])(AVFilterContext *ctx, void *arg, int jobnr, int > nb_jobs); > } AverageBlurContext; > > #define OFFSET(x) offsetof(AverageBlurContext, x) > @@ -60,124 +63,138 @@ AVFILTER_DEFINE_CLASS(avgblur); > typedef struct ThreadData { > int height; > int width; > -uint8_t *ptr; > -int linesize; > +const void *ptr; > +void *dptr; > +int linesize, dlinesize; > } ThreadData; > > -#define HORIZONTAL_FILTER(name, type) > \ > -static int filter_horizontally_##name(AVFilterContext *ctx, void *arg, int > jobnr, int nb_jobs)\ > -{ > \ > -AverageBlurContext *s = ctx->priv; > \ > -ThreadData *td = arg; > \ > -const int height = td->height; > \ > -const int width = td->width; > \ > -const int slice_start = (height * jobnr ) / nb_jobs; > \ > -const int slice_end = (height * (jobnr+1)) / nb_jobs; > \ > -const int radius = FFMIN(s->radius, width / 2); > \ > -const int linesize = td->linesize / sizeof(type); > \ > -float *buffer = s->buffer; > \ > -const type *src; > \ > -float *ptr; > \ > -int y, x; > \ > - > \ > -/* Filter horizontally along each row */ > \ > -for (y = slice_start; y < slice_end; y++) { > \ > -float acc = 0; > \ > -int count = 0; > \ > - > \ > -src = (const type *)td->ptr + linesize * y; > \ > -ptr = buffer + width * y; > \ > - > \ > -for (x = 0; x < radius; x++) { > \ > -acc += src[x]; > \ > -} > \ > -count += radius; > \ > - > \ > -for (x = 0; x <= radius; x++) { > \ > -acc += src[x + radius]; > \ > -count++; > \ > -ptr[x] = acc / count; > \ > -} > \ >
Re: [FFmpeg-devel] [PATCH v2 6/6] avcodec/libsvtav1: support constant quality mode
On Sat, Sep 25, 2021 at 8:36 PM Jan Ekström wrote: > > On Thu, Sep 23, 2021 at 6:08 PM wrote: > > > > On Thu, Sep 23, 2021 at 05:11:49PM +0300, Jan Ekström wrote: > > > On Thu, Sep 23, 2021 at 4:46 PM Christopher Degawa > > > wrote: > > > > > > > > On Sun, Sep 19, 2021 at 2:02 PM Christopher Degawa > > > > wrote: > > > > > > > > > > > > > > > > > > > On Fri, Sep 17, 2021 at 9:28 PM wrote: > > > > > > > > > >> From: Limin Wang > > > > >> > > > > >> Signed-off-by: Limin Wang > > > > >> > > > > > As a note, I personally favor this patch over mine since I don't think > > > > > `enable_tpl_la` is worth exposing to the user if its main role is to > > > > > switch > > > > > between crf and cqp > > > > > > > > > > > > > Ping on this patch, this has been requested on SVT-AV1's side as well > > > > > > I think my further comments on the previous version were mostly to > > > move off from the rc option for rate control, which has become more > > > and more seemingly unnecessary (and different from most other encoders > > > for no obvious reason). > > > > > > The only option that with a quick look doesn't match just setting > > > quantizer|bit rate|CRF is "cvbr", but it doesn't seem to be impossible > > > to either rework "rc" for it, or to utilize a separate option for it. > > > > Do you think it's OK to remove the rc option? to match other encoders, > > We can choose the rate control by the related parameters like: > > > > if (crf >= 0) > > choose crf rate control; > > else if (bitrate > 0) > > choose cvbr rate control; > > else if (cqp >=0 ) > > choose cqp rate control; > > > > In general that is the idea, yes (except bit rate would mean either > vbr or cvbr). It would be nice to follow whatever is the default on > SVT-AV1's side by default, and then if the user specifies a rate > control mode that is not the default, his selection is honored. Not > sure what the best way for that is to be honest. Possibly the style of > setting AVCodecDefault a la libx265? > > For the rc option, given how much SVT-AV1 itself is in flux, I would > be OK with removing the option, or making it an option that decides > between cvbr and vbr (essentially making it "VBR bit rate control > mode"). I wish cvbr would instead be something like VBV/HRD elsewhere, > so we could just utilize maxrate&bufsize for controlling it, instead > of having it as another discrete rate control mode. > > As these things change, I also hope that SVT-AV1 will soon get a > key=value style of option API, that way the wrapper will not have to I agree with this part , now FFmpeg SVT-AV1 wrapper needs to update with the SVT-AV1's structural mapping if want to enable a new feature > be updated constantly according to the changes in the library :) . As > I feel SVT-AV1 will be changed quite a bit in the future (due to its > recent age). > ___ 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 v1 1/1] avformat/amr: Return PATCHWELCOME on stereo files
On Thu, Sep 16, 2021 at 11:24 AM sunzhenliang wrote: > > Signed-off-by: sunzhenliang > --- > libavformat/amr.c | 22 ++ > 1 file changed, 18 insertions(+), 4 deletions(-) > > diff --git a/libavformat/amr.c b/libavformat/amr.c > index 836b276fd5..2762010ebe 100644 > --- a/libavformat/amr.c > +++ b/libavformat/amr.c > @@ -36,8 +36,10 @@ typedef struct { > uint64_t block_count; > } AMRContext; > > -static const char AMR_header[] = "#!AMR\n"; > -static const char AMRWB_header[] = "#!AMR-WB\n"; > +static const char AMR_header[] = "#!AMR\n"; > +static const char AMR_MC_header[] = "#!AMR_MC1.0\n"; > +static const char AMRWB_header[]= "#!AMR-WB\n"; > +static const char AMRWB_MC_header[] = "#!AMR-WB_MC1.0\n"; I don't think you need to format the AMR_header[] and AMRWB_header[] in the patch > > static const uint8_t amrnb_packed_size[16] = { > 13, 14, 16, 18, 20, 21, 27, 32, 6, 1, 1, 1, 1, 1, 1, 1 > @@ -82,7 +84,7 @@ static int amr_read_header(AVFormatContext *s) > { > AVIOContext *pb = s->pb; > AVStream *st; > -uint8_t header[9]; > +uint8_t header[15]; > > if (avio_read(pb, header, 6) != 6) > return AVERROR_INVALIDDATA; > @@ -94,7 +96,19 @@ static int amr_read_header(AVFormatContext *s) > if (avio_read(pb, header + 6, 3) != 3) > return AVERROR_INVALIDDATA; > if (memcmp(header, AMRWB_header, 9)) { > -return -1; > +if (avio_read(pb, header + 6 + 3, 3) != 3) > +return AVERROR_INVALIDDATA; > +if (memcmp(header, AMR_MC_header, 12)) { > +if (avio_read(pb, header + 6 + 3 + 3, 3) != 3) > +return AVERROR_INVALIDDATA; > +if (memcmp(header, AMRWB_MC_header, 15)) { > +return -1; > +} > +avpriv_report_missing_feature(s, "multi-channel AMRWB"); > +return AVERROR_PATCHWELCOME; > +} > +avpriv_report_missing_feature(s, "multi-channel AMR"); > +return AVERROR_PATCHWELCOME; > } > > st->codecpar->codec_tag = MKTAG('s', 'a', 'w', 'b'); > -- > 2.25.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".
Re: [FFmpeg-devel] [PATCH 1] avfilter/vf_avgblur: switch to faster algorithm
On Sun, Sep 26, 2021 at 8:11 PM Paul B Mahol wrote: > > On Sun, Sep 26, 2021 at 1:27 PM myp...@gmail.com wrote: > > > On Sun, Sep 26, 2021 at 4:11 PM Paul B Mahol wrote: > > > > > > Signed-off-by: Paul B Mahol > > > --- > > > libavfilter/vf_avgblur.c | 311 ++ > > > tests/ref/fate/filter-refcmp-psnr-yuv | 80 +++ > > > 2 files changed, 211 insertions(+), 180 deletions(-) > > > > > > diff --git a/libavfilter/vf_avgblur.c b/libavfilter/vf_avgblur.c > > > index 3e222a43fa..a838285bb4 100644 > > > --- a/libavfilter/vf_avgblur.c > > > +++ b/libavfilter/vf_avgblur.c > > > @@ -20,6 +20,7 @@ > > > * SOFTWARE. > > > */ > > > > > > +#include "libavutil/avassert.h" > > > #include "libavutil/imgutils.h" > > > #include "libavutil/opt.h" > > > #include "libavutil/pixdesc.h" > > > @@ -36,13 +37,15 @@ typedef struct AverageBlurContext { > > > int planes; > > > > > > int depth; > > > +int max; > > > +int area; > > > int planewidth[4]; > > > int planeheight[4]; > > > -float *buffer; > > > +void *buffer; > > > +uint16_t lut[256 * 256 * 256]; > > > int nb_planes; > > > > > > -int (*filter_horizontally)(AVFilterContext *ctx, void *arg, int > > jobnr, int nb_jobs); > > > -int (*filter_vertically)(AVFilterContext *ctx, void *arg, int > > jobnr, int nb_jobs); > > > +int (*filter[2])(AVFilterContext *ctx, void *arg, int jobnr, int > > nb_jobs); > > > } AverageBlurContext; > > > > > > #define OFFSET(x) offsetof(AverageBlurContext, x) > > > @@ -60,124 +63,138 @@ AVFILTER_DEFINE_CLASS(avgblur); > > > typedef struct ThreadData { > > > int height; > > > int width; > > > -uint8_t *ptr; > > > -int linesize; > > > +const void *ptr; > > > +void *dptr; > > > +int linesize, dlinesize; > > > } ThreadData; > > > > > > -#define HORIZONTAL_FILTER(name, type) > >\ > > > -static int filter_horizontally_##name(AVFilterContext *ctx, void *arg, > > int jobnr, int nb_jobs)\ > > > -{ > >\ > > > -AverageBlurContext *s = ctx->priv; > > \ > > > -ThreadData *td = arg; > >\ > > > -const int height = td->height; > > \ > > > -const int width = td->width; > > \ > > > -const int slice_start = (height * jobnr ) / nb_jobs; > >\ > > > -const int slice_end = (height * (jobnr+1)) / nb_jobs; > >\ > > > -const int radius = FFMIN(s->radius, width / 2); > >\ > > > -const int linesize = td->linesize / sizeof(type); > >\ > > > -float *buffer = s->buffer; > > \ > > > -const type *src; > > \ > > > -float *ptr; > >\ > > > -int y, x; > >\ > > > - > > \ > > > -/* Filter horizontally along each row */ > > \ > > > -for (y = slice_start; y < slice_end; y++) { > >\ > > > -float acc = 0; > > \ > > > -int count = 0; > > \ > > > - > > \ > > > -src = (const type *)td->ptr + linesize * y; > >\ > > > -ptr = buffer + width * y; > >\ > > > - > > \ > > > -for (x = 0; x < radius; x++) { > > \ > > > -acc += src[x]; > > \ > > > -} > >\ > > > -count += radius; > > \ > > > - > > \ > > > -for (x = 0; x <= radius; x++) { > >\ > > > -acc += src[x + radius]; > >\ > > > -count++; > >
Re: [FFmpeg-devel] [PATCH v4 1/4] avformat/dovi_isom Implement Dolby Vision configuration parsing/writing
On Mon, Sep 27, 2021 at 10:57 AM quietvoid wrote: > > According to specification "Dolby Vision Stream Within the ISO Base Media > File Format Version 2.2" > > This only adds support for the "Dolby Vision configuration box". > Other configuration boxes such as "Dolby Vision enhancement layer > configuration box" are not supported. > > The new functions will be used to implement parsing/writing the DOVI config > for Matroska. > As well as to refactor MOV/MPEG TS to parse the DOVI box/descriptor using > dovi_isom. > > Signed-off-by: quietvoid > --- > libavformat/dovi_isom.c | 120 > libavformat/dovi_isom.h | 35 > 2 files changed, 155 insertions(+) > create mode 100644 libavformat/dovi_isom.c > create mode 100644 libavformat/dovi_isom.h > > diff --git a/libavformat/dovi_isom.c b/libavformat/dovi_isom.c > new file mode 100644 > index 00..747ffc8b2c > --- /dev/null > +++ b/libavformat/dovi_isom.c > @@ -0,0 +1,120 @@ > +/* > + * DOVI ISO Media common code > + * Copyright (c) 2021 quietvoid > + * > + * 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 "libavutil/dovi_meta.h" > + > +#include "libavcodec/put_bits.h" > + > +#include "avformat.h" > +#include "dovi_isom.h" > + > +int ff_isom_parse_dvcc_dvvc(AVFormatContext *s, AVStream *st, const uint8_t > *buf_ptr, uint64_t size) > +{ > +uint32_t buf; > +AVDOVIDecoderConfigurationRecord *dovi; > +size_t dovi_size; > +int ret; > + > +if (size > (1 << 30) || size < 4) > +return AVERROR_INVALIDDATA; > + > +dovi = av_dovi_alloc(&dovi_size); > +if (!dovi) > +return AVERROR(ENOMEM); > + > +dovi->dv_version_major = *buf_ptr++;// 8 bits > +dovi->dv_version_minor = *buf_ptr++;// 8 bits > + > +buf = *buf_ptr++ << 8; > +buf |= *buf_ptr++; > + > +dovi->dv_profile= (buf >> 9) & 0x7f;// 7 bits > +dovi->dv_level = (buf >> 3) & 0x3f;// 6 bits > +dovi->rpu_present_flag = (buf >> 2) & 0x01;// 1 bit > +dovi->el_present_flag = (buf >> 1) & 0x01;// 1 bit > +dovi->bl_present_flag = buf & 0x01;// 1 bit > + > +// Has enough remaining data > +if (size >= 5) { > +dovi->dv_bl_signal_compatibility_id = ((*buf_ptr++) >> 4) & 0x0f; // > 4 bits > +} else { > +// 0 stands for None > +// Dolby Vision V1.2.93 profiles and levels > +dovi->dv_bl_signal_compatibility_id = 0; > +} > + > +ret = av_stream_add_side_data(st, AV_PKT_DATA_DOVI_CONF, > + (uint8_t *)dovi, dovi_size); > +if (ret < 0) { > +av_free(dovi); > +return ret; > +} > + > +av_log(s, AV_LOG_TRACE, "DOVI, version: %d.%d, profile: %d, level: %d, " > + "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n", > + dovi->dv_version_major, dovi->dv_version_minor, > + dovi->dv_profile, dovi->dv_level, > + dovi->rpu_present_flag, > + dovi->el_present_flag, > + dovi->bl_present_flag, > + dovi->dv_bl_signal_compatibility_id > +); > + > +return 0; > +} > + > +int ff_isom_put_dvcc_dvvc(AVFormatContext *s, uint8_t > out[ISOM_DVCC_DVVC_SIZE], uint64_t size, > + AVDOVIDecoderConfigurationRecord *dovi) > +{ > +PutBitContext pb; > +init_put_bits(&pb, out, size); > + > +if (size < ISOM_DVCC_DVVC_SIZE) > +return AVERROR(EINVAL); > + > +put_bits(&pb, 8, dovi->dv_version_major); > +put_bits(&pb, 8, dovi->dv_version_minor); > +put_bits(&pb, 7, dovi->dv_profile); > +put_bits(&pb, 6, dovi->dv_level); > +put_bits(&pb, 1, dovi->rpu_present_flag); > +put_bits(&pb, 1, dovi->el_present_flag); > +put_bits(&pb, 1, dovi->bl_present_flag); > +put_bits(&pb, 4, dovi->dv_bl_signal_compatibility_id); > + > +put_bits(&pb, 28, 0); /* reserved */ > +put_bits32(&pb, 0); /* reserved */ > +put_bits32(&pb, 0); /* reserved */ > +put_bits32(&pb, 0); /* reserved */ > +put_bits32(&pb, 0); /* reserved */ > +flush_put_bits(&pb); > + > +av_log(s, AV_LOG_DEBUG, "DOVI in %s box, version: %d.%d, profile: %d, > level: %d, " > +
Re: [FFmpeg-devel] [PATCH 1] avfilter/vf_avgblur: switch to faster algorithm
On Thu, Sep 30, 2021 at 12:01 AM Paul B Mahol wrote: > > will apply soon. Ok, in my testbed, the patch gets about twice the performance gain with small radius ___ 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 5/8] avformat/mov: support dvwC box for Dolby Vision
On Thu, Oct 14, 2021 at 9:10 PM wrote: > > From: Limin Wang > > By <> > > Signed-off-by: Limin Wang > --- > libavformat/mov.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/libavformat/mov.c b/libavformat/mov.c > index 57c67e3..49a8c27 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -7074,7 +7074,7 @@ static int mov_read_dvcc_dvvc(MOVContext *c, > AVIOContext *pb, MOVAtom atom) > return ret; > } > > -av_log(c, AV_LOG_TRACE, "DOVI in dvcC/dvvC box, version: %d.%d, profile: > %d, level: %d, " > +av_log(c, AV_LOG_TRACE, "DOVI in dvcC/dvvC/dvwC box, version: %d.%d, > profile: %d, level: %d, " > "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n", > dovi->dv_version_major, dovi->dv_version_minor, > dovi->dv_profile, dovi->dv_level, > @@ -7273,6 +7273,7 @@ static const MOVParseTableEntry > mov_default_parse_table[] = { > { MKTAG('c','l','l','i'), mov_read_clli }, > { MKTAG('d','v','c','C'), mov_read_dvcc_dvvc }, > { MKTAG('d','v','v','C'), mov_read_dvcc_dvvc }, > +{ MKTAG('d','v','w','C'), mov_read_dvcc_dvvc }, > { MKTAG('k','i','n','d'), mov_read_kind }, > { 0, NULL } > }; > -- > 1.8.3.1 Do you have test clip for this patch? ___ 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 2/2] avcodec/videotoolboxenc: refactor dump encoder name
On Sat, Nov 25, 2023 at 12:06 PM Zhao Zhili wrote: > > From: Zhao Zhili > > --- > libavcodec/videotoolboxenc.c | 65 +--- > 1 file changed, 38 insertions(+), 27 deletions(-) > > diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c > index b8a07e4e44..fbd33fd3f9 100644 > --- a/libavcodec/videotoolboxenc.c > +++ b/libavcodec/videotoolboxenc.c > @@ -280,6 +280,41 @@ typedef struct VTEncContext { > int max_ref_frames; > } VTEncContext; > > +static int vt_dump_encoder(AVCodecContext *avctx) > +{ > +VTEncContext *vtctx = avctx->priv_data; > +CFStringRef encoder_id = NULL; > +int status; > +CFIndex length, max_size; > +char *name; > + > +status = VTSessionCopyProperty(vtctx->session, > + > compat_keys.kVTCompressionPropertyKey_EncoderID, > + kCFAllocatorDefault, > + &encoder_id); > +// OK if not supported > +if (status != noErr) > +return 0; > + > +length = CFStringGetLength(encoder_id); > +max_size = CFStringGetMaximumSizeForEncoding(length, > kCFStringEncodingUTF8); > +name = av_malloc(max_size); > +if (!name) { > +CFRelease(encoder_id); > +return AVERROR(ENOMEM); > +} > + > +CFStringGetCString(encoder_id, > + name, > + max_size, > + kCFStringEncodingUTF8); > +av_log(avctx, AV_LOG_DEBUG, "Init the encoder: %s\n", name); > +av_freep(&name); > +CFRelease(encoder_id); > + > +return 0; > +} > + > static int vtenc_populate_extradata(AVCodecContext *avctx, > CMVideoCodecType codec_type, > CFStringRef profile_level, > @@ -1176,33 +1211,9 @@ static int vtenc_create_encoder(AVCodecContext > *avctx, > } > #endif > > -// Dump the init encoder > -{ > -CFStringRef encoderID = NULL; > -status = VTSessionCopyProperty(vtctx->session, > - > compat_keys.kVTCompressionPropertyKey_EncoderID, > - kCFAllocatorDefault, > - &encoderID); > -if (status == noErr) { > -CFIndex length = CFStringGetLength(encoderID); > -CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, > kCFStringEncodingUTF8); > -char *name = av_malloc(max_size); > -if (!name) { > -CFRelease(encoderID); > -return AVERROR(ENOMEM); > -} > - > -CFStringGetCString(encoderID, > - name, > - max_size, > - kCFStringEncodingUTF8); > -av_log(avctx, AV_LOG_DEBUG, "Init the encoder: %s\n", name); > - > -av_freep(&name); > -} > -if (encoderID != NULL) > -CFRelease(encoderID); > -} > +status = vt_dump_encoder(avctx); > +if (status < 0) > +return status; > > if (avctx->flags & AV_CODEC_FLAG_QSCALE && !vtenc_qscale_enabled()) { > av_log(avctx, AV_LOG_ERROR, "Error: -q:v qscale not available for > encoder. Use -b:v bitrate instead.\n"); > -- > 2.42.0 > Patchset looks good for if pass the build ___ 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 1/2] lavc/cbs_h265: Add sps_multilayer_extension support
On Tue, Nov 28, 2023 at 1:59 AM Mark Thompson wrote: > > On 17/11/2023 13:03, Jun Zhao wrote: > > Add sps_multilayer_extensio support. > > > > Signed-off-by: Jun Zhao > > --- > > libavcodec/cbs_h265.h | 3 +++ > > libavcodec/cbs_h265_syntax_template.c | 12 +++- > > 2 files changed, 14 insertions(+), 1 deletion(-) > > > > diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h > > index 1b1195f198..15951269fd 100644 > > --- a/libavcodec/cbs_h265.h > > +++ b/libavcodec/cbs_h265.h > > @@ -330,6 +330,9 @@ typedef struct H265RawSPS { > > uint8_t persistent_rice_adaptation_enabled_flag; > > uint8_t cabac_bypass_alignment_enabled_flag; > > > > +// Multilayer extension. > > +uint8_t inter_view_mv_vert_constraint_flag; > > + > > // Screen content coding extension. > > uint8_t sps_curr_pic_ref_enabled_flag; > > uint8_t palette_mode_enabled_flag; > > diff --git a/libavcodec/cbs_h265_syntax_template.c > > b/libavcodec/cbs_h265_syntax_template.c > > index 2d4b954718..1e3bc1acd8 100644 > > --- a/libavcodec/cbs_h265_syntax_template.c > > +++ b/libavcodec/cbs_h265_syntax_template.c > > @@ -717,6 +717,16 @@ static int > > FUNC(sps_range_extension)(CodedBitstreamContext *ctx, RWContext *rw, > > return 0; > > } > > > > +static int FUNC(sps_multilayer_extension)(CodedBitstreamContext *ctx, > > RWContext *rw, > > + H265RawSPS *current) > > +{ > > +int err; > > + > > +flag(inter_view_mv_vert_constraint_flag); > > + > > +return 0; > > +} > > + > > static int FUNC(sps_scc_extension)(CodedBitstreamContext *ctx, RWContext > > *rw, > > H265RawSPS *current) > > { > > @@ -952,7 +962,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, > > RWContext *rw, > > if (current->sps_range_extension_flag) > > CHECK(FUNC(sps_range_extension)(ctx, rw, current)); > > if (current->sps_multilayer_extension_flag) > > -return AVERROR_PATCHWELCOME; > > +CHECK(FUNC(sps_multilayer_extension)(ctx, rw, current)); > > if (current->sps_3d_extension_flag) > > return AVERROR_PATCHWELCOME; > > if (current->sps_scc_extension_flag) > > This doesn't seem like it it sufficient - when in multilayer the SPS format > isn't the same (§F.7.3.2.2.1). > > Alternatively: maybe this works for the first layer (haven't verified this > but seems plausible), and therefore to work there only it would be sufficient > to check if MultiLayerExtSpsFlag is true in an SPS and stop if it is? > Actually, this case is from MV-HEVC, and I didn't find any other real examples like the Spec above > (A sample suitable for using with fate would help.) > Will add a new MV-HEVC fate test case > Thanks, > > - Mark ___ 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] lavc/vaapi_decode: add va_profile format map support for HEVC_REXT
On Thu, Mar 28, 2019 at 12:03 PM Linjie Fu wrote: > > HEVC_REXT will be map to {VAProfileHEVCMain422_10, VAProfileHEVCMain444, > VAProfileHEVCMain444_10} in vaapi_profile_map[], since need to be > distinguished > to select the exact va_profile. > > Add va_profile -> AV_PIX_FMT map for FF_PROFILE_HEVC_REXT to match the > exact va_profile. > > Signed-off-by: Linjie Fu > --- > libavcodec/vaapi_decode.c | 29 + > 1 file changed, 25 insertions(+), 4 deletions(-) > > diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c > index 015154b879..1cb8683b7c 100644 > --- a/libavcodec/vaapi_decode.c > +++ b/libavcodec/vaapi_decode.c > @@ -414,6 +414,18 @@ static const struct { > #undef MAP > }; > > +static const struct { > +VAProfile va_profile; > +enum AVPixelFormat pix_fmt; > +} rext_format_map[] = { > +#define MAP(vp, av) { VAProfileHEVCMain ## vp, AV_PIX_FMT_ ## av } > +MAP(422_10, YUYV422), > +MAP(422_10, YUV422P10LE), > +MAP(444, YUV444P), > +MAP(444_10, YUV444P10LE), > +#undef MAP > +}; > + > /* > * Set *va_config and the frames_ref fields from the current codec parameters > * in avctx. > @@ -426,7 +438,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx, > AVVAAPIHWConfig *hwconfig= NULL; > AVHWFramesConstraints *constraints = NULL; > VAStatus vas; > -int err, i, j; > +int err, i, j, k; > const AVCodecDescriptor *codec_desc; > VAProfile *profile_list = NULL, matched_va_profile; > int profile_count, exact_match, matched_ff_profile; > @@ -467,13 +479,22 @@ static int vaapi_decode_make_config(AVCodecContext > *avctx, > if (avctx->profile == vaapi_profile_map[i].codec_profile || > vaapi_profile_map[i].codec_profile == FF_PROFILE_UNKNOWN) > profile_match = 1; > -for (j = 0; j < profile_count; j++) { > -if (vaapi_profile_map[i].va_profile == profile_list[j]) { > +if (avctx->profile == FF_PROFILE_HEVC_REXT) { > +/* find the exact va_profile for HEVC_REXT */ > +for (j = 0; j < FF_ARRAY_ELEMS(rext_format_map); j++) { > +if (avctx->pix_fmt == rext_format_map[j].pix_fmt) > + break; > +} > +if (vaapi_profile_map[i].va_profile != > rext_format_map[j].va_profile) > +continue; > +} > +for (k = 0; k < profile_count; k++) { > +if (vaapi_profile_map[i].va_profile == profile_list[k]) { > exact_match = profile_match; > break; > } > } > -if (j < profile_count) { > +if (k < profile_count) { > matched_va_profile = vaapi_profile_map[i].va_profile; > matched_ff_profile = vaapi_profile_map[i].codec_profile; > if (exact_match) > -- What intel platform supported HEVCMain422 or 444? ___ 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] [fixme] avformat/hlsenc.c miss pat&pmt info
On Mon, Apr 1, 2019 at 12:02 PM lmzeng(曾令明) wrote: > > When I try use ffmpeg 4.1 concat some mp3 files like this: > > >>ffconcat version 1.0 > >> > >>file http://1251953721.vod2.myqcloud.com/0ec02e46vodcq1251953721/8e15b6325285890787361152529/f0.mp3 > >>file http://1251953721.vod2.myqcloud.com/0ec02e46vodcq1251953721/ee02b7825285890787362994665/f0.mp3 > >>file http://1251953721.vod2.myqcloud.com/0ec02e46vodcq1251953721/726920765285890787364016855/f0.mp3 > > >>ffmpeg -safe 0 -protocol_whitelist "file,tcp,http,hls" -i mp3.txt -vn -map 0:a? -acodec copy -hls_list_size 0 -hls_ts_options mpegts_copyts=1 -hls_time 10 -hls_flags single_file -f hls 26374_2256155.f3.m3u8 > > VlC player can’t seek, here miss add PAT&PMT at per segment(except the first segment)? > > hlsenc.c:2281 > >>>if (use_temp_file) { > >>>if (!(hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size <= 0)) > >>>if ((vs->avf->oformat->priv_class && vs->avf->priv_data) && hls->segment_type != SEGMENT_TYPE_FMP4) > >>>av_opt_set(vs->avf->priv_data, "mpegts_flags", "resend_headers", 0); > >>>} I think you need to create a bug in trac if it's a issue, more information you can refer to https://trac.ffmpeg.org/ticket/7820, tks ___ 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] lavfi: add nlmeans_opencl filter
On Mon, Apr 1, 2019 at 3:53 PM Ruiling Song wrote: > Signed-off-by: Ruiling Song > --- > This filter runs about 2x faster on integrated GPU than nlmeans on my > Skylake CPU. > Anybody like to give some comments? > > Ruiling > > configure | 1 + > doc/filters.texi| 4 + > libavfilter/Makefile| 1 + > libavfilter/allfilters.c| 1 + > libavfilter/opencl/nlmeans.cl | 108 + > libavfilter/opencl_source.h | 1 + > libavfilter/vf_nlmeans_opencl.c | 390 > 7 files changed, 506 insertions(+) > create mode 100644 libavfilter/opencl/nlmeans.cl > create mode 100644 libavfilter/vf_nlmeans_opencl.c > > diff --git a/configure b/configure > index f6123f53e5..a233512491 100755 > --- a/configure > +++ b/configure > @@ -3460,6 +3460,7 @@ mpdecimate_filter_select="pixelutils" > minterpolate_filter_select="scene_sad" > mptestsrc_filter_deps="gpl" > negate_filter_deps="lut_filter" > +nlmeans_opencl_filter_deps="opencl" > nnedi_filter_deps="gpl" > ocr_filter_deps="libtesseract" > ocv_filter_deps="libopencv" > diff --git a/doc/filters.texi b/doc/filters.texi > index 867607d870..21c2c1a4b5 100644 > --- a/doc/filters.texi > +++ b/doc/filters.texi > @@ -19030,6 +19030,10 @@ Apply erosion filter with threshold0 set to 30, > threshold1 set 40, threshold2 se > @end example > @end itemize > > +@section nlmeans_opencl > + > +Non-local Means denoise filter through OpenCL, this filter accepts same > options as @ref{nlmeans}. > + > @section overlay_opencl > > Overlay one video on top of another. > diff --git a/libavfilter/Makefile b/libavfilter/Makefile > index fef6ec5c55..92039bfdcf 100644 > --- a/libavfilter/Makefile > +++ b/libavfilter/Makefile > @@ -291,6 +291,7 @@ OBJS-$(CONFIG_MIX_FILTER)+= > vf_mix.o > OBJS-$(CONFIG_MPDECIMATE_FILTER) += vf_mpdecimate.o > OBJS-$(CONFIG_NEGATE_FILTER) += vf_lut.o > OBJS-$(CONFIG_NLMEANS_FILTER)+= vf_nlmeans.o > +OBJS-$(CONFIG_NLMEANS_OPENCL_FILTER) += vf_nlmeans_opencl.o > opencl.o opencl/nlmeans.o > OBJS-$(CONFIG_NNEDI_FILTER) += vf_nnedi.o > OBJS-$(CONFIG_NOFORMAT_FILTER) += vf_format.o > OBJS-$(CONFIG_NOISE_FILTER) += vf_noise.o > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c > index c51ae0f3c7..2a6390c92d 100644 > --- a/libavfilter/allfilters.c > +++ b/libavfilter/allfilters.c > @@ -277,6 +277,7 @@ extern AVFilter ff_vf_mix; > extern AVFilter ff_vf_mpdecimate; > extern AVFilter ff_vf_negate; > extern AVFilter ff_vf_nlmeans; > +extern AVFilter ff_vf_nlmeans_opencl; > extern AVFilter ff_vf_nnedi; > extern AVFilter ff_vf_noformat; > extern AVFilter ff_vf_noise; > diff --git a/libavfilter/opencl/nlmeans.cl b/libavfilter/opencl/nlmeans.cl > new file mode 100644 > index 00..dcb04834ca > --- /dev/null > +++ b/libavfilter/opencl/nlmeans.cl > @@ -0,0 +1,108 @@ > +/* > + * 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 > + */ > + > +const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE | > + CLK_ADDRESS_CLAMP_TO_EDGE | > + CLK_FILTER_NEAREST); > + > +kernel void horiz_sum(__global uint4 *ii, > + __read_only image2d_t src, > + int width, > + int height, > + int4 dx, > + int4 dy) > +{ > + > +int y = get_global_id(0); > +int work_size = get_global_size(0); > + > +uint4 sum = (uint4)(0); > +float4 s2; > +for (int i = 0; i < width; i++) { > +float s1 = read_imagef(src, sampler, (int2)(i, y)).x; > +s2.x = read_imagef(src, sampler, (int2)(i+dx.x, y+dy.x)).x; > +s2.y = read_imagef(src, sampler, (int2)(i+dx.y, y+dy.y)).x; > +s2.z = read_imagef(src, sampler, (int2)(i+dx.z, y+dy.z)).x; > +s2.w = read_imagef(src, sampler, (int2)(i+dx.w, y+dy.w)).x; > +sum += convert_uint4((s1-s2)*(s1-s2) * 255*255); > +ii[y * width + i] = sum; > +} > +} > + > +kernel void vert_sum(__global uint4 *ii, > + int width, > + int height) > +{ > +
Re: [FFmpeg-devel] [PATCH V2] lavf/flvdec: Fix AMF NUMBER type to metadata lost precision
On Thu, Mar 28, 2019 at 9:23 PM Jun Zhao wrote: > > From: Jun Zhao > > Use %.12g replace %.f when save AMF NUMBER(double) type to > metadata. And update fate ref. > > before this fix, we get FLV metadata like: > > Metadata: > lasttimestamp : 113 > lastkeyframetimestamp: 112 > > after this fix: > > Metadata: > lasttimestamp : 113.005 > lastkeyframetimestamp: 111.678 > > Signed-off-by: Jun Zhao > --- > libavformat/flvdec.c |2 +- > tests/ref/fate/flv-add_keyframe_index |2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c > index 445d58d..12bfd4b 100644 > --- a/libavformat/flvdec.c > +++ b/libavformat/flvdec.c > @@ -649,7 +649,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream > *astream, > sizeof(str_val)); > av_dict_set(&s->metadata, key, str_val, 0); > } else if (amf_type == AMF_DATA_TYPE_NUMBER) { > -snprintf(str_val, sizeof(str_val), "%.f", num_val); > +snprintf(str_val, sizeof(str_val), "%.12g", num_val); > av_dict_set(&s->metadata, key, str_val, 0); > } else if (amf_type == AMF_DATA_TYPE_STRING) { > av_dict_set(&s->metadata, key, str_val, 0); > diff --git a/tests/ref/fate/flv-add_keyframe_index > b/tests/ref/fate/flv-add_keyframe_index > index 1c4da65..ce3809e 100644 > --- a/tests/ref/fate/flv-add_keyframe_index > +++ b/tests/ref/fate/flv-add_keyframe_index > @@ -7,6 +7,6 @@ canSeekToEnd=true > datasize=629776 > videosize=629381 > audiosize=0 > -lasttimestamp=20 > +lasttimestamp=19.8571428571 > lastkeyframetimestamp=19 > lastkeyframelocation=597963 > -- Ping, any comments? ___ 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 2/2] lavfi/showinfo: support regions of interest sidedata
On Sat, Mar 9, 2019 at 11:44 PM Thomas Xu wrote: > > +for (int index = 0; index < nb_rois; index++) { > +av_log(ctx, AV_LOG_INFO, "index: %d, region: (%d %d)/(%d %d), qp > offset: %d/%d", > + index, roi->left, roi->top, roi->right, roi->bottom, > roi->qoffset.num, roi->qoffset.den); > +} > > pointer roi never ++, it always point to the first > AVRegionOfInterest structure. Thanks the catch, this issue have been solved in local repository, will update other version after some dependencies merge, ___ 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] avcodec/packet: initialize payload size to zero
On Wed, Apr 3, 2019 at 11:57 AM Andriy Gelman wrote: > > From: Andriy Gelman > > --- > libavcodec/avpacket.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c > index 8f0603df78..6ae092ed31 100644 > --- a/libavcodec/avpacket.c > +++ b/libavcodec/avpacket.c > @@ -44,6 +44,7 @@ FF_ENABLE_DEPRECATION_WARNINGS > pkt->flags= 0; > pkt->stream_index = 0; > pkt->buf = NULL; > +pkt->size = 0; > pkt->side_data= NULL; > pkt->side_data_elems = 0; > } I think you can refer to the link about this question: https://www.mail-archive.com/ffmpeg-devel@ffmpeg.org/msg64312.html In this list, As Hendrik Leppkes likes to point out, " Code can currently rely on size/data to not be modified - and I'm sure there are also places where it does." So I think we can't change as this patch if can't find a way to fight the API break. Thanks. ___ 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 V2] lavf/flvdec: Fix AMF NUMBER type to metadata lost precision
On Thu, Apr 4, 2019 at 5:21 AM Michael Niedermayer wrote: > > On Thu, Mar 28, 2019 at 09:23:29PM +0800, Jun Zhao wrote: > > From: Jun Zhao > > > > Use %.12g replace %.f when save AMF NUMBER(double) type to > > metadata. And update fate ref. > > > > before this fix, we get FLV metadata like: > > > > Metadata: > > lasttimestamp : 113 > > lastkeyframetimestamp: 112 > > > > after this fix: > > > > Metadata: > > lasttimestamp : 113.005 > > lastkeyframetimestamp: 111.678 > > > > Signed-off-by: Jun Zhao > > --- > > libavformat/flvdec.c |2 +- > > tests/ref/fate/flv-add_keyframe_index |2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c > > index 445d58d..12bfd4b 100644 > > --- a/libavformat/flvdec.c > > +++ b/libavformat/flvdec.c > > @@ -649,7 +649,7 @@ static int amf_parse_object(AVFormatContext *s, > > AVStream *astream, > > sizeof(str_val)); > > av_dict_set(&s->metadata, key, str_val, 0); > > } else if (amf_type == AMF_DATA_TYPE_NUMBER) { > > -snprintf(str_val, sizeof(str_val), "%.f", num_val); > > +snprintf(str_val, sizeof(str_val), "%.12g", num_val); > > av_dict_set(&s->metadata, key, str_val, 0); > > } else if (amf_type == AMF_DATA_TYPE_STRING) { > > av_dict_set(&s->metadata, key, str_val, 0); > > diff --git a/tests/ref/fate/flv-add_keyframe_index > > b/tests/ref/fate/flv-add_keyframe_index > > index 1c4da65..ce3809e 100644 > > --- a/tests/ref/fate/flv-add_keyframe_index > > +++ b/tests/ref/fate/flv-add_keyframe_index > > @@ -7,6 +7,6 @@ canSeekToEnd=true > > datasize=629776 > > videosize=629381 > > audiosize=0 > > -lasttimestamp=20 > > +lasttimestamp=19.8571428571 > > does every platform we support produce the same number here ? > if not then make fate would break > its a lot of digits after the decimal point, floats are not exact ... %g flag characters for snprintf is part of C 90 standand, so I think it's ok if the platform with C 90 standand suppoted. For log digits after the decimal point, how about change from %.12g to %.6g? Any other suggestion? -BEGIN PGP SIGNATURE- Version: GnuPG v1 iEYEARECAAYFAlylI7AACgkQYR7HhwQLD6uA0gCgk2yOM8TwH8T6oLhoU+20CnRT XbEAnAuIClxs4buySSU6USaIhAxeqNuV =tDZ7 -END PGP SIGNATURE- ___ 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 for Reproducing Issue 7827
On Thu, Apr 4, 2019 at 2:33 PM Peter Belkner wrote: > > This patch does not improve or fix something instead it is meant for > easily reproducing issue 7827 (as requested, cf. > https://trac.ffmpeg.org/ticket/7827). I've to admit that I don't know > how to produce a patch by "git format-patch" instead it was made by "git > diff > muxing.patch". > A lot of docs for this type question, this is a refer https://www.x.org/wiki/Development/Documentation/SubmittingPatches/ You can used the command like: git format-patch HEAD~1 # create a patch for the last commit And I think "git diff > muxing.patch" will drop the commit message, it's a part of the patch for review, Tks. diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c index 08da98e574..75766f497b 100644 --- a/doc/examples/muxing.c +++ b/doc/examples/muxing.c @@ -49,6 +49,8 @@ #define SCALE_FLAGS SWS_BICUBIC +#define MUX_MATROSKA_FLAC + // a wrapper around a single output AVStream typedef struct OutputStream { AVStream *st; @@ -600,7 +602,12 @@ int main(int argc, char **argv) encode_video = 1; } if (fmt->audio_codec != AV_CODEC_ID_NONE) { -add_stream(&audio_st, oc, &audio_codec, fmt->audio_codec); +#if defined (MUX_MATROSKA_FLAC) // [ + if (!strcmp("matroska",fmt->name)) +add_stream(&audio_st, oc, &audio_codec, AV_CODEC_ID_FLAC); + else +#endif // ] + add_stream(&audio_st, oc, &audio_codec, fmt->audio_codec); have_audio = 1; encode_audio = 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".
Re: [FFmpeg-devel] Patch for Reproducing Issue 7827
On Thu, Apr 4, 2019 at 3:12 PM Peter Belkner wrote: > > On 04.04.2019 08:49, myp...@gmail.com wrote: > > On Thu, Apr 4, 2019 at 2:33 PM Peter Belkner wrote: > > This patch does not improve or fix something instead it is meant for > easily reproducing issue 7827 (as requested, cf. > https://trac.ffmpeg.org/ticket/7827). I've to admit that I don't know > how to produce a patch by "git format-patch" instead it was made by "git > diff > muxing.patch". > > A lot of docs for this type question, this is a refer > https://www.x.org/wiki/Development/Documentation/SubmittingPatches/ > > You can used the command like: > > git format-patch HEAD~1 # create a patch for the last commit > > And I think "git diff > muxing.patch" will drop the commit message, > it's a part of the patch for review, Tks. > > The patch produced with your command is attached. This is *not* the patch I > want to provide. > > Just believe me: I'm able to search the internet myself and luckily finally > found > https://stackoverflow.com/questions/5159185/create-a-git-patch-from-the-changes-in-the-current-working-directory. > > BTW: I already spend hours to narrow this issue to libavformat. Just eat the > provided patch either from the issue itself (cf. > https://trac.ffmpeg.org/ticket/7827) or from this mailing list OR LET IT BE. > > Cheers. Please try the patch https://patchwork.ffmpeg.org/patch/12612/, Thanks. ___ 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 V1] lavf/matroskaenc: Fix memory leak after write trailer
On Thu, Apr 4, 2019 at 5:43 PM Hendrik Leppkes wrote: > > On Thu, Apr 4, 2019 at 11:25 AM Jun Zhao wrote: > > > > From: Jun Zhao > > > > Fix memory leak after write trailer for #7827 > > > > Signed-off-by: Jun Zhao > > --- > > libavformat/matroskaenc.c |2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c > > index b9f99c4..22ba93a 100644 > > --- a/libavformat/matroskaenc.c > > +++ b/libavformat/matroskaenc.c > > @@ -2571,13 +2571,13 @@ static int mkv_write_trailer(AVFormatContext *s) > > // check if we have an audio packet cached > > if (mkv->cur_audio_pkt.size > 0) { > > ret = mkv_write_packet_internal(s, &mkv->cur_audio_pkt, 0); > > -av_packet_unref(&mkv->cur_audio_pkt); > > if (ret < 0) { > > av_log(s, AV_LOG_ERROR, > > "Could not write cached audio packet ret:%d\n", ret); > > return ret; > > } > > } > > +av_packet_unref(&mkv->cur_audio_pkt); > > > > Won't this leak instead when the error path above is triggered? > Also, whats in the packet if it has a size of 0? > I think is mkv_write_packet() with the codec_type == AVMEDIA_TYPE_AUDIO in https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/matroskaenc.c#L2537 ___ 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 V2] lavf/matroskaenc: Fix memory leak after write trailer
On Fri, Apr 5, 2019 at 12:38 AM Andreas Rheinhardt via ffmpeg-devel < ffmpeg-devel@ffmpeg.org> wrote: > > Jun Zhao: > > From: Jun Zhao > > > > Fix memory leak after write trailer for #7827, only store a audio > > packet whose buffer has size greater than zero in cur_audio_pkt. > > > > Thanks to Andreas Rheinhardt for the suggestions. > > > > Signed-off-by: Jun Zhao > > --- > > libavformat/matroskaenc.c |3 ++- > > 1 files changed, 2 insertions(+), 1 deletions(-) > > > > diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c > > index b9f99c4..06f3aeb 100644 > > --- a/libavformat/matroskaenc.c > > +++ b/libavformat/matroskaenc.c > > @@ -2534,7 +2534,8 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt) > > // buffer an audio packet to ensure the packet containing the video > > // keyframe's timecode is contained in the same cluster for WebM > > if (codec_type == AVMEDIA_TYPE_AUDIO) { > > -ret = av_packet_ref(&mkv->cur_audio_pkt, pkt); > > +if (pkt->size > 0) > > +ret = av_packet_ref(&mkv->cur_audio_pkt, pkt); > > } else > > ret = mkv_write_packet_internal(s, pkt, 0); > > return ret; > > > Seems that I took quite a lot of time to write my commit message. I > don't care which patch gets committed, but I presume you did run > valgrind to make sure that it actually fixes #7827? > > - Andreas Yes, I've run the valgrind for muxing with FLAC and other audio codec for this issue. ___ 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 V1] doc/examples/metadata: fix the example can't dump FLV metadata
On Wed, Apr 3, 2019 at 3:26 PM Jun Zhao wrote: > > From: Jun Zhao > > fix the example can't dump FLV metadata. > > Signed-off-by: Jun Zhao > --- > doc/examples/metadata.c |5 + > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/doc/examples/metadata.c b/doc/examples/metadata.c > index e330d07..b6cfa6b 100644 > --- a/doc/examples/metadata.c > +++ b/doc/examples/metadata.c > @@ -47,6 +47,11 @@ int main (int argc, char **argv) > if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL))) > return ret; > > +if ((ret = avformat_find_stream_info(fmt_ctx, NULL)) < 0) { > +av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n"); > +return ret; > +} > + > while ((tag = av_dict_get(fmt_ctx->metadata, "", tag, > AV_DICT_IGNORE_SUFFIX))) > printf("%s=%s\n", tag->key, tag->value); > > -- > 1.7.1 > Pused, Thanks ___ 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] lavfi: add nlmeans_opencl filter
On Mon, Apr 8, 2019 at 9:33 AM Song, Ruiling wrote: > > > -Original Message- > > From: Song, Ruiling > > Sent: Monday, April 1, 2019 3:53 PM > > To: ffmpeg-devel@ffmpeg.org > > Cc: Song, Ruiling > > Subject: [PATCH] lavfi: add nlmeans_opencl filter > > > > Signed-off-by: Ruiling Song > > --- > > This filter runs about 2x faster on integrated GPU than nlmeans on my > > Skylake > > CPU. > > Anybody like to give some comments? > > Ping? > Tested and verified in i5-8265U OpenCL CPU/pocl 1.2fps with 1080P input OpenCL GPU/intel NEO 1.2 fps with 1080P input ___ 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]lavf/movenc: Pass correct pointer to av_log().
On Mon, Apr 8, 2019 at 5:30 AM Carl Eugen Hoyos wrote: > > Hi! > > Attached patch is what git grep showed me after seeing ecdaa4b4 by Paul. > > Please comment, Carl Eugen LGTM if pass the fate. Thanks ___ 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 V2] lavf/matroskaenc: Fix memory leak after write trailer
On Mon, Apr 8, 2019 at 9:09 AM myp...@gmail.com wrote: > > > > On Fri, Apr 5, 2019 at 12:38 AM Andreas Rheinhardt via ffmpeg-devel > wrote: > > > > Jun Zhao: > > > From: Jun Zhao > > > > > > Fix memory leak after write trailer for #7827, only store a audio > > > packet whose buffer has size greater than zero in cur_audio_pkt. > > > > > > Thanks to Andreas Rheinhardt for the suggestions. > > > > > > Signed-off-by: Jun Zhao > > > --- > > > libavformat/matroskaenc.c |3 ++- > > > 1 files changed, 2 insertions(+), 1 deletions(-) > > > > > > diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c > > > index b9f99c4..06f3aeb 100644 > > > --- a/libavformat/matroskaenc.c > > > +++ b/libavformat/matroskaenc.c > > > @@ -2534,7 +2534,8 @@ static int mkv_write_packet(AVFormatContext *s, > > > AVPacket *pkt) > > > // buffer an audio packet to ensure the packet containing the video > > > // keyframe's timecode is contained in the same cluster for WebM > > > if (codec_type == AVMEDIA_TYPE_AUDIO) { > > > -ret = av_packet_ref(&mkv->cur_audio_pkt, pkt); > > > +if (pkt->size > 0) > > > +ret = av_packet_ref(&mkv->cur_audio_pkt, pkt); > > > } else > > > ret = mkv_write_packet_internal(s, pkt, 0); > > > return ret; > > > > > Seems that I took quite a lot of time to write my commit message. I > > don't care which patch gets committed, but I presume you did run > > valgrind to make sure that it actually fixes #7827? > > > > - Andreas > Yes, I've run the valgrind for muxing with FLAC and other audio codec for > this issue. Will close the https://trac.ffmpeg.org/ticket/7827, Thanks ___ 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 RFC v2 1/3] fftools: Add thumbnail output to vaapi_h264 decoder
On Mon, Apr 8, 2019 at 4:54 PM Zachary Zhou wrote: > > This is sample code for reference > > HW support for decode+scaling in a single HW command (VDBOX+SFC). > The primary target usage is video analytics, but can be used playback, > transcoding, etc. > > For VAAPI - > https://github.com/intel/libva > basically, it allows multiple outputs (in different resolutions) using the > decode context in a single call (you can search for “additional_outputs” in > va.h). > > VAAPI sample code - > https://github.com/intel/libva-utils/commit/957a269f02b00760b7e807643c821ee26abc529b > --- > fftools/ffmpeg_opt.c | 28 > 1 file changed, 28 insertions(+) > > diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c > index 53d688b764..c0dc376541 100644 > --- a/fftools/ffmpeg_opt.c > +++ b/fftools/ffmpeg_opt.c > @@ -111,6 +111,10 @@ int filter_nbthreads = 0; > int filter_complex_nbthreads = 0; > int vstats_version = 2; > > +int thumbnail_flags = 0; > +int thumbnail_width = 0; > +int thumbnail_height = 0; > +char *thumbnail_format; > > static int intra_only = 0; > static int file_overwrite = 0; > @@ -1100,6 +1104,13 @@ static int open_input_file(OptionsContext *o, const > char *filename) > av_dict_set(&o->g->format_opts, "scan_all_pmts", "1", > AV_DICT_DONT_OVERWRITE); > scan_all_pmts_set = 1; > } > + > +//thumbnail opt > +av_dict_set_int(&o->g->codec_opts, "thumbnail_flags", thumbnail_flags, > AV_DICT_DONT_OVERWRITE); > +av_dict_set_int(&o->g->codec_opts, "thumbnail_width", thumbnail_width, > AV_DICT_DONT_OVERWRITE); > +av_dict_set_int(&o->g->codec_opts, "thumbnail_height", thumbnail_height, > AV_DICT_DONT_OVERWRITE); > +av_dict_set(&o->g->codec_opts, "thumbnail_format", thumbnail_format, > AV_DICT_DONT_OVERWRITE); > + > /* open the input file with generic avformat function */ > err = avformat_open_input(&ic, filename, file_iformat, > &o->g->format_opts); > if (err < 0) { > @@ -2898,6 +2909,13 @@ static int opt_vstats_file(void *optctx, const char > *opt, const char *arg) > return 0; > } > > +static int opt_thumbnail_format(void *optctx, const char *opt, const char > *arg) > +{ > +av_free (thumbnail_format); > +thumbnail_format = av_strdup (arg); > +return 0; > +} > + > static int opt_vstats(void *optctx, const char *opt, const char *arg) > { > char filename[40]; > @@ -3746,5 +3764,15 @@ const OptionDef options[] = { > { "filter_hw_device", HAS_ARG | OPT_EXPERT, { .func_arg = > opt_filter_hw_device }, > "set hardware device used when filtering", "device" }, > > +//thumbnail opt > +{ "thumbnail_flags",OPT_VIDEO | HAS_ARG | OPT_INT | OPT_INPUT, { > &thumbnail_flags }, > + "set thumbnail flags", "thumbnail" }, > +{ "thumbnail_width",OPT_VIDEO | HAS_ARG | OPT_INT | OPT_INPUT, { > &thumbnail_width }, > + "set thumbnail width", "thumbnail" }, > +{ "thumbnail_height", OPT_VIDEO | HAS_ARG | OPT_INT | OPT_INPUT, { > &thumbnail_height }, > + "set thumbnail height", "thumbnail" }, > +{ "thumbnail_format", OPT_VIDEO | HAS_ARG | OPT_EXPERT , { .func_arg = > opt_thumbnail_format }, > +"set thumbnail format", "thumbnail" }, > + > { NULL, }, > }; > -- > 2.17.1 Changed the FFmpeg tools for a hardware specific feature is not good idea, I think. The other question is, how to enable this function from FFmpeg API level? (We can not just enable a feature from the FFmpeg command tools). ___ 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 V2] lavf/matroskaenc: Fix memory leak after write trailer
On Mon, Apr 8, 2019 at 3:29 PM myp...@gmail.com wrote: > > On Mon, Apr 8, 2019 at 9:09 AM myp...@gmail.com wrote: > > > > > > > > On Fri, Apr 5, 2019 at 12:38 AM Andreas Rheinhardt via ffmpeg-devel > > wrote: > > > > > > Jun Zhao: > > > > From: Jun Zhao > > > > > > > > Fix memory leak after write trailer for #7827, only store a audio > > > > packet whose buffer has size greater than zero in cur_audio_pkt. > > > > > > > > Thanks to Andreas Rheinhardt for the suggestions. > > > > > > > > Signed-off-by: Jun Zhao > > > > --- > > > > libavformat/matroskaenc.c |3 ++- > > > > 1 files changed, 2 insertions(+), 1 deletions(-) > > > > > > > > diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c > > > > index b9f99c4..06f3aeb 100644 > > > > --- a/libavformat/matroskaenc.c > > > > +++ b/libavformat/matroskaenc.c > > > > @@ -2534,7 +2534,8 @@ static int mkv_write_packet(AVFormatContext *s, > > > > AVPacket *pkt) > > > > // buffer an audio packet to ensure the packet containing the video > > > > // keyframe's timecode is contained in the same cluster for WebM > > > > if (codec_type == AVMEDIA_TYPE_AUDIO) { > > > > -ret = av_packet_ref(&mkv->cur_audio_pkt, pkt); > > > > +if (pkt->size > 0) > > > > +ret = av_packet_ref(&mkv->cur_audio_pkt, pkt); > > > > } else > > > > ret = mkv_write_packet_internal(s, pkt, 0); > > > > return ret; > > > > > > > Seems that I took quite a lot of time to write my commit message. I > > > don't care which patch gets committed, but I presume you did run > > > valgrind to make sure that it actually fixes #7827? > > > > > > - Andreas > > Yes, I've run the valgrind for muxing with FLAC and other audio codec for > > this issue. > > Will close the https://trac.ffmpeg.org/ticket/7827, Thanks Pushed (updated the commit message from Andreas Rheinhardt's patch and add Andreas Rheinhardt to Signed-off-by list). Thanks ___ 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 V1 1/2] lavf/hls: Cleanup the applehttp
On Fri, Apr 12, 2019 at 10:08 PM Steven Liu wrote: > > > > > 在 2019年4月12日,19:20,Jun Zhao 写道: > > > > From: Jun Zhao > > > > Cleanup the applehttp as demuxer name, when use the command : > > > > ffmpeg -formats, get the confused information like: > > " > > E hls Apple HTTP Live Streaming > > D hls,applehttp Apple HTTP Live Streaming > > " > > we don't use applehttp as the demuxer/muxer name usually, so > > cleanup the applehttp and update the documents. > > > > After the change, get the information from "ffmpeg -formats": > > " > > DE hls Apple HTTP Live Streaming > > " > > > > Signed-off-by: Jun Zhao > > --- > > doc/demuxers.texi | 20 +--- > > libavformat/hls.c |4 ++-- > > 2 files changed, 11 insertions(+), 13 deletions(-) > > > > diff --git a/doc/demuxers.texi b/doc/demuxers.texi > > index 2b0b37b..57d1532 100644 > > --- a/doc/demuxers.texi > > +++ b/doc/demuxers.texi > > @@ -25,17 +25,6 @@ Audible Format 2, 3, and 4 demuxer. > > > > This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files. > > > > -@section applehttp > > - > > -Apple HTTP Live Streaming demuxer. > > - > > -This demuxer presents all AVStreams from all variant streams. > > -The id field is set to the bitrate variant index number. By setting > > -the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay), > > -the caller can decide which variant streams to actually receive. > > -The total bitrate of the variant that the stream belongs to is > > -available in a metadata key named "variant_bitrate". > > - > > @section apng > > > > Animated Portable Network Graphics demuxer. > > @@ -320,6 +309,15 @@ infinitely. > > > > HLS demuxer > > > > +Apple HTTP Live Streaming demuxer. > > + > > +This demuxer presents all AVStreams from all variant streams. > > +The id field is set to the bitrate variant index number. By setting > > +the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay), > > +the caller can decide which variant streams to actually receive. > > +The total bitrate of the variant that the stream belongs to is > > +available in a metadata key named "variant_bitrate". > > + > > It accepts the following options: > > > > @table @option > > diff --git a/libavformat/hls.c b/libavformat/hls.c > > index f4e4498..1b61b4b 100644 > > --- a/libavformat/hls.c > > +++ b/libavformat/hls.c > > @@ -2318,14 +2318,14 @@ static const AVOption hls_options[] = { > > }; > > > > static const AVClass hls_class = { > > -.class_name = "hls,applehttp", > > +.class_name = "hls demuxer", > > .item_name = av_default_item_name, > > .option = hls_options, > > .version= LIBAVUTIL_VERSION_INT, > > }; > > > > AVInputFormat ff_hls_demuxer = { > > -.name = "hls,applehttp", > > +.name = "hls", > > .long_name = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"), > > .priv_class = &hls_class, > > .priv_data_size = sizeof(HLSContext), > > -- > > 1.7.1 Will apply, Thanks ___ 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] fftools/ffmpeg_filter: Fix error when both hwaccel and stream_loop applied
On Mon, Apr 15, 2019 at 11:11 AM Leo Zhang wrote: > > For example: > ./ffmpeg -hwaccel cuvid -c:v h264_cuvid -stream_loop -1 -i in.flv -c:v > h264_nvenc out.flv > will print below error messages after one loop: > Impossible to convert between the formats supported by the filter > 'Parsed_null_0' and the filter 'auto_scaler_0' > Error reinitializing filters! > Failed to inject frame into filter network: Function not implemented > > Add b_hwaccel check to fix the bug > Signed-off-by: Leo Zhang > --- > fftools/ffmpeg_filter.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c > index 72838de..b8dd90a 100644 > --- a/fftools/ffmpeg_filter.c > +++ b/fftools/ffmpeg_filter.c > @@ -460,6 +460,7 @@ static int configure_output_video_filter(FilterGraph *fg, > OutputFilter *ofilter, > int pad_idx = out->pad_idx; > int ret; > char name[255]; > +int b_hwaccel = ost->sync_ist && ost->sync_ist->hwaccel_id!=HWACCEL_NONE; > > snprintf(name, sizeof(name), "out_%d_%d", ost->file_index, ost->index); > ret = avfilter_graph_create_filter(&ofilter->filter, > @@ -469,7 +470,7 @@ static int configure_output_video_filter(FilterGraph *fg, > OutputFilter *ofilter, > if (ret < 0) > return ret; > > -if (ofilter->width || ofilter->height) { > +if (!b_hwaccel && (ofilter->width || ofilter->height)) { > char args[255]; > AVFilterContext *filter; > AVDictionaryEntry *e = NULL; > -- > 1.8.3.1 > Please refer to the link: https://patchwork.ffmpeg.org/patch/8173/, Mark given a comments for this patch. ___ 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 V1] lavf/oggparsevorbis: Fix change the case of metadata keys issue
On Tue, Apr 16, 2019 at 5:51 AM Michael Niedermayer wrote: > > On Mon, Apr 15, 2019 at 09:58:30AM +0800, Jun Zhao wrote: > > From: Jun Zhao > > > > The spec in https://xiph.org/vorbis/doc/v-comment.html states that > > the metadata keys are case-insensitive, so don't change the case > > and update the fate test case. > > > > Fix #7784 > > > > Signed-off-by: Jun Zhao > > --- > > libavformat/oggparsevorbis.c |9 - > > tests/ref/fate/limited_input_seek|2 +- > > tests/ref/fate/limited_input_seek-copyts |2 +- > > 3 files changed, 6 insertions(+), 7 deletions(-) > > > > diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c > > index bcfd246..c3c8d38 100644 > > --- a/libavformat/oggparsevorbis.c > > +++ b/libavformat/oggparsevorbis.c > > @@ -44,7 +44,7 @@ static int ogm_chapter(AVFormatContext *as, uint8_t *key, > > uint8_t *val) > > int i, cnum, h, m, s, ms, keylen = strlen(key); > > AVChapter *chapter = NULL; > > > > -if (keylen < 9 || sscanf(key, "CHAPTER%03d", &cnum) != 1) > > +if (keylen < 9 || (av_strcasecmp(key, "CHAPTER")!=0 && sscanf(key+7, > > "%03d", &cnum) != 1)) > > this looks a bit odd, shouldnt this use av_strncasecmp() ? > It's in order to be compatible with the fate test case vorbis-1833-chapthers, in this test, we use lower case in test clip but check upper case in the code. ___ 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 V1 1/2] lavf/hls: Cleanup the applehttp
On Mon, Apr 15, 2019 at 11:02 PM Carl Eugen Hoyos wrote: > > 2019-04-12 13:20 GMT+02:00, Jun Zhao : > > From: Jun Zhao > > > > Cleanup the applehttp as demuxer name, when use the command : > > > > ffmpeg -formats, get the confused information like: > > " > > E hls Apple HTTP Live Streaming > > D hls,applehttp Apple HTTP Live Streaming > > " > > we don't use applehttp as the demuxer/muxer name usually, so > > cleanup the applehttp and update the documents. > > > > After the change, get the information from "ffmpeg -formats": > > " > > DE hls Apple HTTP Live Streaming > > " > > > > Signed-off-by: Jun Zhao > > --- > > doc/demuxers.texi | 20 +--- > > libavformat/hls.c |4 ++-- > > 2 files changed, 11 insertions(+), 13 deletions(-) > > > diff --git a/libavformat/hls.c b/libavformat/hls.c > > index f4e4498..1b61b4b 100644 > > --- a/libavformat/hls.c > > +++ b/libavformat/hls.c > > @@ -2318,14 +2318,14 @@ static const AVOption hls_options[] = { > > }; > > > > static const AVClass hls_class = { > > -.class_name = "hls,applehttp", > > +.class_name = "hls demuxer", > > .item_name = av_default_item_name, > > .option = hls_options, > > .version= LIBAVUTIL_VERSION_INT, > > }; > > > > AVInputFormat ff_hls_demuxer = { > > -.name = "hls,applehttp", > > +.name = "hls", > > This needs an entry in apichanges (which is impossible because > there was no minor version bump) iirc, I suggest you add an > entry to Changelog. > > Carl Eugen Will add an entry to APIChange, Thanks the remind. I didn't even realize this is a API change problem before this comment. sadly. ___ 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 V1 2/2] lavf: bump version/add Changelog entry when cleanup applehttp
On Tue, Apr 16, 2019 at 4:42 PM Hendrik Leppkes wrote: > > On Tue, Apr 16, 2019 at 7:57 AM Jun Zhao wrote: > > > > From: Jun Zhao > > > > commit abfeba9 "lavf/hls: Cleanup the applehttp" missed > > the version bump and Changelog entry. > > > > Signed-off-by: Jun Zhao > > --- > > Changelog |1 + > > libavformat/version.h |2 +- > > 2 files changed, 2 insertions(+), 1 deletions(-) > > > > diff --git a/Changelog b/Changelog > > index 5b2b1e5..2930471 100644 > > --- a/Changelog > > +++ b/Changelog > > @@ -24,6 +24,7 @@ version : > > - KUX demuxer > > - AV1 frame split bitstream filter > > - lscr decoder > > +- cleanup applehttp in hls demuxer > > > > If you read the other changelog entries, does this seem like matching > the pattern in there? :) > ChangeLog is for end-users, for changes that developers should care > about, there is APIchanges. > > - Hendrik Thanks the comments, Hendrik, will update APIChanges ___ 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 V1] lavf/oggparsevorbis: Fix change the case of metadata keys issue
On Wed, Apr 17, 2019 at 6:41 AM Michael Niedermayer wrote: > > On Tue, Apr 16, 2019 at 09:33:08AM +0800, myp...@gmail.com wrote: > > On Tue, Apr 16, 2019 at 5:51 AM Michael Niedermayer > > wrote: > > > > > > On Mon, Apr 15, 2019 at 09:58:30AM +0800, Jun Zhao wrote: > > > > From: Jun Zhao > > > > > > > > The spec in https://xiph.org/vorbis/doc/v-comment.html states that > > > > the metadata keys are case-insensitive, so don't change the case > > > > and update the fate test case. > > > > > > > > Fix #7784 > > > > > > > > Signed-off-by: Jun Zhao > > > > --- > > > > libavformat/oggparsevorbis.c |9 - > > > > tests/ref/fate/limited_input_seek|2 +- > > > > tests/ref/fate/limited_input_seek-copyts |2 +- > > > > 3 files changed, 6 insertions(+), 7 deletions(-) > > > > > > > > diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c > > > > index bcfd246..c3c8d38 100644 > > > > --- a/libavformat/oggparsevorbis.c > > > > +++ b/libavformat/oggparsevorbis.c > > > > @@ -44,7 +44,7 @@ static int ogm_chapter(AVFormatContext *as, uint8_t > > > > *key, uint8_t *val) > > > > int i, cnum, h, m, s, ms, keylen = strlen(key); > > > > AVChapter *chapter = NULL; > > > > > > > > -if (keylen < 9 || sscanf(key, "CHAPTER%03d", &cnum) != 1) > > > > +if (keylen < 9 || (av_strcasecmp(key, "CHAPTER")!=0 && > > > > sscanf(key+7, "%03d", &cnum) != 1)) > > > > > > this looks a bit odd, shouldnt this use av_strncasecmp() ? > > > > > It's in order to be compatible with the fate test case > > vorbis-1833-chapthers, in this test, > > we use lower case in test clip but check upper case in the code. > > av_strcasecmp() will only succeed if the string ends after "CHAPTER" and > contains no number which is why av_strncasecmp() feels like more effective. > The problem is ultimatle that keylen is at this point >= 9 while > the only case where av_strcasecmp with "CHAPTER" == 0 is with a > keylen of 7. Thats tricky to achieve ;) > > Or said differently this code is not a case insensitive version of the > previous Thanks the comments, will update the patch ___ 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 V2] lavf/oggparsevorbis: Fix change the case of metadata keys issue
On Wed, Apr 17, 2019 at 12:44 PM Jun Zhao wrote: > > From: Jun Zhao > > The spec in https://xiph.org/vorbis/doc/v-comment.html states that > the metadata keys are case-insensitive, so don't change the case > and update the fate test case. > > Fix #7784 > > Signed-off-by: Jun Zhao > --- > libavformat/oggparsevorbis.c |9 - > tests/ref/fate/limited_input_seek|2 +- > tests/ref/fate/limited_input_seek-copyts |2 +- > 3 files changed, 6 insertions(+), 7 deletions(-) > > diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c > index bcfd246..43f05f9 100644 > --- a/libavformat/oggparsevorbis.c > +++ b/libavformat/oggparsevorbis.c > @@ -44,7 +44,7 @@ static int ogm_chapter(AVFormatContext *as, uint8_t *key, > uint8_t *val) > int i, cnum, h, m, s, ms, keylen = strlen(key); > AVChapter *chapter = NULL; > > -if (keylen < 9 || sscanf(key, "CHAPTER%03d", &cnum) != 1) > +if (keylen < 9 || av_strncasecmp(key, "CHAPTER", 7) || sscanf(key+7, > "%03d", &cnum) != 1) > return 0; > > if (keylen <= 10) { > @@ -55,7 +55,7 @@ static int ogm_chapter(AVFormatContext *as, uint8_t *key, > uint8_t *val) > ms + 1000 * (s + 60 * (m + 60 * h)), > AV_NOPTS_VALUE, NULL); > av_free(val); > -} else if (!strcmp(key + keylen - 4, "NAME")) { > +} else if (!av_strcasecmp(key + keylen - 4, "NAME")) { > for (i = 0; i < as->nb_chapters; i++) > if (as->chapters[i]->id == cnum) { > chapter = as->chapters[i]; > @@ -91,7 +91,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m, > const uint8_t *p = buf; > const uint8_t *end = buf + size; > int updates= 0; > -unsigned n, j; > +unsigned n; > int s; > > /* must have vendor_length and user_comment_list_length */ > @@ -139,8 +139,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary > **m, > return AVERROR(ENOMEM); > } > > -for (j = 0; j < tl; j++) > -tt[j] = av_toupper(t[j]); > +memcpy(tt, t, tl); > tt[tl] = 0; > > memcpy(ct, v, vl); > diff --git a/tests/ref/fate/limited_input_seek > b/tests/ref/fate/limited_input_seek > index e0c4bf1..3269dce 100644 > --- a/tests/ref/fate/limited_input_seek > +++ b/tests/ref/fate/limited_input_seek > @@ -1 +1 @@ > -20a1bb9a1cfb23c1fe86f14e6065cd95 > +ae878bdaec23f36a63d142165fe57f49 > diff --git a/tests/ref/fate/limited_input_seek-copyts > b/tests/ref/fate/limited_input_seek-copyts > index 92790a8..6eeaef8 100644 > --- a/tests/ref/fate/limited_input_seek-copyts > +++ b/tests/ref/fate/limited_input_seek-copyts > @@ -1 +1 @@ > -ec3604b1954ed80de364b8ef491771ce > +ffe8a674bdf38e4f650f91963debc654 > -- > 1.7.1 > Ping? ___ 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] libavcodec: QSV protect GPB code with CO3 define
On Mon, Apr 22, 2019 at 7:38 PM Li, Zhong wrote: > > > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf > > Of Andreas Håkon via ffmpeg-devel > > Sent: Thursday, April 18, 2019 6:11 PM > > To: FFmpeg development discussions and patches > > > > Cc: Andreas Håkon > > Subject: [FFmpeg-devel] [PATCH] libavcodec: QSV protect GPB code with > > CO3 define > > > > Hi, > > > > In response to this ticket I provide the first part of the patch: > > https://trac.ffmpeg.org/ticket/7839 > > > > This QSV_HAVE_GPB code needs to be protected by QSV_HAVE_CO3. > > > > Regards. > > A.H. > > Why it is must? It is impossible that QSV_HAVE_GPB is enabled but > QSV_HAVE_CO3 is not enabled. > QSV_HAVE_GPB is enabled by MSDK API v1.18, but QSV_HAVE_CO3 is API V1.11. In the ticket, Andreas Håkon pointed out that it is "only as a temporary solution", so I think it's a workaround. ___ 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] libavcodec: QSV protect GPB code with CO3 define
On Mon, Apr 22, 2019 at 8:42 PM Andreas Håkon wrote: > > > ‐‐‐ Original Message ‐‐‐ > On Monday, 22 de April de 2019 14:17, myp...@gmail.com > wrote: > > > On Mon, Apr 22, 2019 at 7:38 PM Li, Zhong zhong...@intel.com wrote: > > > > > > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf > > > > Of Andreas Håkon via ffmpeg-devel > > > > Sent: Thursday, April 18, 2019 6:11 PM > > > > To: FFmpeg development discussions and patches > > > > ffmpeg-devel@ffmpeg.org > > > > Cc: Andreas Håkon andreas.ha...@protonmail.com > > > > Subject: [FFmpeg-devel] [PATCH] libavcodec: QSV protect GPB code with > > > > CO3 define > > > > Hi, > > > > In response to this ticket I provide the first part of the patch: > > > > https://trac.ffmpeg.org/ticket/7839 > > > > This QSV_HAVE_GPB code needs to be protected by QSV_HAVE_CO3. > > > > Regards. > > > > A.H. > > > > > > Why it is must? It is impossible that QSV_HAVE_GPB is enabled but > > > QSV_HAVE_CO3 is not enabled. > > > QSV_HAVE_GPB is enabled by MSDK API v1.18, but QSV_HAVE_CO3 is API V1.11. > > > > In the ticket, Andreas Håkon pointed out that it is "only as a > > temporary solution", so I think it's a workaround. > > Hi mypopy, > > My patch only resolves one part of the problem. It's not a temporary > solution, but a forgot in the original code. > > I feel Mr. Zhong needs to fix the "mpeg2_qsv" encoder. But this simple > patch can help with the "temporary solution" of disable QVBR in the code. > In any case, this patch needs to be merged. > > Regards. > A.H. Thanks the details and clarification, I've got the point for this patch. ___ 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 V2] lavf/oggparsevorbis: Fix change the case of metadata keys issue
On Mon, Apr 22, 2019 at 10:43 PM Derek Buitenhuis wrote: > > On 22/04/2019 13:19, myp...@gmail.com wrote: > > Ping? > > > > LGTM. > > - Derek Pushed, Thanks ___ 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 V2] lavfi/frei0r: Fixes the compilation warnings
On Sun, Apr 21, 2019 at 9:03 PM Paul B Mahol wrote: > > On 4/21/19, Jun Zhao wrote: > > From: Jun Zhao > > > > Fixes the compilation warnings > > > > Signed-off-by: Jun Zhao > > --- > > libavfilter/vf_frei0r.c |2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c > > index c775ed1..165fbd7 100644 > > --- a/libavfilter/vf_frei0r.c > > +++ b/libavfilter/vf_frei0r.c > > @@ -127,7 +127,7 @@ static int set_param(AVFilterContext *ctx, > > f0r_param_info_t info, int index, cha > > break; > > > > case F0R_PARAM_STRING: > > -val.str = param; > > +val.str = (f0r_param_string *)param; > > break; > > } > > > > -- > > 1.7.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". > > lgtm Pushed, Thanks the review and comment. ___ 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] lavc/vaapi_encode_h264: add support for maxframesize
On Tue, Apr 23, 2019 at 11:29 AM Linjie Fu wrote: > > Add support for max frame size: > - max_frame_size (bytes) to indicate the allowed max frame size. > - pass_num to indicate number of passes. > - delta_qp to indicate adjust qp value. > > Currently only AVC encoder can support this settings in multiple pass case. > If the frame size exceeds, the encoder will do more pak passes to adjust the > QP value to control the frame size. > > Set Default num_passes to 4 (1~4), set delta_qp[4] = {1, 1, 1, 1}, use > new_qp for encoder if frame size exceeds the limitation: > new_qp = base_qp + delta_qp[0] + delta_qp[1] + ... > > ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -f rawvideo \ > -v verbose -s:v 352x288 -i ./input.yuv -vf format=nv12,hwupload \ > -c:v h264_vaapi -profile:v main -g 30 -bf 3 -max_frame_size 4 \ > -pass_num 2 -delta_qp 2 -vframes 100 -y ./max_frame_size.h264 > Some question list as follow: 1. Can I change delta_qp per pass, e,g, 4 pass 1, 2, 3, 4, use delta_qp[4] like: 1, 2, 4, 8? 2. So let's think about the limiting case, if we setting max_frame_size = 1 for 1080P, what's the action for this driver? 3. Maybe we can hide the pass_num and delta_qp, only export the max_frame_size for this case? I don't think export the driver QP adjustment detail logic to user space is good idea, user will confused about to how to set/adjust pass_num/delta_qp per pass. 4. Missing docs 5. What's the relationship about other bit rate control like VBR or MBBRC ? 6. Only 264 encoder support this feature? What platform have you tested? > Signed-off-by: Linjie Fu > --- > libavcodec/vaapi_encode.c | 46 ++ > libavcodec/vaapi_encode.h | 11 > libavcodec/vaapi_encode_h264.c | 15 +++ > 3 files changed, 72 insertions(+) > > diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c > index 2dda451882..762c42ef13 100644 > --- a/libavcodec/vaapi_encode.c > +++ b/libavcodec/vaapi_encode.c > @@ -236,6 +236,14 @@ static int vaapi_encode_issue(AVCodecContext *avctx, > goto fail; > } > > +if (ctx->max_frame_size) { > +err = vaapi_encode_make_param_buffer(avctx, pic, > VAEncMiscParameterBufferType, > +(char*) &ctx->mfs_params.misc, > +sizeof(ctx->mfs_params)); > +if (err < 0) > +goto fail; > +} > + > if (pic->type == PICTURE_TYPE_IDR) { > if (ctx->va_packed_headers & VA_ENC_PACKED_HEADER_SEQUENCE && > ctx->codec->write_sequence_header) { > @@ -1630,6 +1638,38 @@ rc_mode_found: > return 0; > } > > +static av_cold int vaapi_encode_init_max_frame_size(AVCodecContext *avctx) > +{ > +VAAPIEncodeContext *ctx = avctx->priv_data; > + > +uint32_t max_frame_size = ctx->max_frame_size; > +uint8_t num_passes = ctx->pass_num; > +uint8_t *delta_qp = av_mallocz_array(num_passes, sizeof(uint8_t)); > +int err = 0; > +int i = 0; > + > +if (!delta_qp) { > +err = AVERROR(ENOMEM); > +return err; > +} > +for (i = 0; i +delta_qp[i] = ctx->delta_qp; > +} > + > + > +ctx->mfs_params.misc.type = VAEncMiscParameterTypeMultiPassFrameSize; > +ctx->mfs_params.mfs.type = VAEncMiscParameterTypeMultiPassFrameSize; > +ctx->mfs_params.mfs.max_frame_size = max_frame_size; > +ctx->mfs_params.mfs.num_passes = num_passes; > +ctx->mfs_params.mfs.delta_qp = delta_qp; > + > +av_log(avctx, AV_LOG_VERBOSE, "Max Frame Size: %d bytes, " > + "num_passes: %d, delta_qp = %d.\n", > +ctx->max_frame_size, num_passes, > ctx->delta_qp); > + > +return 0; > +} > + > static av_cold int vaapi_encode_init_gop_structure(AVCodecContext *avctx) > { > VAAPIEncodeContext *ctx = avctx->priv_data; > @@ -2095,6 +2135,12 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) > goto fail; > } > > +if (ctx->max_frame_size) { > +err = vaapi_encode_init_max_frame_size(avctx); > +if (err < 0) > +goto fail; > +} > + > vas = vaCreateConfig(ctx->hwctx->display, > ctx->va_profile, ctx->va_entrypoint, > ctx->config_attributes, ctx->nb_config_attributes, > diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h > index 44a8db566e..557476d226 100644 > --- a/libavcodec/vaapi_encode.h > +++ b/libavcodec/vaapi_encode.h > @@ -176,6 +176,13 @@ typedef struct VAAPIEncodeContext { > // Desired B frame reference depth. > int desired_b_depth; > > +// Max Frame Size > +int max_frame_size; > +// Number Of Passes > +int pass_num; > +// Delta_qp For Each Pass > +int delta_qp; > + > // Explicitly set RC mode (otherwise attempt to pick from >
Re: [FFmpeg-devel] [FFmpeg-cvslog] lavfi/frei0r: Fixes the compilation warnings
On Wed, Apr 24, 2019 at 5:04 AM Carl Eugen Hoyos wrote: > > 2019-04-21 15:21 GMT+02:00, Jun Zhao : > > ffmpeg | branch: master | Jun Zhao | Sun Apr 21 > > 12:37:29 2019 +0800| [b272d5b9b6e189cb855ad393edf8524066bd0d07] | committer: > > Jun Zhao > > > > lavfi/frei0r: Fixes the compilation warnings > > > > Fixes the compilation warnings > > > > Reviewed-by: Paul B Mahol > > Signed-off-by: Jun Zhao > > > >> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b272d5b9b6e189cb855ad393edf8524066bd0d07 > > --- > > > > libavfilter/vf_frei0r.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c > > index c775ed1d99..165fbd7d81 100644 > > --- a/libavfilter/vf_frei0r.c > > +++ b/libavfilter/vf_frei0r.c > > @@ -127,7 +127,7 @@ static int set_param(AVFilterContext *ctx, > > f0r_param_info_t info, int index, cha > > break; > > > > case F0R_PARAM_STRING: > > -val.str = param; > > +val.str = (f0r_param_string *)param; > > How can I test this? > (Did you test it?) > > Carl Eugen You can build ffmpeg with frei0r in Ubuntu 18.04, if don't have this patch, it's will get the warning like: libavfilter/vf_frei0r.c:131:17: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] val.str = param; ^ gcc -v get out put as follow: Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04) ___ 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]lavfi/frei0r: Fix union and remove unneeded cast
On Wed, Apr 24, 2019 at 5:12 AM Carl Eugen Hoyos wrote: > > Hi! > > I failed to test attached patch but it seems like a more useful fix for > the following (past) warning: > libavfilter/vf_frei0r.c:130:17: warning: assignment to ‘char **’ from > incompatible pointer type ‘char *’ > > Please comment, Carl Eugen LGTM, looks like I given a wrong type casting in this case. ___ 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 V1 0/2] Use avctx->framerate first for frame rate setting
On Sat, Apr 27, 2019 at 8:22 PM Gyan wrote: > > > > On 27-04-2019 05:25 PM, Carl Eugen Hoyos wrote: > > 2019-04-27 13:17 GMT+02:00, Jun Zhao : > >> perfer avctx->framerate first than use avctx->time_base when > >> setting the frame rate to encoder. 1/time_base is not the > >> average frame rate if the frame rate is not constant. > > But why would the average framerate be a good choice to set > > the encoder timebase? > > > > Also, note that x264/5 RC looks at the framerate. > See > https://code.videolan.org/videolan/x264/commit/c583687fab832ba7eaf8626048f05ad1f861a855 > > I can generate a difference with x264 by setting -enc_time_base to > different values (with vsync vfr). > Maybe check that this change does not lead to a significant change in > output. Although I think this would be still an improvement for those > cases where r_frame_rate >> avg_frame_rate > > Gyan Yes, framerate and time_base is not close correlation in vfr case, e,g, I can setting the framerate = 60fps, but time_base = 1/1000 s, then setting pts like: time_base = 1/1000 s = 1 millisecond framerate = 60 fps per second PTS 01633506683100 ... PTS delta 161717161717 ... we will get 16ms * 20 frames + 17 ms * 40 frames = 1000ms ___ 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 V1 1/2] lavf/hls: Remove HLSContext.strict_std_compliance field
On Tue, Apr 16, 2019 at 2:04 PM Jun Zhao wrote: > > From: Jun Zhao > > After the commit 9f61abc8111, we can use AVFormatContext.strict_std_compliance > instead of HLSContext.strict_std_compliance to avoid the code redundancy. > > Signed-off-by: Jun Zhao > --- > libavformat/hls.c |4 +--- > 1 files changed, 1 insertions(+), 3 deletions(-) > > diff --git a/libavformat/hls.c b/libavformat/hls.c > index 1b61b4b..19ea88e 100644 > --- a/libavformat/hls.c > +++ b/libavformat/hls.c > @@ -203,7 +203,6 @@ typedef struct HLSContext { > int64_t cur_timestamp; > AVIOInterruptCB *interrupt_callback; > AVDictionary *avio_opts; > -int strict_std_compliance; > char *allowed_extensions; > int max_reload; > int http_persistent; > @@ -485,7 +484,7 @@ static struct rendition *new_rendition(HLSContext *c, > struct rendition_info *inf > return NULL; > > /* TODO: handle subtitles (each segment has to parsed separately) */ > -if (c->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) > +if (c->ctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) > if (type == AVMEDIA_TYPE_SUBTITLE) > return NULL; > > @@ -1786,7 +1785,6 @@ static int hls_read_header(AVFormatContext *s) > > c->ctx= s; > c->interrupt_callback = &s->interrupt_callback; > -c->strict_std_compliance = s->strict_std_compliance; > > c->first_packet = 1; > c->first_timestamp = AV_NOPTS_VALUE; > -- > 1.7.1 > Pushed, Thanks ___ 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] libavfilter: Add more operation supports in FFmpeg dnn native mode.
On Sun, Apr 28, 2019 at 5:27 PM wrote: > > This patch is for the support of derain filter project in GSoC. It adds > supports for the following operations: > > > > > (1) Conv padding method: "SAME" and "VALID" > > (2) Dilation > > (3) Activation: "NONE" and "LEAKY_RELU" > > > > > These operations are all needed in derain filter. And if modify the dnn > native mode in FFmpeg, the generation process of Super Resolution model > should be changed accordingly, e.g. add padding method parameter (= 0) and > dilation parameter (= 1). > > > > > In addition, I have a question about the Super Resulotion implementation. The > model training process of SR uses "VALID" method. According to my > understanding of "VALID" mode in tensorflow, the size of output image should > be smaller than the current design in SR. Because pixels near the boundary > are not processed in "VALID" mode, however, these unprocessed pixels are > filled with adjacent pixels in current dnn native mode. I wonder why to do > like this here. > > > > > From 4d92ef21a5acf064122c51f442d0e2f5437b3343 Mon Sep 17 00:00:00 2001 > From: Xuewei Meng > Date: Sun, 28 Apr 2019 17:21:35 +0800 > Subject: [PATCH] Add operation supports in dnn_native > > Signed-off-by: Xuewei Meng > --- > libavfilter/dnn_backend_native.c | 36 +--- > libavfilter/dnn_backend_native.h | 6 +- > 2 files changed, 29 insertions(+), 13 deletions(-) > > diff --git a/libavfilter/dnn_backend_native.c > b/libavfilter/dnn_backend_native.c > index 70d857f5f2..0e3ef5d64d 100644 > --- a/libavfilter/dnn_backend_native.c > +++ b/libavfilter/dnn_backend_native.c > @@ -157,13 +157,15 @@ DNNModel *ff_dnn_load_model_native(const char > *model_filename) > ff_dnn_free_model_native(&model); > return NULL; > } > +conv_params->dilation = (int32_t)avio_rl32(model_file_context); > +conv_params->padding_method = > (int32_t)avio_rl32(model_file_context); > conv_params->activation = (int32_t)avio_rl32(model_file_context); > conv_params->input_num = (int32_t)avio_rl32(model_file_context); > conv_params->output_num = (int32_t)avio_rl32(model_file_context); > conv_params->kernel_size = > (int32_t)avio_rl32(model_file_context); > kernel_size = conv_params->input_num * conv_params->output_num * >conv_params->kernel_size * > conv_params->kernel_size; > -dnn_size += 16 + (kernel_size + conv_params->output_num << 2); > +dnn_size += 24 + (kernel_size + conv_params->output_num << 2); Add some comments for the number 16 or 24 ? > if (dnn_size > file_size || conv_params->input_num <= 0 || > conv_params->output_num <= 0 || conv_params->kernel_size <= > 0){ > avio_closep(&model_file_context); > @@ -221,23 +223,28 @@ DNNModel *ff_dnn_load_model_native(const char > *model_filename) > > static void convolve(const float *input, float *output, const > ConvolutionalParams *conv_params, int width, int height) > { > -int y, x, n_filter, ch, kernel_y, kernel_x; Why? > int radius = conv_params->kernel_size >> 1; > int src_linesize = width * conv_params->input_num; > int filter_linesize = conv_params->kernel_size * conv_params->input_num; > int filter_size = conv_params->kernel_size * filter_linesize; > +int pad_size = (conv_params->padding_method == VALID) ? > (conv_params->kernel_size - 1) / 2 * conv_params->dilation : 0; > > -for (y = 0; y < height; ++y){ > -for (x = 0; x < width; ++x){ > -for (n_filter = 0; n_filter < conv_params->output_num; > ++n_filter){ > +for (int y = pad_size; y < height - pad_size; ++y){ > +for (int x = pad_size; x < width - pad_size; ++x){ > +for (int n_filter = 0; n_filter < conv_params->output_num; > ++n_filter){ > output[n_filter] = conv_params->biases[n_filter]; > -for (ch = 0; ch < conv_params->input_num; ++ch){ > -for (kernel_y = 0; kernel_y < conv_params->kernel_size; > ++kernel_y){ > -for (kernel_x = 0; kernel_x < > conv_params->kernel_size; ++kernel_x){ > -output[n_filter] += input[CLAMP_TO_EDGE(y + > kernel_y - radius, height) * src_linesize + > - CLAMP_TO_EDGE(x + > kernel_x - radius, width) * conv_params->input_num + ch] * > -conv_params->kernel[n_filter > * filter_size + kernel_y * filter_linesize + > -kernel_x > * conv_params->input_num + ch]; > + > +for (int ch = 0; ch < conv_params->input_num; ++ch){ > +for (int kernel_y = 0; kernel_y < > conv_params->kernel_size; ++kernel_y){ > +for (int k
Re: [FFmpeg-devel] [PATCH V1 0/2] Use avctx->framerate first for frame rate setting
On Sun, Apr 28, 2019 at 5:30 PM Gyan wrote: > > > > On 28-04-2019 07:19 AM, myp...@gmail.com wrote: > > On Sat, Apr 27, 2019 at 8:22 PM Gyan wrote: > >> > >> > >> On 27-04-2019 05:25 PM, Carl Eugen Hoyos wrote: > >>> 2019-04-27 13:17 GMT+02:00, Jun Zhao : > >>>> perfer avctx->framerate first than use avctx->time_base when > >>>> setting the frame rate to encoder. 1/time_base is not the > >>>> average frame rate if the frame rate is not constant. > >>> But why would the average framerate be a good choice to set > >>> the encoder timebase? > >>> > >> Also, note that x264/5 RC looks at the framerate. > >> See > >> https://code.videolan.org/videolan/x264/commit/c583687fab832ba7eaf8626048f05ad1f861a855 > >> > >> I can generate a difference with x264 by setting -enc_time_base to > >> different values (with vsync vfr). > >> Maybe check that this change does not lead to a significant change in > >> output. Although I think this would be still an improvement for those > >> cases where r_frame_rate >> avg_frame_rate > >> > >> Gyan > > Yes, framerate and time_base is not close correlation in vfr case, > > e,g, I can setting the framerate = 60fps, but time_base = 1/1000 s, > > then setting pts like: > > > > time_base = 1/1000 s = 1 millisecond > > framerate = 60 fps per second > > PTS 01633506683100 ... > > > > PTS delta 161717161717 ... > > > > we will get 16ms * 20 frames + 17 ms * 40 frames = 1000ms > > I'm aware of the relationship between TB and PTS. My point is x264's RC > adjusts its quantizer based on fps. You're changing that value so the > output bitrate will change for the same input with the same encoder > config if (avg_frame_rate) != (ticks * 1/TB). > > Gyan in fact,this is the purpose of this patch, we used FFmpeg API to setting the time_base/pts/framerate like above to tuning the PTS. ___ 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 V1 0/2] Use avctx->framerate first for frame rate setting
On Sun, Apr 28, 2019 at 7:02 PM myp...@gmail.com wrote: > > On Sun, Apr 28, 2019 at 5:30 PM Gyan wrote: > > > > > > > > On 28-04-2019 07:19 AM, myp...@gmail.com wrote: > > > On Sat, Apr 27, 2019 at 8:22 PM Gyan wrote: > > >> > > >> > > >> On 27-04-2019 05:25 PM, Carl Eugen Hoyos wrote: > > >>> 2019-04-27 13:17 GMT+02:00, Jun Zhao : > > >>>> perfer avctx->framerate first than use avctx->time_base when > > >>>> setting the frame rate to encoder. 1/time_base is not the > > >>>> average frame rate if the frame rate is not constant. > > >>> But why would the average framerate be a good choice to set > > >>> the encoder timebase? > > >>> > > >> Also, note that x264/5 RC looks at the framerate. > > >> See > > >> https://code.videolan.org/videolan/x264/commit/c583687fab832ba7eaf8626048f05ad1f861a855 > > >> > > >> I can generate a difference with x264 by setting -enc_time_base to > > >> different values (with vsync vfr). > > >> Maybe check that this change does not lead to a significant change in > > >> output. Although I think this would be still an improvement for those > > >> cases where r_frame_rate >> avg_frame_rate > > >> > > >> Gyan > > > Yes, framerate and time_base is not close correlation in vfr case, > > > e,g, I can setting the framerate = 60fps, but time_base = 1/1000 s, > > > then setting pts like: > > > > > > time_base = 1/1000 s = 1 millisecond > > > framerate = 60 fps per second > > > PTS 01633506683100 ... > > > > > > PTS delta 161717161717 ... > > > > > > we will get 16ms * 20 frames + 17 ms * 40 frames = 1000ms > > > > I'm aware of the relationship between TB and PTS. My point is x264's RC > > adjusts its quantizer based on fps. You're changing that value so the > > output bitrate will change for the same input with the same encoder > > config if (avg_frame_rate) != (ticks * 1/TB). > > > > Gyan > in fact,this is the purpose of this patch, we used FFmpeg API to > setting the time_base/pts/framerate like above to tuning the PTS. Any other comments? Thanks ___ 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 V1 0/2] Use avctx->framerate first for frame rate setting
On Sun, May 5, 2019 at 9:31 AM Carl Eugen Hoyos wrote: > > Am So., 5. Mai 2019 um 03:23 Uhr schrieb myp...@gmail.com : > > > > On Sun, Apr 28, 2019 at 7:02 PM myp...@gmail.com wrote: > > > > > > On Sun, Apr 28, 2019 at 5:30 PM Gyan wrote: > > > > > > > > > > > > > > > > On 28-04-2019 07:19 AM, myp...@gmail.com wrote: > > > > > On Sat, Apr 27, 2019 at 8:22 PM Gyan wrote: > > > > >> > > > > >> > > > > >> On 27-04-2019 05:25 PM, Carl Eugen Hoyos wrote: > > > > >>> 2019-04-27 13:17 GMT+02:00, Jun Zhao : > > > > >>>> perfer avctx->framerate first than use avctx->time_base when > > > > >>>> setting the frame rate to encoder. 1/time_base is not the > > > > >>>> average frame rate if the frame rate is not constant. > > > > >>> But why would the average framerate be a good choice to set > > > > >>> the encoder timebase? > > > > >>> > > > > >> Also, note that x264/5 RC looks at the framerate. > > > > >> See > > > > >> https://code.videolan.org/videolan/x264/commit/c583687fab832ba7eaf8626048f05ad1f861a855 > > > > >> > > > > >> I can generate a difference with x264 by setting -enc_time_base to > > > > >> different values (with vsync vfr). > > > > >> Maybe check that this change does not lead to a significant change in > > > > >> output. Although I think this would be still an improvement for those > > > > >> cases where r_frame_rate >> avg_frame_rate > > > > >> > > > > >> Gyan > > > > > Yes, framerate and time_base is not close correlation in vfr case, > > > > > e,g, I can setting the framerate = 60fps, but time_base = 1/1000 s, > > > > > then setting pts like: > > > > > > > > > > time_base = 1/1000 s = 1 millisecond > > > > > framerate = 60 fps per second > > > > > PTS 01633506683100 ... > > > > > > > > > > PTS delta 161717161717 ... > > > > > > > > > > we will get 16ms * 20 frames + 17 ms * 40 frames = 1000ms > > > > > > > > I'm aware of the relationship between TB and PTS. My point is x264's RC > > > > adjusts its quantizer based on fps. You're changing that value so the > > > > output bitrate will change for the same input with the same encoder > > > > config if (avg_frame_rate) != (ticks * 1/TB). > > > > > > > > Gyan > > > in fact,this is the purpose of this patch, we used FFmpeg API to > > > setting the time_base/pts/framerate like above to tuning the PTS. > > > > Any other comments? > > Please explain why this patch is a good idea / what gets fixed. > In this patch, we can setting time_base/framerate without tight coupling from encoding API level, it's need for VFR case like above sample ___ 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] [DECISION] Project policy on closed source components
On Mon, Apr 29, 2019 at 4:02 AM Marton Balint wrote: > > Hi All, > > There has been discussion on the mailing list several times about the > inclusion of support for closed source components (codecs, formats, > filters, etc) in the main ffmpeg codebase. > > Also the removal of libNDI happened without general consensus, so a vote > is necessary to justify the removal. > > So here is a call to the voting committee [1] to decide on the following > two questions: > > 1) Should libNDI support be removed from the ffmpeg codebase? Yes > > 2) Should patches using closed source libraries which are not considered > "System Libraries" according to the GPL be rejected? > Yes Thanks. ___ 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 6/7] hwcontext_vaapi: Try to create devices via DRM before X11
On Mon, May 6, 2019 at 10:56 PM Mark Thompson wrote: > > Opening the device via X11 (DRI2/DRI3) rather than opening a DRM render > node directly is only useful if you intend to use the legacy X11 interop > functions. That's never true for the ffmpeg utility, and a library user > who does want this will likely provide their own display instance rather > than making a new one here. > --- > libavutil/hwcontext_vaapi.c | 42 ++--- > 1 file changed, 21 insertions(+), 21 deletions(-) > > diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c > index 35883d7855..1219b75784 100644 > --- a/libavutil/hwcontext_vaapi.c > +++ b/libavutil/hwcontext_vaapi.c > @@ -1500,27 +1500,6 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, > const char *device, > try_x11 = HAVE_VAAPI_X11; > } > > -#if HAVE_VAAPI_X11 > -if (!display && try_x11) { > -// Try to open the device as an X11 display. > -priv->x11_display = XOpenDisplay(device); > -if (!priv->x11_display) { > -av_log(ctx, AV_LOG_VERBOSE, "Cannot open X11 display " > - "%s.\n", XDisplayName(device)); > -} else { > -display = vaGetDisplay(priv->x11_display); > -if (!display) { > -av_log(ctx, AV_LOG_ERROR, "Cannot open a VA display " > - "from X11 display %s.\n", XDisplayName(device)); > -return AVERROR_UNKNOWN; > -} > - > -av_log(ctx, AV_LOG_VERBOSE, "Opened VA display via " > - "X11 display %s.\n", XDisplayName(device)); > -} > -} > -#endif > - > #if HAVE_VAAPI_DRM > while (!display && try_drm) { > // If the device is specified, try to open it as a DRM device node. > @@ -1588,6 +1567,27 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, > const char *device, > } > #endif > > +#if HAVE_VAAPI_X11 > +if (!display && try_x11) { > +// Try to open the device as an X11 display. > +priv->x11_display = XOpenDisplay(device); > +if (!priv->x11_display) { > +av_log(ctx, AV_LOG_VERBOSE, "Cannot open X11 display " > + "%s.\n", XDisplayName(device)); > +} else { > +display = vaGetDisplay(priv->x11_display); > +if (!display) { > +av_log(ctx, AV_LOG_ERROR, "Cannot open a VA display " > + "from X11 display %s.\n", XDisplayName(device)); > +return AVERROR_UNKNOWN; > +} > + > +av_log(ctx, AV_LOG_VERBOSE, "Opened VA display via " > + "X11 display %s.\n", XDisplayName(device)); > +} > +} > +#endif > + > if (!display) { > if (device) > av_log(ctx, AV_LOG_ERROR, "No VA display found for " > -- > 2.20.1 > LGTM, I remember that I seem to have submitted a similar patch :), maybe not submitted but keep in the local git repo? I can't remember the details, Anyway, I like this patch ___ 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 5/7] hwcontext_vaapi: Add option to set driver name
On Mon, May 6, 2019 at 10:55 PM Mark Thompson wrote: > > For example: -init_hw_device vaapi:/dev/dri/renderD128,driver=foo > > This may be more convenient that using the environment variable, and allows > loading different drivers for different devices in the same process. > --- > libavutil/hwcontext_vaapi.c | 19 +++ > 1 file changed, 19 insertions(+) > > diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c > index c151f8da93..35883d7855 100644 > --- a/libavutil/hwcontext_vaapi.c > +++ b/libavutil/hwcontext_vaapi.c > @@ -1598,6 +1598,25 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, > const char *device, > return AVERROR(EINVAL); > } > > +ent = av_dict_get(opts, "driver", NULL, 0); > +if (ent) { > +#if VA_CHECK_VERSION(0, 38, 0) > +VAStatus vas; > +vas = vaSetDriverName(display, ent->value); > +if (vas != VA_STATUS_SUCCESS) { > +av_log(ctx, AV_LOG_ERROR, "Failed to set driver name to " > + "%s: %d (%s).\n", ent->value, vas, vaErrorStr(vas)); > +vaTerminate(display); > +return AVERROR_EXTERNAL; > +} > +#else > +av_log(ctx, AV_LOG_WARNING, "Driver name setting is not " > + "supported with this VAAPI version.\n"); > +vaTerminate(display); > +return AVERROR(ENOSYS); > +#endif > +} > + > return vaapi_device_connect(ctx, display); > } > LGTM, except for the need to update the document ___ 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 V1 0/2] Use avctx->framerate first for frame rate setting
On Sun, May 5, 2019 at 11:23 AM myp...@gmail.com wrote: > > On Sun, May 5, 2019 at 9:31 AM Carl Eugen Hoyos wrote: > > > > Am So., 5. Mai 2019 um 03:23 Uhr schrieb myp...@gmail.com > > : > > > > > > On Sun, Apr 28, 2019 at 7:02 PM myp...@gmail.com wrote: > > > > > > > > On Sun, Apr 28, 2019 at 5:30 PM Gyan wrote: > > > > > > > > > > > > > > > > > > > > On 28-04-2019 07:19 AM, myp...@gmail.com wrote: > > > > > > On Sat, Apr 27, 2019 at 8:22 PM Gyan wrote: > > > > > >> > > > > > >> > > > > > >> On 27-04-2019 05:25 PM, Carl Eugen Hoyos wrote: > > > > > >>> 2019-04-27 13:17 GMT+02:00, Jun Zhao : > > > > > >>>> perfer avctx->framerate first than use avctx->time_base when > > > > > >>>> setting the frame rate to encoder. 1/time_base is not the > > > > > >>>> average frame rate if the frame rate is not constant. > > > > > >>> But why would the average framerate be a good choice to set > > > > > >>> the encoder timebase? > > > > > >>> > > > > > >> Also, note that x264/5 RC looks at the framerate. > > > > > >> See > > > > > >> https://code.videolan.org/videolan/x264/commit/c583687fab832ba7eaf8626048f05ad1f861a855 > > > > > >> > > > > > >> I can generate a difference with x264 by setting -enc_time_base to > > > > > >> different values (with vsync vfr). > > > > > >> Maybe check that this change does not lead to a significant change > > > > > >> in > > > > > >> output. Although I think this would be still an improvement for > > > > > >> those > > > > > >> cases where r_frame_rate >> avg_frame_rate > > > > > >> > > > > > >> Gyan > > > > > > Yes, framerate and time_base is not close correlation in vfr case, > > > > > > e,g, I can setting the framerate = 60fps, but time_base = 1/1000 s, > > > > > > then setting pts like: > > > > > > > > > > > > time_base = 1/1000 s = 1 millisecond > > > > > > framerate = 60 fps per second > > > > > > PTS 01633506683100 ... > > > > > > > > > > > > PTS delta 161717161717 ... > > > > > > > > > > > > we will get 16ms * 20 frames + 17 ms * 40 frames = 1000ms > > > > > > > > > > I'm aware of the relationship between TB and PTS. My point is x264's > > > > > RC > > > > > adjusts its quantizer based on fps. You're changing that value so the > > > > > output bitrate will change for the same input with the same encoder > > > > > config if (avg_frame_rate) != (ticks * 1/TB). > > > > > > > > > > Gyan > > > > in fact,this is the purpose of this patch, we used FFmpeg API to > > > > setting the time_base/pts/framerate like above to tuning the PTS. > > > > > > Any other comments? > > > > Please explain why this patch is a good idea / what gets fixed. > > > In this patch, we can setting time_base/framerate without tight > coupling from encoding API level, it's need for VFR case like above > sample More comments for this patchset 1. This patchset used to when use FFmpeg codec API to setting the avctx->time_base/framerate with PTS like following example: setting the framerate = 60fps, but time_base = 1/1000s = 1 millisecond, and PTS like: PTS 01633506683100 ... PTS delta 161717161717 ... get 16ms * 20 frames + 17 ms * 40 frames = 1000ms in one second. 2. For ffmpeg command tools, it's will support "enc_time_base" and "r" options both for encoder In fact, time_base/framerate is not tightly coupled like current libx264 wrapper. Thanks. ___ 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 V1 0/2] Use avctx->framerate first for frame rate setting
On Tue, May 7, 2019 at 9:54 AM myp...@gmail.com wrote: > > On Sun, May 5, 2019 at 11:23 AM myp...@gmail.com wrote: > > > > On Sun, May 5, 2019 at 9:31 AM Carl Eugen Hoyos wrote: > > > > > > Am So., 5. Mai 2019 um 03:23 Uhr schrieb myp...@gmail.com > > > : > > > > > > > > On Sun, Apr 28, 2019 at 7:02 PM myp...@gmail.com > > > > wrote: > > > > > > > > > > On Sun, Apr 28, 2019 at 5:30 PM Gyan wrote: > > > > > > > > > > > > > > > > > > > > > > > > On 28-04-2019 07:19 AM, myp...@gmail.com wrote: > > > > > > > On Sat, Apr 27, 2019 at 8:22 PM Gyan wrote: > > > > > > >> > > > > > > >> > > > > > > >> On 27-04-2019 05:25 PM, Carl Eugen Hoyos wrote: > > > > > > >>> 2019-04-27 13:17 GMT+02:00, Jun Zhao : > > > > > > >>>> perfer avctx->framerate first than use avctx->time_base when > > > > > > >>>> setting the frame rate to encoder. 1/time_base is not the > > > > > > >>>> average frame rate if the frame rate is not constant. > > > > > > >>> But why would the average framerate be a good choice to set > > > > > > >>> the encoder timebase? > > > > > > >>> > > > > > > >> Also, note that x264/5 RC looks at the framerate. > > > > > > >> See > > > > > > >> https://code.videolan.org/videolan/x264/commit/c583687fab832ba7eaf8626048f05ad1f861a855 > > > > > > >> > > > > > > >> I can generate a difference with x264 by setting -enc_time_base > > > > > > >> to > > > > > > >> different values (with vsync vfr). > > > > > > >> Maybe check that this change does not lead to a significant > > > > > > >> change in > > > > > > >> output. Although I think this would be still an improvement for > > > > > > >> those > > > > > > >> cases where r_frame_rate >> avg_frame_rate > > > > > > >> > > > > > > >> Gyan > > > > > > > Yes, framerate and time_base is not close correlation in vfr case, > > > > > > > e,g, I can setting the framerate = 60fps, but time_base = 1/1000 > > > > > > > s, > > > > > > > then setting pts like: > > > > > > > > > > > > > > time_base = 1/1000 s = 1 millisecond > > > > > > > framerate = 60 fps per second > > > > > > > PTS 01633506683100 ... > > > > > > > > > > > > > > PTS delta 161717161717 ... > > > > > > > > > > > > > > we will get 16ms * 20 frames + 17 ms * 40 frames = 1000ms > > > > > > > > > > > > I'm aware of the relationship between TB and PTS. My point is > > > > > > x264's RC > > > > > > adjusts its quantizer based on fps. You're changing that value so > > > > > > the > > > > > > output bitrate will change for the same input with the same encoder > > > > > > config if (avg_frame_rate) != (ticks * 1/TB). > > > > > > > > > > > > Gyan > > > > > in fact,this is the purpose of this patch, we used FFmpeg API to > > > > > setting the time_base/pts/framerate like above to tuning the PTS. > > > > > > > > Any other comments? > > > > > > Please explain why this patch is a good idea / what gets fixed. > > > > > In this patch, we can setting time_base/framerate without tight > > coupling from encoding API level, it's need for VFR case like above > > sample > > More comments for this patchset > > 1. This patchset used to when use FFmpeg codec API to setting > the avctx->time_base/framerate with PTS like following example: > > setting the framerate = 60fps, but time_base = 1/1000s = 1 millisecond, > and PTS like: > > PTS 01633506683100 ... > PTS delta 161717161717 ... > > get 16ms * 20 frames + 17 ms * 40 frames = 1000ms in one second. > > 2. For ffmpeg command tools, it's will support "enc_time_base" and "r" > options both for encoder > > In fact, time_base/framerate is not tightly coupled like current > libx264 wrapper. > Ping ? ___ 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 3/3] tools/crypto_bench: update the comment about build command
On Thu, May 9, 2019 at 4:55 PM Nicolas George wrote: > > Jun Zhao (12019-05-09): > > From: Jun Zhao > > > > commit cd62f9d557f missing the comment about build > > > > Signed-off-by: Jun Zhao > > --- > > tools/crypto_bench.c |2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > LGTM. > Applied, Thanks. ___ 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 2/3] tools/crypto_bench: check malloc fail before using it
On Thu, May 9, 2019 at 4:53 PM Nicolas George wrote: > > Jun Zhao (12019-05-09): > > From: Jun Zhao > > > > Need to check malloc fail before using it, so adjust the location > > in the code. > > > > Signed-off-by: Jun Zhao > > --- > > tools/crypto_bench.c |8 +--- > > 1 files changed, 5 insertions(+), 3 deletions(-) > > Ok. > Applied, Thanks ___ 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 1/6] lavc/aacenc_ltp: remove unnecessary condition check.
On Sat, May 11, 2019 at 12:06 AM Jun Zhao wrote: > > From: Jun Zhao > > Condition 'sum==2' is always true, so remove the check logic to > make the code clean. > > Signed-off-by: Jun Zhao > --- > libavcodec/aacenc_ltp.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/libavcodec/aacenc_ltp.c b/libavcodec/aacenc_ltp.c > index 674a2a0..f77f0b6 100644 > --- a/libavcodec/aacenc_ltp.c > +++ b/libavcodec/aacenc_ltp.c > @@ -144,7 +144,7 @@ void ff_aac_adjust_common_ltp(AACEncContext *s, > ChannelElement *cpe) > int sum = sce0->ics.ltp.used[sfb] + sce1->ics.ltp.used[sfb]; > if (sum != 2) { > sce0->ics.ltp.used[sfb] = 0; > -} else if (sum == 2) { > +} else { > count++; > } > } > -- > 1.7.1 > Pushed, Thanks ___ 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 5/6] lavc/mlpenc: remove the redundant condition check
On Sat, May 11, 2019 at 12:06 AM Jun Zhao wrote: > > From: Jun Zhao > > remove the redundant condition check for 'frame' > > Signed-off-by: Jun Zhao > --- > libavcodec/mlpenc.c |6 ++ > 1 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c > index 7536d3b..deb1716 100644 > --- a/libavcodec/mlpenc.c > +++ b/libavcodec/mlpenc.c > @@ -2232,10 +2232,8 @@ static int mlp_encode_frame(AVCodecContext *avctx, > AVPacket *avpkt, > return 1; > > /* add current frame to queue */ > -if (frame) { > -if ((ret = ff_af_queue_add(&ctx->afq, frame)) < 0) > -return ret; > -} > +if ((ret = ff_af_queue_add(&ctx->afq, frame)) < 0) > +return ret; > > data = frame->data[0]; > > -- > 1.7.1 Pushed, Thanks ___ 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 6/6] lavc/pngenc: check malloc fail before using the pointer
On Sat, May 11, 2019 at 12:06 AM Jun Zhao wrote: > > From: Jun Zhao > > Need to check malloc fail before using the pointer > > Signed-off-by: Jun Zhao > --- > libavcodec/pngenc.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c > index 69b4495..d4d8dc8 100644 > --- a/libavcodec/pngenc.c > +++ b/libavcodec/pngenc.c > @@ -748,11 +748,11 @@ static int apng_encode_frame(AVCodecContext *avctx, > const AVFrame *pict, > original_bytestream_end = s->bytestream_end; > > temp_bytestream = av_malloc(original_bytestream_end - > original_bytestream); > -temp_bytestream_end = temp_bytestream + (original_bytestream_end - > original_bytestream); > if (!temp_bytestream) { > ret = AVERROR(ENOMEM); > goto fail; > } > +temp_bytestream_end = temp_bytestream + (original_bytestream_end - > original_bytestream); > > for (last_fctl_chunk.dispose_op = 0; last_fctl_chunk.dispose_op < 3; > ++last_fctl_chunk.dispose_op) { > // 0: APNG_DISPOSE_OP_NONE > -- > 1.7.1 Pushed, Thanks ___ 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] avfilter/drawtext: make command processing error-resilient
On Mon, May 13, 2019 at 4:06 AM Gyan wrote: > > > > On 10-05-2019 07:25 PM, Gyan wrote: > > At present, if the command args passed to drawtext contain any invalid > > values, ffmpeg may crash or, at best, stop drawing any text. > > Attached patch gets the filter to continue with existing parameters, > > if not all of the changes can be parsed or applied. This allows users > > in live processing to correct and resubmit. > > Ping. Tested and verified, LGTM, Thanks ___ 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 2/6] lavc/avpacket: check NULL before using the pointer
On Sat, May 11, 2019 at 8:23 AM Michael Niedermayer wrote: > > On Fri, May 10, 2019 at 10:00:54PM +0200, Carl Eugen Hoyos wrote: > > Am Fr., 10. Mai 2019 um 18:13 Uhr schrieb Jun Zhao : > > > > > > From: Jun Zhao > > > > > > Need to check NULL before using the pointer > > > > > > Signed-off-by: Jun Zhao > > > --- > > > libavcodec/avpacket.c |3 ++- > > > 1 files changed, 2 insertions(+), 1 deletions(-) > > > > > > diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c > > > index 8f0603d..2b20067 100644 > > > --- a/libavcodec/avpacket.c > > > +++ b/libavcodec/avpacket.c > > > @@ -522,11 +522,12 @@ fail: > > > > > > int av_packet_unpack_dictionary(const uint8_t *data, int size, > > > AVDictionary **dict) > > > { > > > -const uint8_t *end = data + size; > > > +const uint8_t *end; > > > int ret = 0; > > > > > > if (!dict || !data || !size) > > > return ret; > > > +end = data + size; > > > > Could somebody explain to me why this is necessary? > > if data is NULL adding a non zero value to it would be undefined behavior > i think > Yes, it's a undefined behavior to adding a non zero value if the pointer is NULL, this is the reason to change the code. Applied, Thanks ___ 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 4/6] lavc/libvpxenc: remove redundant condition check
On Sat, May 11, 2019 at 3:14 AM Vignesh Venkatasubramanian wrote: > > From: Jun Zhao > Date: Fri, May 10, 2019 at 9:06 AM > To: > Cc: Jun Zhao > > > From: Jun Zhao > > > > Redundant condition: '!A || B' is equivalent to '!A || (A && B)' but > > more clearly. > > > > Signed-off-by: Jun Zhao > > --- > > libavcodec/libvpxenc.c |2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c > > index c823b8a..feb52ea 100644 > > --- a/libavcodec/libvpxenc.c > > +++ b/libavcodec/libvpxenc.c > > @@ -978,7 +978,7 @@ static int queue_frames(AVCodecContext *avctx, AVPacket > > *pkt_out) > > are only good through the next vpx_codec call */ > > while ((pkt = vpx_codec_get_cx_data(&ctx->encoder, &iter)) && > > (!ctx->is_alpha || > > -(ctx->is_alpha && (pkt_alpha = > > vpx_codec_get_cx_data(&ctx->encoder_alpha, &iter_alpha) { > > +(pkt_alpha = vpx_codec_get_cx_data(&ctx->encoder_alpha, > > &iter_alpha { > > switch (pkt->kind) { > > case VPX_CODEC_CX_FRAME_PKT: > > if (!size) { > > -- > > 1.7.1 > > > > lgtm. > Pushed, Thanks ___ 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 3/6] lavc/bink: Remove the dead code block
On Sat, May 11, 2019 at 11:04 AM Peter Ross wrote: > > On Sat, May 11, 2019 at 12:05:51AM +0800, Jun Zhao wrote: > > From: Jun Zhao > > > > Remove the dead code block > > > > Signed-off-by: Jun Zhao > > --- > > libavcodec/bink.c |2 -- > > 1 files changed, 0 insertions(+), 2 deletions(-) > > > > diff --git a/libavcodec/bink.c b/libavcodec/bink.c > > index 6673afa..d0f1b39 100644 > > --- a/libavcodec/bink.c > > +++ b/libavcodec/bink.c > > @@ -1046,8 +1046,6 @@ static int bink_decode_plane(BinkContext *c, AVFrame > > *frame, GetBitContext *gb, > > if ((ret = read_runs(c->avctx, gb, &c->bundle[BINK_SRC_RUN])) < 0) > > return ret; > > > > -if (by == bh) > > -break; > > dst = frame->data[plane_idx] + 8*by*stride; > > prev = (c->last->data[plane_idx] ? c->last->data[plane_idx] > > : frame->data[plane_idx]) + > > 8*by*stride; > > -- > > 1.7.1 > > looks good. please apply. > > -- Peter > (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) Pushed, Thanks ___ 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] "assert(a && b)" --> "assert(a); assert(b)" for more precise diagnostics, except for libformat
On Wed, May 15, 2019 at 7:01 AM Hendrik Leppkes wrote: > > On Tue, May 14, 2019 at 11:25 PM Adam Richter wrote: > > > > Consider, for example, if you agree that columnization makes this range > > check > > more recognizable in a glance and makes it easier to spot what the bounds > > are > > (the sixteen space indentation is taken from the code in which it appeared): > > > > av_assert0(par->bits_per_coded_sample >= 0 && > > par->bits_per_coded_sample <= 8); > > > > ...vs... > > > > av_assert0(par->bits_per_coded_sample >= 0); > > av_assert0(par->bits_per_coded_sample <= 8); > > > > A possible counter-argument to this might be that, in a long sequence > > of assertions, can be informative to group related assertions > > together, which I think is true, but it is possible to get this other > > means, such as by using blank lines to separate express such grouping. > > > > So, Mark, if you decide you are OK with my complete patches, I encourage > > you to let me know. Otherwise, if there are any of those changes which you > > are OK with, I would like to just to to get those merged. Finally, if you > > would > > rather see none of those changes merged (one one to split the assertions in > > libavformat and one was for everywhere else in ffmpeg), please let me know > > about that too, in which case, if no one advocates for their > > inclusion, I'll drop > > my proposal to merge these changes. > > > > Unfortunately I have to agree with Mark. asserst that check the same > value or extremely closely related values should stay combined. > I agree this part > > > > Also after this, I may take a look at adding a branch hint to the av_assertN > > macros if nobody objects. > > > > Please don't, we don't do branch hints anywhere, and this is a bad > place to start. > If an assert is truely performance sensitive (as in, it makes a > measurable difference), it should probably be moved from assert0 to > assert1, and as such is only enabled in testing builds. > If assert0 or assert1 lead to performance drop, we need some profiling data, then try to fix it. > - Hendrik ___ 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] libavdevice/gdigrab: fix ffmpeg -devices doesn't show gdigrab
On Fri, May 17, 2019 at 7:33 PM Paul B Mahol wrote: > > On 5/17/19, Jun Zhao wrote: > > From: Jun Zhao > > > > missed the category AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT lead to > > ffmpeg -devices doesn't show gdigrab as a input device > > > > FIx #7848 > > > > Found-by: dangibson > > Signed-off-by: Jun Zhao > > --- > > libavdevice/gdigrab.c |1 + > > 1 files changed, 1 insertions(+), 0 deletions(-) > > > > diff --git a/libavdevice/gdigrab.c b/libavdevice/gdigrab.c > > index b226bd0..f40 100644 > > --- a/libavdevice/gdigrab.c > > +++ b/libavdevice/gdigrab.c > > @@ -647,6 +647,7 @@ static const AVClass gdigrab_class = { > > .item_name = av_default_item_name, > > .option = options, > > .version= LIBAVUTIL_VERSION_INT, > > +.category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, > > }; > > > > /** gdi grabber device demuxer declaration */ > > -- > > 1.7.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". > > lgtm Pushed, Thanks ___ 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 v2 01/11] cbs: Mention all codecs in unit type comment
On Tue, May 21, 2019 at 7:02 AM Mark Thompson wrote: > > --- > libavcodec/cbs.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/libavcodec/cbs.h b/libavcodec/cbs.h > index 967dcd1468..e8b2d41ecb 100644 > --- a/libavcodec/cbs.h > +++ b/libavcodec/cbs.h > @@ -49,6 +49,8 @@ struct CodedBitstreamType; > * H.265 / HEVC: nal_unit_type > * MPEG-2: start code value (without prefix) > * VP9: unused, set to zero (every unit is a frame) > + * JPEG: marker value (without 0xff prefix) > + * AV1: obu_type > */ > typedef uint32_t CodedBitstreamUnitType; > LGTM ___ 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 v2 02/11] cbs: Ensure that reference fields always follow the associated pointer
On Tue, May 21, 2019 at 7:08 AM Mark Thompson wrote: > > Hvaing these together allows us to find both pointers given the address > of only one of them. > --- > libavcodec/cbs_av1.h | 6 +++--- > libavcodec/cbs_h264.h | 18 +- > libavcodec/cbs_h265.h | 16 > libavcodec/cbs_jpeg.h | 2 +- > libavcodec/cbs_mpeg2.h | 10 +- > libavcodec/cbs_vp9.h | 2 +- > 6 files changed, 27 insertions(+), 27 deletions(-) > > diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h > index 1fb668ada4..a87cbc030b 100644 > --- a/libavcodec/cbs_av1.h > +++ b/libavcodec/cbs_av1.h > @@ -284,8 +284,8 @@ typedef struct AV1RawFrameHeader { > > typedef struct AV1RawTileData { > uint8_t *data; > -size_t data_size; > AVBufferRef *data_ref; > +size_t data_size; > } AV1RawTileData; > > typedef struct AV1RawTileGroup { > @@ -346,8 +346,8 @@ typedef struct AV1RawMetadataITUTT35 { > uint8_t itu_t_t35_country_code_extension_byte; > > uint8_t *payload; > -size_t payload_size; > AVBufferRef *payload_ref; > +size_t payload_size; > } AV1RawMetadataITUTT35; > > typedef struct AV1RawMetadataTimecode { > @@ -379,8 +379,8 @@ typedef struct AV1RawMetadata { > > typedef struct AV1RawPadding { > uint8_t *payload; > -size_t payload_size; > AVBufferRef *payload_ref; > +size_t payload_size; > } AV1RawPadding; > > > diff --git a/libavcodec/cbs_h264.h b/libavcodec/cbs_h264.h > index cc46eeb3b0..57a9782cc9 100644 > --- a/libavcodec/cbs_h264.h > +++ b/libavcodec/cbs_h264.h > @@ -277,16 +277,16 @@ typedef struct H264RawSEIPanScanRect { > typedef struct H264RawSEIUserDataRegistered { > uint8_t itu_t_t35_country_code; > uint8_t itu_t_t35_country_code_extension_byte; > -uint8_t *data; > -size_t data_length; > +uint8_t *data; > AVBufferRef *data_ref; > +size_t data_length; > } H264RawSEIUserDataRegistered; > > typedef struct H264RawSEIUserDataUnregistered { > uint8_t uuid_iso_iec_11578[16]; > -uint8_t *data; > -size_t data_length; > +uint8_t *data; > AVBufferRef *data_ref; > +size_t data_length; > } H264RawSEIUserDataUnregistered; > > typedef struct H264RawSEIRecoveryPoint { > @@ -328,9 +328,9 @@ typedef struct H264RawSEIPayload { > H264RawSEIDisplayOrientation display_orientation; > H264RawSEIMasteringDisplayColourVolume > mastering_display_colour_volume; > struct { > -uint8_t *data; > -size_t data_length; > +uint8_t *data; > AVBufferRef *data_ref; > +size_t data_length; > } other; > } payload; > } H264RawSEIPayload; > @@ -423,10 +423,10 @@ typedef struct H264RawSliceHeader { > typedef struct H264RawSlice { > H264RawSliceHeader header; > > -uint8_t *data; > -size_t data_size; > -int data_bit_start; > +uint8_t *data; > AVBufferRef *data_ref; > +size_t data_size; > +int data_bit_start; > } H264RawSlice; > > typedef struct H264RawFiller { > diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h > index c9bc90187b..5cab93c828 100644 > --- a/libavcodec/cbs_h265.h > +++ b/libavcodec/cbs_h265.h > @@ -184,8 +184,8 @@ typedef struct H265RawVUI { > > typedef struct H265RawPSExtensionData { > uint8_t *data; > -size_t bit_length; > AVBufferRef *data_ref; > +size_t bit_length; > } H265RawPSExtensionData; > > typedef struct H265RawVPS { > @@ -541,10 +541,10 @@ typedef struct H265RawSliceHeader { > typedef struct H265RawSlice { > H265RawSliceHeader header; > > -uint8_t *data; > -size_t data_size; > -int data_bit_start; > +uint8_t *data; > AVBufferRef *data_ref; > +size_t data_size; > +int data_bit_start; > } H265RawSlice; > > > @@ -600,15 +600,15 @@ typedef struct H265RawSEIUserDataRegistered { > uint8_t itu_t_t35_country_code; > uint8_t itu_t_t35_country_code_extension_byte; > uint8_t *data; > -size_t data_length; > AVBufferRef *data_ref; > +size_t data_length; > } H265RawSEIUserDataRegistered; > > typedef struct H265RawSEIUserDataUnregistered { > uint8_t uuid_iso_iec_11578[16]; > uint8_t *data; > -size_t data_length; > AVBufferRef *data_ref; > +size_t data_length; > } H265RawSEIUserDataUnregistered; > > typedef struct H265RawSEIRecoveryPoint { > @@ -698,9 +698,9 @@ typedef struct H265RawSEIPayload { > H265RawSEIAlternativeTransferCharacteristics > alternative_transfer_characteristics; > struct { > -uint8_t *data; > -size_t data_length; > +uint8_t *data; > AVBufferRef *data_ref; > +size_t data_length; > } other; > } payload; > } H265RawSEIPayload; > diff --git a/libavcodec/
Re: [FFmpeg-devel] [PATCH] lavfi/colorlevels: Add slice threading support
On Tue, May 21, 2019 at 9:49 AM Jun Zhao wrote: > > From: Jun Zhao > > Add slice threading support, use the command like: > > ./ffmpeg -i input -vf colorlevel with 1080p h264 clip, the fps > from 39 fps to 79 fps in the local > > Signed-off-by: Jun Zhao > --- > libavfilter/vf_colorlevels.c | 125 +++-- > 1 files changed, 106 insertions(+), 19 deletions(-) > > diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c > index 5385a5e..68668e7 100644 > --- a/libavfilter/vf_colorlevels.c > +++ b/libavfilter/vf_colorlevels.c > @@ -105,6 +105,83 @@ static int config_input(AVFilterLink *inlink) > return 0; > } > > +struct thread_data { > +const uint8_t *srcrow; > +uint8_t *dstrow; > +int dst_linesize; > +int src_linesize; > + > +double coeff; > +uint8_t offset; > + > +int h; > + > +int imin; > +int omin; > +}; > + > +static int colorlevel_slice_8(AVFilterContext *ctx, void *arg, int jobnr, > int nb_jobs) > +{ > +ColorLevelsContext *s = ctx->priv; > +const struct thread_data *td = arg; > + > +int process_h = td->h; > +const int slice_start = (process_h * jobnr ) / nb_jobs; > +const int slice_end = (process_h * (jobnr+1)) / nb_jobs; > +int x, y; > +const uint8_t *srcrow = td->srcrow; > +uint8_t *dstrow = td->dstrow; > +const int step = s->step; > +const uint8_t offset = td->offset; > + > +int imin = td->imin; > +int omin = td->omin; > +double coeff = td->coeff; > + > +for (y = slice_start; y < slice_end; y++) { > +const uint8_t *src = srcrow; > +uint8_t *dst = dstrow; > + > +for (x = 0; x < s->linesize; x += step) > +dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * coeff > + omin); > +dstrow += td->dst_linesize; > +srcrow += td->src_linesize; > +} > + > +return 0; > +} > + > +static int colorlevel_slice_16(AVFilterContext *ctx, void *arg, int jobnr, > int nb_jobs) > +{ > +ColorLevelsContext *s = ctx->priv; > +const struct thread_data *td = arg; > + > +int process_h = td->h; > +const int slice_start = (process_h * jobnr ) / nb_jobs; > +const int slice_end = (process_h * (jobnr+1)) / nb_jobs; > +int x, y; > +const uint8_t *srcrow = td->srcrow; > +uint8_t *dstrow = td->dstrow; > +const int step = s->step; > +const uint8_t offset = td->offset; > + > +int imin = td->imin; > +int omin = td->omin; > +double coeff = td->coeff; > + > +for (y = slice_start; y < slice_end; y++) { > +const uint16_t *src = (const uint16_t *)srcrow; > +uint16_t *dst = (uint16_t *)dstrow; > + > +for (x = 0; x < s->linesize; x += step) > +dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * coeff > + omin); > +dstrow += td->dst_linesize; > +srcrow += td->src_linesize; > +} > + > +return 0; > +} > + > static int filter_frame(AVFilterLink *inlink, AVFrame *in) > { > AVFilterContext *ctx = inlink->dst; > @@ -137,6 +214,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) > int omin = lrint(r->out_min * UINT8_MAX); > int omax = lrint(r->out_max * UINT8_MAX); > double coeff; > +struct thread_data td; > > if (imin < 0) { > imin = UINT8_MAX; > @@ -162,15 +240,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > *in) > > srcrow = in->data[0]; > coeff = (omax - omin) / (double)(imax - imin); > -for (y = 0; y < inlink->h; y++) { > -const uint8_t *src = srcrow; > -uint8_t *dst = dstrow; > - > -for (x = 0; x < s->linesize; x += step) > -dst[x + offset] = av_clip_uint8((src[x + offset] - imin) > * coeff + omin); > -dstrow += out->linesize[0]; > -srcrow += in->linesize[0]; > -} > + > +td.srcrow= srcrow; > +td.dstrow= dstrow; > +td.dst_linesize = out->linesize[0]; > +td.src_linesize = in->linesize[0]; > +td.coeff = coeff; > +td.offset= offset; > +td.h = inlink->h; > +td.imin = imin; > +td.omin = omin; > + > +ctx->internal->execute(ctx, colorlevel_slice_8, &td, NULL, > + FFMIN(inlink->h, > ff_filter_get_nb_threads(ctx))); > } > break; > case 2: > @@ -184,6 +266,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) > int omin = lrint(r->out_min * UINT16_MAX); > int omax = lrint(r->out_max * UINT16_MAX); > double coeff; > +struct thread_data td; > > if (imin < 0) { > imin = UINT16_MAX; > @@ -209,15 +292,19 @@ static int filter_fra
Re: [FFmpeg-devel] [PATCH V1] lavfi/lut: Add slice threading support
On Wed, May 22, 2019 at 11:03 AM Song, Ruiling wrote: > > > > > -Original Message- > > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf > > Of Jun Zhao > > Sent: Wednesday, May 22, 2019 12:29 AM > > To: ffmpeg-devel@ffmpeg.org > > Cc: Jun Zhao > > Subject: [FFmpeg-devel] [PATCH V1] lavfi/lut: Add slice threading support > > > > From: Jun Zhao > > > > Used the command for 1080p h264 clip as follow: > > > > a). ffmpeg -i input -vf lutyuv="u=128:v=128" -f null /dev/null > > b). ffmpeg -i input -vf lutrgb="g=0:b=0" -f null /dev/null > > > > after enabled the slice threading, the fps change from: > > > > a). 144fps to 258fps (lutyuv) > > b). 94fps to 153fps (lutrgb) > > > > in Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz > > > > Signed-off-by: Jun Zhao > > --- > > libavfilter/vf_lut.c | 328 +-- > > --- > > 1 files changed, 216 insertions(+), 112 deletions(-) > > > > diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c > > index c815ddc..61550ee 100644 > > --- a/libavfilter/vf_lut.c > > +++ b/libavfilter/vf_lut.c > > @@ -337,13 +337,194 @@ static int config_props(AVFilterLink *inlink) > > return 0; > > } > > > > +struct thread_data { > > +AVFrame *in; > > +AVFrame *out; > > + > > +int w; > > +int h; > > +}; > > I think it's better to refine the patch to avoid duplicating code, the > exiting source code has been copy-pasted too much. > Maybe we just need lut_packed() and lut_planar(). For 8/16 variation, I think > it is easy to add one field( like "int is_16bit;")in thread_data to solve it. Ha, in fact, they are come from origin code, and I noticed the code redundancy in origin code, as my plan, I plan to split with 2 steps: step 1: enabling the slice thread, it's will help to review + test (as this patch) step 2: refine the code redundancy, (the next round patch). So you want to combine step 1 and step 2 as one patch ? Thanks. ___ 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 V1 2/2] doc/writing_filters: Use ff_filter_get_nb_threads() get number of threads
On Wed, May 22, 2019 at 4:14 PM Paul B Mahol wrote: > > On 5/22/19, Jun Zhao wrote: > > From: Jun Zhao > > > > ff_filter_get_nb_threads() respect AVFilterContext.nb_threads and > > graph->nb_threads both, in most case, we perfer this API than using > > ctx->graph->nb_threads directly. > > --- > > doc/writing_filters.txt |2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/doc/writing_filters.txt b/doc/writing_filters.txt > > index 98b9c6f..2e25cbe 100644 > > --- a/doc/writing_filters.txt > > +++ b/doc/writing_filters.txt > > @@ -389,7 +389,7 @@ distributor with something like this: > > > > td.in = in; > > td.out = out; > > -ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, > > ctx->graph->nb_threads)); > > +ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, > > ff_filter_get_nb_threads(ctx))); > > > > // ... > > > > lgtm > Pushed, Thanks. ___ 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 V1 1/2] lavfi/lensfun: Use ff_filter_get_nb_threads() get number of threads
On Wed, May 22, 2019 at 4:20 PM Paul B Mahol wrote: > > On 5/22/19, Jun Zhao wrote: > > From: Jun Zhao > > > > ff_filter_get_nb_threads() respect AVFilterContext.nb_threads and > > graph->nb_threads both, in most case, we perfer this API than using > > ctx->graph->nb_threads directly. > > > > Signed-off-by: Jun Zhao > > --- > > libavfilter/vf_lensfun.c |4 ++-- > > 1 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/libavfilter/vf_lensfun.c b/libavfilter/vf_lensfun.c > > index 3b723dd..089121e 100644 > > --- a/libavfilter/vf_lensfun.c > > +++ b/libavfilter/vf_lensfun.c > > @@ -465,7 +465,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > > *in) > > vignetting_filter_slice, > > &vignetting_thread_data, > > NULL, > > - FFMIN(outlink->h, ctx->graph->nb_threads)); > > + FFMIN(outlink->h, > > ff_filter_get_nb_threads(ctx))); > > } > > > > if (lensfun->mode & (GEOMETRY_DISTORTION | SUBPIXEL_DISTORTION)) { > > @@ -493,7 +493,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > > *in) > > distortion_correction_filter_slice, > > &distortion_correction_thread_data, > > NULL, > > - FFMIN(outlink->h, ctx->graph->nb_threads)); > > + FFMIN(outlink->h, > > ff_filter_get_nb_threads(ctx))); > > > > av_frame_free(&in); > > return ff_filter_frame(outlink, out); > > -- > > 1.7.1 > > > > lgtm > Pushed, Thanks. ___ 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 V2] lavfi/colorlevels: Add slice threading support
On Wed, May 22, 2019 at 12:24 PM Li, Zhong wrote: > > > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf > > Of Jun Zhao > > Sent: Tuesday, May 21, 2019 7:21 PM > > To: ffmpeg-devel@ffmpeg.org > > Cc: Jun Zhao > > Subject: [FFmpeg-devel] [PATCH V2] lavfi/colorlevels: Add slice threading > > support > > > > From: Jun Zhao > > > > Add slice threading support, use the command like: > > > > ./ffmpeg -i input -vf colorlevel with 1080p h264 clip, the fps from 39 fps > > to > > 79 fps in the local > > > > Signed-off-by: Jun Zhao > > --- > > libavfilter/vf_colorlevels.c | 125 > > +++-- > > 1 files changed, 106 insertions(+), 19 deletions(-) > > > > diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c > > index > > 5385a5e..68668e7 100644 > > --- a/libavfilter/vf_colorlevels.c > > +++ b/libavfilter/vf_colorlevels.c > > @@ -105,6 +105,83 @@ static int config_input(AVFilterLink *inlink) > > return 0; > > } > > > > +struct thread_data { > > +const uint8_t *srcrow; > > +uint8_t *dstrow; > > +int dst_linesize; > > +int src_linesize; > > + > > +double coeff; > > +uint8_t offset; > > + > > +int h; > > + > > +int imin; > > +int omin; > > +}; > > + > > +static int colorlevel_slice_8(AVFilterContext *ctx, void *arg, int > > +jobnr, int nb_jobs) { > > +ColorLevelsContext *s = ctx->priv; > > +const struct thread_data *td = arg; > > + > > +int process_h = td->h; > > +const int slice_start = (process_h * jobnr ) / nb_jobs; > > +const int slice_end = (process_h * (jobnr+1)) / nb_jobs; > > +int x, y; > > +const uint8_t *srcrow = td->srcrow; > > +uint8_t *dstrow = td->dstrow; > > +const int step = s->step; > > +const uint8_t offset = td->offset; > > + > > +int imin = td->imin; > > +int omin = td->omin; > > +double coeff = td->coeff; > > + > > +for (y = slice_start; y < slice_end; y++) { > > +const uint8_t *src = srcrow; > > +uint8_t *dst = dstrow; > > + > > +for (x = 0; x < s->linesize; x += step) > > +dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * > > coeff > > + omin); > > +dstrow += td->dst_linesize; > > +srcrow += td->src_linesize; > > +} > > + > > +return 0; > > +} > > + > > +static int colorlevel_slice_16(AVFilterContext *ctx, void *arg, int > > +jobnr, int nb_jobs) { > > +ColorLevelsContext *s = ctx->priv; > > +const struct thread_data *td = arg; > > + > > +int process_h = td->h; > > +const int slice_start = (process_h * jobnr ) / nb_jobs; > > +const int slice_end = (process_h * (jobnr+1)) / nb_jobs; > > +int x, y; > > +const uint8_t *srcrow = td->srcrow; > > +uint8_t *dstrow = td->dstrow; > > +const int step = s->step; > > +const uint8_t offset = td->offset; > > + > > +int imin = td->imin; > > +int omin = td->omin; > > +double coeff = td->coeff; > > + > > +for (y = slice_start; y < slice_end; y++) { > > +const uint16_t *src = (const uint16_t *)srcrow; > > +uint16_t *dst = (uint16_t *)dstrow; > > Function colorlevel_slice_16() is same as colorlevel_slice_8 expect here to > replace unit8_t to be unit16t. > Would better to define a template function to be reused. I don't like to get in C to templates is some ugly macro code for function overloading, this is the reason use 2 function for 8bits/16bits ___ 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] libavfilter: Add derain filter.
On Fri, May 24, 2019 at 8:40 PM Xuewei Meng wrote: > > Remove the rain in the input image/video by applying the derain > methods based on convolutional neural networks. Training scripts > as well as scripts for model generation are provided in the > repository at https://github.com/XueweiMeng/derain_filter.git. > > Signed-off-by: Xuewei Meng > --- > doc/filters.texi | 34 ++ > libavfilter/Makefile | 1 + > libavfilter/allfilters.c | 1 + > libavfilter/vf_derain.c | 219 +++ > 4 files changed, 255 insertions(+) > create mode 100644 libavfilter/vf_derain.c > > diff --git a/doc/filters.texi b/doc/filters.texi > index 4fdcfe919e..f1d3841ed3 100644 > --- a/doc/filters.texi > +++ b/doc/filters.texi > @@ -8248,6 +8248,40 @@ delogo=x=0:y=0:w=100:h=77:band=10 > > @end itemize > > +@section derain > + > +Remove the rain in the input image/video by applying the derain methods > based on > +convolutional neural networks. Supported models: > + > +@itemize > +@item > +Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN). > +See > @url{http://openaccess.thecvf.com/content_ECCV_2018/papers/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.pdf}. > +@end itemize > + > +Training scripts as well as scripts for model generation are provided in > +the repository at @url{https://github.com/XueweiMeng/derain_filter.git}. > + > +The filter accepts the following options: > + > +@table @option > +@item dnn_backend > +Specify which DNN backend to use for model loading and execution. This > option accepts > +the following values: > + > +@table @samp > +@item native > +Native implementation of DNN loading and execution. > +@end table > +Default value is @samp{native}. > + > +@item model > +Set path to model file specifying network architecture and its parameters. > +Note that different backends use different file formats. TensorFlow backend > +can load files for both formats, while native backend can load files for only > +its format. > +@end table > + > @section deshake > > Attempt to fix small changes in horizontal and/or vertical shift. This > diff --git a/libavfilter/Makefile b/libavfilter/Makefile > index 9a61c25b05..b7191d0081 100644 > --- a/libavfilter/Makefile > +++ b/libavfilter/Makefile > @@ -200,6 +200,7 @@ OBJS-$(CONFIG_DCTDNOIZ_FILTER) += > vf_dctdnoiz.o > OBJS-$(CONFIG_DEBAND_FILTER) += vf_deband.o > OBJS-$(CONFIG_DEBLOCK_FILTER)+= vf_deblock.o > OBJS-$(CONFIG_DECIMATE_FILTER) += vf_decimate.o > +OBJS-$(CONFIG_DERAIN_FILTER) += vf_derain.o > OBJS-$(CONFIG_DECONVOLVE_FILTER) += vf_convolve.o framesync.o > OBJS-$(CONFIG_DEDOT_FILTER) += vf_dedot.o > OBJS-$(CONFIG_DEFLATE_FILTER)+= vf_neighbor.o > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c > index 40534738ee..f3c8883960 100644 > --- a/libavfilter/allfilters.c > +++ b/libavfilter/allfilters.c > @@ -196,6 +196,7 @@ extern AVFilter ff_vf_deinterlace_vaapi; > extern AVFilter ff_vf_dejudder; > extern AVFilter ff_vf_delogo; > extern AVFilter ff_vf_denoise_vaapi; > +extern AVFilter ff_vf_derain; > extern AVFilter ff_vf_deshake; > extern AVFilter ff_vf_despill; > extern AVFilter ff_vf_detelecine; > diff --git a/libavfilter/vf_derain.c b/libavfilter/vf_derain.c > new file mode 100644 > index 00..05d9fc5e7d > --- /dev/null > +++ b/libavfilter/vf_derain.c > @@ -0,0 +1,219 @@ > +/* > + * Copyright (c) 2019 Xuewei Meng > + * > + * 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 > + */ > + > +/** > + * @file > + * Filter implementing image derain filter using deep convolutional networks. > + * https://arxiv.org/abs/1609.05158 > + * > http://openaccess.thecvf.com/content_ECCV_2018/html/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.html > + */ > + > +#include "libavutil/opt.h" > +#include "libavformat/avio.h" > +#include "libswscale/swscale.h" This filter didn't use libswscale, please remove unused headers. > +#include "avfilter.h" > +#include "dnn_interface.h" > +#include "formats.h" > +#include "internal.h" > + > +typedef struct DRContext { > +const AVClass *class; > + > +
Re: [FFmpeg-devel] [PATCH V2] lavfi/lut: Add slice threading support
On Wed, May 29, 2019 at 4:19 PM Song, Ruiling wrote: > > > -Original Message- > > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf > > Of Jun Zhao > > Sent: Saturday, May 25, 2019 10:33 AM > > To: ffmpeg-devel@ffmpeg.org > > Cc: Jun Zhao > > Subject: [FFmpeg-devel] [PATCH V2] lavfi/lut: Add slice threading support > > > > V2: - update comments > > > > Jun Zhao (1): > > lavfi/lut: Add slice threading support > > > > libavfilter/vf_lut.c | 329 +-- > > --- > > 1 files changed, 216 insertions(+), 113 deletions(-) > I have attached the patch which I would like to happen. > I only test lutyuv on 1080p input, seems the performance penalty is less than > 5%. > I would like also hear performance numbers from your environment. > I am not sure do you like the patch? > > Ruiling > > Thanks the refine to avoid redundancy, will update after performance compare and other test. ___ 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 V2] lavfi/lut: Add slice threading support
On Wed, May 29, 2019 at 4:31 PM Paul B Mahol wrote: > > On 5/29/19, Song, Ruiling wrote: > >> -Original Message- > >> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf > >> Of Jun Zhao > >> Sent: Saturday, May 25, 2019 10:33 AM > >> To: ffmpeg-devel@ffmpeg.org > >> Cc: Jun Zhao > >> Subject: [FFmpeg-devel] [PATCH V2] lavfi/lut: Add slice threading support > >> > >> V2: - update comments > >> > >> Jun Zhao (1): > >> lavfi/lut: Add slice threading support > >> > >> libavfilter/vf_lut.c | 329 +-- > >> --- > >> 1 files changed, 216 insertions(+), 113 deletions(-) > > I have attached the patch which I would like to happen. > > I only test lutyuv on 1080p input, seems the performance penalty is less > > than 5%. > > I would like also hear performance numbers from your environment. > > I am not sure do you like the patch? > > > > You should use function pointers. Will using function pointers to avoid runtime check is_16bits, Thanks ___ 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 V5 2/2] lavfi/lut: Add slice threading support
On Sun, Jun 2, 2019 at 4:13 PM Paul B Mahol wrote: > > On 6/1/19, Jun Zhao wrote: > > -- > > 1.7.1 > > > > Should be ok if md5 hash does not change. > Yes, both changes pass the md5 hash test. Will apply, Thanks ___ 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 V5 1/2] lavfi/colorlevels: Add slice threading support
On Sun, Jun 2, 2019 at 4:19 PM Paul B Mahol wrote: > > On 6/1/19, Jun Zhao wrote: > > From: Jun Zhao > > > > Add slice threading support, use the command like: > > > > ./ffmpeg -i input -vf colorlevels -f null /dev/null > > > > with 1080p h264 clip, the fps from 39 fps to 79 fps > > in the local(Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz) > > > > Signed-off-by: Jun Zhao > > --- > > libavfilter/vf_colorlevels.c | 110 > > ++--- > > 1 files changed, 91 insertions(+), 19 deletions(-) > > Should be ok if filter produces same md5 output with multiple threads. > Pushed, thanks ___ 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 V1 4/5] lavc/webvttenc: fix ffmpeg -h full can't display webvtt encoder
On Wed, Jun 5, 2019 at 6:36 AM Hendrik Leppkes wrote: > > On Tue, Jun 4, 2019 at 7:39 AM Jun Zhao wrote: > > > > From: Jun Zhao > > > > fix ffmpeg -h full can't display webvtt encoder > > > > Whats the point of adding an empty help section without any options in it? > If you use ffmpeg -encoders, for example, you'll get a full list of > all supported encoders. An empty help section without any contents > doesn't seem helpful to me. > > - Hendrik Ha, for me, I want to get more information for WebVTT from FFmpeg command line, so I used the command like: ffmpeg -h full | grep -i webvtt, but get noting, it's quite frustrating even the WebVTT muxer/decoder/encoder without any options, I think dumping a name better than get nothing in this case. ___ 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 V1 4/5] lavc/webvttenc: fix ffmpeg -h full can't display webvtt encoder
On Wed, Jun 5, 2019 at 4:39 AM Michael Niedermayer wrote: > > On Tue, Jun 04, 2019 at 01:38:43PM +0800, Jun Zhao wrote: > > From: Jun Zhao > > > > fix ffmpeg -h full can't display webvtt encoder > > > > Signed-off-by: Jun Zhao > > --- > > libavcodec/webvttenc.c | 13 + > > 1 files changed, 13 insertions(+), 0 deletions(-) > > breaks fate > > Assertion *(const AVClass **)avctx->priv_data == codec->priv_class failed at > libavcodec/utils.c:1009 > make: *** [fate-sub-webvttenc] Error 134 > Will check this issue, Thanks ___ 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 v2] libavfilter/vf_cover_rect.c: free the allocated frame
On Sat, Jun 8, 2019 at 6:58 AM wrote: > > From: Limin Wang > > Signed-off-by: Limin Wang > --- > libavfilter/vf_cover_rect.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavfilter/vf_cover_rect.c b/libavfilter/vf_cover_rect.c > index 41cd1a1..ac0f684 100644 > --- a/libavfilter/vf_cover_rect.c > +++ b/libavfilter/vf_cover_rect.c > @@ -197,7 +197,7 @@ static av_cold void uninit(AVFilterContext *ctx) > CoverContext *cover = ctx->priv; > > if (cover->cover_frame) > -av_freep(&cover->cover_frame->data[0]); > +av_frame_free(&cover->cover_frame); > } > > static av_cold int init(AVFilterContext *ctx) > -- av_frame_free have check the NULL pointer, so does not need to check cover->cover_frame if use this function. ___ 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, v2] lavc/vaapi_encode: add support for AVC Trellis
On Wed, Jun 12, 2019 at 3:28 PM Linjie Fu wrote: > > Add support for VAAPI AVC Trellis Quantization with limitation: > - VA-API version >= (1, 0, 0) > > Use option "-trellis off/I/P/B" to disable or enable Trellis > quantization for I/P/B frames. > > Signed-off-by: Linjie Fu > --- > [v2]: Since nonstandard struct for VAEncMiscParameterQuantization is > fixed: https://github.com/intel/libva/issues/265 > update patch based on: > http://git.ffmpeg.org/gitweb/ffmpeg.git/commit/2880a32c668023bfee4745095c885450d547ae45 > libavcodec/vaapi_encode.c | 48 ++ > libavcodec/vaapi_encode.h | 9 +-- > libavcodec/vaapi_encode_h264.c | 9 +++ > 3 files changed, 64 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c > index dd2a24de04..fbfbe78c6b 100644 > --- a/libavcodec/vaapi_encode.c > +++ b/libavcodec/vaapi_encode.c > @@ -1671,6 +1671,48 @@ rc_mode_found: > return 0; > } > > +static av_cold int vaapi_encode_init_quantization(AVCodecContext *avctx) > +{ > +#if VA_CHECK_VERSION(1, 0, 0) > +VAAPIEncodeContext *ctx = avctx->priv_data; > +VAStatus vas; > +VAConfigAttrib attr = { VAConfigAttribEncQuantization }; > +int trellis = ctx->trellis; > + > +vas = vaGetConfigAttributes(ctx->hwctx->display, > +ctx->va_profile, > +ctx->va_entrypoint, > +&attr, 1); > +if (vas != VA_STATUS_SUCCESS) { > +av_log(avctx, AV_LOG_ERROR, "Failed to query quantization " > + "config attribute: %d (%s).\n", vas, vaErrorStr(vas)); > +return AVERROR_EXTERNAL; > +} > + > +if (attr.value == VA_ATTRIB_NOT_SUPPORTED || > +attr.value == VA_ENC_QUANTIZATION_NONE) { > +av_log(avctx, AV_LOG_WARNING, "Special Quantization attribute is not > " > +"supported: will use default quantization.\n"); > +} else if (attr.value == VA_ENC_QUANTIZATION_TRELLIS_SUPPORTED){ > +av_log(avctx, AV_LOG_VERBOSE, "Quantization Trellis supported.\n"); > + > +ctx->quantization_params = (VAEncMiscParameterQuantization) { > +.quantization_flags.value = trellis, > +}; > + > +vaapi_encode_add_global_param(avctx, > + VAEncMiscParameterTypeQuantization, > + &ctx->quantization_params, > + sizeof(ctx->quantization_params)); > +} > +#else > +av_log(avctx, AV_LOG_WARNING, "The encode quantization option (Trellis) > is " > + "not supported with this VAAPI version.\n"); > +#endif > + > +return 0; > +} > + > static av_cold int vaapi_encode_init_gop_structure(AVCodecContext *avctx) > { > VAAPIEncodeContext *ctx = avctx->priv_data; > @@ -2132,6 +2174,12 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) > if (err < 0) > goto fail; > > +if (ctx->trellis) { > +err = vaapi_encode_init_quantization(avctx); > +if (err < 0) > +goto fail; > +} > + > if (avctx->compression_level >= 0) { > err = vaapi_encode_init_quality(avctx); > if (err < 0) > diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h > index eeec06036b..b24735da59 100644 > --- a/libavcodec/vaapi_encode.h > +++ b/libavcodec/vaapi_encode.h > @@ -37,7 +37,7 @@ struct VAAPIEncodePicture; > > enum { > MAX_CONFIG_ATTRIBUTES = 4, > -MAX_GLOBAL_PARAMS = 4, > +MAX_GLOBAL_PARAMS = 5, > MAX_DPB_SIZE = 16, > MAX_PICTURE_REFERENCES = 2, > MAX_REORDER_DELAY = 16, > @@ -220,6 +220,9 @@ typedef struct VAAPIEncodeContext { > // Packed headers which will actually be sent. > unsigned intva_packed_headers; > > +// Quantization mode > +int trellis; > + > // Configuration attributes to use when creating va_config. > VAConfigAttrib config_attributes[MAX_CONFIG_ATTRIBUTES]; > int nb_config_attributes; > @@ -256,7 +259,9 @@ typedef struct VAAPIEncodeContext { > #if VA_CHECK_VERSION(0, 36, 0) > VAEncMiscParameterBufferQualityLevel quality_params; > #endif > - > +#if VA_CHECK_VERSION(1, 0, 0) > +VAEncMiscParameterQuantization quantization_params; > +#endif > // Per-sequence parameter structure (VAEncSequenceParameterBuffer*). > void *codec_sequence_params; > > diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c > index d1427112ea..427fb6320e 100644 > --- a/libavcodec/vaapi_encode_h264.c > +++ b/libavcodec/vaapi_encode_h264.c > @@ -72,6 +72,7 @@ typedef struct VAAPIEncodeH264Context { > int sei; > int profile; > int level; > +int trellis; > > // Derived settings. > int mb_width; > @@ -1233,6 +1234,8 @@ static av_cold int > vaapi_encode_h264_init(AVCodecContext *avctx) > if (priv->qp > 0) > ctx
Re: [FFmpeg-devel] [PATCH v2] avfilter/vaapi: add overlay_vaapi filter
? On Tue, Jun 11, 2019 at 10:52 AM Zachary Zhou wrote: > > --- > configure | 1 + > libavfilter/Makefile | 1 + > libavfilter/allfilters.c | 1 + > libavfilter/vaapi_vpp.c| 95 + > libavfilter/vaapi_vpp.h| 5 + > libavfilter/vf_overlay_vaapi.c | 357 + > 6 files changed, 460 insertions(+) > create mode 100644 libavfilter/vf_overlay_vaapi.c > > diff --git a/configure b/configure > index 32fc26356c..f469e6a3b1 100755 > --- a/configure > +++ b/configure > @@ -3478,6 +3478,7 @@ openclsrc_filter_deps="opencl" > overlay_opencl_filter_deps="opencl" > overlay_qsv_filter_deps="libmfx" > overlay_qsv_filter_select="qsvvpp" > +overlay_vaapi_filter_deps="vaapi" > owdenoise_filter_deps="gpl" > pan_filter_deps="swresample" > perspective_filter_deps="gpl" > diff --git a/libavfilter/Makefile b/libavfilter/Makefile > index 07ea8d7edc..5cbf1a7e41 100644 > --- a/libavfilter/Makefile > +++ b/libavfilter/Makefile > @@ -311,6 +311,7 @@ OBJS-$(CONFIG_OVERLAY_FILTER)+= > vf_overlay.o framesync.o > OBJS-$(CONFIG_OVERLAY_OPENCL_FILTER) += vf_overlay_opencl.o opencl.o > \ > opencl/overlay.o framesync.o > OBJS-$(CONFIG_OVERLAY_QSV_FILTER)+= vf_overlay_qsv.o framesync.o > +OBJS-$(CONFIG_OVERLAY_VAAPI_FILTER) += vf_overlay_vaapi.o > framesync.o > OBJS-$(CONFIG_OWDENOISE_FILTER) += vf_owdenoise.o > OBJS-$(CONFIG_PAD_FILTER)+= vf_pad.o > OBJS-$(CONFIG_PALETTEGEN_FILTER) += vf_palettegen.o > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c > index 9c846b1ddd..27ee1df78b 100644 > --- a/libavfilter/allfilters.c > +++ b/libavfilter/allfilters.c > @@ -295,6 +295,7 @@ extern AVFilter ff_vf_oscilloscope; > extern AVFilter ff_vf_overlay; > extern AVFilter ff_vf_overlay_opencl; > extern AVFilter ff_vf_overlay_qsv; > +extern AVFilter ff_vf_overlay_vaapi; > extern AVFilter ff_vf_owdenoise; > extern AVFilter ff_vf_pad; > extern AVFilter ff_vf_palettegen; > diff --git a/libavfilter/vaapi_vpp.c b/libavfilter/vaapi_vpp.c > index b5b245c8af..a8caa5b532 100644 > --- a/libavfilter/vaapi_vpp.c > +++ b/libavfilter/vaapi_vpp.c > @@ -663,6 +663,101 @@ fail: > return err; > } > > +int ff_vaapi_vpp_render_overlay(AVFilterContext *avctx, > +VAProcPipelineParameterBuffer *params, > +VAProcPipelineParameterBuffer *subpic_params, > +VASurfaceID output_surface) > +{ > +VABufferID params_id; > +VABufferID subpic_params_id; > +VAStatus vas; > +int err = 0; > +VAAPIVPPContext *ctx = avctx->priv; > + > +vas = vaBeginPicture(ctx->hwctx->display, > + ctx->va_context, output_surface); > +if (vas != VA_STATUS_SUCCESS) { > +av_log(avctx, AV_LOG_ERROR, "Failed to attach new picture: " > + "%d (%s).\n", vas, vaErrorStr(vas)); > +err = AVERROR(EIO); > +goto fail; > +} > + > +vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context, > + VAProcPipelineParameterBufferType, > + sizeof(*params), 1, params, ¶ms_id); > +if (vas != VA_STATUS_SUCCESS) { > +av_log(avctx, AV_LOG_ERROR, "Failed to create parameter buffer: " > + "%d (%s).\n", vas, vaErrorStr(vas)); > +err = AVERROR(EIO); > +goto fail_after_begin; > +} > +av_log(avctx, AV_LOG_DEBUG, "Pipeline parameter buffer is %#x.\n", > + params_id); > + > + > +vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context, > + VAProcPipelineParameterBufferType, > + sizeof(*subpic_params), 1, subpic_params, > &subpic_params_id); > +if (vas != VA_STATUS_SUCCESS) { > +av_log(avctx, AV_LOG_ERROR, "Failed to create parameter buffer: " > + "%d (%s).\n", vas, vaErrorStr(vas)); > +err = AVERROR(EIO); > +goto fail_after_begin; > +} > +av_log(avctx, AV_LOG_DEBUG, "Pipeline subpic parameter buffer is %#x.\n", > + subpic_params_id); > + > +vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context, > + ¶ms_id, 1); > +if (vas != VA_STATUS_SUCCESS) { > +av_log(avctx, AV_LOG_ERROR, "Failed to render parameter buffer: " > + "%d (%s).\n", vas, vaErrorStr(vas)); > +err = AVERROR(EIO); > +goto fail_after_begin; > +} > + > +vas = vaRenderPicture(ctx->hwctx->display, ctx->va_context, > + &subpic_params_id, 1); > +if (vas != VA_STATUS_SUCCESS) { > +av_log(avctx, AV_LOG_ERROR, "Failed to render subpic parameter > buffer: " > + "%d (%s).\n", vas, vaErrorStr(vas)); > +err = AVERROR(EIO); > +goto fail_after_begin; > +} > + > +
Re: [FFmpeg-devel] [PATCH v2] avfilter/vaapi: add overlay_vaapi filter
On Wed, Jun 19, 2019 at 5:26 PM Zhou, Zachary wrote: > > > > > -Original Message- > > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of > > myp...@gmail.com > > Sent: Wednesday, June 19, 2019 10:13 AM > > To: FFmpeg development discussions and patches > > Subject: Re: [FFmpeg-devel] [PATCH v2] avfilter/vaapi: add overlay_vaapi > > filter > > > > ? > > On Tue, Jun 11, 2019 at 10:52 AM Zachary Zhou > > wrote: > > > > > > --- > > > configure | 1 + > > > libavfilter/Makefile | 1 + > > > libavfilter/allfilters.c | 1 + > > > libavfilter/vaapi_vpp.c| 95 + > > > libavfilter/vaapi_vpp.h| 5 + > > > libavfilter/vf_overlay_vaapi.c | 357 > > > + > > > 6 files changed, 460 insertions(+) > > > create mode 100644 libavfilter/vf_overlay_vaapi.c > > > > > > diff --git a/configure b/configure > > > index 32fc26356c..f469e6a3b1 100755 > > > --- a/configure > > > +++ b/configure > > > @@ -3478,6 +3478,7 @@ openclsrc_filter_deps="opencl" > > > overlay_opencl_filter_deps="opencl" > > > overlay_qsv_filter_deps="libmfx" > > > overlay_qsv_filter_select="qsvvpp" > > > +overlay_vaapi_filter_deps="vaapi" > > > owdenoise_filter_deps="gpl" > > > pan_filter_deps="swresample" > > > perspective_filter_deps="gpl" > > > diff --git a/libavfilter/Makefile b/libavfilter/Makefile index > > > 07ea8d7edc..5cbf1a7e41 100644 > > > --- a/libavfilter/Makefile > > > +++ b/libavfilter/Makefile > > > @@ -311,6 +311,7 @@ OBJS-$(CONFIG_OVERLAY_FILTER)+= > > vf_overlay.o framesync.o > > > OBJS-$(CONFIG_OVERLAY_OPENCL_FILTER) += vf_overlay_opencl.o > > opencl.o \ > > > opencl/overlay.o > > > framesync.o > > > OBJS-$(CONFIG_OVERLAY_QSV_FILTER)+= vf_overlay_qsv.o > > framesync.o > > > +OBJS-$(CONFIG_OVERLAY_VAAPI_FILTER) += vf_overlay_vaapi.o > > framesync.o > > > OBJS-$(CONFIG_OWDENOISE_FILTER) += vf_owdenoise.o > > > OBJS-$(CONFIG_PAD_FILTER)+= vf_pad.o > > > OBJS-$(CONFIG_PALETTEGEN_FILTER) += vf_palettegen.o > > > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index > > > 9c846b1ddd..27ee1df78b 100644 > > > --- a/libavfilter/allfilters.c > > > +++ b/libavfilter/allfilters.c > > > @@ -295,6 +295,7 @@ extern AVFilter ff_vf_oscilloscope; extern > > > AVFilter ff_vf_overlay; extern AVFilter ff_vf_overlay_opencl; extern > > > AVFilter ff_vf_overlay_qsv; > > > +extern AVFilter ff_vf_overlay_vaapi; > > > extern AVFilter ff_vf_owdenoise; > > > extern AVFilter ff_vf_pad; > > > extern AVFilter ff_vf_palettegen; > > > diff --git a/libavfilter/vaapi_vpp.c b/libavfilter/vaapi_vpp.c index > > > b5b245c8af..a8caa5b532 100644 > > > --- a/libavfilter/vaapi_vpp.c > > > +++ b/libavfilter/vaapi_vpp.c > > > @@ -663,6 +663,101 @@ fail: > > > return err; > > > } > > > > > > +int ff_vaapi_vpp_render_overlay(AVFilterContext *avctx, > > > +VAProcPipelineParameterBuffer *params, > > > +VAProcPipelineParameterBuffer > > > *subpic_params, > > > +VASurfaceID output_surface) { > > > +VABufferID params_id; > > > +VABufferID subpic_params_id; > > > +VAStatus vas; > > > +int err = 0; > > > +VAAPIVPPContext *ctx = avctx->priv; > > > + > > > +vas = vaBeginPicture(ctx->hwctx->display, > > > + ctx->va_context, output_surface); > > > +if (vas != VA_STATUS_SUCCESS) { > > > +av_log(avctx, AV_LOG_ERROR, "Failed to attach new picture: " > > > + "%d (%s).\n", vas, vaErrorStr(vas)); > > > +err = AVERROR(EIO); > > > +goto fail; > > > +} > > > + > > > +vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context, > > > + VAProcPipelineParameterBufferType, > > > + sizeof(*params), 1, params, ¶ms_id); > > > +if (vas !=
Re: [FFmpeg-devel] [PATCH V1 2/3] ffmpeg_opt: Respect default disposition when select audio/video
On Fri, Jun 21, 2019 at 10:36 PM Michael Niedermayer wrote: > > On Thu, Jun 20, 2019 at 12:50:33PM +0800, Jun Zhao wrote: > > From: Jun Zhao > > > > Respect default disposition when select audio/video > > > > Signed-off-by: Jun Zhao > > --- > > fftools/ffmpeg_opt.c |6 -- > > 1 files changed, 4 insertions(+), 2 deletions(-) > > this is probably ok > > some testcase in fate would probably be good > Will add some FATE test case, tks ___ 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 V1] lavf/flvenc: add automatic bitstream filtering
On Sat, Jun 22, 2019 at 5:54 PM Steven Liu wrote: > > > > > 在 2019年6月22日,17:04,Jun Zhao 写道: > > > > From: Jun Zhao > > > > add automatic bitstream filtering when mux AAC > > > > Signed-off-by: Jun Zhao > > --- > > libavformat/flvenc.c | 27 --- > > 1 files changed, 24 insertions(+), 3 deletions(-) > > > > diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c > > index e4863f1..fb1dede 100644 > > --- a/libavformat/flvenc.c > > +++ b/libavformat/flvenc.c > > @@ -653,11 +653,9 @@ end: > > return ret; > > } > > > > - > > -static int flv_write_header(AVFormatContext *s) > > +static int flv_init(struct AVFormatContext *s) > > { > > int i; > > -AVIOContext *pb = s->pb; > > FLVContext *flv = s->priv_data; > > > > for (i = 0; i < s->nb_streams; i++) { > > @@ -736,6 +734,15 @@ static int flv_write_header(AVFormatContext *s) > > > > flv->delay = AV_NOPTS_VALUE; > > > > +return 0; > > +} > > + > > +static int flv_write_header(AVFormatContext *s) > > +{ > > +int i; > > +AVIOContext *pb = s->pb; > > +FLVContext *flv = s->priv_data; > > + > > avio_write(pb, "FLV", 3); > > avio_w8(pb, 1); > > avio_w8(pb, FLV_HEADER_FLAG_HASAUDIO * !!flv->audio_par + > > @@ -1074,6 +1081,18 @@ static int flv_write_packet(AVFormatContext *s, > > AVPacket *pkt) > > return pb->error; > > } > > > > +static int flv_check_bitstream(struct AVFormatContext *s, const AVPacket > > *pkt) > > +{ > > +int ret = 1; > > +AVStream *st = s->streams[pkt->stream_index]; > > + > > +if (st->codecpar->codec_id == AV_CODEC_ID_AAC) { > > +if (pkt->size > 2 && (AV_RB16(pkt->data) & 0xfff0) == 0xfff0) > > +ret = ff_stream_add_bitstream_filter(st, "aac_adtstoasc", > > NULL); > > +} > > +return ret; > > +} > > + > > 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" }, > > @@ -1099,9 +1118,11 @@ AVOutputFormat ff_flv_muxer = { > > .priv_data_size = sizeof(FLVContext), > > .audio_codec= CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : > > AV_CODEC_ID_ADPCM_SWF, > > .video_codec= AV_CODEC_ID_FLV1, > > +.init = flv_init, > > .write_header = flv_write_header, > > .write_packet = flv_write_packet, > > .write_trailer = flv_write_trailer, > > +.check_bitstream= flv_check_bitstream, > > .codec_tag = (const AVCodecTag* const []) { > > flv_video_codec_ids, flv_audio_codec_ids, 0 > > }, > > -- > > 1.7.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”. > > LGTM > > Don’t forget add add Reported-by: Yabo Wei > Pushed and add the Reported-by, Tks ___ 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 v3] libavcodec/vp8dec: fix the multi-thread HWAccel decode error
On Mon, Jul 1, 2019 at 2:38 PM Wang, Shaofei wrote: > > Hello here, > A simple ping about this patch > Please feel free to ask if you have any question Is it this patch https://patchwork.ffmpeg.org/patch/13723/ fix the same issue? ___ 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]lavc/r210enc: Fix undefined behaviour encoding r10k
On Mon, Jul 1, 2019 at 7:08 PM Carl Eugen Hoyos wrote: > > Hi! > > Attached patch fixes an invalid left shift reported in ticket #7982. > > Please comment, Carl Eugen Ha, great catch:), LGTM ___ 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 V2 0/4] Respect default disposition when select stream
On Fri, Jun 28, 2019 at 3:21 PM Jun Zhao wrote: > > V2: - Add FATE test case, the test clip will upload to FATE server > > Jun Zhao (4): > lavf/utils: Respect default disposition when select the AVStream > ffmpeg_opt: Respect default disposition when select audio/video > lavf/dump: More disposition flag dump > fate: add disposition default test case > > fftools/ffmpeg_opt.c |6 +- > libavformat/dump.c|8 ++ > libavformat/utils.c |3 +- > tests/fate/ffmpeg.mak |4 + > tests/ref/fate/ffmpeg-disposition_default | 106 > + > 5 files changed, 124 insertions(+), 3 deletions(-) > create mode 100644 tests/ref/fate/ffmpeg-disposition_default > Will apply patch 1-3, the patch 4 will hold until the test clip upload to FATE server. Thanks ___ 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 V1 1/2] doc/muxers: fix and update docs for HLS muxer
On Fri, Jun 28, 2019 at 9:55 PM Gyan wrote: > > > > On 28-06-2019 07:02 PM, Jun Zhao wrote: > > From: Jun Zhao > > > > fix and update docs for HLS muxer > > > > Signed-off-by: Jun Zhao > > --- > > doc/muxers.texi | 68 > > ++ > > 1 files changed, 38 insertions(+), 30 deletions(-) > > > > diff --git a/doc/muxers.texi b/doc/muxers.texi > > index dd64672..d93d1cf 100644 > > --- a/doc/muxers.texi > > +++ b/doc/muxers.texi > > @@ -554,32 +554,32 @@ segmentation. > > This muxer supports the following options: > > > > @table @option > > -@item hls_init_time @var{seconds} > > +@item -hls_init_time @var{seconds} > These docs are for API users as well, and since the hyphen isn't part of > the option name, it would be confusing. At least that was the consensus > when a similar change was proposed - see > http://www.ffmpeg.org/pipermail/ffmpeg-devel/2019-February/240380.html > > Gyan Submitted V2 for this in https://patchwork.ffmpeg.org/patch/13750/ and https://patchwork.ffmpeg.org/patch/13749/, Please help to review, Thanks ___ 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 v1] lavc/libdavs2.c: optimize frame copy
On Wed, Jul 3, 2019 at 11:24 AM hwrenx wrote: > > Signed-off-by: hwrenx > --- > libavcodec/libdavs2.c | 15 ++- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c > index 218f3ec..15ed3a1 100644 > --- a/libavcodec/libdavs2.c > +++ b/libavcodec/libdavs2.c > @@ -62,7 +62,7 @@ static int davs2_dump_frames(AVCodecContext *avctx, > davs2_picture_t *pic, int *g > davs2_seq_info_t *headerset, int ret_type, > AVFrame *frame) > { > DAVS2Context *cad= avctx->priv_data; > -int bytes_per_sample = pic->bytes_per_sample; > +int bytes_per_sample = pic->bytes_per_sample == 8 ? 1 : 2; Looks like davs2 use a wrong name for bits per sample, I think need to fix in davs2 first, it's better than the workaround in the wrapper. > int plane = 0; > int line = 0; > > @@ -104,6 +104,7 @@ static int davs2_dump_frames(AVCodecContext *avctx, > davs2_picture_t *pic, int *g > > for (plane = 0; plane < 3; ++plane) { > int size_line = pic->widths[plane] * bytes_per_sample; > +void *dst, *src; > frame->buf[plane] = av_buffer_alloc(size_line * pic->lines[plane]); > > if (!frame->buf[plane]){ > @@ -114,10 +115,14 @@ static int davs2_dump_frames(AVCodecContext *avctx, > davs2_picture_t *pic, int *g > frame->data[plane] = frame->buf[plane]->data; > frame->linesize[plane] = size_line; > > -for (line = 0; line < pic->lines[plane]; ++line) > -memcpy(frame->data[plane] + line * size_line, > - pic->planes[plane] + line * pic->strides[plane], > - pic->widths[plane] * bytes_per_sample); > +dst = frame->data[plane]; > +src = pic->planes[plane]; > + > +for (line = 0; line < pic->lines[plane]; ++line) { > +memcpy(dst, src, size_line); > +dst += size_line; > +src += pic->strides[plane]; > +} > } > > frame->width = cad->headerset.width; > -- > 2.7.4 > ___ 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 V2 2/2] doc/muxers: fix docs format for DASH muxer
On Thu, Jul 4, 2019 at 4:52 PM Gyan wrote: > > > > On 28-06-2019 08:36 PM, Jun Zhao wrote: > > From: Jun Zhao > > > > fix docs format for DASH muxer > > > > Signed-off-by: Jun Zhao > > --- > > doc/muxers.texi | 62 > > -- > > 1 files changed, 32 insertions(+), 30 deletions(-) > > > > diff --git a/doc/muxers.texi b/doc/muxers.texi > > index d179584..c220bd2 100644 > > --- a/doc/muxers.texi > > +++ b/doc/muxers.texi > > @@ -220,64 +220,64 @@ In addition to the standard identifiers, an > > ffmpeg-specific "$ext$" identifier i > > When specified ffmpeg will replace $ext$ in the file name with muxing > > format's extensions such as mp4, webm etc., > > > > @example > > -ffmpeg -re -i -map 0 -map 0 -c:a libfdk_aac -c:v libx264 > > --b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline > > --profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 > > --b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 > > --window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" > > +ffmpeg -re -i -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \ > > +-b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline \ > > +-profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 \ > > +-b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \ > > +-window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" \ > > -f dash /path/to/out.mpd > > @end example > > > > @table @option > > -@item -min_seg_duration @var{microseconds} > > +@item min_seg_duration @var{microseconds} > > This is a deprecated option to set the segment length in microseconds, > > use @var{seg_duration} instead. > > -@item -seg_duration @var{duration} > > +@item seg_duration @var{duration} > > Set the segment length in seconds (fractional value can be set). The > > value is > > treated as average segment duration when @var{use_template} is enabled and > > @var{use_timeline} is disabled and as minimum segment duration for all > > the other > > use cases. > > -@item -window_size @var{size} > > +@item window_size @var{size} > > Set the maximum number of segments kept in the manifest. > > -@item -extra_window_size @var{size} > > +@item extra_window_size @var{size} > > Set the maximum number of segments kept outside of the manifest before > > removing from disk. > > -@item -remove_at_exit @var{remove} > > +@item remove_at_exit @var{remove} > > Enable (1) or disable (0) removal of all segments when finished. > > -@item -use_template @var{template} > > +@item use_template @var{template} > > Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList. > > -@item -use_timeline @var{timeline} > > +@item use_timeline @var{timeline} > > Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate. > > -@item -single_file @var{single_file} > > +@item single_file @var{single_file} > > Enable (1) or disable (0) storing all segments in one file, accessed > > using byte ranges. > > -@item -single_file_name @var{file_name} > > +@item single_file_name @var{file_name} > > DASH-templated name to be used for baseURL. Implies @var{single_file} set > > to "1". In the template, "$ext$" is replaced with the file name extension > > specific for the segment format. > > -@item -init_seg_name @var{init_name} > > +@item init_seg_name @var{init_name} > > DASH-templated name to used for the initialization segment. Default is > > "init-stream$RepresentationID$.$ext$". "$ext$" is replaced with the file > > name extension specific for the segment format. > > -@item -media_seg_name @var{segment_name} > > +@item media_seg_name @var{segment_name} > > DASH-templated name to used for the media segments. Default is > > "chunk-stream$RepresentationID$-$Number%05d$.$ext$". "$ext$" is replaced > > with the file name extension specific for the segment format. > > -@item -utc_timing_url @var{utc_url} > > +@item utc_timing_url @var{utc_url} > > URL of the page that will return the UTC timestamp in ISO format. > > Example: "https://time.akamai.com/?iso"; > > @item method @var{method} > > Use the given HTTP method to create output files. Generally set to PUT or > > POST. > > -@item -http_user_agent @var{user_agent} > > +@item http_user_agent @var{user_agent} > > Override User-Agent field in HTTP header. Applicable only for HTTP output. > > -@item -http_persistent @var{http_persistent} > > +@item http_persistent @var{http_persistent} > > Use persistent HTTP connections. Applicable only for HTTP output. > > -@item -hls_playlist @var{hls_playlist} > > +@item hls_playlist @var{hls_playlist} > > Generate HLS playlist files as well. The master playlist is generated > > with the filename master.m3u8. > > One media playlist file is generated for each stream with filenames > > media_0.m3u8, media_1.m3u8, etc. > > -@item -streaming @var{streaming} > > +@item streaming @var{streaming} > > Enable (1) or disable (0) chunk streaming mode of outp
Re: [FFmpeg-devel] [PATCH v1] lavc/libdavs2.c: optimize frame copy
On Fri, Jul 5, 2019 at 9:09 AM Song, Ruiling wrote: > > > -Original Message- > > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf > > Of hwrenx > > Sent: Wednesday, July 3, 2019 11:24 AM > > To: ffmpeg-devel@ffmpeg.org > > Subject: [FFmpeg-devel] [PATCH v1] lavc/libdavs2.c: optimize frame copy > > > > I think it's better to use "correct ..." or "fix ..." instead of "optimize" > in the title. > Maybe a short commit message here would be useful for reviewer. > > > Signed-off-by: hwrenx > > --- > > libavcodec/libdavs2.c | 15 ++- > > 1 file changed, 10 insertions(+), 5 deletions(-) > > > > diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c > > index 218f3ec..15ed3a1 100644 > > --- a/libavcodec/libdavs2.c > > +++ b/libavcodec/libdavs2.c > > @@ -62,7 +62,7 @@ static int davs2_dump_frames(AVCodecContext *avctx, > > davs2_picture_t *pic, int *g > > davs2_seq_info_t *headerset, int ret_type, > > AVFrame *frame) > > { > > DAVS2Context *cad= avctx->priv_data; > > -int bytes_per_sample = pic->bytes_per_sample; > > +int bytes_per_sample = pic->bytes_per_sample == 8 ? 1 : 2; > > int plane = 0; > > int line = 0; > > > > @@ -104,6 +104,7 @@ static int davs2_dump_frames(AVCodecContext > > *avctx, davs2_picture_t *pic, int *g > > > > for (plane = 0; plane < 3; ++plane) { > > int size_line = pic->widths[plane] * bytes_per_sample; > > +void *dst, *src; > > frame->buf[plane] = av_buffer_alloc(size_line * > > pic->lines[plane]); > > > > if (!frame->buf[plane]){ > > @@ -114,10 +115,14 @@ static int davs2_dump_frames(AVCodecContext > > *avctx, davs2_picture_t *pic, int *g > > frame->data[plane] = frame->buf[plane]->data; > > frame->linesize[plane] = size_line; > > > > Did you observe performance difference with only below lines of change? > If it is just for code cleanup, it's better to split this into separate patch. > After talked with hwrenx offline, I think hwrenx will use the other way for this type performance issue like libdav1d.c wrapper, it's will reduce the memory copy from davs2 decoder to FFmpeg. > Thanks! > Ruiling > > -for (line = 0; line < pic->lines[plane]; ++line) > > -memcpy(frame->data[plane] + line * size_line, > > - pic->planes[plane] + line * pic->strides[plane], > > - pic->widths[plane] * bytes_per_sample); > > +dst = frame->data[plane]; > > +src = pic->planes[plane]; > > + > > +for (line = 0; line < pic->lines[plane]; ++line) { > > +memcpy(dst, src, size_line); > > +dst += size_line; > > +src += pic->strides[plane]; > > +} > > } > > > > frame->width = cad->headerset.width; > > -- > > 2.7.4 ___ 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 V1 2/2] doc/filters: Document missing options for scale in/out color matrix
On Fri, Jul 5, 2019 at 12:48 PM Gyan wrote: > > > > On 05-07-2019 10:06 AM, Jun Zhao wrote: > > From: Jun Zhao > > > > Document missing options for scale in/out color matrix > > > > Signed-off-by: Jun Zhao > > --- > > doc/filters.texi |5 + > > 1 files changed, 5 insertions(+), 0 deletions(-) > > > > diff --git a/doc/filters.texi b/doc/filters.texi > > index 700a76f..b7dec47 100644 > > --- a/doc/filters.texi > > +++ b/doc/filters.texi > > @@ -15151,6 +15151,8 @@ Set color space conforming to the United States > > Federal Communications > > Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 > > (a). > > > > @item bt601 > > +@item bt470 > > +@item smpte170m > > Set color space conforming to: > > > > @itemize > > @@ -15167,6 +15169,9 @@ Society of Motion Picture and Television Engineers > > (SMPTE) ST 170:2004 > > > > @item smpte240m > > Set color space conforming to SMPTE ST 240:1999. > > + > > +@item bt2020 > > +Set color space conforming to ITU-R BT2020 non-constant luminance system. > s/BT2020/BT.2020. Rest LGTM. > > > @end table > > > > @item in_range > Pushed the 2 patches and followed the comment ___ 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] avcodec/audiotoolboxdec: Fix decoding 24 Bit ALAC
On Tue, Jul 9, 2019 at 12:37 AM Davis wrote: > > "avctx->bits_per_raw_sample" always returns 0. > Tested with 24 Bit ALAC. The result is bit-perfect. > Fix #7287. > --- > libavcodec/audiotoolboxdec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c > index 5c0a9de8f6..95bf9acc42 100644 > --- a/libavcodec/audiotoolboxdec.c > +++ b/libavcodec/audiotoolboxdec.c > @@ -302,7 +302,7 @@ static av_cold int ffat_create_decoder(AVCodecContext > *avctx, AVPacket *pkt) > OSStatus status; > int i; > > -enum AVSampleFormat sample_fmt = (avctx->bits_per_raw_sample == 32) ? > +enum AVSampleFormat sample_fmt = (avctx->bits_per_coded_sample > 16) ? LGTM > AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16; > > AudioStreamBasicDescription in_format = { > -- ___ 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] accurrate time output in program_date_time
On Tue, Jul 9, 2019 at 4:43 PM Pavel Pilar wrote: > > --- > libavformat/hlsenc.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c > index 057134f410..00c725af18 100644 > --- a/libavformat/hlsenc.c > +++ b/libavformat/hlsenc.c > @@ -23,6 +23,7 @@ > #include "config.h" > #include > #include i > +#include > #if HAVE_UNISTD_H > #include > #endif > @@ -2741,9 +2742,15 @@ static int hls_init(AVFormatContext *s) > } > > if (hls->flags & HLS_PROGRAM_DATE_TIME) { > +#ifdef _POSIX_TIMERS > +struct timespec now0; > +clock_gettime(CLOCK_MONOTONIC, &now0); > +vs->initial_prog_date_time = now0.tv_sec + now0.tv_nsec / 1e9; > +#else I think you can use av_gettime() in this case > time_t now0; > time(&now0); > vs->initial_prog_date_time = now0; > +#endif > } > if (hls->format_options_str) { > ret = av_dict_parse_string(&hls->format_options, > hls->format_options_str, "=", ":", 0); > -- > 2.17.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". -- === Jun zhao/赵军 +++ ___ 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] libavformat/hlsenc.c Accurrate time output in program_date_time (corrected)
On Tue, Jul 9, 2019 at 7:42 PM Pavel Pilar wrote: > > --- > libavformat/hlsenc.c | 12 +++- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c > index 00c725af18..94fd713834 100644 > --- a/libavformat/hlsenc.c > +++ b/libavformat/hlsenc.c > @@ -2653,6 +2653,9 @@ static int hls_init(AVFormatContext *s) > char *p = NULL; > int vtt_basename_size = 0; > int fmp4_init_filename_len = strlen(hls->fmp4_init_filename) + 1; > +#ifdef _POSIX_TIMERS > +struct timespec now_accurate; > +#endif > > hls->has_default_key = 0; > hls->has_video_m3u8 = 0; > @@ -2742,14 +2745,13 @@ static int hls_init(AVFormatContext *s) > } > > if (hls->flags & HLS_PROGRAM_DATE_TIME) { > -#ifdef _POSIX_TIMERS > -struct timespec now0; > -clock_gettime(CLOCK_MONOTONIC, &now0); > -vs->initial_prog_date_time = now0.tv_sec + now0.tv_nsec / 1e9; > -#else > time_t now0; > time(&now0); > vs->initial_prog_date_time = now0; > +#ifdef _POSIX_TIMERS > +if (clock_gettime(CLOCK_REALTIME, &now_accurate) == 0) { > +vs->initial_prog_date_time = now_accurate.tv_sec + > now_accurate.tv_nsec / 1e9; > +} > #endif > } > if (hls->format_options_str) { > -- > 2.17.1 As my comments before, av_gettime or av_gettime_relative can be used in this case, these functions better handle cross-platform issues like check #ifdef _POSIX_TIMERS ___ 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 v1 2/2] libavformat/file: initilize the fd to -1 instead of 0(valid fd) in case unexpected file close
On Wed, Jul 10, 2019 at 11:11 PM Limin Wang wrote: > > > ping? I have developed code to use avio_open_dir function, after using > avio_close_dir > to release the resource, my ffmepg command will lost interact for the fd > 0 is closed by avio_close_dir. > > > On Tue, Jun 18, 2019 at 06:45:13PM +0800, lance.lmw...@gmail.com wrote: > > From: Limin Wang > > > > Signed-off-by: Limin Wang > > --- > > libavformat/file.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/libavformat/file.c b/libavformat/file.c > > index 08c7f8e6dd.. 40ae9ad2a8 100644 > > --- a/libavformat/file.c > > +++ b/libavformat/file.c > > @@ -274,6 +274,7 @@ static int file_open_dir(URLContext *h) > > #if HAVE_LSTAT > > FileContext *c = h->priv_data; > > > > +c->fd = -1; I don't konw why need to change the fd , suppose we have a calling sequence like file_open ahead of file_open_dir, can we leak a fd resource ? > > c->dir = opendir(h->filename); > > if (!c->dir) > > return AVERROR(errno); > > -- > > 2.21.0 ___ 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] fftools/ffmpeg_filter: use -reinit_filter to disable/enable auto scale
On Fri, Jul 12, 2019 at 1:19 PM Linjie Fu wrote: > > Currently, ffmpeg inserts scale filter in the filter graph to force > the whole decoded stream to scale into the same size with the first > frame. It's not quite make sense in resolution changing cases if user > wants the rawvideo without any scale. > > Option -reinit_filter 0 could be used to realize similar function, but > it fails when ifilter has hw_frame_ctx. > > Add auto_scale flag set by -reinit_filter to indicate whether auto > inserting the scale filter in the filter graph. > > Signed-off-by: Linjie Fu > --- > Request for comments. > As we have discussed in the rawdump filter patch, here is a simpler > solution based on -reinit_filter, and reuse this option.(maybe it's not > easy to be accepted to add a separate option) > > fftools/ffmpeg.c| 2 +- > fftools/ffmpeg.h| 1 + > fftools/ffmpeg_filter.c | 2 +- > 3 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c > index 01f04103cf..5305b87bd4 100644 > --- a/fftools/ffmpeg.c > +++ b/fftools/ffmpeg.c > @@ -2133,6 +2133,7 @@ static int ifilter_send_frame(InputFilter *ifilter, > AVFrame *frame) > > /* determine if the parameters for this input changed */ > need_reinit = ifilter->format != frame->format; > +fg->auto_scale = ifilter->ist->reinit_filters; > > switch (ifilter->ist->st->codecpar->codec_type) { > case AVMEDIA_TYPE_AUDIO: > @@ -2145,7 +2146,6 @@ static int ifilter_send_frame(InputFilter *ifilter, > AVFrame *frame) > ifilter->height != frame->height; > break; > } > - Unrelated change > if (!ifilter->ist->reinit_filters && fg->graph) > need_reinit = 0; > > diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h > index 7b6f802082..0c289b439f 100644 > --- a/fftools/ffmpeg.h > +++ b/fftools/ffmpeg.h > @@ -285,6 +285,7 @@ typedef struct FilterGraph { > > AVFilterGraph *graph; > int reconfiguration; > +int auto_scale; > > InputFilter **inputs; > int nb_inputs; > diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c > index 72838de1e2..856ba48de7 100644 > --- a/fftools/ffmpeg_filter.c > +++ b/fftools/ffmpeg_filter.c > @@ -469,7 +469,7 @@ static int configure_output_video_filter(FilterGraph *fg, > OutputFilter *ofilter, > if (ret < 0) > return ret; > > -if (ofilter->width || ofilter->height) { > +if ((ofilter->width || ofilter->height) && fg->auto_scale) { > char args[255]; > AVFilterContext *filter; > AVDictionaryEntry *e = NULL; > -- > 2.17.1 > Add an option to disable/enable "auto insert" is Ok for me, but I think if you reuse the -reinit_filter option, you need to update doc part at the same time. ___ 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 V1] doc/codecs: Add missing documentation for nointra
On Mon, Jul 15, 2019 at 2:58 AM Michael Niedermayer wrote: > > On Sun, Jul 14, 2019 at 03:32:59PM +0800, Jun Zhao wrote: > > From: Jun Zhao > > > > Add missing documentation for nointra. > > LGTM > > thx Applied, Thanks ___ 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 V1 2/3] doc/ffmpeg: Document dts_error_threshold option
On Wed, Jul 24, 2019 at 5:08 PM Gyan wrote: > > > > On 24-07-2019 01:38 PM, Michael Niedermayer wrote: > > On Sun, Jul 21, 2019 at 10:31:36PM +0800, Jun Zhao wrote: > >> From: Jun Zhao > >> > >> Document dts_error_threshold option. > >> > >> Signed-off-by: Jun Zhao > >> --- > >> doc/ffmpeg.texi |2 ++ > >> 1 files changed, 2 insertions(+), 0 deletions(-) > >> > >> diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi > >> index cd35eb4..2152e62 100644 > >> --- a/doc/ffmpeg.texi > >> +++ b/doc/ffmpeg.texi > >> @@ -1515,6 +1515,8 @@ Enable bitexact mode for (de)muxer and (de/en)coder > >> Finish encoding when the shortest input stream ends. > >> @item -dts_delta_threshold > >> Timestamp discontinuity delta threshold. > >> +@item -dts_error_threshold > >> +Timestamp error delta threshold. > > ok, though a bit terse > > > Yes, mention what this option actually does. Mention units and if > applicable, range. > Will add other part as the comments. Tks ___ 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 V1 1/3] lavf/hls: remove redundancy reset_packet() after av_packet_unref()
On Thu, Jul 25, 2019 at 2:00 PM Steven Liu wrote: > > Jun Zhao 于2019年7月21日周日 下午10:55写道: > > > > From: Jun Zhao > > > > av_packet_unref have reseted the AVPacket, so don't need to call > > reset_packet after that. > > > > Signed-off-by: Jun Zhao > > --- > > libavformat/hls.c |4 > > 1 files changed, 0 insertions(+), 4 deletions(-) > > > > diff --git a/libavformat/hls.c b/libavformat/hls.c > > index 8c12fce..238ebd0 100644 > > --- a/libavformat/hls.c > > +++ b/libavformat/hls.c > > @@ -2120,7 +2120,6 @@ static int hls_read_packet(AVFormatContext *s, > > AVPacket *pkt) > > } > > } > > av_packet_unref(&pls->pkt); > > -reset_packet(&pls->pkt); > > } > > } > > /* Check if this stream has the packet with the lowest dts */ > > @@ -2149,7 +2148,6 @@ static int hls_read_packet(AVFormatContext *s, > > AVPacket *pkt) > > ret = update_streams_from_subdemuxer(s, pls); > > if (ret < 0) { > > av_packet_unref(&pls->pkt); > > -reset_packet(&pls->pkt); > > return ret; > > } > > > > @@ -2174,7 +2172,6 @@ static int hls_read_packet(AVFormatContext *s, > > AVPacket *pkt) > > av_log(s, AV_LOG_ERROR, "stream index inconsistency: index %d, > > %d main streams, %d subdemuxer streams\n", > > pls->pkt.stream_index, pls->n_main_streams, > > pls->ctx->nb_streams); > > av_packet_unref(&pls->pkt); > > -reset_packet(&pls->pkt); > > return AVERROR_BUG; > > } > > > > @@ -2262,7 +2259,6 @@ static int hls_read_seek(AVFormatContext *s, int > > stream_index, > > ff_format_io_close(pls->parent, &pls->input_next); > > pls->input_next_requested = 0; > > av_packet_unref(&pls->pkt); > > -reset_packet(&pls->pkt); > > pls->pb.eof_reached = 0; > > /* Clear any buffered data */ > > pls->pb.buf_end = pls->pb.buf_ptr = pls->pb.buffer; > > -- > > 1.7.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". > > LGTM > > Thanks Will apply, Thanks ___ 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 V1 3/3] lavf/hls: replace the same code logic with ensure_playlist()
On Thu, Jul 25, 2019 at 2:06 PM Steven Liu wrote: > > Jun Zhao 于2019年7月21日周日 下午10:32写道: > > > > From: vacingfang > > > > Replace the same code logic with ensure_playlist(), it's will > > help reusable blocks of code. > > > > Reviewed-by: Jun Zhao > > Signed-off-by: vacingfang > > --- > > libavformat/hls.c | 10 +++--- > > 1 files changed, 3 insertions(+), 7 deletions(-) > > > > diff --git a/libavformat/hls.c b/libavformat/hls.c > > index 238ebd0..0522445 100644 > > --- a/libavformat/hls.c > > +++ b/libavformat/hls.c > > @@ -861,13 +861,9 @@ static int parse_playlist(HLSContext *c, const char > > *url, > > } > > if (is_segment) { > > struct segment *seg; > > -if (!pls) { > > -if (!new_variant(c, 0, url, NULL)) { > > -ret = AVERROR(ENOMEM); > > -goto fail; > > -} > > -pls = c->playlists[c->n_playlists - 1]; > > -} > > +ret = ensure_playlist(c, &pls, url); > > +if (ret < 0) > > +goto fail; > > seg = av_malloc(sizeof(struct segment)); > > if (!seg) { > > ret = AVERROR(ENOMEM); > > -- > > 1.7.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". > > > LGTM > > Thanks Will apply, Thanks ___ 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".