1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

10890 Commits

Author SHA1 Message Date
Paul B Mahol
c37cf59c5b avfilter/vf_xfade: send EOF to first input early
No point to consume 1st input frames any more after crossfade is over.
2023-05-22 17:13:31 +02:00
Niklas Haas
877ccaf776 lavfi/vf_libplacebo: don't intrude on pl_ namespace
No reason to use this prefix here.
2023-05-22 10:31:51 +02:00
Niklas Haas
21715ecff1 lavfi/vf_libplacebo: update peak detection options
Upstream peak detection lost one option and gained one option. Update
code and documentation as required.
2023-05-22 10:31:51 +02:00
Niklas Haas
643cf2ec46 lavfi/vf_libplacebo: update for new tone mapping API
This algorithm has once again been refactored, this time leading to a
dropping of the old `tone_mapping_mode` field, to be replaced by a
single tunable hybrid mode with configurable strength.

We can approximately map the old modes onto the new API for backwards
compatibility. Replace deprecated enums by their integer equivalents to
safely preserve this API until the next bump.
2023-05-22 10:31:50 +02:00
Niklas Haas
d637f20f05 lavfi/vf_libplacebo: switch to new gamut mapping API
Upstream deprecated the old ad-hoc, enum/intent-based gamut mapping API
and added a new API based on colorimetrically accurate gamut mapping
functions.

The relevant change for us is the addition of several new modes, as well
as deprecation of the old options. Update the documentation accordingly.
2023-05-22 10:31:50 +02:00
Niklas Haas
f66280182a lavfi/vf_libplacebo: add RGB colorspace sanity
Explicitly forbid using a non-RGB colorspace with RGB pixel format or
vice versa. This mirrors identical logic from vf_scale.
2023-05-22 10:31:23 +02:00
Niklas Haas
c00fd02558 lavfi/libplacebo: properly handle EOF
The current code relied on pl_queue eventually returning EOF back to the
caller, which didn't work in all situations (e.g. single frame input).
Also, the current code assumed that ff_inlink_acknowledge_status only
fired once, which was patently not true, as the above edge cases
demonstrated.

Solve both issues by keeping track of the acknowledged link status and
forwarding it (instead of trying to probe the pl_queue again) in the
event that we run out of queued input frames, as well as (in CFR mode)
when we pass the indicated status PTS.
2023-05-22 10:31:13 +02:00
Paul B Mahol
7428f1e8f2 avfilter/vf_xfade: fix fadegrays for gbrp* formats
The array elements were left uninitialized.
2023-05-22 09:08:24 +02:00
Paul B Mahol
6284afec07 avfilter/vf_xfade: avoid some not needed dereferencing in inner loops 2023-05-22 08:42:06 +02:00
Paul B Mahol
0709680fc4 avfilter/vf_xfade: add horizontal and vertical wind transforms 2023-05-22 08:42:06 +02:00
Paul B Mahol
e684967e74 avfilter/f_graphmonitor: output one frame more after eof
To easily debug eof issues.
2023-05-21 22:06:55 +02:00
Paul B Mahol
c4b3e882f8 avfilter/f_graphmonitor: make opacity runtime option 2023-05-21 14:56:30 +02:00
Paul B Mahol
08eb13c05c avfilter/f_graphmonitor: add missing queue flag 2023-05-21 14:56:29 +02:00
Paul B Mahol
416c1e62f1 avfilter/f_graphmonitor: cache strlen() values 2023-05-21 14:56:27 +02:00
Paul B Mahol
f055345595 avfilter/f_graphmonitor: speed-up clear_image() 2023-05-21 14:56:26 +02:00
Kacper Michajłow
1aeefc4c06 lavfi/vf_libplacebo: allow linking to shared library with dllimport
Address of dll imported variables can't be used for constant
initialization in C language modes.
2023-05-21 13:15:28 +02:00
Paul B Mahol
65fe18040a avfilter/f_graphmonitor: add flags option shortcuts 2023-05-21 13:02:02 +02:00
Paul B Mahol
b528e098a9 avfilter/f_graphmonitor: show also current timeline status of filter 2023-05-21 13:01:59 +02:00
Paul B Mahol
5fe6a0e5c7 avfilter/src_movie: switch to activate 2023-05-21 10:49:41 +02:00
Paul B Mahol
3546f70410 avfilter/src_movie: dr support 2023-05-21 10:49:30 +02:00
James Almer
d55743c809 avfilter/af_surround: replace double constants with float variants
This is cleaner than the approach in d1ded7310a.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-19 17:12:04 -03:00
Paul B Mahol
613f716450 avfilter/vf_mix: improve speed even more by avoiding using filter private context 2023-05-19 19:32:22 +02:00
Paul B Mahol
4c695bfa65 avfilter/f_graphmonitor: make mode option of type flags 2023-05-18 18:12:42 +02:00
Paul B Mahol
8cdbe3abb6 avfilter/f_graphmonitor: add commands support 2023-05-18 18:12:42 +02:00
Paul B Mahol
386de9319e avfilter/f_graphmonitor: add nozeroeof mode 2023-05-18 18:12:42 +02:00
Paul B Mahol
01d9a84ef5 avfilter/avf_showspectrum: check for allocation error 2023-05-18 12:06:38 +02:00
Paul B Mahol
2a74826b02 avfilter/*xfade: reduce memory consumption
There is no always need for new buffers.
2023-05-14 23:35:50 +02:00
Paul B Mahol
66175c2dca avfilter/f_graphmonitor: set output frame duration 2023-05-14 20:58:08 +02:00
Paul B Mahol
932ccf9e7d avfilter/f_loop: free video frames once not needed 2023-05-14 20:58:08 +02:00
Paul B Mahol
c27895bb98 avfilter/f_graphmonitor: add nozero display mode 2023-05-14 20:58:08 +02:00
Paul B Mahol
6eecfc577b avfilter/f_graphmonitor: rename enums 2023-05-14 20:58:08 +02:00
Paul B Mahol
8041d00271 avfilter/f_loop: fix looping for aloop 2023-05-14 20:58:07 +02:00
Paul B Mahol
7a63add0ea avfilter/f_loop: add time option, for loop start in seconds 2023-05-14 20:58:07 +02:00
Niklas Haas
30c71ef98e lavfi/vf_libplacebo: add frame_mixer option
Fairly straightforward. We just need to modify the scaler handling code
slightly to support looking at a different list of filter presets.
2023-05-14 11:21:43 +02:00
Niklas Haas
02f3b9312a lavfi/vf_libplacebo: allow fps conversion
This exposes libplacebo's frame mixing functionality to vf_libplacebo,
by allowing users to specify a desired target fps to output at. Incoming
frames will be smoothly resampled (in a manner determined by the
`frame_mixer` option, to be added in the next commit).

To generate a consistently timed output stream, we directly use the
desired framerate as the timebase, and simply output frames in
sequential order (tracked by the number of frames output so far).
2023-05-14 11:21:43 +02:00
Niklas Haas
83b1f3f54e lavfi/vf_libplacebo: switch to activate()
To present compatibility with the current behavior, we keep track of a
FIFO of exact frame timestamps that we want to output to the user. In
practice, this is essentially equivalent to the current filter_frame()
code, but this design allows us to scale to more complicated use cases
in the future - for example, insertion of intermediate frames
(deinterlacing, frame doubling, conversion to fixed fps, ...)
2023-05-14 11:21:43 +02:00
Niklas Haas
9e802a47cc lavfi/vf_libplacebo: switch to pl_queue-based design
This does not leverage any immediate benefits, but refactors and
prepares the codebase for upcoming changes, which will include the
ability to do deinterlacing and resampling (frame mixing).
2023-05-14 11:21:43 +02:00
Niklas Haas
2d5e137207 lavfi/vf_libplacebo: split and refactor logic
This commit contains no functional change. The goal is merely to
separate the highly intertwined `filter_frame` and `process_frames`
functions into their separate concerns, specifically to separate frame
uploading (which is now done directly in `filter_frame`) from emitting a
frame (which is now done by a dedicated function `output_frame`).

The overall idea here is to be able to ultimately call `output_frame`
multiple times, to e.g. emit several output frames for a single input
frame.
2023-05-14 11:21:43 +02:00
Niklas Haas
482d81378f lavfi/vf_libplacebo: update render params on demand
Only update this struct when it's expected to change, and cache it
otherwise. Partially motivated by a desire to make `process_frames`
smaller.
2023-05-14 11:15:49 +02:00
Oleg
e700d87b20 avfilter/setpts: add command support
Add support for changing expr on the fly.

Signed-off-by: Oleg <oafanasiev@gmail.com>
2023-05-14 11:10:50 +02:00
Paul B Mahol
28a73506df avfilter/vf_waveform: add input option
For finer control of selected formats for filtering.
2023-05-14 00:13:59 +02:00
Paul B Mahol
fb8efa9793 avfilter/avfiltergraph: remove no longer valid comment 2023-05-14 00:13:52 +02:00
James Almer
b446ea22e9 avfilter/formats: fix format negotiation when multiple channel_layouts are provided
For example
ffmpeg -f lavfi -i sine -af "aformat=cl=stereo|5.1|7.1,lowpass,aformat=cl=7.1|5.1|stereo" -f null -

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-13 18:21:29 -03:00
Niklas Haas
c65e481330 lavfi/vf_libplacebo: allow operation without avhwdevice
Recent versions of libplacebo have required Vulkan versions incompatible
with lavu Vulkan hwcontexts. While this is expected to change
eventually, breaking vf_libplacebo every time there is such a transition
period is obviously undesired behavior, as the following sea of bug
reports shows.

This commit adds a fallback path for init_vulkan failures which simply
creates an internal device if there was no user-supplied Vulkan hwaccel.
Useful when no interop with lavu vulkan hwframes is needed or desired,
and makes using this filter easier inside certain applications.

Fixes: https://github.com/haasn/libplacebo/issues/170
Fixes: https://github.com/mpv-player/mpv/issues/9589#issuecomment-1535432185
Fixes: https://github.com/mpv-player/mpv/issues/11363
Fixes: https://github.com/mpv-player/mpv/issues/11685#issuecomment-1546627082
Closes: https://code.videolan.org/videolan/libplacebo/-/issues/270
2023-05-13 17:38:20 +02:00
Paul B Mahol
e076d8a9b3 avfilter/af_asetrate: extend query_formats()
It left some formats not defined. Causing format negotiation
errors with ffplay.

Fixes #9248
2023-05-13 10:58:48 +02:00
Paul B Mahol
ee6ef66d65 avfilter/avfiltergraph: fix check for negative return
Before this commit if allocation would fail in ff_add_channel_layout()
function, function would return negative error code and this would
cause wrong format pick up later. If allocation would not fail return
code would be 0 and then format negotiation would simply fail as code
would break from the loop but with wrong return code.

Error was introduced in 6aaac24d72 commit.

Fixes #6638
2023-05-13 10:58:46 +02:00
James Almer
8564b4ab05 avfilter/ccfifo: constify some parameters
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-12 22:33:16 -03:00
Paul B Mahol
e65f03ca13 avfilter/af_loudnorm: simplify query_formats even more 2023-05-12 22:44:54 +02:00
James Almer
7f890b2fbb avfilter/ccfifo: remove unnecessary context allocations
This is not public API, no it has no need for an alloc() and free()
functions. The struct can reside on stack.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-12 16:21:18 -03:00
Paul B Mahol
cb4e7831e7 avfilter/af_surround: scale output gain for non-default overlap 2023-05-12 12:33:33 +02:00