1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00
Commit Graph

118440 Commits

Author SHA1 Message Date
cef3422b48 avformat/hls: Fix twitter
Allow mp4 with all mpegts extensions

Fixes: Ticket11435
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-06 22:04:11 +01:00
c17774a9ae avformat/mov: fix eof check in mov_read_iinf()
This fix ensures that the loop stops early on EOF. The issue occurs
because mov_read_infe() performs a version check and skips unsupported
versions. The problem is that seeking within the stream clears the EOF
flag, causing avio_feof() to not function as expected. This is resolved
by moving the EOF check after reading the size and type, ensuring the
EOF flag is set when necessary.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-06 22:04:11 +01:00
4d9cdf82ee doc/t2h: Support texinfo 7.1 and 7.2 pretest
Here is a proposed patch for portability of doc/t2h.pm for GNU Texinfo
7.1 and 7.1.90 (7.2 pretest).  I tested against 7.1 and 7.1.90 (7.2
pretest).  There is a difference in the headings compared to the website
version, maybe related to FA_ICONS not being set the same, but the
result seems correct.

I also renamed $element to $output_unit in ffmpeg_heading_command as in
new equivalent makeinfo/texi2any code the $element variable is the
$command variable in ffmpeg_heading_command, which is very confusing.  I
left as is the $command variable to have a patch easier to read, but it
could make sense to rename $command as $element later on.

The patch could also have effects with Texinfo 7.0, since some of the
changes are for that version, but that probably never show up because it
is for situations that may not exist in ffmpeg manuals (for example
@node without sectioning command), or because the code is robust to some
missing information (case of $heading_level in ffmpeg_heading_command
that was not set, as far as I can tell).

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-06 18:00:34 -03:00
d1fa9cf4b4 avfilter/drawtext: fix memory leak when using "reinit" runtime command
Free AVOption in drawtext private context when freeing old copy of drawtext
private context during processing of "reinit" runtime command.

Signed-off-by: Steven Zhou <steven.zhou@netint.ca>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-06 17:41:12 -03:00
19045957af avcodec/ffv1enc_vulkan: add missing arguent to ff_ffv1_common_init()
Missed in 3d3ce9647f.

Found-by: kasper93
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-06 17:03:25 -03:00
dc9e0ca447 fate/libswresample: add a test downmixing with a custom order layout
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-06 13:51:23 -03:00
e504247db6 avcodec: add a ffv1 parser
Only setting frame and stream properties. No packetization is performed.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-06 13:48:47 -03:00
3d3ce9647f avcodec/ffv1: split off and share frame header parsing code
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-06 13:46:58 -03:00
6da82b4485 avfilter/xpsnr: avoid division by zero
The ref input may have its frame rate unset, which would then lead to
SIGFPE. So fall back to the main link frame rate. If that too is unset,
default to 0.

Related to #11428
2025-02-06 16:06:20 +05:30
779a3187a8 ffv1dec: fix threaded decode failures
Fixes 7187eadf8c

The issue is that while avctx->pix_fmt is synchronized between
threads, f->pix_fmt was not.

Fixes fate-vsynth1-ffv1-2pass10 with THREADS=2.
2025-02-06 06:57:07 +01:00
9729444c7d lavf/mxfenc: Return AVERROR(EINVAL) in mxf_write_jpeg2000_subdesc() is pixfmt not set 2025-02-05 15:48:22 +01:00
0202c7cc2e lavf/mxfenc: Make write_desc return int
This enables returning AVERRORs
2025-02-05 15:48:22 +01:00
b9c99baced libswresample/rematrix: add support for custom order channel layouts
Limited to the same channels as a native layout, but not constrained by channel ordering.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-05 09:51:08 -03:00
e52701d173 swresample/rematrix: split filling the matrix array into its own function
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-04 23:21:07 -03:00
33679f5325 avcodec/vvc/refs: fix negative pps_scaling_win offsets
The spec seems to allow these to  be negative

Fixes: left shift of negative value -15
Fixes: 392687035/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-6559804532785152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Frank Plowman <post@frankplowman.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-05 01:35:57 +01:00
a750bcb237 avfilter/Makefile: add missing SKIPHEADERS for AMF
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-04 16:35:06 -03:00
84ad9146e2 avutil/Makefile: fix SKIPHEADERS for AMF
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-04 16:34:51 -03:00
1fbe9deee3 avcodec/nvenc: add support for writing mastering metadata SEI messages
Including Mastering Display and Content Light Level.
Requires SDK 13.0, and only supports HEVC and AV1.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-04 14:28:19 -03:00
a8595dae0f doc/ffmpeg: update example command line for IAMF muxing
Missed in 8f6a1a06a6.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-04 13:48:11 -03:00
873204e6e4 avcodec/nvenc: add compile time check for outputRecoveryPointSEI for HEVC
Fixes compilation when using API headers older than 12.0

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-04 10:39:27 -03:00
4307008b9a avformat/matroskaenc: log unsupported subtitle codec name
It's more user friendly than codec ID.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Marth64 <marth64@proxyid.net>
2025-02-04 13:42:43 +08:00
88a8ba5c99 avcodec/amfenc: redesign to use hwcontext_amf.
Co-authored-by: Evgeny Pavlov <lucenticus@gmail.com>
v3: cleanup code
2025-02-04 00:14:14 +01:00
1f94cc4588 doc/filters: Add documentation for AMF filters
Signed-off-by: Evgeny Pavlov <lucenticus@gmail.com>
2025-02-04 00:14:14 +01:00
4b77a0a681 avfilter/scale_amf: Add AMF VPP & super resolution filters
This commit adds two AMF filters: vpp_amf & sr_amf.
Both filters are using AMF hardware acceleration.
vpp_amf supports simple scaling algorithms & color conversion.
sr_amf supports advanced scaling algorithms such as FSR & can
be used for upscaling only.
2025-02-04 00:14:14 +01:00
fbfde33230 avcodec: add amfdec.
Added AMF based h264, hevc, av1 decoders.
Co-authored-by: Dmitrii Ovchinnikov <ovchinnikov.dmitrii@gmail.com>
v2: added encoder reinitialisation
v3: use AMF_SURFACE_UNKNOWN to int decoder(ctx->output_format before)
2025-02-04 00:14:14 +01:00
9e7242579e avutil: add hwcontext_amf.
Adds  hwcontext_amf, enabling a shared AMF context for encoders,
decoders, and AMF-based filters, without copy to the host memory.
Code also was tested in HandBrake.

Benefits:
 - Optimizations for direct video memory access from CPU
 - Significant performance boost in full AMF pipelines with filters
 - Integration of GPU filters like VPP, Super Resolution, and
    Compression Artefact Removal(in future plans)
 - VCN power management control for decoders.
 - Ability to specify which VCN instance to use for decoding
   (like for encoder)
 - AMD will soon introduce full AMF API for multimedia accelerator MA35D
   - With AMF API, integration will be much easier:
      GPU and the accelerator will have the same API
   - including encoder, decoder, scaler, color converter,
      Windows and Linux.
   Learn more:
      https://www.amd.com/en/products/accelerators/alveo/ma35d.html

Changes by versions:
v2: Header file cleanup.
v3: Removed an unnecessary class.
v4: code cleanup and improved error handling
v5: Fixes related to HandBrake integration.
v6: Sequential filters error and memory leak have been fixed.
2025-02-04 00:14:14 +01:00
1c5961e4b4 avformat/seek: Remove always true condition
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2025-02-04 01:24:23 +08:00
ef3ffd8c5c avformat/seek: Remove dead code
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Marth64 <marth64@proxyid.net>
2025-02-04 01:22:57 +08:00
1438f6997d avcodec/nvenc: Enable recovery point SEI for intra refresh mode
Otherwise all frames can be dropped after seek without the
output_corrupt/showall flags.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-04 01:21:26 +08:00
4a0e1cfc6f avcodec/speexdec: fix frame_size for mode == 2
Should match the non-extradata path now, and fix ticket #11078.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-03 13:23:30 -03:00
49726a922f avfilter/vf_scale: remove global side data when it no longer applies after scaling
Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-03 11:05:59 -03:00
db7ff13574 avfilter/avfilter: remove accidental loop index variable reset
Fixes ticket #11442.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-02-03 11:05:59 -03:00
59f9dbaa31 swscale/x86/rgb2rgb: add AVX512ICL versions of shuffle_bytes
On a AMD 7950x Zen 4

shuffle_bytes_0321_c:                                   56.5 ( 1.00x)
shuffle_bytes_0321_ssse3:                               15.2 ( 3.70x)
shuffle_bytes_0321_avx2:                                10.2 ( 5.51x)
shuffle_bytes_0321_avx512icl:                            9.2 ( 6.11x)
shuffle_bytes_1230_c:                                   84.5 ( 1.00x)
shuffle_bytes_1230_ssse3:                               14.2 ( 5.93x)
shuffle_bytes_1230_avx2:                                15.2 ( 5.54x)
shuffle_bytes_1230_avx512icl:                           11.2 ( 7.51x)
shuffle_bytes_2103_c:                                   48.5 ( 1.00x)
shuffle_bytes_2103_ssse3:                               21.2 ( 2.28x)
shuffle_bytes_2103_avx2:                                13.8 ( 3.53x)
shuffle_bytes_2103_avx512icl:                            9.2 ( 5.24x)
shuffle_bytes_3012_c:                                   84.5 ( 1.00x)
shuffle_bytes_3012_ssse3:                               14.2 ( 5.93x)
shuffle_bytes_3012_avx2:                                16.2 ( 5.20x)
shuffle_bytes_3012_avx512icl:                           10.2 ( 8.24x)
shuffle_bytes_3210_c:                                   89.2 ( 1.00x)
shuffle_bytes_3210_ssse3:                               24.2 ( 3.68x)
shuffle_bytes_3210_avx2:                                16.2 ( 5.49x)
shuffle_bytes_3210_avx512icl:                            9.2 ( 9.65x)

Signed-off-by: Shreesh Adiga <16567adigashreesh@gmail.com>
2025-02-03 10:16:44 -03:00
957eb2323a avcodec/h264dec: make slice header parse errors fatal under AV_EF_EXPLODE
This fixes timeout issues and seems like it was intended
since the line emits an error log.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Marth64 <marth64@proxyid.net>
2025-02-02 21:38:19 -06:00
33daef5f49 avcodec/mpeg12dec: rename 0x0502 CC format
The format is used by at least Dish Network, but is not
defined in any DVB standard, so remove references to DVB.

This is a simple rename, no functional change.

Signed-off-by: Marth64 <marth64@proxyid.net>
2025-02-02 21:38:19 -06:00
b37606e562 avcodec/nvenc: finalize SDK 13.0 support 2025-02-02 20:02:16 +01:00
89b37b4dcb avcodec/nvenc: use encoder level options for qmin/qmax
AV1 uses a vastly different range than what the global options permit,
and also for the other codecs the range of the global options is at
least misaligned.

Fixes #11365
2025-02-02 20:02:16 +01:00
a583f7e2fd avcodec/nvenc: add Temporal Filtering for AV1 and H.264 in NVENC
This commit extends the support for Temporal Filtering in NVENC for
AV1 and H.264 codecs. For natural videos with noise, NVENC temporal
filtering improves video coding efficiency by 4-5%.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-02 20:02:12 +01:00
ed80e55586 avcodec/nvenc: add UHQ to AV1 for NVENC
This commit adds support for Ultra High Quality mode for AV1 on
NVIDIA GPUs.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-02 20:02:08 +01:00
2cfef29f97 avcodec/nvenc: add 4:2:2 encoding and H.264 10-bit support
This commit adds support for 4:2:2 encoding for HEVC and H.264 on
NVIDIA Blackwell GPUs. Additionally, it supports 10-bit encoding
for H.264 on Blackwell GPUs.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-02 20:02:04 +01:00
7e9655800d avcodec/cuviddec: add HEVC/H.264 4:2:2 and H.264 10-bit support
This commit adds support for 4:2:2 decoding for HEVC and H.264 on
NVIDIA Blackwell GPUs for cuviddec. Moreover, it supports 10-bit
decoding for H.264 on Blackwell GPUs.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-02 20:02:00 +01:00
30e6effff9 avcodec/nvdec: add 4:2:2 decoding and 10-bit support
This commit adds support for 4:2:2 decoding for HEVC and H.264 on
NVIDIA Blackwell GPUs. Additionally, it supports 10-bit decoding
for H.264 on Blackwell GPUs.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-02 20:01:56 +01:00
7454a07d58 avutil/hwcontext_cuda: add 4:2:2 pixel format support
This commit adds support for 4:2:2 pixel formats, namely NV16 and
P216 for NVIDIA GPUs.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-02-02 20:01:51 +01:00
452d6738b5 fftools/ffmpeg_opt: Remove audio_drift_threshold
Forgotten in 5a04aae821.

Reviewed-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-02 17:03:32 +01:00
10047fea1c avutil/cpu: Disable ff_getauxval() on x86
Not used there.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-02 17:03:20 +01:00
4afe61ea6c swscale/x86/swscale: Make M24 variables static
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-02 17:03:13 +01:00
3797e9239e swscale/x86/swscale: Move some constants to rgb2rgb.c
ff_w1111 and ff_bgr2(Y|UV)Offset are only used there
(and only on x86-32 since caaec2ea95).
Also make them static.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-02-02 17:00:07 +01:00
0113e30806 libavformat/hls: Be more restrictive on mpegts extensions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-02 02:42:03 +01:00
9e12572933 avformat/hls: .ts is always ok even if its a mov/mp4
Maybe fixes: 11435

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-02-02 02:42:02 +01:00
9b5a4c0aea avcodec/libxvid: add check for invalid intra/inter matrix values
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-02-01 21:10:20 +01:00