[FFmpeg-devel] [PATCH v2] avfilter/vf_subtitles: add wrap_unicode option

2023-05-21 Thread Zhao Zhili
From: Zhao Zhili So CJK can be wrapped automatically. Signed-off-by: Zhao Zhili --- v2: Don't overwrite wrap automatically for native ASS libavfilter/version.h | 2 +- libavfilter/vf_subtitles.c | 14 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --

[FFmpeg-devel] [PATCH v3] avfilter/vf_subtitles: add wrap_unicode option

2023-05-22 Thread Zhao Zhili
From: Zhao Zhili So CJK can be wrapped automatically. Signed-off-by: Zhao Zhili --- v3: Fix build error with older libass v2: Don't overwrite wrap automatically for native ASS libavfilter/version.h | 2 +- libavfilter/vf_subtitles.c | 18 ++ 2 files change

[FFmpeg-devel] [PATCH] avformat/mov: decrease probe score for a random tag

2023-05-22 Thread Zhao Zhili
From: Zhao Zhili The tag comes from samples/ffmpeg/mov/unrecognized/bartjones.mov really looks like some random data. Now the random tag matched another file, which isn't a mov. --- libavformat/mov.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/mov.c b/libavformat/

[FFmpeg-devel] [PATCH v4] avfilter/vf_subtitles: add wrap_unicode option

2023-05-22 Thread Zhao Zhili
From: Zhao Zhili So CJK can be wrapped automatically. Signed-off-by: Zhao Zhili --- v4: add doc doc/filters.texi | 7 +++ libavfilter/version.h | 2 +- libavfilter/vf_subtitles.c | 18 ++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/doc

[FFmpeg-devel] [PATCH] avformat/hlsenc: fix CODECS attribute of H.264

2023-05-29 Thread Zhao Zhili
From: Zhao Zhili Signed-off-by: Zhao Zhili --- libavformat/hlsenc.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 871afb571b..1e0848ce3d 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: fix CODECS attribute of H.264

2023-05-29 Thread Zhao Zhili
> 在 2023年5月29日,22:46,Anton Khirnov 写道: > > Quoting Zhao Zhili (2023-05-30 00:16:05) >> Subject: Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: fix CODECS attribute of >> H.264 > > "fix bug" commit message are not very useful However, CODECS attribut

[FFmpeg-devel] [PATCH v2] avformat/hlsenc: fix CODECS attribute of H.264

2023-06-07 Thread Zhao Zhili
From: Zhao Zhili 1. Add avcc extradata support. 2. Add non-standard annexb support with 0 0 1 as prefix for SPS. Signed-off-by: Zhao Zhili --- v2: Describe what the patch does. libavformat/hlsenc.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a

Re: [FFmpeg-devel] [Internet][PATCH] avformat/mov: decrease probe score for a random tag

2023-06-07 Thread Zhao Zhili
On Mon, 2023-05-22 at 22:07 +0800, Zhao Zhili wrote: > From: Zhao Zhili > > The tag comes from samples/ffmpeg/mov/unrecognized/bartjones.mov > really looks like some random data. Now the random tag matched > another file, which isn't a mov. > --- > libavformat/mov.c |

Re: [FFmpeg-devel] [PATCH 01/10] avfilter/dnn: define each backend as a DNNModule

2023-06-07 Thread Zhao Zhili
On Sun, 2023-04-30 at 23:38 +0800, Zhao Zhili wrote: > From: Zhao Zhili > > To avoid export multiple functions for each backend > implementation. > > Signed-off-by: Zhao Zhili > --- > libavfilter/dnn/dnn_backend_openvino.c | 98 +

Re: [FFmpeg-devel] [PATCH] configure: add pkg-config check for libopenvino

2023-06-07 Thread Zhao Zhili
On Thu, 2023-05-04 at 11:59 +0800, Zhao Zhili wrote: > From: Zhao Zhili > > Signed-off-by: Zhao Zhili > --- > configure | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/configure b/configure > index bb7be67676..7be98ed2ba 100755 > ---

Re: [FFmpeg-devel] [PATCH] avfilter/dnn_backend_openvino: fix log message

2023-06-07 Thread Zhao Zhili
On Thu, 2023-05-04 at 21:06 +0800, Zhao Zhili wrote: > From: Zhao Zhili > > Signed-off-by: Zhao Zhili > --- > libavfilter/dnn/dnn_backend_openvino.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavfilter/dnn/dnn_backend_openvi

[FFmpeg-devel] [PATCH] avcodec/mediacodecenc: add profile names to options

2023-06-09 Thread Zhao Zhili
From: Zhao Zhili H.264 high10/high422/high44 are unlikely supported by devices. It's there for developers to do the experiment. H.265 main10 works on my device with AV_PIX_FMT_MEDIACODEC. OMX_COLOR_FormatYUV420Planar16 doesn't work. Signed-off-by: Zhao Zhili --- libavcodec/media

[FFmpeg-devel] [PATCH 1/3] avcodec/videotoolboxenc: use int as the type of profile

2023-06-09 Thread Zhao Zhili
From: Zhao Zhili Other than save a few bytes, it also has the benefit to show the AV_OPT_TYPE_CONST value in help, e.g., -profile E..V... Profile (from 0 to INT_MAX) (default 0) baseline66 E..V... Baseline Profile ... --- libavcodec

[FFmpeg-devel] [PATCH 2/3] avcodec/videotoolboxenc: remove AUTO_PROFILE define

2023-06-09 Thread Zhao Zhili
From: Zhao Zhili Use FF_PROFILE_UNKNOWN as auto mode. --- libavcodec/videotoolboxenc.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index 26485a3dea..9f65519700 100644 --- a/libavcodec

[FFmpeg-devel] [PATCH 3/3] avcodec/videotoolboxenc: inherit profile from AVCodecContext

2023-06-09 Thread Zhao Zhili
From: Zhao Zhili This can happen when user set the avctx->profile field directly instead of specify profile via option. --- libavcodec/videotoolboxenc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index 9f65519

[FFmpeg-devel] [PATCH] avformat/mov: fix overallocation when reading pssh/saiz

2023-06-12 Thread Zhao Zhili
From: Zhao Zhili mov_try_read_block() allocates 1MB at least, which can be more than enough. It was called when reading saiz box, which can appear periodically inside fmp4. This consumes a lot of memory. We can fix mov_try_read_block() by clamp 'block_size' with 'size'. Howe

[FFmpeg-devel] [PATCH 2/4] avcodec/hevc_parse: check the size of hvcC is at least 23

2023-06-13 Thread Zhao Zhili
From: Zhao Zhili The code after the check skip 21 bytes and then read two bytes. Signed-off-by: Zhao Zhili --- libavcodec/hevc_parse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/hevc_parse.c b/libavcodec/hevc_parse.c index 1f3beed183..7bc28fd081 100644

[FFmpeg-devel] [PATCH 1/4] avcodec/hevc_parse: restrict configurationVersion to 0 and 1

2023-06-13 Thread Zhao Zhili
From: Zhao Zhili The standard only defined configurationVersion 1. configurationVersion 0 is for backward compatibility predates the standard. This patch reduces the chance that some malformated streams being detected as hvcC. Signed-off-by: Zhao Zhili --- libavcodec/hevc_parse.c | 10

[FFmpeg-devel] [PATCH 4/4] avformat/asfdec_f: fix need_parsing flag for codec mpeg4

2023-06-13 Thread Zhao Zhili
From: Zhao Zhili AVSTREAM_PARSE_FULL_ONCE is only implemented for H.264. Signed-off-by: Zhao Zhili --- libavformat/asfdec_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/asfdec_f.c b/libavformat/asfdec_f.c index 1e3eb33fd6..5405956467 100644 --- a

[FFmpeg-devel] [PATCH 3/4] avformat/asfdec_f: support bmp_tags_unofficial

2023-06-13 Thread Zhao Zhili
From: Zhao Zhili Signed-off-by: Zhao Zhili --- libavformat/asfdec_f.c | 4 1 file changed, 4 insertions(+) diff --git a/libavformat/asfdec_f.c b/libavformat/asfdec_f.c index bdbd4271c8..1e3eb33fd6 100644 --- a/libavformat/asfdec_f.c +++ b/libavformat/asfdec_f.c @@ -445,6 +445,8 @@ static

Re: [FFmpeg-devel] [PATCH 2/4] avcodec/hevc_parse: check the size of hvcC is at least 23

2023-06-13 Thread Zhao Zhili
13, 2023 at 3:37 PM Zhao Zhili wrote: > > > From: Zhao Zhili > > > > The code after the check skip 21 bytes and then read two bytes. > > > > Signed-off-by: Zhao Zhili > > --- > > libavcodec/hevc_parse.c | 4 +++- > > 1 file changed, 3 insertions(

Re: [FFmpeg-devel] [PATCH 04/21 v2] tests/fate: add a test for -streamloop with transcoding video+audio

2023-06-19 Thread Zhao Zhili
> 在 2023年6月19日,21:22,James Almer 写道: > > On 6/19/2023 9:34 AM, "zhilizhao(赵志立)" wrote: On Jun 19, 2023, at 20:29, James Almer wrote: >>> >>> On 6/16/2023 3:01 AM, Anton Khirnov wrote: --- Now using aacdec_fixed with s32le output --- tests/fate/ffmpeg.mak

Re: [FFmpeg-devel] [PATCH] tests/fate/ffmpeg: actually use aac_fixed for fate-ffmpeg-streamloop-transcode-av

2023-06-19 Thread Zhao Zhili
On Mon, 2023-06-19 at 15:33 +0200, Anton Khirnov wrote: > --- > tests/fate/ffmpeg.mak | 2 +- > tests/ref/fate/ffmpeg-streamloop-transcode-av | 186 +- > 2 files changed, 94 insertions(+), 94 deletions(-) > > diff --git a/tests/fate/ffmpeg.mak b/tests/fat

[FFmpeg-devel] [PATCH] avutil/bfin: remove dead code

2023-07-04 Thread Zhao Zhili
From: Zhao Zhili The code is unused for a decade since bf6c84d7eb27b. Signed-off-by: Zhao Zhili --- libavutil/bfin/bswap.h | 45 -- libavutil/bfin/timer.h | 41 -- 2 files changed, 86 deletions(-) delete mode 100644

[FFmpeg-devel] [PATCH] avcodec/nvenc: fix intraRefreshPeriod setting

2023-07-05 Thread Zhao Zhili
From: Zhao Zhili Regression since 99dfdb45. intraRefreshPeriod access cc->gopLength, which has been overwritten to NVENC_INFINITE_GOPLENGTH before. Fixes #10445. --- libavcodec/nvenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/nvenc.c b/libavco

[FFmpeg-devel] [PATCH v2 2/5] avcodec/h264_mp4toannexb_bsf: remove pass padding size as argument

2023-07-06 Thread Zhao Zhili
From: Zhao Zhili It's a fixed value. There is no use case to change that. --- libavcodec/h264_mp4toannexb_bsf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c index 7dce1ae9b6..846671abb6 1

[FFmpeg-devel] [PATCH v2 5/5] fate/h264: move mp4toannexb_ticket5927 test to fate-h264

2023-07-06 Thread Zhao Zhili
From: Zhao Zhili --- tests/fate/ffmpeg.mak | 6 +- tests/fate/h264.mak | 6 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak index 2b3135b6a6..b7ced7d23c 100644 --- a/tests/fate/ffmpeg.mak +++ b/tests/fate/ffmpeg.mak

[FFmpeg-devel] [PATCH v2 3/5] avcodec/h264_mp4toannexb_bsf: fix missing PS before IDR frames

2023-07-06 Thread Zhao Zhili
From: Zhao Zhili If there is a single group of SPS/PPS before an IDR frame, but no SPS/PPS after that, we will miss the chance to reset idr_sps_seen/idr_pps_seen. No SPS/PPS are inserted afterwards. This patch saves in-band SPS/PPS and insert them before IDR frames when necessary. --- v2: Use a

[FFmpeg-devel] [PATCH v2 4/5] avcodec/h264_mp4toannexb_bsf: process new extradata

2023-07-06 Thread Zhao Zhili
From: Zhao Zhili For fate-h264_mp4toannexb_ticket5927 and fate-h264_mp4toannexb_ticket5927_2, they work by accident previously. The sample file has two 'avc1' entries, and video samples use the second one. It means packets should be decoded with new extradata in side data. Before

[FFmpeg-devel] [PATCH v2 1/5] avcodec/h264_mp4toannexb_bsf: refactor start_code_size handling

2023-07-06 Thread Zhao Zhili
From: Zhao Zhili start_code_size depends on whether PS comes from out-of-band or in-band. Make the code more readable. --- libavcodec/h264_mp4toannexb_bsf.c | 34 --- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/libavcodec/h264_mp4toannexb_bsf.c b

[FFmpeg-devel] [PATCH 2/2] avcodec/nvenc: set idrPeriod to gopLength unconditionally

2023-07-06 Thread Zhao Zhili
From: Zhao Zhili When intra_refresh is enabled, gopLength is equal to NVENC_INFINITE_GOPLENGTH. gopLength should be 1 at least. Signed-off-by: Zhao Zhili --- libavcodec/nvenc.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/libavcodec/nvenc.c b

[FFmpeg-devel] [PATCH] avformat/mov: avss box should be AV_CODEC_ID_CAVS

2023-07-07 Thread Zhao Zhili
From: Zhao Zhili I cannot find the spec, but according to the original commit d4fdba0df71, it's CAVS. e571305a714 changed it to AVS by accident. Ten years on, nothing happened. We still have the sample [1], however, since there is no cavs_mp4tofoobar bsf, the cavs decoder doesn't wor

[FFmpeg-devel] [PATCH 3/3] avfilter: add transpose_vt for videotoolbox pix_fmt

2023-07-16 Thread Zhao Zhili
From: Zhao Zhili --- Changelog | 1 + configure | 2 + doc/filters.texi | 48 +++ libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/version.h | 2 +- libavfilter/vf_transpose_vt.c

[FFmpeg-devel] [PATCH 1/3] avcodec/videotoolboxenc: use color parameters conversion from avutil

2023-07-16 Thread Zhao Zhili
From: Zhao Zhili --- libavcodec/videotoolboxenc.c | 137 --- 1 file changed, 13 insertions(+), 124 deletions(-) diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index 6114351392..8e493c4f7a 100644 --- a/libavcodec/videotoolboxenc.c +++ b

[FFmpeg-devel] [PATCH 2/3] avfilter: add scale_vt for videotoolbox pix_fmt

2023-07-16 Thread Zhao Zhili
From: Zhao Zhili For example, ./ffmpeg -hwaccel videotoolbox \ -hwaccel_output_format videotoolbox_vld \ -i ios-265.mov \ -c:v hevc_videotoolbox \ -profile:v main \ -b:v 3M \ -vf scale_vt=w=iw/2:h=ih/2:color_matrix=bt709:color_primaries=bt709

[FFmpeg-devel] [PATCH 1/2] avformat/movenc: fix sample size being zero in pcmC

2023-07-25 Thread Zhao Zhili
From: Zhao Zhili bits_per_raw_sample might not set when remux raw PCM. Fix #10433. --- libavformat/movenc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index f1cc80b1b3..7ef6cef46a 100644 --- a/libavformat/movenc.c +++ b

[FFmpeg-devel] [PATCH 2/2] fate/mov: add remux PCM to mp4 test

2023-07-25 Thread Zhao Zhili
From: Zhao Zhili --- tests/fate/mov.mak | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index d795445691..6cb493ceab 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -17,6 +17,7 @@ FATE_MOV = fate-mov-3elist \ fate-mov-bbi

Re: [FFmpeg-devel] [PATCH 1/2] avformat/movenc: fix sample size being zero in pcmC

2023-07-26 Thread Zhao Zhili
> From: ffmpeg-devel On Behalf Of Raphaël > Zumer > Sent: 2023年7月26日 21:38 > To: ffmpeg-devel@ffmpeg.org > Subject: Re: [FFmpeg-devel] [PATCH 1/2] avformat/movenc: fix sample size > being zero in pcmC > > On 7/25/23 23:45, Zhao Zhili wrote: > > From: Zhao Zhili

Re: [FFmpeg-devel] [PATCH] avformat/movenc: Fix writing a sample size of 0 for PCM in MP4

2023-07-26 Thread Zhao Zhili
> -Original Message- > From: ffmpeg-devel On Behalf Of Raphaël > Zumer > Sent: 2023年7月26日 21:20 > To: ffmpeg-devel@ffmpeg.org > Subject: Re: [FFmpeg-devel] [PATCH] avformat/movenc: Fix writing a sample > size of 0 for PCM in MP4 > > Hello, > > On 7/26/23 00:09, "zhilizhao(赵志立)" wrote

[FFmpeg-devel] [PATCH] avcodec/cuviddec: fix AV1 decoding error

2022-06-23 Thread Zhao Zhili
From: Zhao Zhili Regression from 45e3b6a68. cuvidParseVideoData report unknown error with AV1CodecConfigurationRecord. --- libavcodec/cuviddec.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c index cb3cda7e24..584fff40ed 100644

[FFmpeg-devel] [PATCH] avcodec/cuviddec: fix AV1 decoding error

2022-06-23 Thread Zhao Zhili
From: Zhao Zhili cuvidParseVideoData only supports pure OBUs, it report unknown error with AV1CodecConfigurationRecord. Check whether extradata is AV1CodecConfigurationRecord and skip the first 4 bytes to fix the issue. The bug is revealed in ffmpeg cmd since 45e3b6a68 and ffd1316e

[FFmpeg-devel] [PATCH 1/2] avcodec/cuviddec: fix null pointer dereference

2022-06-24 Thread Zhao Zhili
From: Zhao Zhili It can happened on error path of cuvid_decode_init(). --- libavcodec/cuviddec.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c index fc9c0515fe..2f6bbdc7d8 100644 --- a/libavcodec/cuviddec.c +++ b

[FFmpeg-devel] [PATCH 2/2] avcodec/cuviddec: reindent after previous commit

2022-06-24 Thread Zhao Zhili
From: Zhao Zhili --- libavcodec/cuviddec.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c index 2f6bbdc7d8..3e29cde83b 100644 --- a/libavcodec/cuviddec.c +++ b/libavcodec/cuviddec.c @@ -662,15 +662,15 @@ static

[FFmpeg-devel] [PATCH] avcodec/libdavs2: workaround memory leak

2022-06-27 Thread Zhao Zhili
n/common.h:1240 #2 0x563af9765ef3 in davs2_alloc_picture davs2/source/common/header.cc:815 Signed-off-by: Zhao Zhili --- libavcodec/libdavs2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index d7625718a2..c2040775ae 100644 --- a/libavcodec/l

[FFmpeg-devel] [PATCH] avcodec/apedec: fix prediction

2022-06-30 Thread Zhao Zhili
From: Zhao Zhili Fixes ticket #9816. Regression since ed0001482a74b60f3d5bc5. Prediction value larger than INT32_MAX should be treated as negative. The code already depends on undefined right shift behavior before the patch, which doesn't get fixed by the patch. Signed-off-by: Zhao

[FFmpeg-devel] [PATCH v2] avcodec/apedec: fix prediction

2022-06-30 Thread Zhao Zhili
From: Zhao Zhili Regression since ed0001482a74b60f3d5bc5. Tested with: ./ffmpeg -i foo.ape -f md5 - for samples in #9816 and #2239. It gives the same result as before ed0001482a for ticket #9816, and doesn't break ticket #2239. Signed-off-by: Zhao Zhili --- libavcodec/apedec.c | 2

[FFmpeg-devel] [PATCH] avformat/mov: discard data streams with all zero sample_delta

2022-07-05 Thread Zhao Zhili
From: Zhao Zhili Streams with all zero sample_delta in 'stts' have all zero dts. They have higher chance be chose by mov_find_next_sample(), which leads to seek again and again. For example, GoPro created a 'GoPro SOS' stream: Stream #0:4[0x5](eng): Data: none (fdsc /

[FFmpeg-devel] [PATCH v2] avformat/mov: discard data streams with all zero sample_delta

2022-07-06 Thread Zhao Zhili
From: Zhao Zhili Streams with all zero sample_delta in 'stts' have all zero dts. They have higher chance be chose by mov_find_next_sample(), which leads to seek again and again. For example, GoPro created a 'GoPro SOS' stream: Stream #0:4[0x5](eng): Data: none (fdsc /

[FFmpeg-devel] [PATCH v3] avformat/mov: discard data streams with all zero sample_delta

2022-07-06 Thread Zhao Zhili
From: Zhao Zhili Streams with all zero sample_delta in 'stts' have all zero dts. They have higher chance be chose by mov_find_next_sample(), which leads to seek again and again. For example, GoPro created a 'GoPro SOS' stream: Stream #0:4[0x5](eng): Data: none (fdsc /

[FFmpeg-devel] [PATCH 2/2] avformat/flvdec: make key frame timestamps more accurate

2022-07-13 Thread Zhao Zhili
From: Zhao Zhili There is an implicit cast from double to int64_t in time unit of second. --- libavformat/flvdec.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index c5d3c63bd0..a78d720295 100644 --- a

[FFmpeg-devel] [PATCH 1/2] avformat/flvenc: fix timestamp of key frame index

2022-07-13 Thread Zhao Zhili
From: Zhao Zhili Firstly, the timestamps generated from framerate are inaccurate for variable framerate mode. Secondly, the timestamps always start from zero, while pts/dts can start from nonzero. FLV demuxer rejects such index with message: "Found invalid index entries, clearing the

[FFmpeg-devel] [PATCH 3/3] avformat/flvenc: fix shadowed variable ts

2022-07-14 Thread Zhao Zhili
From: Zhao Zhili --- libavformat/flvenc.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 1c4ffb985a..5d574fa790 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -993,12 +993,9 @@ static int

[FFmpeg-devel] [PATCH] avdevice/v4l2: fix leak of timefilter

2022-07-26 Thread Zhao Zhili
From: Zhao Zhili Fixes ticket #9844. --- I don't have a camera for test. So I'm not sure if it's the only case of memleak in ticket #9844. libavdevice/v4l2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 5340382d57..be422d7c

[FFmpeg-devel] [PATCH v2 0/3] avformat/flv: fix timestamps of key frame index

2022-07-28 Thread Zhao Zhili
From: Zhao Zhili v2: Simplify patch 2/3 as Michael's suggestion. Zhao Zhili (3): avformat/flvenc: fix timestamp of key frame index avformat/flvdec: make key frame timestamps more accurate avformat/flvenc: fix shadowed variable ts libavformat/flvdec.c

[FFmpeg-devel] [PATCH v2 1/3] avformat/flvenc: fix timestamp of key frame index

2022-07-28 Thread Zhao Zhili
From: Zhao Zhili Firstly, the timestamps generated from framerate are inaccurate for variable framerate mode. Secondly, the timestamps always start from zero, while pts/dts can start from nonzero. FLV demuxer rejects such index with message: "Found invalid index entries, clearing the

[FFmpeg-devel] [PATCH v2 3/3] avformat/flvenc: fix shadowed variable ts

2022-07-28 Thread Zhao Zhili
From: Zhao Zhili --- libavformat/flvenc.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 1c4ffb985a..5d574fa790 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -993,12 +993,9 @@ static int

[FFmpeg-devel] [PATCH v2 2/3] avformat/flvdec: make key frame timestamps more accurate

2022-07-28 Thread Zhao Zhili
From: Zhao Zhili There was an implicit cast from double to int64_t in time unit of second. --- libavformat/flvdec.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 8dba92661b..10f0ea7736 100644 --- a/libavformat

[FFmpeg-devel] [PATCH 1/2] avformat/mov: fix frag_index.current out of sync

2022-07-30 Thread Zhao Zhili
From: Zhao Zhili frag_index.current is used by cenc_filter, and is updated inside mov_read_moof. It can out of sync regarding to mov_read_packet. Partly fix ticket #9807. --- libavformat/mov.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a

[FFmpeg-devel] [PATCH 2/2] avformat/mov: fix encryption index in the case of multiple trun

2022-07-30 Thread Zhao Zhili
From: Zhao Zhili frag_stream_info->index_entry isn't the first sample/trun index. cenc.frag_index_entry_base failed to catch the case since current_index > 0. Fix ticket #9807. --- libavformat/isom.h | 3 ++- libavformat/mov.c | 10 ++ 2 files changed, 8 insertions(+),

[FFmpeg-devel] [PATCH] avutil/hwcontext_videotoolbox: add missing include for AVFrame

2022-08-04 Thread Zhao Zhili
From: Zhao Zhili Signed-off-by: Zhao Zhili --- libavutil/hwcontext_videotoolbox.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/hwcontext_videotoolbox.h b/libavutil/hwcontext_videotoolbox.h index b6bdcf243d..25dde85df5 100644 --- a/libavutil/hwcontext_videotoolbox.h +++ b

Re: [FFmpeg-devel] [PATCH v2] mov: Compare frag times in correct time base when seeking a stream without a corresponding sidx

2022-08-13 Thread Zhao Zhili
On Fri, 2022-08-12 at 16:22 +0100, Derek Buitenhuis wrote: > On 8/9/2022 10:38 AM, "zhilizhao(赵志立)" wrote: > > It’s suspicious to return a timestamp with unknown timebase. > > Would you suggest erroring in the case where there's no frag_stream? > That could > make sense. Or just continue the loop

Re: [FFmpeg-devel] [PATCH v3] mov: Compare frag times in correct time base when seeking a stream without a corresponding sidx

2022-08-16 Thread Zhao Zhili
> -Original Message- > From: ffmpeg-devel-boun...@ffmpeg.org On > Behalf Of Derek Buitenhuis > Sent: 2022年8月16日 22:49 > To: ffmpeg-devel@ffmpeg.org > Subject: [FFmpeg-devel] [PATCH v3] mov: Compare frag times in correct time > base when seeking a stream without a corresponding sidx >

Re: [FFmpeg-devel] [PATCH v3] mov: Compare frag times in correct time base when seeking a stream without a corresponding sidx

2022-08-16 Thread Zhao Zhili
On Tue, 2022-08-16 at 17:32 +0100, Derek Buitenhuis wrote: > On 8/16/2022 5:21 PM, Zhao Zhili wrote: > > get_frag_time() can be called with an mp4 file which has no sidx at > > all. In that case, > > dst_st should have a higher priority than other streams, even if >

[FFmpeg-devel] [PATCH] avutil/mem: fix doc for reallocs

2022-04-01 Thread Zhao Zhili
The doc says those function are like av_free if size or nmemb is zero. It doesn't match the code. av_realloc() realloc one byte if size is zero, which was added by 91ff05f6ac5 ten years ago. realloc() itself in C is implementation-dependent. Make the doc match the longstanding behaviour. --- libav

Re: [FFmpeg-devel] [PATCH] libavformat/rtsp: pkt_size option is not honored in rtsp

2022-04-06 Thread Zhao Zhili
> 在 2022年4月6日,下午9:49,Yubo Xie 写道: > > Yes, I've removed it already. Sorry I missed that. LGTM. > > From: ffmpeg-devel on behalf of > "zhilizhao(赵志立)" > Sent: Wednesday, April 6, 2022 6:28 AM > To: FFmpeg development discussions and patches > Subject: Re: [

[FFmpeg-devel] [PATCH 01/10] avformat/hls: fix repeated requests for media init section

2022-04-12 Thread Zhao Zhili
--- libavformat/hls.c | 59 --- 1 file changed, 40 insertions(+), 19 deletions(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index 83ff4cc607..67c9650e0b 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -407,48 +407,65 @@ struct init_se

[FFmpeg-devel] [PATCH 03/10] avformat/hls: extract free_playlist method

2022-04-12 Thread Zhao Zhili
--- libavformat/hls.c | 43 --- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index e249810bce..ecb6237d2e 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -253,30 +253,35 @@ static void free_i

[FFmpeg-devel] [PATCH 02/10] avformat/hls: fix leak of init section when dynarray_add fail

2022-04-12 Thread Zhao Zhili
When av_dynarray_add failed, pls->init_sections will be freed, which leads to leak of all entries of pls->init_sections. --- libavformat/hls.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index 67c9650e0b..e249810bce 100644 --- a/

[FFmpeg-devel] [PATCH 04/10] avformat/hls: fix leak of playlist when dynarray_add fail

2022-04-12 Thread Zhao Zhili
--- libavformat/hls.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index ecb6237d2e..d5c3009d07 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -330,7 +330,10 @@ static struct playlist *new_playlist(HLSContext *c, const ch

[FFmpeg-devel] [PATCH 06/10] avformat/hls: fix leak of rendition when dynarray_add fail

2022-04-12 Thread Zhao Zhili
--- libavformat/hls.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index b5cdf158c6..3ed6007d0d 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -556,7 +556,10 @@ static struct rendition *new_rendition(HLSConte

[FFmpeg-devel] [PATCH 05/10] avformat/hls: fix leak of variant when dynarray_add fail

2022-04-12 Thread Zhao Zhili
--- libavformat/hls.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index d5c3009d07..b5cdf158c6 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -366,8 +366,16 @@ static struct variant *new_variant(HLSContext *c, s

[FFmpeg-devel] [PATCH 07/10] avformat/hls: extract free_segment method

2022-04-12 Thread Zhao Zhili
--- libavformat/hls.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index 3ed6007d0d..65937120d5 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -225,13 +225,18 @@ typedef struct HLSContext { HLSCryptoContext c

[FFmpeg-devel] [PATCH 08/10] avformat/hls: fix leak of segments when dynarray_add fail

2022-04-12 Thread Zhao Zhili
--- libavformat/hls.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index 65937120d5..b9e2e8a04d 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -1024,7 +1024,12 @@ static int parse_playlist(HLSContext *c, const char *url,

[FFmpeg-devel] [PATCH 09/10] avformat/hls: do error check in add_renditions_to_variant

2022-04-12 Thread Zhao Zhili
--- libavformat/hls.c | 49 +-- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index b9e2e8a04d..c102e36f52 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -1666,9 +1666,10 @@ reload:

[FFmpeg-devel] [PATCH 10/10] avformat/hls: check dynarray_add error when add stream

2022-04-12 Thread Zhao Zhili
--- libavformat/hls.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index c102e36f52..4ab565f8e0 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -1882,7 +1882,10 @@ static int update_streams_from_subdemuxer(AVFormatContext

[FFmpeg-devel] [PATCH RFC] avformat/hls: check IV size inside EXT-X-KEY

2022-04-12 Thread Zhao Zhili
IV should always be 128 bits. If the IV attribute was truncated inside EXT-X-KEY, padding on the left which is the same as when using sequence number as IV. --- I'm not sure which method is better: do padding or just return AVERROR_INVALIDDATA? libavformat/hls.c | 8 +++- 1 file changed, 7 in

[FFmpeg-devel] [PATCH v2] avformat/hls: check IV size inside EXT-X-KEY

2022-04-13 Thread Zhao Zhili
Before the patch, an implicit padding on the right is applied for incomplete IV in manifest. No padding is allowed for IV inside EXT-X-KEY. --- libavformat/hls.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index 83ff4cc607..312294

[FFmpeg-devel] [PATCH] avformat/mov: skip call ff_codec_get_id if possible

2022-04-18 Thread Zhao Zhili
ff_codec_get_id loops over ff_codec_movvideo_tags (which is a large array) two times. The result is unused most of the cases. --- libavformat/mov.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 6c847de164..bdc8c84bae 100644 --- a

[FFmpeg-devel] [PATCH 1/3] avformat/mov: remove an always true condition

2022-04-26 Thread Zhao Zhili
--- libavformat/mov.c | 4 1 file changed, 4 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 26aeeaea0c..6116078b1a 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -7693,9 +7693,6 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)

[FFmpeg-devel] [PATCH 3/3] avformat/mov: fix use invalid box size/type due to eof

2022-04-26 Thread Zhao Zhili
--- libavformat/mov.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index e948c6cd0f..429f9fcbf7 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -7691,10 +7691,12 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb

[FFmpeg-devel] [PATCH 2/3] avformat/mov: reindent after previous commit

2022-04-26 Thread Zhao Zhili
--- libavformat/mov.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 6116078b1a..e948c6cd0f 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -7693,12 +7693,12 @@ static int mov_read

[FFmpeg-devel] [PATCH] avcodec/libuavs3d: fix access uninitialized variable when draining

2022-05-12 Thread Zhao Zhili
buf_ptr is uninitialized and accessed when function return. --- libavcodec/libuavs3d.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/libuavs3d.c b/libavcodec/libuavs3d.c index 6966e00b62..23de4c8cd5 100644 --- a/libavcodec/libuavs3d.c +++ b/libavcodec/libuavs3d.c

[FFmpeg-devel] [PATCH] avcodec/amfenc: add query_timeout option for h264/hevc

2022-05-12 Thread Zhao Zhili
From: 21pages Signed-off-by: 21pages Co-authored-by: Zhao Zhili --- libavcodec/amfenc.h | 1 + libavcodec/amfenc_h264.c | 4 libavcodec/amfenc_hevc.c | 4 libavcodec/version.h | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libavcodec/amfenc.h b

[FFmpeg-devel] [PATCH v2] avcodec/amfenc: add query_timeout option for h264/hevc

2022-05-12 Thread Zhao Zhili
From: 21pages Signed-off-by: 21pages Co-authored-by: Zhao Zhili --- v2: fix range libavcodec/amfenc.h | 1 + libavcodec/amfenc_h264.c | 4 libavcodec/amfenc_hevc.c | 4 libavcodec/version.h | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libavcodec

[FFmpeg-devel] [PATCH 2/3] avcodec/libuavs3d: use output_reorder_delay as has_b_frames

2022-05-13 Thread Zhao Zhili
has_b_frames is more than a bool, it's the size of the frame reordering buffer in the decoder. --- libavcodec/libuavs3d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libuavs3d.c b/libavcodec/libuavs3d.c index 23de4c8cd5..e911963a41 100644 --- a/libavcodec/libuavs

[FFmpeg-devel] [PATCH 1/3] avcodec/avs3_parser: set has_b_frames properly

2022-05-13 Thread Zhao Zhili
has_b_frames should be output_reorder_delay field in AVS3 sequence header and larger than 1. The parser implementation doesn't parse that field. Decoder can set has_b_frames properly, so use FFMAX here to avoid resetting has_b_frames from output_reorder_delay to 1. --- libavcodec/avs3_parser.c | 2

[FFmpeg-devel] [PATCH 3/3] avcodec/libdavs2: export has_b_frames info

2022-05-13 Thread Zhao Zhili
More precisely, we should use picture_reorder_delay, but it's unavailable yet. --- libavcodec/libdavs2.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index a47027d300..bc31745a4f 100644 --- a/libavcodec/libdavs2.c +++ b/libavcodec/libdavs2

[FFmpeg-devel] [PATCH v2 1/3] avcodec/avs3_parser: set has_b_frames properly

2022-05-13 Thread Zhao Zhili
has_b_frames should be output_reorder_delay field in AVS3 sequence header and larger than 1. The parser implementation doesn't parse that field. Decoder can set has_b_frames properly, so use FFMAX here to avoid resetting has_b_frames from output_reorder_delay to 1. --- libavcodec/avs3_parser.c | 5

[FFmpeg-devel] [PATCH 2/2] avformat/movenc: enable btrt for mov mode

2022-05-30 Thread Zhao Zhili
Signed-off-by: Zhao Zhili --- libavformat/movenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index c2dc354ed3..69726d93e3 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -6897,7 +6897,7 @@ static int mov_init

[FFmpeg-devel] [PATCH 1/2] avformat/movenc: enable compressorname for mp4 mode

2022-05-30 Thread Zhao Zhili
Signed-off-by: Zhao Zhili --- libavformat/movenc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index de971f94e8..c2dc354ed3 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2121,7 +2121,9 @@ static void

[FFmpeg-devel] [PATCH] avcodec/proresdec2: fix description of known fourcc

2022-05-30 Thread Zhao Zhili
'acpo' should be 'apco', and add missing 'ap4x'. Signed-off-by: Zhao Zhili --- libavcodec/proresdec2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index dba64a2489..385ca2fb1c 100644 --- a

[FFmpeg-devel] [PATCH] avcodec/libuavs3d: fix potential index out of range

2022-06-02 Thread Zhao Zhili
Signed-off-by: Zhao Zhili --- libavcodec/libuavs3d.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/libuavs3d.c b/libavcodec/libuavs3d.c index e911963a41..7c6c3f0440 100644 --- a/libavcodec/libuavs3d.c +++ b/libavcodec/libuavs3d.c @@ -84,13 +84,13

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

2022-06-10 Thread Zhao Zhili
Including video resolution, framerate and picture type, etc. Signed-off-by: Zhao Zhili --- libavcodec/avs2.h| 27 ++ libavcodec/avs2_parser.c | 103 +++ 2 files changed, 130 insertions(+) diff --git a/libavcodec/avs2.h b/libavcodec/avs2.h

[FFmpeg-devel] [PATCH 2/3] avcodec/avs2_parser: split data into frames

2022-06-10 Thread Zhao Zhili
From: Zhao Zhili Before the patch, the parser split data into units, not frames. Signed-off-by: Zhao Zhili --- libavcodec/avs2.h| 2 +- libavcodec/avs2_parser.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/avs2.h b/libavcodec/avs2.h index

[FFmpeg-devel] [PATCH 1/3] avcodec/avs2: add AVS2 related definitions

2022-06-10 Thread Zhao Zhili
Replace magic numbers by enum values. Signed-off-by: Zhao Zhili --- libavcodec/avs2.h| 41 libavcodec/avs2_parser.c | 6 +- 2 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 libavcodec/avs2.h diff --git a/libavcodec/avs2

[FFmpeg-devel] [PATCH v2] avformat/movenc: enable compressorname for mp4 mode

2022-06-12 Thread Zhao Zhili
Signed-off-by: Zhao Zhili --- v2: update fate test libavformat/movenc.c | 5 +++-- tests/ref/lavf/mp4 | 6 +++--- tests/ref/vsynth/vsynth1-mpeg4 | 2 +- tests/ref/vsynth/vsynth2-mpeg4 | 2 +- tests/ref/vsynth/vsynth3-mpeg4 | 2 +- tests/ref/vsynth

[FFmpeg-devel] [PATCH v2 3/3] avcodec/avs2_parser: parse more info

2022-06-12 Thread Zhao Zhili
Including video resolution, framerate and picture type, etc. Signed-off-by: Zhao Zhili --- v2: fix unused variable warning libavcodec/avs2.h| 27 ++ libavcodec/avs2_parser.c | 103 +++ 2 files changed, 130 insertions(+) diff --git a

[FFmpeg-devel] [PATCH v3 1/5] avcodec/avs2: add AVS2 related definitions

2022-06-12 Thread Zhao Zhili
Replace magic numbers by enum values. Signed-off-by: Zhao Zhili --- libavcodec/avs2.h| 41 libavcodec/avs2_parser.c | 6 +- 2 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 libavcodec/avs2.h diff --git a/libavcodec/avs2

[FFmpeg-devel] [PATCH v3 2/5] avcodec/avs2_parser: split data into frames

2022-06-12 Thread Zhao Zhili
Before the patch, the parser split data into units, not frames. Signed-off-by: Zhao Zhili --- libavcodec/avs2.h| 2 +- libavcodec/avs2_parser.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/avs2.h b/libavcodec/avs2.h index 7b66f51998..f342ba52a0

[FFmpeg-devel] [PATCH v3 4/5] configure: select avs2 parser for libdavs2 decoder

2022-06-12 Thread Zhao Zhili
Signed-off-by: Zhao Zhili --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 3dca1c4bd3..3b60fde733 100755 --- a/configure +++ b/configure @@ -3324,6 +3324,7 @@ libcodec2_encoder_deps="libcodec2" libdav1d_decoder_deps

<    5   6   7   8   9   10   11   12   13   14   >