Re: [FFmpeg-devel] [PATCH 4/5] avformat: make AVFormatContext io_close return an int

2021-11-30 Thread Andreas Rheinhardt
Marton Balint: > Otherwise there is no way to detect any error during avio_close(). > > Signed-off-by: Marton Balint > --- > doc/APIchanges | 3 +++ > libavformat/avformat.h | 6 +- > libavformat/internal.h | 6 +- > libavformat/options.c | 4 ++-- > libavformat/utils.c| 6 +

Re: [FFmpeg-devel] [PATCH v18 15/19] avfilter/textmod: Add textmod, censor and show_speaker filters

2021-11-30 Thread Michael Niedermayer
On Mon, Nov 29, 2021 at 07:48:38PM +, Soft Works wrote: > - textmod {S -> S) > Modify subtitle text in a number of ways > > - censor {S -> S) > Censor subtitles using a word list > > - show_speaker {S -> S) > Prepend speaker names from ASS subtitles to the visible text lines > > Signed

[FFmpeg-devel] [PATCH V2 1/3] libavcodec/vaapi_decode: fix the problem that init_pool_size < nb_surface

2021-11-30 Thread Wenbin Chen
For vaapi if the init_pool_size is not zero, the pool size is fixed. This means max surfaces is init_pool_size, but when mapping vaapi frame to qsv frame, the init_pool_size < nb_surface. The cause is that vaapi_decode_make_config() config the init_pool_size and it is called twice. The first time i

[FFmpeg-devel] [PATCH V2 2/3] libavutil/hwcontext_qsv: fix a bug for mapping vaapi frame to qsv

2021-11-30 Thread Wenbin Chen
From: nyanmisaka The data stored in data[3] in VAAPI AVFrame is VASurfaceID while the data stored in pair->first is the pointer of VASurfaceID, so we need to do cast to make following commandline works: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \ -hwaccel_output_format vaapi -i i

[FFmpeg-devel] [PATCH V2 3/3] libavutil/hwcontext_opencl: fix a bug for mapping qsv frame to opencl

2021-11-30 Thread Wenbin Chen
From: nyanmisaka mfxHDLPair was added to qsv, so modify qsv->opencl map function as well. Now the following commandline works: ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 \ -init_hw_device qsv=qs@va -init_hw_device opencl=ocl@va -filter_hw_device ocl \ -hwaccel qsv -hwaccel_ou

Re: [FFmpeg-devel] [PATCH v18 15/19] avfilter/textmod: Add textmod, censor and show_speaker filters

2021-11-30 Thread Soft Works
> -Original Message- > From: ffmpeg-devel On Behalf Of Michael > Niedermayer > Sent: Tuesday, November 30, 2021 9:36 AM > To: FFmpeg development discussions and patches > Subject: Re: [FFmpeg-devel] [PATCH v18 15/19] avfilter/textmod: Add textmod, > censor and show_speaker filters > >

Re: [FFmpeg-devel] [PATCH 4/5] avformat: make AVFormatContext io_close return an int

2021-11-30 Thread Marton Balint
On Tue, 30 Nov 2021, Andreas Rheinhardt wrote: Marton Balint: Otherwise there is no way to detect any error during avio_close(). Signed-off-by: Marton Balint --- doc/APIchanges | 3 +++ libavformat/avformat.h | 6 +- libavformat/internal.h | 6 +- libavformat/options.c |

[FFmpeg-devel] [PATCH] avformat/mxfenc: fix DNxHD GC ULs

2021-11-30 Thread Nicolas Gaullier
Fix GC container ul. Fix GC element type both for the generic case and for OPAtom. Thanks to Philip de Nier for checking the values, especially for OPAtom. --- libavformat/mxfenc.c | 8 ++-- tests/ref/lavf/mxf_opatom | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a

[FFmpeg-devel] [PATCH 1/6] avcodec/movtextenc: Fix infinite loop due to variable truncation

2021-11-30 Thread Andreas Rheinhardt
Regression since af043b839c38e850af1184fd6be691f8475c048e. Fixes ticket #9409. Signed-off-by: Andreas Rheinhardt --- libavcodec/movtextenc.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 2ae5a9bf0b..0632463a63

[FFmpeg-devel] [PATCH 2/6] avcodec/movtextenc: Reset AVBPrint at the beginning, not end of encoding

2021-11-30 Thread Andreas Rheinhardt
This avoids abusing a variable called length for the return value and ensures that the AVBPrint is always reset before using it; previously this has been forgotten in some error paths. Signed-off-by: Andreas Rheinhardt --- libavcodec/movtextenc.c | 18 ++ 1 file changed, 6 insert

[FFmpeg-devel] [PATCH 3/6] avcodec/movtextenc: Check for too long subtitles

2021-11-30 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/movtextenc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 46109e0a5e..eecadaf503 100644 --- a/libavcodec/movtextenc.c +++ b/libavcodec/movtextenc.c @@ -667,6 +667,8 @@ static int mov_

[FFmpeg-devel] [PATCH 4/6] avcodec/movtextenc: Fix encoding of subtitles with multiple rects

2021-11-30 Thread Andreas Rheinhardt
The format of a mov_text (3GPP Timed Text) sample is: uint16_t text_length; uint8_t text[text_length]; TextSampleModifierBox text_modifier; Yet in case our encoder receives an AVSubtitle with multiple ASS AVSubtitleRects, it creates something like this: uint16_t text_length; uint8_t text[text_l

[FFmpeg-devel] [PATCH 5/6] avcodec/movtextenc: Remove redundant byte count

2021-11-30 Thread Andreas Rheinhardt
Use the AVBPrint's len instead. Signed-off-by: Andreas Rheinhardt --- libavcodec/movtextenc.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 52e51503d6..112af41093 100644 --- a/libavcodec/movtextenc.c +++ b/liba

[FFmpeg-devel] [PATCH 6/6] avcodec/movtextenc: Simplify writing a single char

2021-11-30 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/movtextenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 112af41093..5869942ec0 100644 --- a/libavcodec/movtextenc.c +++ b/libavcodec/movtextenc.c @@ -615,8 +615,8 @@ s

Re: [FFmpeg-devel] [PATCH] avformat/matroskaenc: Sort cues entries by pts

2021-11-30 Thread Andreas Rheinhardt
Andreas Rheinhardt: > Currently they are ordered as-written (i.e. by increasing position); > in case av_interleaved_write_frame() is used, this is (mostly) > the same as ordered by increasing dts. > Yet the Matroska specification strongly recommends (SHOULD) that > the CuePoints be sorted by CueTim

Re: [FFmpeg-devel] [PATCH] avcodec/vaapi_encode: Fix segfault upon closing uninitialized encoder

2021-11-30 Thread Andreas Rheinhardt
Andreas Rheinhardt: > Fixes ticket #9537. > Probably a regression since 2b3206891649f317c20993411efef4bee39ae784. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/vaapi_encode.c | 13 ++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/libavcodec/vaapi_enco

[FFmpeg-devel] [PATCH] swresample/swresample: Remove array size hint from swr_convert()

2021-11-30 Thread Andreas Rheinhardt
SWR_CH_MAX is internal only and the arrays are therefore not required to have that many elements (and they typically don't do it). So remove this potentially confusing hint. (Newer versions of GCC emit -Warray-parameter= warnings for this, because the definition with explicit size differs from the

[FFmpeg-devel] [PATCH 1/1] avcodec/vpp_qsv: Copy side data from input to output frame

2021-11-30 Thread Soft Works
Signed-off-by: softworkz --- libavfilter/qsvvpp.c | 59 libavfilter/qsvvpp.h | 2 ++ libavfilter/vf_overlay_qsv.c | 19 +--- 3 files changed, 76 insertions(+), 4 deletions(-) diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c in

Re: [FFmpeg-devel] [PATCH v18 12/19] fftools/ffmpeg: Replace sub2video with subtitle frame filtering and use new frame-based subtitle encoding API

2021-11-30 Thread Michael Niedermayer
On Mon, Nov 29, 2021 at 07:48:25PM +, Soft Works wrote: > This commit actually enables subtitle filtering in ffmpeg by > sending and receiving subtitle frames to and from a filtergraph. > > The heartbeat functionality from the previous sub2video implementation > is retained and applied to all

[FFmpeg-devel] [PATCH 1/2] lafi/vf_edgedetect: Move some common functions into seperate file

2021-11-30 Thread Thilo Borgmann
Hi, v2, common functions moved into lavfi/edge_common.{c,h}. Also moved gaussian_blur() into the same. -Thilo From 0599b15e109cd6d0e1452663eb45b8b70b428444 Mon Sep 17 00:00:00 2001 From: Thilo Borgmann Date: Tue, 30 Nov 2021 00:16:52 +0100 Subject: [PATCH 1/2] lafi/vf_edgedetect: Move some comm

[FFmpeg-devel] [PATCH 2/2] lavfi: Add blurriness filter

2021-11-30 Thread Thilo Borgmann
Hi, $subject -Thilo From 0fa76024cf921df8a6df77a3860faab9669d0a2e Mon Sep 17 00:00:00 2001 From: Thilo Borgmann Date: Tue, 30 Nov 2021 00:17:44 +0100 Subject: [PATCH 2/2] lavfi: Add blurriness filter --- doc/filters.texi| 55 ++ libavfilter/Makefile| 1 + libavfilter

[FFmpeg-devel] [PATCH] libavdevice/avfoundation.m: use AudioConvert, extend supported formats

2021-11-30 Thread Romain Beauxis
* Implement support for AudioConverter * Switch to AudioConverter's API to convert unsupported PCM formats (non-interleaved, non-packed) to supported formats * Minimize data copy. This fixes: https://trac.ffmpeg.org/ticket/9502 API ref: https://developer.apple.com/documentation/audiotoolbox/aud

[FFmpeg-devel] [PATCH v1] [libavfiler/dnn] :[To improve efficiency, the exponential operation is changed to single precision]

2021-11-30 Thread Qiang.Zhang
Signed-off-by: Qiang.Zhang --- libavfilter/dnn/dnn_backend_native_layer_conv2d.c | 4 ++-- libavfilter/dnn/dnn_backend_native_layer_dense.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c b/libavfilter/dnn/dnn_backend_na

[FFmpeg-devel] [PATCH v2 1/1] avcodec/vpp_qsv: Copy side data from input to output frame

2021-11-30 Thread Soft Works
Signed-off-by: softworkz --- V2: Add public method av_frame_copy_side_data() instead to copying the implementation. libavfilter/qsvvpp.c | 5 libavfilter/vf_overlay_qsv.c | 19 +--- libavutil/frame.c| 57 libavutil/frame.h

Re: [FFmpeg-devel] [PATCH 2/2] lavfi: Add blurriness filter

2021-11-30 Thread Marton Balint
On Tue, 30 Nov 2021, Thilo Borgmann wrote: Hi, $subject Can you name this blurdetect to be more in line with existing similar filters? (blackdetect, freezedetect) Thanks, Marton ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffm

Re: [FFmpeg-devel] [PATCH 2/2] lavfi: Add blurriness filter

2021-11-30 Thread Thilo Borgmann
Am 30.11.21 um 17:11 schrieb Marton Balint: > > > On Tue, 30 Nov 2021, Thilo Borgmann wrote: > >> Hi, >> >> $subject > > Can you name this blurdetect to be more in line with existing similar > filters? (blackdetect, freezedetect) Totally will in the next version. Thanks, Thilo _

[FFmpeg-devel] [PATCH 1/3] avcodec/h264_redundant_pps_bsf: Remove flush callback

2021-11-30 Thread Andreas Rheinhardt
extradata_pic_init_qp is unset since fa75e438756f159a667080dcba58ea2e3b190001 (and resetting current_pic_init_qp to the value it had in extradata never made much sense). Signed-off-by: Andreas Rheinhardt --- libavcodec/h264_redundant_pps_bsf.c | 8 1 file changed, 8 deletions(-) diff -

[FFmpeg-devel] [PATCH 2/3] avcodec/h264_redundant_pps_bsf: Support multiple input PPS

2021-11-30 Thread Andreas Rheinhardt
Up until now, the h264_redundant_pps_bsf stored the initial value of pic_init_qp_minus26 of the most recently encountered PPS; it also modified the slices based upon to assumption that the most recent PPS is the PPS the slice belongs to. Yet this assumption is flawed, as there can be several PPS wi

[FFmpeg-devel] [PATCH 3/3] avcodec/h264_redundant_pps_bsf: Inline constant

2021-11-30 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/h264_redundant_pps_bsf.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/libavcodec/h264_redundant_pps_bsf.c b/libavcodec/h264_redundant_pps_bsf.c index 5efcf5ea5d..769946abfd 100644 --- a/libavcodec/h264_redundant_

Re: [FFmpeg-devel] [PATCH 5/5] avformat/mxfdec: rework MCA channel layout parsing

2021-11-30 Thread Marton Balint
On Mon, 29 Nov 2021, Pierre-Anthony Lemieux wrote: On Mon, Nov 29, 2021 at 11:20 AM Marton Balint wrote: On Sun, 28 Nov 2021, Pierre-Anthony Lemieux wrote: On Sun, Nov 28, 2021 at 5:00 PM Marton Balint wrote: Setting the channel layout was based on SoundfieldGroupLabelSubDescriptor,

[FFmpeg-devel] [PATCH 3/3] avcodec/speexdec: Avoid violating the vector_fmul_scalar() API

2021-11-30 Thread Michael Niedermayer
Fixes: out of array access Fixes: 40054/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-6713285764841472 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/speexdec.c | 3 ++- 1 fi

[FFmpeg-devel] [PATCH 1/3] tools/target_dec_fuzzer: Adjust DXA threshold

2021-11-30 Thread Michael Niedermayer
Fixes: Timeout Fixes: 40203/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXA_fuzzer-4587923496894464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- tools/target_dec_fuzzer.c | 1 + 1 file changed,

[FFmpeg-devel] [PATCH 2/3] avcodec/vp3: Check version in all cases when VP4 code is not built

2021-11-30 Thread Michael Niedermayer
Fixes: out of array read Fixes: 40284/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP3_fuzzer-4599568176644096 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/vp3.c | 9 - 1 file

[FFmpeg-devel] [PATCH] avformat/aviobuf: remove unnecessary label in ffio_fdopen

2021-11-30 Thread Steven Liu
From: Steven Liu Because the s->buffer has been freed by av_freep in avio_closep. It should not av_freep the buffer in label fail after avio_closep. Then just move the av_freep before avio_closep and remove the label fail. Reported-by: TOTE Robot Signed-off-by: Steven Liu --- libavformat/avio

Re: [FFmpeg-devel] [PATCH] avformat/aviobuf: remove unnecessary label in ffio_fdopen

2021-11-30 Thread zhilizhao(赵志立)
> On Dec 1, 2021, at 11:25 AM, Steven Liu wrote: > > From: Steven Liu > > Because the s->buffer has been freed by av_freep in avio_closep. > It should not av_freep the buffer in label fail after avio_closep. > Then just move the av_freep before avio_closep and remove the label fail. The pat

[FFmpeg-devel] [PATCH v2 2/3] avcodec: [loongarch] optimize get_cabac.

2021-11-30 Thread Shiyou Yin
Decoding 1080P H264 on 2.5Ghz 3A5000: 165fps==>168fps. Testing command: ffmpeg -i ***.mp4 -f rawvideo -y /dev/null -an --- libavcodec/cabac_functions.h | 3 + libavcodec/loongarch/cabac.h | 238 +++ 2 files changed, 241 insertions(+) create mode 100644 libavcodec

[FFmpeg-devel] Add support for loongarch.

2021-11-30 Thread Shiyou Yin
V2: 1. rebase. 2. Change Author email from yinshi...@loongson.cn to yinshiyou...@loongson.cn for 1/3 2/3. 3. Refine 2/3. [PATCH v2 1/3] configure: Add support for loongarch. [PATCH v2 2/3] avcodec: [loongarch] optimize get_cabac. [PATCH v2 3/3] avcodec: [loongarch] Optimize decode_significance. _

[FFmpeg-devel] [PATCH v2 1/3] configure: Add support for loongarch.

2021-11-30 Thread Shiyou Yin
For la464 cpu: ./configure --cpu=la464 With cross-compiler: ./configure --cross-prefix=loongarch64-linux-gnu- \ --enable-cross-compile --arch=loongarch64 \ --target-os=linux --cpu=la464 --- Changelog | 1 + configure | 23 +++ 2 files changed, 24 inser

[FFmpeg-devel] [PATCH v2 3/3] avcodec: [loongarch] Optimize decode_significance/_8x8_loongarch.

2021-11-30 Thread Shiyou Yin
From: Hao Chen Decoding 1080P H264 from 168fps to 170fps. Signed-off-by: Shiyou Yin --- libavcodec/h264_cabac.c | 2 + libavcodec/loongarch/h264_cabac.c | 140 ++ 2 files changed, 142 insertions(+) create mode 100644 libavcodec/loongarch/h264_cabac.c d

Re: [FFmpeg-devel] [PATCH] libx264: Do not explicitly set X264_API_IMPORTS

2021-11-30 Thread Matt Oliver
On Sat, 30 Oct 2021 at 14:16, Matt Oliver wrote: > Setting X264_API_IMPORTS only affects msvc builds and it breaks linking to > static builds (although is required for shared builds). This flag is set by > x264 in its pkgconfig as required since build 158 > (a615f027ed172e2dd5380e736d487aa858a0c4

Re: [FFmpeg-devel] [PATCH 2/3] avcodec/vp3: Check version in all cases when VP4 code is not built

2021-11-30 Thread Peter Ross
On Tue, Nov 30, 2021 at 08:59:34PM +0100, Michael Niedermayer wrote: > Fixes: out of array read > Fixes: > 40284/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP3_fuzzer-4599568176644096 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/gemdec: Check tag & planes before image allocation

2021-11-30 Thread Peter Ross
On Sun, Nov 28, 2021 at 07:55:14PM +0100, Michael Niedermayer wrote: > Fixes: Timeout > Fixes: > 41083/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GEM_fuzzer-5843826518917120 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-

Re: [FFmpeg-devel] [PATCH v2 2/2] avformat/mvdec: handle audio sample size

2021-11-30 Thread Peter Ross
On Sat, Nov 27, 2021 at 04:45:51PM -0500, John-Paul Stewart wrote: > Adds support for reading audio sample size from the data instead of > assuming all audio is 16 bits per sample. > --- > libavformat/mvdec.c | 18 +++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > > diff --g

Re: [FFmpeg-devel] [PATCH 5/5] avformat/mxfdec: rework MCA channel layout parsing

2021-11-30 Thread Pierre-Anthony Lemieux
On Tue, Nov 30, 2021 at 10:36 AM Marton Balint wrote: > > > > On Mon, 29 Nov 2021, Pierre-Anthony Lemieux wrote: > > > On Mon, Nov 29, 2021 at 11:20 AM Marton Balint wrote: > >> > >> > >> > >> On Sun, 28 Nov 2021, Pierre-Anthony Lemieux wrote: > >> > >>> On Sun, Nov 28, 2021 at 5:00 PM Marton Bal

Re: [FFmpeg-devel] [PATCH v2 3/3] avcodec: [loongarch] Optimize decode_significance/_8x8_loongarch.

2021-11-30 Thread 陈昊
LGTM "yinshiyou...@loongson.cn" 写道: > From: Hao Chen > > Decoding 1080P H264 from 168fps to 170fps. > > Signed-off-by: Shiyou Yin > --- > libavcodec/h264_cabac.c | 2 + > libavcodec/loongarch/h264_cabac.c | 140 ++ > 2 files ch

Re: [FFmpeg-devel] [PATCH v2 2/3] avcodec: [loongarch] optimize get_cabac.

2021-11-30 Thread 陈昊
LGTM "yinshiyou...@loongson.cn" 写道: > Decoding 1080P H264 on 2.5Ghz 3A5000: 165fps==>168fps. > Testing command: ffmpeg -i ***.mp4 -f rawvideo -y /dev/null -an > --- > libavcodec/cabac_functions.h | 3 + > libavcodec/loongarch/cabac.h | 238 +

Re: [FFmpeg-devel] [PATCH v2 1/3] configure: Add support for loongarch.

2021-11-30 Thread 陈昊
LGTM "yinshiyou...@loongson.cn" 写道: > For la464 cpu: ./configure --cpu=la464 > > With cross-compiler: > ./configure --cross-prefix=loongarch64-linux-gnu- \ > --enable-cross-compile --arch=loongarch64 \ > --target-os=linux --cpu=la464 > --- > Chan