Commit Graph
9655 Commits
Author SHA1 Message Date
StachowiakDawid c182b1c09c Add new mode to mpdecimate video filter 2026-07-20 17:49:47 +00:00
Romain Beauxis b0c702aec2 libavformat/id3v2: deprecate legacy COMM descriptor-as-key behavior 2026-07-18 09:59:57 -05:00
Timo RothenpielerandDiego de Souza ef3dcf4ea6 avutil/hwcontext_cuda: add CUarray surface pool support
Extend the internal CUDA frames context (CUDAFramesContext) to manage
block-linear CUarray surfaces alongside the existing pitched-linear
allocations.

When the frames context format is AV_PIX_FMT_CUARRAY, the caller
(e.g. NVDEC) can fill cuarray_desc and cuarray_num_surfaces before
calling av_hwframe_ctx_init(), which then allocates the CUarray
surfaces.

Also add cuda_transfer_data_from_cuarray() to support hwdownload
from CUarray frames to host memory via cuMemcpy2DAsync.

Co-authored-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
2026-07-14 19:45:02 +00:00
Diego de Souza c7546ce0ea avutil/pixfmt: add AV_PIX_FMT_CUARRAY for opaque CUDA block-linear surfaces
Add a new hardware pixel format representing opaque block-linear CUDA
arrays (CUarray). This format is used by NVDEC when decoding into
opaque surfaces registered with cuvidRegisterDecodeSurfaces, and can
be consumed directly by NVENC as CUDA array input without requiring
a pitch-linear copy.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
2026-07-14 19:45:02 +00:00
Michael NiedermayerandFable-5 cff4a69294 avfilter: add latticepal filter
Convert packed 24/32-bit RGB/BGR/RGBA/BGRA input to PAL8 using a per-frame palette
whose colors are placed on a face-centered cubic lattice (realized as the
scaled D3/D4 checkerboard lattice), with a user-supplied density controlling
the number of lattice steps spanning one color axis.

Only lattice points actually used by a frame enter its palette; if a frame
needs more than 256 of them, the filter will itearatively drop palettte
entries and reassign affected pixels until 256 color remain

lookup uses the Conway-Sloane rounding algorithm. Supported dithering
modes: none, ordered 8x8 bayer (swscale), Cluster & Void blue noise and
Floyd-Steinberg error diffusion.

Co-Authored-by: Fable-5
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-13 18:16:18 +00:00
Araz Iusubov fc4b523596 avfilter/vf_vqe_amf: Add AMF Video Quality Enhancer filter 2026-07-13 16:40:41 +00:00
Michael Niedermayer 01a9a98f35 doc/developer.texi: update reviews section
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-13 16:13:47 +00:00
Michael Niedermayer 0c29cabc97 doc/infra.txt: add fairy 2026-07-13 16:13:47 +00:00
Lynne 92f2e6374d configure: remove libshaderc and libglslang support
All of it is now gone.
2026-07-13 18:57:38 +09:00
Lynne aa6aa4ec3e swscale: remove GLSL backend
No longer needed. The SPIR-V version is pretty clean and neat.
2026-07-13 18:57:37 +09:00
James Almer 7e68fdd4da avutil/frame: add a new side data type for downmix matrix
Signed-off-by: James Almer <jamrial@gmail.com>
2026-07-11 19:32:17 -03:00
James Almer 56e39bd20b avutil/downmix_info: add a new API to propagate pre-made downmix matrixes
Useful for formats where they provide the downmix matrix in the bistream rather
than scale factors for channel groups.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-07-11 19:32:17 -03:00
Romain Beauxis 4641be96e5 fftools/ffmpeg_mux_init.c: delete encoder-specific metadata when re-encoding. 2026-07-11 17:14:43 +00:00
Romain Beauxis 1f24840239 avdevice/alsa: auto-detect channel layout when capturing audio 2026-07-11 08:45:54 -05:00
Vignesh Venkat 7c4e41b54c avcodec: Add itut-t35 metadata as a codec type
Signed-off-by: Vignesh Venkat <vigneshv@google.com>
2026-07-10 01:56:22 +00:00
Philip Langdale 8ad6288553 avfilter/vf_libplacebo: add flag to inherit the input's Vulkan device
vf_libplacebo is unique in that it can function as both a Vulkan filter, and a
software filter, depending on how it the filter graph is configured. While this
is very flexible, it create a problem in situations where the filter does not
receive a Vulkan hw frames context up front. When that doesn't happen, it will
initialise its own standalone pl context, and then fail to interoperate with
a context provided via the input link. This then leads to graph failures.

There are two primary scenarios where this existing logic breaks what should
be valid configurations:
* When the global filter hw device is a cuda device and we use something like
  `hwupload=derive_device=vulkan` to pass frames from cuda to vulkan
* In mpv (and probably other media players) which don't set the global filter
  hw device at all. In this case, it's impossible to configure vf_libplacebo
  to use a hw frames ctx, even if it's using Vulkan for everythng else. This
  prevents the use of vf_libplacebo in any fully hardware accelerated pipeline
  in mpv

There are various ways we could imagine addressing it - such as allowing the
filter to discard the initial pl context and recreating it based on the passed
in device, but it's easier to reason about if we add a flag that explicitly
tells the filter that it should inherit the device context from the input link.
This puts the filter into a mode that works like all the other Vulkan filters.

This requires explicit configuration from the user, but the intent is clearer,
and the user can always know when it's necessary as they define the filter
graph.
2026-07-09 13:25:09 +00:00
James Almer 32a256f619 avcodec: add a graph based bitstream filtering API
Tagged experimental for now, as it may see modifications depending on
requirements.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-07-06 13:26:02 -03:00
Vladimir Panteleev 722493d3e1 vf_photosensitivity: add blend option
This commit attempts to address feedback from this filter's users, by
introducing a new option which controls the amelioration mechanism.

The "blend" option is a factor which is multiplied by the difference
in badness (between the threshold and the currently accumulated
badness). This difference normally controls how much of the next frame
we can let through without making it exceed the badness threshold.

Setting the option to zero effectively puts the filter into a mode
where it always duplicates the last frame (which did not put
accumulated badness over the threshold) instead of attempting to blend
in new frames.  I have received reports that this mode is preferable
to users for some types of media.
2026-07-05 00:41:30 +00:00
marcos ashton 2f779272e0 libavformat/img2enc: add update_filemtime option
Add a new boolean option -update_filemtime to the image2 muxer that
sets each output file's modification time based on the creation_time
metadata plus the frame's PTS offset.

This is useful when extracting frames from dashcam or action camera
footage where wall-clock timestamps should be preserved on the output
files, allowing photo management tools to sort frames by capture time
without post-processing.

The option requires creation_time metadata to be set (via -metadata
creation_time=...). If not present, a warning is logged and the
option is silently disabled. When PTS is unavailable, the creation
time is used as-is without frame offset.

Uses utimes() on POSIX and _utime() on Windows to set file timestamps
with microsecond and second precision respectively.

Includes a FATE roundtrip test that writes frames with a known
creation_time, reads them back using the demuxer's -ts_from_file
option, and verifies the PTS values match the expected timestamps.

Closes: https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/22537
Signed-off-by: marcos ashton <marcosashiglesias@gmail.com>
2026-07-03 19:47:10 +00:00
Niklas Haas aa8fc9f946 avformat/shared: add -retry_corrupt option
Similar to -retry_errors, this retries blocks whose only crime is failing
the CRC self-check.

Sponsored-by: nxtedition AB
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-07-02 14:29:42 +00:00
Andreas Rheinhardt fc7a984aae swscale/graph: Remove ff_sws_graph_create()
Unused since 9fe0ff3d56.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-07-01 05:03:34 +02:00
Zhao Zhili 0a44e7ddc1 avformat: add iTerm2 inline image protocol muxer
Add a muxer that wraps encoded image in the iTerm2 inline image protocol
(OSC 1337) so ffmpeg can play video directly in an iTerm2 terminal. The
output is a self-contained byte stream: it can be played live or saved
to a file and replayed with cat.
2026-06-30 05:08:44 +00:00
Niklas Haas ee2bc31032 avformat/http: imply keep-alive by default when beneficial
By turning it into a tristate that defaults to -1 (auto). Users can still
force a particular value for debugging.

Sponsored-by: nxtedition AB
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-28 12:47:40 +02:00
Bogdan Lisman d26ba5377d doc/muxers: document undocumented segment muxer options
write_header_trailer, individual_header_trailer, segment_header_filename and
segment_wrap_number had no documentation. Describe each option and the ways
they constrain one another.

Signed-off-by: Bogdan Lisman <bogdan@pydevsolutions.com>
2026-06-27 04:03:37 +00:00
Michael Niedermayer b140509940 pre branch Update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-26 02:26:01 +02:00
Michael Niedermayer e0a012d129 doc/developer: bug fixes intended for backporting should stay minimal.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-24 14:15:26 +00:00
Niklas Haas 5d0748243f avfilter/vf_scale_cuda: add use_filters option
This may be faster or slower than the existing specialized kernels,
so I opted not to prefer it by default. I also deliberately didn't expose
additional filter function capabilites yet.

The main motivating reason here is to get correct anti-aliasing behavior
when downscaling, which is currently completely broken.

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-23 19:22:21 +00:00
Andreas Rheinhardt 927ffd0930 fftools/ffmpeg: Remove deprecated -vsync option
Deprecated in commit 09c53a04c5
on 2022-06-11.

Thanks to Michael Niedermayer for pointing out that
the documentation needs to be updated, too.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-06-23 19:15:58 +02:00
Andreas Rheinhardt 762b94e672 libs: Bump major version of all libraries
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-06-23 19:15:57 +02:00
Lynne 61693f6c35 hwcontext_vulkan: switch to VkAccessFlagBits2 2026-06-23 19:15:57 +02:00
Andreas Rheinhardt 191be14fb6 avcodec/packet: Accept const dictionaries in av_packet_pack_dictionary()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-06-23 19:15:57 +02:00
Andreas Rheinhardt 9549c9ad79 avformat/tls: Remove FF_API_NO_DEFAULT_TLS_VERIFY
The decision to switch to checking peer certificates by default
at the next major version bump was announced on 2025-08-09
in commit 5621eee672.

Thanks to Michael Niedermayer for pointing out that the documentation
needs to be updated, too.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-06-23 17:15:02 +02:00
Andreas Rheinhardt 9f58e3014c avfilter: Remove FF_API_LIBNPP_SUPPORT
libnpp and the corresponding filters have been deprecated
in commit 994a368451
on 2025-09-26. By the time of our next release,
a year will have passed, so they are removed immediately.

Note: Passing --enable-libnpp to configure results in
a warning about the deprecation and is otherwise a no-op.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-06-23 17:15:02 +02:00
Jun Zhao 7c176c068d doc/filters: document subtitles filter's shaping option
The shaping option is now exposed by both the ass and subtitles filters.
Document it under subtitles, update the ass filter description to refer
to the shared option set, and note that complex shaping is required for
Arabic, Hebrew, Devanagari and Thai and depends on a HarfBuzz-enabled
libass build.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2026-06-23 03:57:25 +00:00
stevxiao a2856b3c30 avfilter/dnn: add ONNX Runtime backend with GPU execution provider support
This patch adds ONNX Runtime as a new DNN backend for FFmpeg's dnn_processing
filter, enabling hardware-accelerated neural network inference on multiple
GPU and NPU platforms.

Execution Providers Supported:
- CPU execution provider (default)
- CUDA execution provider (NVIDIA GPUs)
- DirectML execution provider (AMD/Intel/NVIDIA GPUs on Windows)
- VitisAI execution provider (AMD Ryzen AI NPU)

The options for dnn_processing with dnn_backend=onnx:
- device: execution provider — cpu, cuda, dml, or vitisai (default: cpu)
- device_id: GPU device index (default: 0)
- threads_per_operation: inference thread count for CPU EP (default: 0, auto)
- input: input tensor name. When omitted the backend resolves it from loaded session
- output: output tensor name. When omitted the backend resolves it from loaded session

Example usage:
  # CPU inference
  ffmpeg -i input.mp4 -vf "format=rgb24,dnn_processing=dnn_backend=onnx:model=model.onnx:input=image_in:output=image_out" output.mp4

  # CUDA GPU inference
  ffmpeg -i input.mp4 -vf "dnn_processing=dnn_backend=onnx:model=model.onnx:device=cuda:device_id=0" output.mp4

  # DirectML GPU inference (Windows)
  ffmpeg -i input.mp4 -vf "dnn_processing=dnn_backend=onnx:model=model.onnx:device=dml:device_id=0" output.mp4

  # VitisAI NPU inference
  ffmpeg -i input.mp4 -vf "dnn_processing=dnn_backend=onnx:model=model.onnx:device=vitisai" output.mp4

  Note: depending on the model, you may need a format filter (e.g. format=rgb24 or format=grayf32) before dnn_processing to convert the frames to the pixel format the model's input tensor expects.

Signed-off-by: younengxiao <steven.xiao@amd.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
2026-06-22 20:06:40 +08:00
Bogdan Lisman 07ae44a607 doc/muxers: document the lrc precision option
The lrc muxer has a precision option controlling the number of
fractional digits written in each timestamp, but it was not documented.
Add it to the lrc section, including its range and default.

Signed-off-by: Bogdan Lisman <bogdan@pydevsolutions.com>
2026-06-16 00:23:38 +00:00
Niklas Haas c97a2328c0 avformat/shared: set default cache timeout to 10 ms
This value is matched to the typical seek latency in a reasonably capable
7200 rpm disk device, as well as the typical latency of an on-premise HTTP
request.

Note that this change should rarely have a significant effect, because
it only matters when using multiple concurrent processes, and one process
is somehow stuck in I/O (or died). Since we sleep in a loop for 1/16th of
the requested timeout value, this should only increase the effective read
latency by up to ~500 us on top of the actual underlying latency.

The alternative is hammering the same underlying resource with the exact
same requests at the exact same time (e.g. during init).

Sponsored-by: nxtedition AB
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-14 11:10:12 +02:00
Daniel Verkamp 4a7cc39c63 doc/muxers: Document wav muxer
Signed-off-by: Daniel Verkamp <daniel@drv.nu>
2026-06-13 04:10:48 +00:00
Daniel Verkamp 7d416470c7 doc/demuxers: Document wav ignore_length option
Signed-off-by: Daniel Verkamp <daniel@drv.nu>
2026-06-13 04:10:48 +00:00
Bejoy a5ee6ff720 docs: refine issue tracker transition references 2026-06-10 06:35:21 +00:00
Lynne 12dc67b6fe lavu/frame: add camera raw codec side data
Required to correctly present raw video.
Codec-specific since I'd like to support ARRIRAW in the future, which
has a different format.
2026-06-10 02:38:35 +09:00
Andreas Rheinhardt 72f751ef78 doc/examples/encode_audio: Don't access deprecated AVCodec fields
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-06-04 19:39:32 +00:00
Andreas Rheinhardt 27d49179e1 doc/examples/mux: Don't access deprecated AVCodec fields
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-06-04 19:39:32 +00:00
Andreas Rheinhardt ed18f8a463 doc/examples/transcode_aac: Don't access deprecated AVCodec.sample_fmts
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-06-04 19:39:32 +00:00
Niklas Haas afce637550 avformat/shared: add option to verify cache file contents
This will effectively disable the cache but allows the cache layer to verify
cached files against the original input file. Useful only for debugging
the shared cache protocol itself, as file corruption can already be caught by
the CRC check.
2026-06-04 17:48:12 +02:00
Niklas Haas 56de70a2e6 avformat: add shared concurrent block cache protocol
This adds a new protocol shared:URI which is distinct from the existing
`cache:` in that it is explicity designed to be thread-safe and cross-process,
enabling multiple ffmpeg processes (or multiple ffmpeg decoders within the same
process) to share a single cache file, for e.g. a remote HTTP stream. As such,
it uses a radically different internal design.

To facilitate zero-knowledge cross-process interoperability, the cache file
itself is just a memory-mapped representation of the underlying file data,
which has the side benefit that the resulting cache file will contain a
working copy of the streamed file (assuming the stream was read to
completion).

To keep track of which regions are cached and which are not, we use a
secondary file that contains a minimal header along with a static bytemap of
blocks within the file. This secondary file is also used to store metadata
such as the filesize, if known, as well as marking "failed" blocks.

Both files can grow dynamically in order to accommodate larger/growing files,
and can be atomically updated (through the use of shared space maps). I have
extensively checked the space map initalization and update code for race
conditions, and I believe the current design to be solid.

That said, it is the user's responsibility to some extent to ensure that the
same URI is not used for different streams, as we rely on the URI to uniquely
identify the cache files. That said, we use a cryptographic hash with
sufficient collision resistance to protect against possible abuse. The lack of
any implicit default on `-cache_dir` also means that `shared:` can't be enabled
via URL injection to possibly access random files on the disk (or intentionally
leak content from other streams with similar URIs, even if the cryptograhic
hash function is broken).
2026-06-04 17:48:12 +02:00
Niklas Haas cd3f335207 avformat/file: return ENOSYS for filesize query on files with follow=1
If the input is expected to grow, we shouldn't make any assumptions about
the file size. This matches e.g. the behavior of streamed protocols like
chunked HTTP, which similarly return ENOSYS for streams of unknown size.

Sponsored-by: nxtedition AB
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-04 17:48:12 +02:00
Niklas Haas 972c0cf91f swscale: add new SwsContext.backends option
This allows constraining the set of available backends. This serves as a
better replacement for the "unstable" flag, which is a bit ambiguous. Allows
users to, for example, opt into the memcpy or x86 backend, while excluding
e.g. the upcoming JIT backends.

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-03 21:39:55 +00:00
Niklas Haas 9fe5758da5 avutil/hwcontext_vulkan: publicly expose queue device creation flags
These are needed for interop with e.g. libplacebo, which needs to know the
correct flags to call vkGetDeviceQueue2.

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-02 13:32:43 +02:00
Kacper Michajłow 6026988b75 avcodec/bsf: add dovi_split BSF
Allows splitting interleaved BL+EL HEVC bitstream into separate streams.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-05-31 16:58:23 +02:00