Re: [FFmpeg-devel] [PATCH 0/6 v2] avformat/movenc: normalize on AC-3 parser usage

2022-06-20 Thread Jan Ekström
On Fri, Jun 17, 2022 at 4:04 PM Jan Ekström wrote: > > The simplified parsing currently in `mov_write_ac3_tag` trusts the content > of the packets a bit too much (the AC-3 parser returns all data fed to it, > including any possible data before the start code), while the existing E-AC-3 > logic doe

Re: [FFmpeg-devel] [PATCH] lavc/dovi_rpu: Fix UB for possible left shift of negative values

2022-06-20 Thread Thilo Borgmann
Am 16.06.22 um 13:19 schrieb Thilo Borgmann: Am 16.06.22 um 12:40 schrieb Andreas Rheinhardt: Thilo Borgmann: Am 16.06.22 um 12:13 schrieb Andreas Rheinhardt: Thilo Borgmann: diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c index a87562c8a3..833ce9e705 100644 --- a/libavcodec/dovi_r

Re: [FFmpeg-devel] [PATCH] tests/checkasm/sw_scale: Fix alignment for movdqa

2022-06-20 Thread Thilo Borgmann
Am 18.06.22 um 23:50 schrieb Martin Storsjö: On Thu, 16 Jun 2022, Thilo Borgmann wrote: Hi, movdqa in ff_yuv2yuvX_sse3() expects a 16-byte alignment according to its documentation causing segfaults in fate-checkasm-sw_scale. LGTM, thanks! Pushed, Thanks! -Thilo __

Re: [FFmpeg-devel] [PATCH] lavc/libx264.c: Fix possible UB by NULL pointer LHS

2022-06-20 Thread Thilo Borgmann
Am 16.06.22 um 22:01 schrieb Michael Niedermayer: On Thu, Jun 16, 2022 at 05:58:09PM +0200, Thilo Borgmann wrote: Hi, the LHS pointer might be NULL so that += would be UB. Thanks, Thilo libx264.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 558de1ca7a30aa728193297a7d605c05

Re: [FFmpeg-devel] [PATCH 5/6] avformat/movenc: utilize existing AC-3 parsing workflow for AC-3

2022-06-20 Thread Andreas Rheinhardt
Jan Ekström: > From: Jan Ekström > > Signed-off-by: Jan Ekström > --- > libavformat/Makefile | 1 + > libavformat/ac3_bitrate_tab.c | 22 ++ > libavformat/movenc.c | 55 +-- > 3 files changed, 50 insertions(+), 28 deletions(-) > cr

[FFmpeg-devel] [PATCH] libavcodec/qsvenc_hevc: Use default value from MSDK to set bf.

2022-06-20 Thread Wenbin Chen
Change the default value of "bf" for hevc_qsv to -1. 8 isn't the best choice so let MSDK to decide the number of b frames. Signed-off-by: Wenbin Chen --- libavcodec/qsvenc_hevc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc

Re: [FFmpeg-devel] [PATCH v3] avcodec/mfenc: set variable frame size flag.

2022-06-20 Thread Gyan Doshi
On 2022-06-19 09:14 pm, Gyan Doshi wrote: On 2022-06-19 03:15 pm, Gyan Doshi wrote: Default avctx->frame_size is 0 which led to init failure for audio MediaFoundation encoders since 827d6fe73d. The MF audio encoders accept variable frame size input buffers. Fixes #9802 Plan to push tomo

[FFmpeg-devel] [PATCH v20 1/5] libavutil: Add wchartoutf8(), wchartoansi(), utf8toansi(), getenv_utf8(), freeenv_utf8() and getenv_dup()

2022-06-20 Thread Nil Admirari
wchartoutf8() converts strings returned by WinAPI into UTF-8, which is FFmpeg's preffered encoding. Some external dependencies, such as AviSynth, are still not Unicode-enabled. utf8toansi() converts UTF-8 strings into ANSI in two steps: UTF-8 -> wchar_t -> ANSI. wchartoansi() is responsible for th

[FFmpeg-devel] [PATCH v20 3/5] fftools: Remove MAX_PATH limit and switch to UTF-8 versions of fopen() and getenv()

2022-06-20 Thread Nil Admirari
--- fftools/cmdutils.c | 53 +--- fftools/ffmpeg_opt.c | 9 ++-- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 5d7cdc3e10..69a6f54ea3 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmduti

[FFmpeg-devel] [PATCH v20 2/5] compat/w32dlfcn.h: Remove MAX_PATH limit and replace LoadLibraryExA with LoadLibraryExW

2022-06-20 Thread Nil Admirari
--- compat/w32dlfcn.h | 100 -- libavcodec/mf_utils.h | 1 + 2 files changed, 79 insertions(+), 22 deletions(-) diff --git a/compat/w32dlfcn.h b/compat/w32dlfcn.h index 52a94efafb..fb1aa1b72e 100644 --- a/compat/w32dlfcn.h +++ b/compat/w32dlfcn.h @@ -

[FFmpeg-devel] [PATCH v20 5/5] libavfilter/vf_frei0r.c: Use UTF-8 version of getenv()

2022-06-20 Thread Nil Admirari
--- libavfilter/vf_frei0r.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c index f11ae6e55c..1e01114b76 100644 --- a/libavfilter/vf_frei0r.c +++ b/libavfilter/vf_frei0r.c @@ -31,6 +31,7 @@ #include "libavutil/a

[FFmpeg-devel] [PATCH v20 4/5] libavformat: Remove MAX_PATH limit and use UTF-8 version of getenv()

2022-06-20 Thread Nil Admirari
1. getenv() is replaced with getenv_utf8() across libavformat. 2. New versions of AviSynth+ are now called with UTF-8 filenames. 3. Old versions of AviSynth are still using ANSI strings, but MAX_PATH limit on filename is removed. --- libavformat/avisynth.c| 39 +++---

Re: [FFmpeg-devel] [PATCH v19 1/5] libavutil: Add wchartoutf8(), wchartoansi(), utf8toansi(), getenv_utf8() and freeenv_utf8()

2022-06-20 Thread nil-admirari
> Looks good overall, thanks! The freeenv_utf8 function needed a couple > minor fixes though, to fix these warnings/errors: Fixed: https://ffmpeg.org/pipermail/ffmpeg-devel/2022-June/297841.html ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org h

Re: [FFmpeg-devel] [PATCH v19 3/5] fftools: Remove MAX_PATH limit and switch to UTF-8 versions of fopen() and getenv()

2022-06-20 Thread nil-admirari
> ./libavutil/getenv_utf8.h: In function ‘freeenv_utf8’: > ./libavutil/getenv_utf8.h:69:1: error: parameter name omitted > static inline void freeenv_utf8(const char *) > ^~ Fixed: https://ffmpeg.org/pipermail/ffmpeg-devel/2022-June/297841.html __

Re: [FFmpeg-devel] [PATCH v17 1/5] libavutil: Add wchartoutf8(), wchartoansi(), utf8toansi() and getenv_utf8()

2022-06-20 Thread nil-admirari
> Or any reuses the #ifs from getenv_utf8.h. > https://github.com/mkver/FFmpeg/commits/getenv contains a version that > does this. Introduced getenv_dup() and simplified #ifs a little: https://ffmpeg.org/pipermail/ffmpeg-devel/2022-June/297841.html __

Re: [FFmpeg-devel] [PATCH 00/41] Stop including superseded functions for x64

2022-06-20 Thread Andreas Rheinhardt
Andreas Rheinhardt: > Andreas Rheinhardt: >> x64 requires MMX, MMXEXT, SSE and SSE2; yet there is no shortage >> of code like the following: >> >> if (EXTERNAL_MMX(cpu_flags)) { >> c->ssd_int8_vs_int16 = ff_ssd_int8_vs_int16_mmx; >> } >> if (EXTERNAL_SSE2(cpu_flags)) { >>

[FFmpeg-devel] [PATCH] avcodec/get_bits: Don't let number of bits_left become invalid

2022-06-20 Thread Andreas Rheinhardt
When using the checked cached bitstream reader, it can currently happen that the GetBitContext's number of bits_left becomes wrong, namely off by UINT_MAX due to wraparound (if it were an int, it would become negative). The reason for this is that reading new input is performed through show_bits()

Re: [FFmpeg-devel] [PATCH 4/5] lavc/bitstream: make skip_remaining() public

2022-06-20 Thread Andreas Rheinhardt
Anton Khirnov: > Also rename it to bitstream_skip_cache(), which is more descriptive and > follows the naming conventions of tis API. > --- > libavcodec/bitstream.h | 1 + > libavcodec/bitstream_template.h | 19 --- > 2 files changed, 13 insertions(+), 7 deletions(-) > >

Re: [FFmpeg-devel] [PATCH 5/6] avformat/movenc: utilize existing AC-3 parsing workflow for AC-3

2022-06-20 Thread Jan Ekström
On Mon, Jun 20, 2022 at 12:10 PM Andreas Rheinhardt wrote: > > Jan Ekström: > > From: Jan Ekström > > > > Signed-off-by: Jan Ekström > > --- > > libavformat/Makefile | 1 + > > libavformat/ac3_bitrate_tab.c | 22 ++ > > libavformat/movenc.c | 55 +-

[FFmpeg-devel] [PATCH] fftools/ffmpeg: change frame counters to 64 bit

2022-06-20 Thread Marton Balint
Frame counters can overflow relatively easily (INT_MAX number of frames is slightly more than 1 year for 60 fps content), so make sure we are always using 64 bit values for them. A live stream can easily run for more than a year and the framedup logic breaks on an overflow. Signed-off-by: Marton

Re: [FFmpeg-devel] [PATCH v20 1/5] libavutil: Add wchartoutf8(), wchartoansi(), utf8toansi(), getenv_utf8(), freeenv_utf8() and getenv_dup()

2022-06-20 Thread Martin Storsjö
On Mon, 20 Jun 2022, Nil Admirari wrote: wchartoutf8() converts strings returned by WinAPI into UTF-8, which is FFmpeg's preffered encoding. Some external dependencies, such as AviSynth, are still not Unicode-enabled. utf8toansi() converts UTF-8 strings into ANSI in two steps: UTF-8 -> wchar_t

[FFmpeg-devel] [PATCH v2] doc/examples/muxing: code rewrite with improved readability and fixed issues

2022-06-20 Thread Paolo Prete
Please review it! Difference to v1: *) AVCodecParameter(s) allocated with avcodec_parameters_alloc() *) AVRational  objects created with av_make_q() (in the original muxing.c they are created through a cast to AVRational) *) removed unuseful "else"s *) fixed error check in case of avcodec_alloc_

[FFmpeg-devel] [PATCH] avformat/flacdec: Implement decoding of 32-bit PCM

2022-06-20 Thread Martijn van Beurden
Recently libFLAC gained the ability (not in any released version yet though) to create FLAC files containing 32-bit int PCM samples. To keep complexity reasonable, the choice was made to limit residuals to 32-bit integers, which the encoder must make sure of. In case the encoder cannot find any pre

Re: [FFmpeg-devel] [PATCH] lavc/aarch64: unify formatting

2022-06-20 Thread Martin Storsjö
On Tue, 14 Jun 2022, J. Dekker wrote: Performs the following changes: - Lower case format specifiers - Lower case sxtw/uxtw - Numeric labels on same line as next instruction Why do you feel the need to do that? I like the occasional extra spacing that an empty line for such labels adds - at l

Re: [FFmpeg-devel] [PATCH 1/7] avcodec/v210dec: properly support odd widths

2022-06-20 Thread Marton Balint
On Sun, 12 Jun 2022, Marton Balint wrote: Fixes ticket #5195. Signed-off-by: Marton Balint --- libavcodec/v210dec.c | 49 +--- 1 file changed, 33 insertions(+), 16 deletions(-) Will apply the series. Regards, Marton diff --git a/libavcodec/v210de

Re: [FFmpeg-devel] [PATCH 2/2] avformat/img2enc: use unmatched filename for an invalid or missing sequence pattern

2022-06-20 Thread Marton Balint
On Mon, 13 Jun 2022, Marton Balint wrote: Also warn the user that for single images -update should be used, for sequences a proper pattern should be specified. Fixes ticket #9748. Ping for this. Note that this patch will show a warning for any non-sequence image filename (unless the -upda

Re: [FFmpeg-devel] [PATCH] avformat/mpegts: remove obsolate hacks for detecting streams with bad PMTs

2022-06-20 Thread Marton Balint
On Wed, 15 Jun 2022, Marton Balint wrote: Ffmpeg/ffprobe/ffplay sets scan_all_pmts to 1 when finding the streams, that should be enough to handle files for which some early PMTs miss some streams. Fixes ticket #9782. Will apply. Regards, Marton Signed-off-by: Marton Balint --- libavfo

Re: [FFmpeg-devel] [PATCH] fftools/ffprobe: report avio errors

2022-06-20 Thread Marton Balint
On Mon, 13 Jun 2022, Marton Balint wrote: Signed-off-by: Marton Balint --- fftools/ffprobe.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) Will apply. Regards, Marton diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 4e2fdbaec8..5020ba484c 100644 --- a/fftool

Re: [FFmpeg-devel] [PATCH 2/2] lavf/id3v2dec: support multiple values and TIPL frames

2022-06-20 Thread Andreas Rheinhardt
rcombs: > Fixes https://trac.ffmpeg.org/ticket/6949 > > Ordinary text frames in ID3v2 are allowed to have multiple > (null-separated) values. This technically isn't allowed in TXXX, > but it's used in practice by Picard, and supporting it is harmless. > > TIPL/IPL (Involved People List) and TMCL

Re: [FFmpeg-devel] [PATCH 2/2] lavf/id3v2dec: support multiple values and TIPL frames

2022-06-20 Thread Soft Works
> -Original Message- > From: ffmpeg-devel On Behalf Of > Ridley Combs > Sent: Tuesday, June 21, 2022 12:33 AM > To: ffmpeg-devel > Subject: Re: [FFmpeg-devel] [PATCH 2/2] lavf/id3v2dec: support > multiple values and TIPL frames > > > > On Jun 20, 2022, at 17:15, Andreas Rheinhardt >

Re: [FFmpeg-devel] [PATCH 1/2] avformat/demux: Make read_frame_internal() return AVERREOR(EAGAIN) on stuck empty input parser

2022-06-20 Thread Michael Niedermayer
On Mon, Jun 20, 2022 at 01:44:52AM +0200, Andreas Rheinhardt wrote: [...] > PS: The fact that the parsing API is based upon buffers and not > AVPackets btw leads to buggy side-data handling: If a parser introduces > delay, then the side-data will not be attached to the correct packet, > but to the

Re: [FFmpeg-devel] [PATCH 2/2] lavf/id3v2dec: support multiple values and TIPL frames

2022-06-20 Thread Michael Niedermayer
On Sun, Jun 19, 2022 at 08:37:11PM -0500, rcombs wrote: > Fixes https://trac.ffmpeg.org/ticket/6949 > > Ordinary text frames in ID3v2 are allowed to have multiple > (null-separated) values. This technically isn't allowed in TXXX, > but it's used in practice by Picard, and supporting it is harmless

[FFmpeg-devel] [PATCH 1/6] avformat/matroskaenc: Split assembling CodecPrivate from writing it

2022-06-20 Thread Andreas Rheinhardt
This is in preparation for splitting writing and updating extradata more thoroughly later. Signed-off-by: Andreas Rheinhardt --- libavformat/matroskaenc.c | 74 --- 1 file changed, 46 insertions(+), 28 deletions(-) diff --git a/libavformat/matroskaenc.c b/lib

[FFmpeg-devel] [PATCH 2/6] avformat/matroskaenc: Avoid swapping codecpar->extradata temporarily

2022-06-20 Thread Andreas Rheinhardt
Instead pass extradata and extradata_size explicitly. (It is not perfect, as ff_put_(wav|bmp)_header() still uses the extradata embedded in codecpar, but this is not an issue as long as their CodecPrivate isn't updated.) Signed-off-by: Andreas Rheinhardt --- libavformat/matroskaenc.c | 82 +

[FFmpeg-devel] [PATCH 3/6] avformat/matroskaenc: Split updating CodecPrivate from writing it

2022-06-20 Thread Andreas Rheinhardt
Up until now, updating extradata was very ad-hoc: The amount of space reserved for extradata was not recorded when writing the header; instead the AAC code simply presumed that it was enough. This commit changes this by recording how much space is available. This brings with it that the code for w

[FFmpeg-devel] [PATCH 4/6] avcodec/av1: Add upper bound for the size of a sane sequence header

2022-06-20 Thread Andreas Rheinhardt
It will be used by the Matroska muxer to reserve a certain number of bytes for the CodecPrivate in case no extradata is initially available (as it is for the libaom-av1 encoder). Signed-off-by: Andreas Rheinhardt --- libavcodec/av1.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/liba

[FFmpeg-devel] [PATCH 5/6] avformat/matroskaenc: Improve handling of AV1 extradata

2022-06-20 Thread Andreas Rheinhardt
Up until now, only the first four bytes (the ones preceding the OBU) were written because not enough space has been reserved for the complete CodecPrivate. This commit changes this by increasing the space reserved for the CodecPrivate (it is big enough for every sane sequence header plus something

[FFmpeg-devel] [PATCH 6/6] avformat/matroskaenc: Fix outdated comment

2022-06-20 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavformat/matroskaenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index b240ca0a06..acb50017b6 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -273

Re: [FFmpeg-devel] [PATCH] AV1 VDPAU hwaccel Decode support

2022-06-20 Thread Manoj Bonda
Hi Philip, The issue seems to be from MPV side rather than from ffmpeg patch. I was able to decode the clip Halo_AV1 properly bitmatching with nvcuvid output with ffmpeg + VDPAU. Please find the cmds I used to verify the same. ./ffmpeg -hwaccel vdpau -i /home/bondamanoj/VideoClips/AV1Clip

Re: [FFmpeg-devel] [PATCH v3 3/5] avcodec/avs2_parser: parse more info

2022-06-20 Thread hwren
At 2022-06-13 11:36:34, "Zhao Zhili" wrote: >Including video resolution, framerate and picture type, etc. > >Signed-off-by: Zhao Zhili >--- > libavcodec/Makefile | 2 +- > libavcodec/avs2.c| 42 > libavcodec/avs2.h| 10 > libavcodec/

[FFmpeg-devel] [PATCH 7/7] avformat/matroskaenc: Reuse dynamic buffer

2022-06-20 Thread Andreas Rheinhardt
Avoids some allocations. Signed-off-by: Andreas Rheinhardt --- libavformat/matroskaenc.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index acb50017b6..bfc397dbe6 100644 --- a/libavformat/matroska

Re: [FFmpeg-devel] [PATCH] libavcodec/qsvenc: Enable fixed QP configure in qsv CQP runtime

2022-06-20 Thread Xiang, Haihao
On Wed, 2022-06-15 at 15:25 +0800, Wenbin Chen wrote: > From: Yue Heng > > Enable dynamic QP configuration in runtime on qsv encoder. Through > AVFrame->metadata, we can set key "qsv_config_qp" to change QP > configuration when we encode video in CQP mode. > > Signed-off-by: Yue Heng > Signed-o

[FFmpeg-devel] [PATCH v3 0/6] avformat/movenc: normalize on AC-3 parser usage

2022-06-20 Thread Jan Ekström
The simplified parsing currently in `mov_write_ac3_tag` trusts the content of the packets a bit too much (the AC-3 parser returns all data fed to it, including any possible data before the start code), while the existing E-AC-3 logic does proper header validation by utilizing the (E-)AC-3 parser.

[FFmpeg-devel] [PATCH v3 1/6] avcodec: make AC-3 bit rate table available in a separate header

2022-06-20 Thread Jan Ekström
From: Jan Ekström This makes it possible to include it from libavformat Signed-off-by: Jan Ekström --- libavcodec/Makefile | 8 +--- libavcodec/ac3_bitrate_tab.c | 22 ++ libavcodec/ac3_bitrate_tab.h | 33 + libavcodec/ac3tab.c

[FFmpeg-devel] [PATCH v3 2/6] {configure, avformat/movenc}: enable AC-3 parser for movenc

2022-06-20 Thread Jan Ekström
From: Jan Ekström This simplifies the code to no longer have #ifs in a manner which does not require handling avpriv_ac3_parse_header returning ENOSYS. As an existing example, the MPEG-TS muxer already requires the AC-3 parser, and in order to fix existing issues with the current AC-3 movenc cod

[FFmpeg-devel] [PATCH v3 3/6] avformat/movenc: enable handle_eac3 to handle AC-3 tracks

2022-06-20 Thread Jan Ekström
From: Jan Ekström Add the AC-3 frame type, as well as early exit from additional packet parsing in case of AC-3, as only a single packet is required to get the required information. Signed-off-by: Jan Ekström --- libavformat/movenc.c | 11 ++- 1 file changed, 10 insertions(+), 1 deleti

[FFmpeg-devel] [PATCH v3 4/6] avformat/movenc: move eac3_info definition so that it can be used for AC-3

2022-06-20 Thread Jan Ekström
From: Jan Ekström Signed-off-by: Jan Ekström --- libavformat/movenc.c | 64 ++-- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index c24b11cf5f..103f958d75 100644 --- a/libavformat/movenc.c +++

[FFmpeg-devel] [PATCH v3 5/6] avformat/movenc: utilize existing AC-3 parsing workflow for AC-3

2022-06-20 Thread Jan Ekström
From: Jan Ekström Signed-off-by: Jan Ekström --- libavcodec/Makefile | 1 + libavformat/Makefile | 1 + libavformat/ac3_bitrate_tab.c | 22 ++ libavformat/movenc.c | 55 +-- 4 files changed, 51 insertions(+), 28 deletions

[FFmpeg-devel] [PATCH v3 6/6] avformat/movenc: handle OOM situations when parsing AC-3 headers

2022-06-20 Thread Jan Ekström
From: Jan Ekström Signed-off-by: Jan Ekström --- libavformat/movenc.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index a071f1cdd5..58ba0bc545 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -420,7 +420,10 @

Re: [FFmpeg-devel] [PATCH] libavcodec/qsvenc: Enable fixed QP configure in qsv CQP runtime

2022-06-20 Thread Chen, Wenbin
> On Wed, 2022-06-15 at 15:25 +0800, Wenbin Chen wrote: > > From: Yue Heng > > > > Enable dynamic QP configuration in runtime on qsv encoder. Through > > AVFrame->metadata, we can set key "qsv_config_qp" to change QP > > configuration when we encode video in CQP mode. > > > > Signed-off-by: Yue He