[FFmpeg-devel] [PATCH 19/22] lavf/deinterlace_qsv: re-use VPPContext for deinterlace_qsv filter

2021-05-13 Thread Haihao Xiang
All features are implemented in vpp_qsv filter now, so deinterlace_qsv can be taken as a specical case of vpp_qsv filter, we re-use VPPContext with a different option array and pix formats for deinterlace_qsv filter --- libavfilter/Makefile | 2 +- libavfilter/vf_deinterlace_qsv.c |

[FFmpeg-devel] [PATCH 18/22] lavf/deinterlace_qsv: simplify deinterlace_qsv filter

2021-05-13 Thread Haihao Xiang
Like what we did for scale_qsv filter, we use QSVVPPContext as a base context to manage MFX session for deinterlace_qsv filter --- libavfilter/vf_deinterlace_qsv.c | 492 ++- 1 file changed, 30 insertions(+), 462 deletions(-) diff --git a/libavfilter/vf_deinterlace_qsv

[FFmpeg-devel] [PATCH 17/22] lavf/vpp_qsv: check output format string against NULL pointer

2021-05-13 Thread Haihao Xiang
This is in preparation for re-using VPPContext but with a different option array for deinterlacing_qsv filter --- libavfilter/vf_vpp_qsv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index 018b0e8689..90b0b25210 100644 ---

[FFmpeg-devel] [PATCH 16/22] lavf/qsvvpp: set PTS for output frame

2021-05-13 Thread Haihao Xiang
When the SDK returns MFX_ERR_MORE_SURFACE, the PTS is not set for the output frame. We assign a PTS calculated from the input frame to the output frame. After applying this patch, we may avoid the error below: [null @ 0x56395cab4ae0] Application provided invalid, non monotonically increasing dts t

[FFmpeg-devel] [PATCH 14/22] lavf/vpp_qsv: double the framerate for deinterlacing

2021-05-13 Thread Haihao Xiang
--- libavfilter/vf_vpp_qsv.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index 29ba220665..ec35f85b04 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -255,10 +255,14 @@ static int config_inp

[FFmpeg-devel] [PATCH 12/22] lavf/scale_qsv: add new options for scale_qsv filter

2021-05-13 Thread Haihao Xiang
Allow user to set crop area and async depth --- libavfilter/vf_vpp_qsv.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index 03785e9398..bceee8c4df 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -675,6 +675,10

[FFmpeg-devel] [PATCH 15/22] lavf/qsvvpp: avoid overriding the returned value

2021-05-13 Thread Haihao Xiang
Currently the returned value from MFXVideoVPP_RunFrameVPPAsync() is overridden, so the check of 'ret == MFX_ERR_MORE_SURFACE' is always false when MFX_ERR_MORE_SURFACE is returned from MFXVideoVPP_RunFrameVPPAsync() --- libavfilter/qsvvpp.c | 11 --- 1 file changed, 8 insertions(+), 3 dele

[FFmpeg-devel] [PATCH 13/22] lavf/scale_qsv: add more input / output pixel formats

2021-05-13 Thread Haihao Xiang
NV12 and P010 are added $ ffmpeg -init_hw_device qsv -c:v h264_qsv -i input.h264 -vf "scale_qsv=format=p010" -f null - --- libavfilter/vf_vpp_qsv.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index bceee8c4df..29ba220

[FFmpeg-devel] [PATCH 21/22] lavf/deinterlace_qsv: add more input / output pixel formats

2021-05-13 Thread Haihao Xiang
NV12 is added in system memory and the command below may work now. $ ffmpeg -init_hw_device qsv -c:v h264_qsv -i input.h264 -vf deinterlace_qsv -f null - --- libavfilter/vf_vpp_qsv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_v

[FFmpeg-devel] [PATCH 22/22] lavf/vpp_qsv: allow user to set scaling mode for vpp_qsv filter

2021-05-13 Thread Haihao Xiang
option 'scaling' accepts one of low_power and hq $ ffmpeg -init_hw_device qsv -hwaccel qsv -c:v h264_qsv -i input.h264 -vf "vpp_qsv=scaling=hq" -f null - --- libavfilter/vf_vpp_qsv.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.

[FFmpeg-devel] [PATCH 20/22] lavf/deinterlace_qsv: add async_depth option

2021-05-13 Thread Haihao Xiang
Allow user to set async depth for deinterlace_qsv --- libavfilter/vf_vpp_qsv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index c0afb001b9..bb3aebf047 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -711,6 +711,7

[FFmpeg-devel] [PATCH 08/22] lavf/vpp_qsv: pass scaling mode to the SDK

2021-05-13 Thread Haihao Xiang
After this patch, the scaling mode will be passed to the SDK when the scaling mode is not equal to the default mode. This is in preparation for re-using VPPContext for scale_qsv filter --- libavfilter/vf_vpp_qsv.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --gi

[FFmpeg-devel] [PATCH 10/22] lavf/scale_qsv: re-use VPPContext for scale_qsv filter

2021-05-13 Thread Haihao Xiang
All features are implemented in vpp_qsv filter, scale_qsv can be taken as a special case of vpp_qsv filter now, we re-use VPPContext with a different option arrary and pixel formats --- libavfilter/Makefile | 2 +- libavfilter/vf_scale_qsv.c | 334 - lib

[FFmpeg-devel] [PATCH 11/22] lavf/vpp_qsv: factor common QSV filter definition

2021-05-13 Thread Haihao Xiang
--- libavfilter/vf_vpp_qsv.c | 195 +-- 1 file changed, 86 insertions(+), 109 deletions(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index dd3afb5e10..03785e9398 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -105

[FFmpeg-devel] [PATCH 06/22] lavf/vpp_qsv: allow special values for the output dimensions

2021-05-13 Thread Haihao Xiang
Special values are: 0 = original width/height -1 = keep original aspect This is in preparation for re-using VPPContext for scale_qsv filter --- libavfilter/vf_vpp_qsv.c | 47 ++-- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/libavfilter/vf_vpp

[FFmpeg-devel] [PATCH 07/22] lavf/vpp_qsv: factorize extra MFX configuration

2021-05-13 Thread Haihao Xiang
This is in preparation for re-using VPPContext for scale_qsv filter --- libavfilter/vf_vpp_qsv.c | 78 +--- 1 file changed, 32 insertions(+), 46 deletions(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index 7afbb3c983..c9a7b0ceb9 100644 --

[FFmpeg-devel] [PATCH 09/22] lavf/vpp_qsv: add vpp_preinit callback

2021-05-13 Thread Haihao Xiang
Set the expected default value for options in this callback, hence we have the right values even if these options are not included in the option arrray. This is in preparation for re-using VPPContext but with a different option array for other QSV filters --- libavfilter/vf_vpp_qsv.c | 14

[FFmpeg-devel] [PATCH 05/22] lavf/vpp_qsv: handle NULL pointer when evaluating an expression

2021-05-13 Thread Haihao Xiang
This is in preparation for re-using VPPContext but with a different option array for scale_qsv filter --- libavfilter/vf_vpp_qsv.c | 36 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index e7

[FFmpeg-devel] [PATCH 04/22] lavf/vpp_qsv: add "a", "dar" and "sar" variables

2021-05-13 Thread Haihao Xiang
Also fix the coding style for VAR index. This is in preparation for re-using VPPContext for scale_qsv filter --- libavfilter/vf_vpp_qsv.c | 29 +++-- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index 72

[FFmpeg-devel] [PATCH 03/22] lavf/scale_qsv: don't need variables for constants in FFmpeg

2021-05-13 Thread Haihao Xiang
PI, PHI and E are defined in FFmpeg --- libavfilter/vf_scale_qsv.c | 9 - 1 file changed, 9 deletions(-) diff --git a/libavfilter/vf_scale_qsv.c b/libavfilter/vf_scale_qsv.c index 77a782aa58..f8e937e40e 100644 --- a/libavfilter/vf_scale_qsv.c +++ b/libavfilter/vf_scale_qsv.c @@ -44,9 +44,

[FFmpeg-devel] [PATCH 02/22] lavf/scale_qsv: simplify scale_qsv filter

2021-05-13 Thread Haihao Xiang
Use QSVVPPContext as a base context of QSVScaleContext, hence we may re-use functions defined for QSVVPPContext to manage MFX session for scale_qsv filter too. Because system memory is taken into account in QSVVVPPContext, we may add support for non-QSV pixel formats in the future --- libavfilter/

[FFmpeg-devel] [PATCH 01/22] lavf/qsv: use QSVVPPContext as base context in vf_vpp_qsv/vf_overlay_qsv

2021-05-13 Thread Haihao Xiang
The same members between QSVVPPContext and VPPContext are removed from VPPContext, and async_depth is moved from QSVVPPParam to QSVVPPContext so that all QSV filters using QSVVPPContext may support async depth. In addition we may use QSVVPPContext as base context in other QSV filters in the future.

[FFmpeg-devel] [PATCH 00/22] clean-up QSV filters

2021-05-13 Thread Haihao Xiang
This patchset clean up scale_qsv and deinterlace_qsv filters, and take the two filters as the special cases of vpp_qsv, so vf_scale_qsv.c and vf_deinterlace_qsv.c can be deleted from FFmpeg. In addition, a few small features are added in this patchset. Haihao Xiang (22): lavf/qsv: use QSVVPPCon

Re: [FFmpeg-devel] Encode user data unregistered SEI (H.264/H.265)

2021-05-13 Thread Brad Hards
On Friday, 14 May 2021 1:59:13 AM AEST Marton Balint wrote: > On Tue, 11 May 2021, Brad Hards wrote: > > On Saturday, 1 May 2021 12:23:00 PM AEST Brad Hards wrote: > >> MISB ST 0604 and ST 2101 require user data unregistered SEI messages > >> (precision timestamps and sensor identifiers) to be incl

Re: [FFmpeg-devel] [PATCH v2 4/4] doc: add example for user data unregistered SEI encoding

2021-05-13 Thread Brad Hards
On Friday, 14 May 2021 7:22:02 AM AEST James Almer wrote: > This example is a simple encode API usage with the sole addition of > inserting one side data element to every frame. It's not really useful. I will remove it from v3. Brad ___ ffmpeg-devel

Re: [FFmpeg-devel] [PATCH] avfilter/guided: simplify subsampling assignment.

2021-05-13 Thread Steven Liu
> 2021年5月14日 上午11:43,Gyan Doshi 写道: > > Reduce option ranges to effective values. > --- > Will reindent after this is applied. > > libavfilter/vf_guided.c | 26 -- > 1 file changed, 8 insertions(+), 18 deletions(-) > > diff --git a/libavfilter/vf_guided.c b/libavfilter/

[FFmpeg-devel] [PATCH] avfilter/guided: simplify subsampling assignment.

2021-05-13 Thread Gyan Doshi
Reduce option ranges to effective values. --- Will reindent after this is applied. libavfilter/vf_guided.c | 26 -- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/libavfilter/vf_guided.c b/libavfilter/vf_guided.c index e7c689e7be..88bae5ab19 100644 --- a/li

[FFmpeg-devel] [PATCH v2] avfilter/vf_guided: add null pointer check of ref_frame and main_frame

2021-05-13 Thread Steven Liu
fix CID: 1484785 check ref_frame and main_frame before use them Ignore previous patch please, this should better than that. Signed-off-by: Steven Liu --- libavfilter/vf_guided.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_guided.c b/libavfilter/vf_guided.c

[FFmpeg-devel] [PATCH] avfilter/vf_guided: add null pointer check of ref_frame and main_frame

2021-05-13 Thread Steven Liu
fix CID: 1484785 check ref_frame and main_frame before use them Signed-off-by: Steven Liu --- libavfilter/vf_guided.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_guided.c b/libavfilter/vf_guided.c index e7c689e7be..0868b9cd4f 100644 --- a/libavfilter/vf_gui

Re: [FFmpeg-devel] [PATCH V4 2/5] lavfi/dnn_backend_native_layer_conv2d.h: Documentation

2021-05-13 Thread Guo, Yejun
> -Original Message- > From: ffmpeg-devel On Behalf Of > Shubhanshu Saxena > Sent: 2021年5月13日 15:04 > To: ffmpeg-devel@ffmpeg.org > Cc: Shubhanshu Saxena > Subject: [FFmpeg-devel] [PATCH V4 2/5] > lavfi/dnn_backend_native_layer_conv2d.h: Documentation > > Add documentation for 2D Convo

[FFmpeg-devel] [PATCH] avformat/flvdec: Ignore the first two data/subtitle streams.

2021-05-13 Thread Josh Allmann
Previously, one or the other would have been ignored, but not both. Since the probe terminates at three streams, it could exit prematurely if both data and subtitles are present along with slightly trailing media, usually video trailing audio. Trailing media is common in RTMP, and encoders write s

Re: [FFmpeg-devel] [PATCH v3] GSoC: Add guided filter

2021-05-13 Thread Andreas Rheinhardt
Xuewei Meng: > V3: Add examples on how to use this filter, and improve the code style. > V2: Implement the slice-level parallelism for guided filter. > V1: Add the basic version of guided filter. > > Signed-off-by: Xuewei Meng > --- > doc/filters.texi | 38 + > libavfilter/Makefile

Re: [FFmpeg-devel] [PATCH v2 4/4] doc: add example for user data unregistered SEI encoding

2021-05-13 Thread James Almer
On 4/30/2021 11:23 PM, Brad Hards wrote: Signed-off-by: Brad Hards --- configure | 2 + doc/examples/.gitignore| 1 + doc/examples/Makefile | 1 + doc/examples/Makefile.example | 1 + doc/examples/encode_unregistered.c | 205 ++

Re: [FFmpeg-devel] [PATCH] avformat/utils: Fix NPD when allocating AVStreamInternal fails

2021-05-13 Thread Andreas Rheinhardt
Marton Balint: > > > On Thu, 13 May 2021, Andreas Rheinhardt wrote: > >> Regression since b9c5fdf6027010d15ee90a43aa023e45a5189097; >> fixes Coverity ID #1484786. >> >> Signed-off-by: Andreas Rheinhardt >> --- >> Checking for st->internal->parser is btw unnecessary as >> av_parser_close(NULL) i

Re: [FFmpeg-devel] [PATCH] avformat/utils: Fix NPD when allocating AVStreamInternal fails

2021-05-13 Thread Marton Balint
On Thu, 13 May 2021, Andreas Rheinhardt wrote: Regression since b9c5fdf6027010d15ee90a43aa023e45a5189097; fixes Coverity ID #1484786. Signed-off-by: Andreas Rheinhardt --- Checking for st->internal->parser is btw unnecessary as av_parser_close(NULL) is safe. I think it is fine if you also

Re: [FFmpeg-devel] [PATCH] avformat/utils: Fix NPD when allocating AVStreamInternal fails

2021-05-13 Thread James Almer
On 5/13/2021 5:22 PM, Andreas Rheinhardt wrote: Regression since b9c5fdf6027010d15ee90a43aa023e45a5189097; fixes Coverity ID #1484786. Signed-off-by: Andreas Rheinhardt --- Checking for st->internal->parser is btw unnecessary as av_parser_close(NULL) is safe. libavformat/utils.c | 5 ++---

[FFmpeg-devel] [PATCH] avformat/utils: Fix NPD when allocating AVStreamInternal fails

2021-05-13 Thread Andreas Rheinhardt
Regression since b9c5fdf6027010d15ee90a43aa023e45a5189097; fixes Coverity ID #1484786. Signed-off-by: Andreas Rheinhardt --- Checking for st->internal->parser is btw unnecessary as av_parser_close(NULL) is safe. libavformat/utils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) dif

Re: [FFmpeg-devel] [PATCH] ffmpeg: return no chosen output if an uninitialized stream is unavailable

2021-05-13 Thread Jan Ekström
On Fri, May 7, 2021 at 12:22 AM Jan Ekström wrote: > > Otherwise the rate emulation logic in `transcode_step` never gets > hit, and the unavailability flag never gets reset, leading to an > eternal loop. > > Fixes #9160 > --- > fftools/ffmpeg.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion

Re: [FFmpeg-devel] Encode user data unregistered SEI (H.264/H.265)

2021-05-13 Thread Marton Balint
On Tue, 11 May 2021, Brad Hards wrote: On Saturday, 1 May 2021 12:23:00 PM AEST Brad Hards wrote: MISB ST 0604 and ST 2101 require user data unregistered SEI messages (precision timestamps and sensor identifiers) to be included. That currently isn't supported. This series adds encoding for l

[FFmpeg-devel] Ping: [PATCH] avfilter/vf_subtitles: allow using embedded fonts

2021-05-13 Thread Oneric
On Sun, May 02, 2021 at 23:02:02 +0200, Oneric wrote: > ASS subtitles can have encoded fonts embedded into the subtitle file > itself. Allow libass to load those, to render subs as intended. > --- > libavfilter/vf_subtitles.c | 1 + > 1 file changed, 1 insertion(+) pinging for review

Re: [FFmpeg-devel] [PATCH] ffmpeg: return no chosen output if an uninitialized stream is unavailable

2021-05-13 Thread Jan Ekström
On Thu, May 13, 2021 at 6:11 PM Jan Ekström wrote: > > On Fri, May 7, 2021 at 12:22 AM Jan Ekström wrote: > > > > Otherwise the rate emulation logic in `transcode_step` never gets > > hit, and the unavailability flag never gets reset, leading to an > > eternal loop. > > > > Fixes #9160 > > --- >

Re: [FFmpeg-devel] [PATCH 6/9] avcodec/adpcm: Set vqa_version before use in init

2021-05-13 Thread Michael Niedermayer
On Thu, May 13, 2021 at 11:14:13AM +1000, Zane van Iperen wrote: > > > On 13/5/21 10:50 am, Andreas Rheinhardt wrote: > > Michael Niedermayer: > > > Fixes: null pointer dereference > > > Fixes: > > > 33172/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_WS_fuzzer-5200164273913856 > >

Re: [FFmpeg-devel] Questions about Codec

2021-05-13 Thread Nicolas Frattaroli
On 13.05.21 10:16, Renvoi wrote: Dear ffmpeg-devel I want to encode a video or serial number file to the Grassvallay HQ codec in AVI format and export it. Is there any way? Please help us. Grass Valley https://pro.grassvalley.jp/catalog/hqcodec/hq_codec.htm This is the development list, not

[FFmpeg-devel] Questions about Codec

2021-05-13 Thread Renvoi
Dear ffmpeg-devel I want to encode a video or serial number file to the Grassvallay HQ codec in AVI format and export it. Is there any way? Please help us. Grass Valley https://pro.grassvalley.jp/catalog/hqcodec/hq_codec.htm -- cont...@renvoi.net

Re: [FFmpeg-devel] [PATCH 3/5 v2] lavfi/dnn_backend_native_layer_dense.h: Documentation

2021-05-13 Thread Shubhanshu Saxena
On Thu, May 13, 2021 at 6:52 AM Guo, Yejun wrote: > > > > -Original Message- > > From: ffmpeg-devel On Behalf Of > > Shubhanshu Saxena > > Sent: 2021年5月13日 2:45 > > To: ffmpeg-devel@ffmpeg.org > > Cc: Shubhanshu Saxena > > Subject: [FFmpeg-devel] [PATCH 3/5 v2] > > lavfi/dnn_backend_nat

[FFmpeg-devel] [PATCH V4 3/5] lavfi/dnn_backend_native_layer_dense.h: Documentation

2021-05-13 Thread Shubhanshu Saxena
Add documentation for Dense Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_dense.h | 27 +++ 1 file changed, 27 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_dense.h b/libavfilter/dnn/dnn_backend_native_layer_dense.h index

[FFmpeg-devel] [PATCH V4 4/5] lavfi/dnn_backend_native_layer_depth2space.h: Documentation

2021-05-13 Thread Shubhanshu Saxena
Add documentation for Depth to Space Layer Signed-off-by: Shubhanshu Saxena --- .../dnn_backend_native_layer_depth2space.h| 30 +++ 1 file changed, 30 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_depth2space.h b/libavfilter/dnn/dnn_backend_native_laye

[FFmpeg-devel] [PATCH V4 5/5] lavfi/dnn_backend_native_layer_mathunary.h: Documentation

2021-05-13 Thread Shubhanshu Saxena
Add documentation for Unary Math Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_mathunary.h | 30 +++ 1 file changed, 30 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_mathunary.h b/libavfilter/dnn/dnn_backend_native_layer_math

[FFmpeg-devel] [PATCH V4 2/5] lavfi/dnn_backend_native_layer_conv2d.h: Documentation

2021-05-13 Thread Shubhanshu Saxena
Add documentation for 2D Convolution Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_conv2d.h | 27 +++ 1 file changed, 27 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_conv2d.h b/libavfilter/dnn/dnn_backend_native_layer_con

[FFmpeg-devel] [PATCH V4 1/5] lavfi/dnn_backend_native_layer_avgpool.h: Documentation

2021-05-13 Thread Shubhanshu Saxena
Add documentation for Average Pool Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_avgpool.h| 28 +++ 1 file changed, 28 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_avgpool.h b/libavfilter/dnn/dnn_backend_native_layer_avgp