Commit graph

9307 commits

Author SHA1 Message Date
James Almer
ea3c3b42df avutil/frame: add a side data prop to signal channel layout dependent types
Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-25 21:56:49 -03:00
James Almer
6707d970c0 avfilter/buffersink: add av_buffersink_get_side_data()
This will be used to get global side data that was propagated through the
filterchain.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-25 21:56:49 -03:00
James Almer
7a025e1cb5 avfilter/buffersrc: add a side_data field
This will be used to propagate global side data through the filterchain.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-25 21:56:49 -03:00
James Almer
ef1cb1c9c8 avfilter/avfilter: add a side_data field to AVFilterLink
This will be used to propagate global side data through the filterchain.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-25 21:56:49 -03:00
91d96dc8dd
avformat/hls: Be more picky on extensions
This blocks disallowed extensions from probing
It also requires all available segments to have matching extensions to the format
mpegts is treated independent of the extension

It is recommended to set the whitelists correctly
instead of depending on extensions, but this should help a bit,
and this is easier to backport

Fixes: CVE-2023-6602 II. HLS Force TTY Demuxer
Fixes: CVE-2023-6602 IV. HLS XBIN Demuxer DoS Amplification

The other parts of CVE-2023-6602 have been fixed by prior commits

Found-by: Harvey Phillips of Amazon Element55 (element55)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-26 01:12:28 +01:00
Stefan Pöschel
2ac2ebcd76
doc/protocols: fix/improve RTP documentation
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-01-17 23:33:26 +01:00
James Almer
42e72d5c8b avutil/frame: add AV_FRAME_SIDE_DATA_FLAG_NEW_REF
The flag is documented but did not exist. So introduce it as it can be
useful.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-10 15:02:22 -03:00
Marton Balint
19c95ecbff avcodec: deprecate AVCodecContext properties
These properties are unreliable because they depend on the frames decoded so
far, users should check directly the presence of the decoded AVFrame side data
or AVFrame flags.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-01-05 22:25:29 +01:00
Marton Balint
8a29b4e38d fftools/ffprobe: print lossless frame flag
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-01-05 22:23:16 +01:00
Marton Balint
2d91f89445 avcodec/frame: add AV_FRAME_FLAG_LOSSLESS
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-01-05 22:23:15 +01:00
f3c4082645
avcodec/libjxl: add animated JPEG XL encoder
libjxl supports animated encoding, so we add a wrapper to the
library using the receive_packet callback method.

This code was based largely on a patch sent by Zsolt Vadász,
although it was updated to use more recent coding practices
and many of the leaks and issues were fixed.

Reviewed-by: Marth64 <marth64@proxyid.net>
Co-authored-by: Zsolt Vadász <zsolt_vadasz@protonmail.com>
Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-01-03 19:37:28 -05:00
James Almer
da9dcaba69 avutil/channel_layout: add a 5.1.2 layout using side channels
And rename the existing 5.1.2 to explicitly state it contains back channels.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-01-03 10:27:12 -03:00
James Almer
6ffbc22b53 doc/ffmpeg.texi: replace use of uncommon unicode characters
Addresses ticket #11372

Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-26 13:41:28 -03:00
Niklas Haas
b88944a8aa avutil/frame: add av_frame_side_data_remove_by_props()
As discussed in the previous commit, we often need a convenient way of
stripping all side data related to a certain aspect of the frame. This helper
accomplishes just that.

I considered also adding a way to match only side data matching *all*
properties, but I think this is sufficiently useless in practise to not warrant
inclusion in the API.
2024-12-23 14:22:56 +01:00
Niklas Haas
3428a8d830 avutil/frame: add AV_SIDE_DATA_PROP_{SIZE,COLOR}_DEPENDENT
Many filters modify certain aspects of frame data, e.g. through resizing
(vf_*scale* family), color volume mapping (vf_lut*, vf_tonemap*), or
possibly others.

When this happens, we should strip all frame side data that will no
longer be correct/relevant after the operation. For example, changing
the image size should invalidate AV_FRAME_DATA_PANSCAN because the crop
window (given in pixels) no longer corresponds to the actual image size.
For another example, tone-mapping filters (e.g. from HDR to SDR) should
strip all of the dynamic HDR related metadata.

Since there are a lot of different side data types that are affected by such
operations, it makes sense to establish this information in a common, easily
accessible way. The existing side data properties enum is a perfect fit for
this.
2024-12-23 13:33:33 +01:00
Niklas Haas
b7a2333357 avfilter/vf_scale: add colorspace and transfer property options
In the long run, it would be ideal if we could add these to the avfilter
negotiation as well, but for now, this is a good start.
2024-12-23 12:33:43 +01:00
Niklas Haas
45f0a7ad33 swscale: add ICC intent enum and option
This setting can be used to infuence the type of tone and gamut mapping used
internally when color space conversions are required. As discussed at VDD'24,
the default was set to relative colorimetric clipping, which is approximately
associative, surjective and idempotent. As such, it roundtrips well, although
it is strictly speaking not associative on out-of-gamut colors.
2024-12-23 12:33:43 +01:00
Paul B Mahol
c3083b3266 avcodec: add ADPCM IMA XBOX decoder 2024-12-22 16:08:33 +11:00
Anton Khirnov
2ac34d0854 lavc/packet: add API for an AVPacket-based AVContainerFifo 2024-12-15 14:05:33 +01:00
Anton Khirnov
2e956d9c0f lavc/container_fifo: move to lavu and make public
This can be useful in other places, e.g. it can replace objpool in
fftools.

The API is modified in the following nontrivial ways:
* opaque pointers can be passed through to all user callbacks
* read and write were previously separate callbacks in order to
  accomodate the caller wishing to write a new reference to the FIFO and
  keep the original one; the two callbacks are now merged into one, and
  a flags argument is added that allows to request such behaviour on a
  per-call basis
* new peek and drain functions
2024-12-15 14:05:15 +01:00
Anton Khirnov
56ba57b672 lavc/refstruct: move to lavu and make public
It is highly versatile and generally useful.
2024-12-15 14:03:47 +01:00
90af8e07b0 fftools/ffprobe: add analyze_frames option for CC and grain detection
Currently, ffprobe has two stream-level fields that do not work,
closed_captions and film_grain).

Their value is always 0 because ffprobe cannot access the internal
codec properties when it is setting up its stream contexts.

In this commit, add the new option -analyze_frames to ffprobe,
allowing the user to read frames up to the interval they have defined
and fill these fields based on what is exposed in AVPacketSideData.

Additionally, in the same commit, don't write these fields to
the output unless analyze_frames is enabled. Finally, fix the
FATE test refs accordingly and update the docs.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-13 22:41:31 -06:00
James Almer
6eb4bf04e9 avutil/channel_layout: add a 9.1.6 layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-13 16:35:47 -03:00
Martin Storsjö
1e76bd2f39 fate: Add a target for listing failed tests
If running tests with "make -j<N> fate", the execution will stop
after the first failing test. To get an overview of the whole
test suite, one rather would run "make -k -j<N> fate", which then
again buries the results about what tests actually failed further
up in the console log.

Add a target so one can run "make fate-list-failing", to see a list
of all tests that failed the last time they were executed.

Also add a companion target "fate-clear-reports" which removes all
the old test reports. (When executing a subset of tests, the report
files of all tests that aren't executed stay untouched. This also
allows getting rid of reports for tests that no longer are present
in the testsuite.)

Co-authored-by: Alexander Strasser <eclipse7@gmx.net>

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-12-11 14:10:22 +02:00
Niklas Haas
06f084468e avutil/csp: add EOTF function definitions
The existing av_csp_trc_func_from_id() mostly implements the OETF, except for
PQ. As such, we are currently missing a precise definition of an ITU-R EOTF.
Introduce the new functions av_csp_itu_eotf() and av_csp_itu_eotf_inv(), to fill
this void. Note that this is not possible in all cases, e.g. AVCOL_TRC_LOG which
has no corresponding EOTF definition in any ITU-R standard.

Note that we cannot implement the proper HLG and SMPTE 428 OOTFs without access
to all three color channels, because they are not independent per channel. As a
result, we need to define them on double[3] instead of double (*func)(double).
2024-12-05 12:27:32 +01:00
Niklas Haas
bf0a6c4111 avutil/csp: add av_csp_trc_inv_from_id()
Mathematical inverse of av_csp_trc_from_id(), plus testing to make sure it
roundtrips correctly with the corresponding TRC.
2024-12-05 12:26:49 +01:00
James Almer
cb27e478f7 doc/codecs: add missing enhancements value for export_side_data
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-02 12:53:54 -03:00
James Almer
d2c90abab7 doc/filters: add an entry for vf_lcevc
Signed-off-by: James Almer <jamrial@gmail.com>
2024-12-02 12:53:54 -03:00
c250a903a7
doc/encoders: very basic FFv1 documentation
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-12-02 03:14:44 +01:00
1c2c70fe4d doc/demuxers/dvdvideo: seeking is supported, remove outdated statement
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-12-01 13:49:01 -06:00
f57f2a356d
doc/infra: List at what companies the name servers are hosted and who provides the servers
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-28 23:19:00 +01:00
51a20517d2 doc: add styles for good/bad code examples
Makes it easier to immediately see if the code examples given in the
style documentation are good or bad examples, making it harder to
accidentally confuse a bad example for a good one.
2024-11-25 17:17:57 +01:00
9cdd3cbe9b doc/developer: add examples to clarify code style
Given the frequency that new developers, myself included, get the
code style wrong, it is useful to add some examples to clarify how
things should be done.
2024-11-25 17:17:56 +01:00
Niklas Haas
2a091d4f2e swscale: introduce new, dynamic scaling API
As part of a larger, ongoing effort to modernize and partially rewrite
libswscale, it was decided and generally agreed upon to introduce a new
public API for libswscale. This API is designed to be less stateful, more
explicitly defined, and considerably easier to use than the existing one.

Most of the API work has been already accomplished in the previous commits,
this commit merely introduces the ability to use sws_scale_frame()
dynamically, without prior sws_init_context() calls. Instead, the new API
takes frame properties from the frames themselves, and the implementation is
based on the new SwsGraph API, which we simply reinitialize as needed.

This high-level wrapper also recreates the logic that used to live inside
vf_scale for scaling interlaced frames, enabling it to be reused more easily
by end users.

Finally, this function is designed to simply copy refs directly when nothing
needs to be done, substantially improving throughput of the noop fast path.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:03:50 +01:00
Niklas Haas
fb16964009 swscale: organize and better document flags
Group them into an enum rather than random #defines, and document their
behavior a bit more obviously.

Of particular note, I discovered that SWS_DIRECT_BGR is not referenced
anywhere else in the code base. As such, I have moved it to the deprecated
section, alongside SWS_ERROR_DIFFUSION.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 11:02:12 +01:00
Niklas Haas
ed5dd67562 swscale: expose SwsContext publicly
Following in the footsteps of the work in the previous commit, it's now
relatively straightforward to expose the options struct publicly as
SwsContext. This is a step towards making this more user friendly, as
well as following API conventions established elsewhere.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2024-11-25 10:59:49 +01:00
Pavel Koshevoy
46cb7b8d9d avutil/frame: also align data pointers in av_frame_get_buffer()
This avoids unpleasant surprises to av_frame_get_buffer callers
that explicitly specified 64-byte alignment and didn't get
AVFrame.data pointers that are 64-byte aligned.

For example, see https://github.com/sekrit-twc/zimg/issues/212

Although the zscale issue has already been resolved by other means
it would still be prudent to improve the behavior of av_frame_get_buffer
to fix any unknown and future instances of similar issues.

Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-22 10:43:55 -03:00
7051825b01
doc/developer: Document relationship between git accounts and MAINTAINERS
This should have been documented long ago and i thought it was

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-20 21:28:14 +01:00
edc4855f77
doc/infra: Document trac backup system
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-20 21:28:13 +01:00
8a21d8baf9
doc/infra: clarify domain name servers
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-20 21:28:13 +01:00
60434b483c avformat/dvdvideodec: remove auto value for menu_lu option
The "auto" mode serves no functional purpose except for logging
a message and setting the value to 1. The documentation clearly
explains what the option is for.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
4a03e95ff4 avformat/dvdvideodec: default menu_vts option to 1 and clarify description
Menu 0 is the VIDEO_TS root menu, which does not appear to be used
commonly for menu segments. Instead, default to the menu of VTS 1.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
c1e4b6c676 avformat/dvdvideodec: enable chapter calculation for menus
Menus are generally segmented by cell, so use them as the
marker delimiters. Requires preindex option to be enabled.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
e1ace1d314 avformat/dvdvideodec: remove "auto" value for -pg option, default to 1
The default "auto" mode is effectively useless; the reasonable
default use case is to use the first PG (segment) of the
selected PGC for both menus and standard titles. Just
default the value to 1, since the option is irrelevant
unless -pgc is also set.

Note that this should not break users using this advanced option.
The "auto" mode errored and asked for a PG number regardless
for non-menus, and for menus the mode simply defaulted to 1.

Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-16 14:40:51 -06:00
07904231cb
doc/infra: Document gitolite
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-11-14 21:50:51 +01:00
James Almer
20af68b63a avutil/channel_layout: add Binaural channels and layout
Signed-off-by: James Almer <jamrial@gmail.com>
2024-11-13 12:38:04 -03:00
compn
e35587250c doc/infra: add reddit sub, facebook page and wikipedia 2024-11-13 08:04:13 +10:00
compn
b16102ab1c doc/infra: add more information and accounts 2024-11-11 10:26:35 +10:00
6d5a0998b6 doc/bitstream_filters: elaborate on h264_redundant_pps
Signed-off-by: Marth64 <marth64@proxyid.net>
2024-11-09 10:02:34 -06:00
Anton Khirnov
9e68b26765 Document stream specifier syntax change from 46cbe4ab5c
Fixes #11248.
2024-11-09 02:45:58 +01:00