1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

110611 Commits

Author SHA1 Message Date
Anton Khirnov
2ad468ed1f lavc/libkvazaar,libopenh264enc: drop redundant checks
The same check is present in encode_preinit_video().
2023-05-15 10:32:05 +02:00
Anton Khirnov
aa3b0f4376 libaomenc: use AVCodecContext.framerate when available 2023-05-15 10:32:05 +02:00
Anton Khirnov
3fabf71207 lavc/msmpeg4enc: use AVCodecContext.framerate when available 2023-05-15 10:32:05 +02:00
Anton Khirnov
dc20baa049 lavc/ratecontrol: use AVCodecContext.framerate when available 2023-05-15 10:32:05 +02:00
Anton Khirnov
e930b834a9 lavf: use AV_CODEC_PROP_FIELDS where appropriate
H.264 and mpeg12 parsers need to be adjusted at the same time to stop
using the value of AVCodecContext.ticks_per_frame, because it is not set
correctly unless the codec has been opened. Previously this would result
in both the parser and lavf seeing the same incorrect value, which would
cancel out.
Updating lavf and not the parsers would result in correct value in lavf,
but the wrong one in parsers, which would break some tests.
2023-05-15 10:31:55 +02:00
Anton Khirnov
70433abf7f lavc/codec_desc: add a property for codecs that support field coding
Multiple places currently use AVCodecContext.ticks_per_frame > 1 to
identify such codecs, which
* requires a codec context
* requires it to be open
2023-05-15 10:31:55 +02:00
Anton Khirnov
78e84c054a fftools/ffmpeg: fix computing video frame duration from repeat_pict
This field contains the number of _field_ durations by which the
standard frame duration should be extended.
2023-05-15 10:31:55 +02:00
Anton Khirnov
d45a296732 lavu/frame: extend AVFrame.repeat_pict documentation 2023-05-15 10:31:55 +02:00
Anton Khirnov
02823210d7 fftools/opt_common: stop printing deprecated AV_CODEC_CAP_SUBFRAMES 2023-05-15 10:24:54 +02:00
Anton Khirnov
8b20d0dcb5 lavc: deprecate AV_CODEC_CAP_SUBFRAMES
There is nothing meaningful the caller can do with it.
2023-05-15 10:24:54 +02:00
Anton Khirnov
51d6ae099f lavc/decode: drop a useless warning
Decoders will currently warn if an audio decoder not marked with
AV_CODEC_CAP_SUBFRAMES consumes less than the whole packet, but
* this happens for regular files
* this has no negative consequences
* there is no meeaningful action that can or should be taken in response

The warning is thus useless noise.
2023-05-15 10:24:54 +02:00
Michael Niedermayer
954d16fa3f
avformat/hls: Try to implement RFC8216 playlist refusal
This should fix the regression since 6b1f68ccb0

Should fix Ticket10353 (please test and report cases that still fail)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-15 03:02:28 +02:00
Michael Niedermayer
a7b06bfc5d
avformat: add ff_match_url_ext()
Match url against a list of extensions similar to av_match_ext()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-15 03:02:28 +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
James Almer
6759983bdc avcodec/cbs_av1: add valid range of values for num_units_in_decoding_tick
The spec states "num_units_in_decoding_tick shall be greater than 0".

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-14 17:09:38 -03: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
Stefano Sabatini
6f1368842d tools/normalize: port to python3, extend syntax
Also add documentation and logging.
2023-05-14 10:16:01 +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
Andriy Utkin
86ee031795 doc/muxers/image2: drop unmatched quote in example
Percent sign is not a special character in popular shells, so the
quoting isn't necessary.
2023-05-12 16:20:28 +05:30
Paul B Mahol
cb4e7831e7 avfilter/af_surround: scale output gain for non-default overlap 2023-05-12 12:33:33 +02:00
Paul B Mahol
09cd89df27 avfilter/af_surround: cache constant rdft_size inside loops 2023-05-12 12:33:33 +02:00
Devin Heitmueller
4fd729a1f8 avdevice/decklink: move AVPacketQueue into decklink_common and rename it to DecklinkPacketQueue
Move the AVPacketQueue functionality that is currently only used
for the decklink decode module into decklink_common, so it can
be shared by the decklink encoder (i.e. for VANC insertion when
we receive data packets separate from video).

The threadsafe queue used within the decklink module was named
"AVPacketQueue" which implies that it is part of the public API,
which it is not.

Rename the functions and the name of the queue struct to make
clear it is used exclusively by decklink, per Marton Balint's
suggestion.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-05-11 22:46:15 +02:00
Ammon Riley
4373dadc39 avformat/mxfdec: recognize AAC per SMPTE ST 381-4
This patch simply recognizes the AAC audio track during
decode -- it does not add functionality to encode AAC in
MXF.

Signed-off-by: Ammon Riley <ammon.riley@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-05-11 22:37:41 +02:00
Paul B Mahol
d1ded7310a avfilter/af_surround: reduce double usage 2023-05-11 20:14:46 +02:00
Paul B Mahol
f013650243 avfilter/avf_showwaves: zero whole allocated chunk 2023-05-11 20:14:46 +02:00
Timo Rothenpieler
869c06886d avfilter/vf_yadif_cuda: fix build
Identical patches were sent by Leo Izen and Devin Heitmueller.
2023-05-11 19:24:55 +02:00
Pierre-Anthony Lemieux
21696f6122
avformat/tests/imf: add invalid resource test 2023-05-11 09:04:44 -07:00
Pierre-Anthony Lemieux
23d968d55a
avformat/imf: fix invalid resource handling 2023-05-11 09:04:37 -07:00
Devin Heitmueller
9f4df9a535 avdevice/decklink_enc: add support for playout of 608 captions in MOV files
Unlike other cases where the closed captions are embedded in the
video stream as MPEG-2 userdata or H.264 SEI data, with MOV files
the captions are often found on a separate "e608" subtitle track.

Add support for playout of such files, leveraging the new ccfifo
mechanism to ensure that they are embedded into VANC at the correct
rate (since e608 packets often contain batches of multiple 608 pairs).

Note this patch includes a new file named libavdevice/ccfifo.c, which
allows the ccfifo functionality in libavfilter to be reused even if
doing shared builds.  This is the same approach used for log2_tab.c.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2023-05-11 22:06:20 +08:00
Devin Heitmueller
0e12cdc69c avfilter/vf_ccrepack: Add new filter to repack CEA-708 side data
THis filter can correct certain issues seen from upstream sources
where the cc_count is not properly set or the CEA-608 tuples are
not at the start of the payload as expected.

Make use of the ccfifo to extract and immediately repack the CEA-708
side data, thereby removing any extra padding and ensuring the 608
tuples are at the front of the payload.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2023-05-11 22:06:20 +08:00