Re: [FFmpeg-devel] [PATCH 1/5] avcodec/mjpegdec: Restrict AVID MJPEG to non-SMVJPEG
Andreas Rheinhardt: > AVID content is not supposed to be SMVJPEG; given that > both these codecs involve manipulating image dimensions > and cropping dimensions, it makes sense to restrict > the AVID codepaths to non-SMVJPEG codecs in order not > to have to think about what if SMVJPEG happens to > have a codec tag indicating AVID. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/mjpegdec.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c > index 9b7465abe7..28e2839072 100644 > --- a/libavcodec/mjpegdec.c > +++ b/libavcodec/mjpegdec.c > @@ -452,7 +452,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) > if (ret < 0) > return ret; > > -if ((s->avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || > +if (s->avctx->codec_id != AV_CODEC_ID_SMVJPEG && > +(s->avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || > s->avctx->codec_tag == MKTAG('A', 'V', 'D', 'J')) && > s->orig_height < height) > s->avctx->height = AV_CEIL_RSHIFT(s->orig_height, > s->avctx->lowres); > @@ -2927,7 +2928,8 @@ the_end: > return ret; > } > } > -if ((avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || > +if (avctx->codec_id != AV_CODEC_ID_SMVJPEG && > +(avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || > avctx->codec_tag == MKTAG('A', 'V', 'D', 'J')) && > avctx->coded_height > s->orig_height) { > frame->height = AV_CEIL_RSHIFT(avctx->coded_height, avctx->lowres); Will apply this patchset tonight unless there are objections. - Andreas ___ 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/5] avcodec/mjpegdec: Restrict AVID MJPEG to non-SMVJPEG
On 12/7/22, Andreas Rheinhardt wrote: > AVID content is not supposed to be SMVJPEG; given that > both these codecs involve manipulating image dimensions > and cropping dimensions, it makes sense to restrict > the AVID codepaths to non-SMVJPEG codecs in order not > to have to think about what if SMVJPEG happens to > have a codec tag indicating AVID. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/mjpegdec.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c > index 9b7465abe7..28e2839072 100644 > --- a/libavcodec/mjpegdec.c > +++ b/libavcodec/mjpegdec.c > @@ -452,7 +452,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) > if (ret < 0) > return ret; > > -if ((s->avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || > +if (s->avctx->codec_id != AV_CODEC_ID_SMVJPEG && > +(s->avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || > s->avctx->codec_tag == MKTAG('A', 'V', 'D', 'J')) && > s->orig_height < height) > s->avctx->height = AV_CEIL_RSHIFT(s->orig_height, > s->avctx->lowres); > @@ -2927,7 +2928,8 @@ the_end: > return ret; > } > } > -if ((avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || > +if (avctx->codec_id != AV_CODEC_ID_SMVJPEG && > +(avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || > avctx->codec_tag == MKTAG('A', 'V', 'D', 'J')) && > avctx->coded_height > s->orig_height) { > frame->height = AV_CEIL_RSHIFT(avctx->coded_height, > avctx->lowres); > -- > 2.34.1 > 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". > ___ 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: add adrc filter
On 12/3/22, Paul B Mahol wrote: > Patch attached. > > TODO: add documentation and examples with various transfer expressions > (compressor, expander, limiter, gate, etc). > Updated From 4c6135dfdc0bc3a71ecdeb9f2e38bfbcf890f239 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Mon, 7 Nov 2022 21:00:50 +0100 Subject: [PATCH] avfilter: add adrc filter Signed-off-by: Paul B Mahol --- doc/filters.texi | 79 ++ libavfilter/Makefile | 1 + libavfilter/af_adrc.c| 505 +++ libavfilter/allfilters.c | 1 + 4 files changed, 586 insertions(+) create mode 100644 libavfilter/af_adrc.c diff --git a/doc/filters.texi b/doc/filters.texi index 1cb7fd94a7..e838309c5b 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -872,6 +872,85 @@ Compute derivative/integral of audio stream. Applying both filters one after another produces original audio. +@section adrc + +Apply spectral dynamic range controller filter to input audio stream. + +A description of the accepted options follows. + +@table @option +@item transfer +Set the transfer expression. + +The expression can contain the following constants: + +@table @option +@item ch +current channel number + +@item sn +current sample number + +@item nb_channels +number of channels + +@item t +timestamp expressed in seconds + +@item sr +sample rate + +@item p +current frequency power value, in dB + +@item f +current frequency in Hz +@end table + +Default value is @code{p}. + +@item attack +Set the attack in milliseconds. Default is @code{50} milliseconds. +Allowed range is from 1 to 1000 milliseconds. +@item release +Set the release in milliseconds. Default is @code{100} milliseconds. +Allowed range is from 5 to 2000 milliseconds. +@item channels +Set which channels to filter, by default @code{all} channels in audio stream are filtered. +@end table + +@subsection Commands + +This filter supports the all above options as @ref{commands}. + +@subsection Examples + +@itemize +@item +Apply spectral compression to all frequencies with threshold of -5 dB and 1:6 ratio: +@example +adrc='if(gt(p,-5),-5+(p-(-5))/6,p)':attack=50:release=100 +@end example + +@item +Similar to above but with 1:2 ratio and filtering only front center channel: +@example +adrc='if(gt(p,-5),-5+(p-(-5))/2,p)':attack=50:release=100:channels=FC +@end example + +@item +Apply spectral noise gate to all frequencies with threshold of -35 dB and with short attack time and short release time: +@example +adrc=transfer='if(lte(p,-35),p-800,p)':attack=1:release=5 +@end example + +@item +Apply spectral expansion to all frequencies with threshold of -1 dB and 1:8 ratio: +@example +adrc=transfer='if(lt(p,-1),-1+(p-(-1))*8,p)':attack=50:release=100 +@end example +@end itemize + @section adynamicequalizer Apply dynamic equalization to input audio stream. diff --git a/libavfilter/Makefile b/libavfilter/Makefile index d4e10c15d0..321bd9a0c8 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -48,6 +48,7 @@ OBJS-$(CONFIG_ADECORRELATE_FILTER) += af_adecorrelate.o OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o OBJS-$(CONFIG_ADENORM_FILTER)+= af_adenorm.o OBJS-$(CONFIG_ADERIVATIVE_FILTER)+= af_aderivative.o +OBJS-$(CONFIG_ADRC_FILTER) += af_adrc.o OBJS-$(CONFIG_ADYNAMICEQUALIZER_FILTER) += af_adynamicequalizer.o OBJS-$(CONFIG_ADYNAMICSMOOTH_FILTER) += af_adynamicsmooth.o OBJS-$(CONFIG_AECHO_FILTER) += af_aecho.o diff --git a/libavfilter/af_adrc.c b/libavfilter/af_adrc.c new file mode 100644 index 00..93700d40e3 --- /dev/null +++ b/libavfilter/af_adrc.c @@ -0,0 +1,505 @@ +/* + * Copyright (c) 2022 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +#include "libavutil/eval.h" +#include "libavutil/ffmath.h" +#include "libavutil/opt.h" +#include "libavutil/tx.h" +#include "audio.h" +#include "avfilter.h" +#include "filters.h" +#include "internal.h" + +static const char * const var_names[] = { +"ch", ///< the value of the current channel +"sn", ///< number of samples +"nb_channels", +"t",///< timestamp expressed in seconds +"sr", ///< sample
Re: [FFmpeg-devel] [PATCH] avformat/file: add fd protocol
> From: ffmpeg-devel On Behalf Of Anton > Khirnov > Sent: 2022年12月9日 22:32 > To: FFmpeg development discussions and patches > Cc: Zhao Zhili > Subject: Re: [FFmpeg-devel] [PATCH] avformat/file: add fd protocol > > Quoting Zhao Zhili (2022-11-18 19:48:02) > > From: Zhao Zhili > > > > Unlike the pipe protocol, fd protocol has seek support if it > > corresponding to a regular file. > > --- > > Sometimes it's the only way to access files via file descriptor, e.g., > > requesting a shared file on Android: > > https://developer.android.com/training/secure-file-sharing/request-file > > > > Wouldn't dup()ing the file descriptor be safer? Yes, I have thought that. The question is why pipe protocol doesn't do that. If there is no reason, I can update the patch then improve the pipe protocol. > > -- > Anton Khirnov > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] avfilter/drawutils: pixelstep of 8 is supported
Patch attached From 0bbd87217e9150b23690476eaae0c6c2d3ea5b03 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 10 Dec 2022 15:13:46 +0100 Subject: [PATCH] avfilter/drawutils: pixelstep of 8 is supported Signed-off-by: Paul B Mahol --- libavfilter/drawutils.c | 2 +- tests/ref/fate/filter-pixfmts-pad | 4 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c index 1081938d86..af69861b70 100644 --- a/libavfilter/drawutils.c +++ b/libavfilter/drawutils.c @@ -129,7 +129,7 @@ int ff_draw_init2(FFDrawContext *draw, enum AVPixelFormat format, enum AVColorSp pixelstep[c->plane] != c->step) return AVERROR(ENOSYS); pixelstep[c->plane] = c->step; -if (pixelstep[c->plane] >= 8) +if (pixelstep[c->plane] > 8) return AVERROR(ENOSYS); nb_planes = FFMAX(nb_planes, c->plane + 1); } diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad index 57ccc4ae4d..ff8bfd145d 100644 --- a/tests/ref/fate/filter-pixfmts-pad +++ b/tests/ref/fate/filter-pixfmts-pad @@ -2,10 +2,12 @@ 0rgb8e076dd0f8a9f4652595dffe3544f0f0 abgr52738042432893de555e6a3833172806 argb2a10108ac524b422b8a2393c064b3eab +ayuv64leebb01a75bb015fff20189e6ce11d7bec bgr0025d4d5e5691801ba39bc9de70e39df0 bgr24 f8b65ad845905c7d0c93ca28dfbb826f bgr48le 4564b56dd1f2a9761b8a7a5244ac4c49 bgra929aac15e848038e367c250037575f9f +bgra64leb79de7611b3909d5b91398b49c5bfa89 gbrap 5f16cccab5a17cb766c882e865995167 gbrap10le e63e0a1ae9afd7e6a732f18be194e761 gbrap12le eb7a5ff44a9b5b46bb9829838224ed8e @@ -38,8 +40,10 @@ rgb00984eb985dabbe757ed6beb53db84eff rgb24 17f9e2e0c609009acaf2175c42d4a2a5 rgb48le ed08db9b1aa50d69b8c3d73db93e390e rgbab157c90191463d34fb3ce77b36c96386 +rgba64leef1e2519fb2fdd8124b46f8dd98de4c0 vuya44368c0a758ee68e24ce976e3b1b8535 vuyxbc7c4f693a22cd1ac95e33d473086474 +xv36le 7a264debea0b82700a0c6bcef8e37abd xyz12le 23dadbbba70b2925ce75fb8ba8080ba3 ya16le 8dbfcb586abf626da7d1aca887a581b9 ya8 495daaca2dcb4f7aeba7652768b41ced -- 2.37.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH] avcodec/proresdec2: set color information on frames instead of the decoder context
Similar to how the encoder looks at frame color information to write the frame header bitstream. Should workaround ticket #10091, where container level color parameters passed to the decoder context were being overwritten. Signed-off-by: James Almer --- vf_scale should properly set output frame color fields to really fix this, since this information is in a per frame basis in the prores bitstream and as such making the encoder write encoder context fields into them would not be correct. libavcodec/proresdec2.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index b0d7f8d5d5..c821a07849 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -289,10 +289,10 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, avctx->pix_fmt = ret; } -avctx->color_primaries = buf[14]; -avctx->color_trc = buf[15]; -avctx->colorspace = buf[16]; -avctx->color_range = AVCOL_RANGE_MPEG; +ctx->frame->color_primaries = buf[14]; +ctx->frame->color_trc = buf[15]; +ctx->frame->colorspace = buf[16]; +ctx->frame->color_range = AVCOL_RANGE_MPEG; ptr = buf + 20; flags = buf[19]; -- 2.38.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] AVX512 NUCs for FATE and development
Am Fr., 9. Dez. 2022 um 18:07 Uhr schrieb Michael Niedermayer : > > On Thu, Dec 08, 2022 at 09:40:12PM +, Kieran Kunhya wrote: > > I intend to buy this RAM: > > https://www.amazon.co.uk/Crucial-CT2K16G4SFRA32A-PC4-25600-SODIMM-260-Pin/dp/B08C4X9VR5 > > > > 2x £529 for NUCs > > 2x £102.48 for RAM > > 2x £69 for M.2 NVMe SSD > > > > £1400 total. > > iam in favor of this too +1 Carl Eugen ___ 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 v4] lavc: convert frame threading to the receive_frame() pattern
On 10.12.2022 00:46, Michael Niedermayer wrote: On Fri, Dec 09, 2022 at 02:37:04PM +0100, Timo Rothenpieler wrote: From: Anton Khirnov Reorganize the code such that the frame threading code does not call the decoders directly, but instead calls back into the generic decoding code. This avoids duplicating the logic that wraps the decoder invocation and will be useful in the following commits. --- libavcodec/decode.c| 58 + libavcodec/decode.h| 7 + libavcodec/internal.h | 7 + libavcodec/pthread_frame.c | 256 - libavcodec/thread.h| 18 +-- 5 files changed, 223 insertions(+), 123 deletions(-) this patch changes the output with this: ./ffmpeg -ss 1 -i Enigma_Principles_of_Lust.flv -t 1 -bitexact -f framecrc Yeah, I'd like to have that file. The change is interesting, and it looks like it might actually be legit frames? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 1/2] libavformat/http: Use http_read_header in http_shutdown to react to response errors
Use http_read_header to parse and print/react to errors in http_shutdown if the http server responds with an error (404/500/...) Signed-off-by: Basel Sayeh --- libavformat/http.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavformat/http.c b/libavformat/http.c index 7bce821535..123a7c77f2 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -1853,15 +1853,13 @@ static int http_shutdown(URLContext *h, int flags) ((flags & AVIO_FLAG_READ) && s->chunked_post && s->listen)) { ret = ffurl_write(s->hd, footer, sizeof(footer) - 1); ret = ret > 0 ? 0 : ret; -/* flush the receive buffer when it is write only mode */ + +/* Read and parse http headers when it is write only mode to react to response errors */ if (!(flags & AVIO_FLAG_READ)) { -char buf[1024]; int read_ret; -s->hd->flags |= AVIO_FLAG_NONBLOCK; -read_ret = ffurl_read(s->hd, buf, sizeof(buf)); -s->hd->flags &= ~AVIO_FLAG_NONBLOCK; +read_ret = http_read_header(h); if (read_ret < 0 && read_ret != AVERROR(EAGAIN)) { -av_log(h, AV_LOG_ERROR, "URL read error: %s\n", av_err2str(read_ret)); +av_log(h, AV_LOG_ERROR, "HTTP error: %s\n", av_err2str(read_ret)); ret = read_ret; } } -- 2.30.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/2] libavformat/hlsenc: Return in hls_write_packet if error after retrying with a new http session
Signed-off-by: Basel Sayeh --- libavformat/hlsenc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index a86fc8907f..57149985da 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2591,6 +2591,9 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) av_dict_free(&options); av_freep(&vs->temp_buffer); av_freep(&filename); + +if (ret < 0) +return hls->ignore_io_errors ? 0 : ret; } if (use_temp_file) -- 2.30.2 ___ 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".