| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
| |
This is no longer needed, since we now correctly negotiate the required
range from the mjpeg encoder via avcodec_get_supported_config().
Signed-off-by: Anton Khirnov <anton@khirnov.net>
|
|
|
|
|
|
|
| |
To convert between color spaces/ranges, if needed by the codec
properties.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
|
|
|
|
| |
Signed-off-by: Anton Khirnov <anton@khirnov.net>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The only meaningful difference between choose_pix_fmts and the default
code was the inclusion of an extra branch for `keep_pix_fmt` being true.
However, in this case, we either:
1. Force the specific `ofp->format` that we inherited from
ofilter_bind_ost, or if no format was set:
2. Print an empty format list
Both of these goals can be accomplished by simply moving the decision
logic to ofilter_bind_ost, to avoid setting any format list when
keep_pix_fmt is enabled. This is arguably cleaner as it moves format
selection logic to a single function. In the case of branch 1, nothing
else needs to be done as we already force the format provided in
ofp->format, if any is set. Add an assertion to verify this assumption
just in case.
(Side note: The "choose_*" family of functions are arguably misnomers,
as they should really be called "print_*" - their current behavior is to
print the relevant format lists to the `vf/af_format` filter arguments)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
|
| |
|
|
|
|
|
|
| |
Having macros initialize local variables seems strange to me, and there
are no more current users of these macros. (The one that was commented
out was incorrect anyway, since the macro has changed in the meantime)
|
|
|
|
|
|
|
|
| |
While rewriting this macro, I decided to make it a bit more flexible so
it can work for all of the fields (including future fields) in a more
generic way, and to also print the channel layout using an AVBPrint to
avoid hard-coding the assumption that the length is less than 128
characters.
|
|
|
|
| |
All hail get_supported_config()
|
|
|
|
|
|
| |
This codec's capabilities should be set dynamically based on the value
of strict_std_compliance, when available. This will allow us to finally
get rid of the strictness hack in ffmpeg_filter.c.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
In order to avoid breaking older clients not yet using the new API, we
need to add backwards compatibility for codecs which have switched from
init_static() to get_supported_config().
This function can be removed entirely once the deprecated static fields
are removed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces the myriad of existing lists in AVCodec by a unified API
call, allowing us to (ultimately) trim down the sizeof(AVCodec) quite
substantially, while also making this more trivially extensible.
In addition to the already covered lists, add two new entries for color
space and color range, mirroring the newly added negotiable fields in
libavfilter.
I decided to drop the explicit length field from the API proposed by
Andreas Rheinhardt, because having it in place ended up complicating
both the codec side and the client side implementations, while also
being strictly less flexible (it's trivial to recover a length given
a terminator, but requires allocation to add a terminator given
a length). Using a terminator also presents less of a porting challenge
for existing users of the current API.
Once the deprecation period passes for the existing public fields, the
rough plan is to move the commonly used fields (such as
pix_fmt/sample_fmt) into FFCodec, possibly as a union of audio and video
configuration types, and then implement the rarely used fields with
custom callbacks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I went through all codecs and put them into five basic categories:
1. JPEG range only
2. MPEG range only
3. Explicitly tagged
4. Broken (codec supports both but encoder ignores tags)
5. N/A (headerless or pseudo-formats)
Filters in category 5 remain untouched. The rest gain an explicit
assignment of their supported color ranges, with codecs in category
4 being set to MPEG-only for safety.
It might be considered redundant to distinguish between 0 (category 5)
and MPEG+JPEG (category 3), but in doing so we effectively communicate
that we can guarantee that these tags will be encoded, which is distinct
from the situation where there are some codecs that simply don't have
tagging or implied semantics (e.g. rawvideo).
A full list of codecs follows:
JPEG range only:
- amv
- roqvideo
MPEG range only:
- asv1, asv2
- avui
- cfhd
- cljr
- dnxhd
- dvvideo
- ffv1
- flv
- h261, h263, h263p
- {h263,vp8}_v4l2m2m
- huffyuv, ffvhuff
- jpeg2000
- libopenjpeg
- libtheora
- libwebp, libwebp_anim
- libx262
- libxavs, libxavs2
- libxvid
- mpeg1video, mpeg2video
- mpeg2_qsv
- mpeg2_vaapi
- mpeg4, msmpeg4, msmpeg4v2, wmv1, wmv2
- mpeg4_omx
- rv10, rv20
- snow
- speedhq
- svq1
- tiff
- utvideo
Explicitly tagged (MPEG/JPEG):
- {av1,h264,hevc}_nvenc
- {av1,h264,hevc}_vaapi
- {av1,h264,hevc,vp8,vp9,mpeg4}_mediacodec
- {av1,h264,hevc,vp9}_qsv
- h264_amf
- {h264,hevc,prores}_videotoolbox
- libaom-av1
- libkvazaar
- libopenh264
- librav1e
- libsvtav1
- libvpx, libvpx-vp9
- libx264
- libx265
- ljpeg
- mjpeg
- vc2
Broken (encoder ignores tags):
- {av1,hevc}_amf
- {h264,hevc,mpeg4}_v4l2m2m
- h264_omx
- libxeve
- magicyuv
- {vp8,vp9,mjpeg}_vaapi
N/A:
- ayuv, yuv4, y41p, v308, v210, v410, v408 (headerless)
- pgmyuv (headerless)
- prores, prores_aw, prores_ks (?)
- rawvideo, bitpacked (headerless)
- vnull, wrapped_avframe (pseudocodecs)
|
|
|
|
| |
It is no longer needed after this function returns.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not pass an options dictionary to the avcodec_open2() in enc_open().
This is cleaner and more robust, as previously various bits of code
would try to interpret the contents of the options dictionary, with
varying degrees of correctness. Now they can just access the encoder
AVCodecContext directly.
Cf. 372c78dd42f2b1ca743473b9c32fad71c65919e0 - analogous change for
decoding.
A non-progressive field order is now written on the container level in
interlaced ProRes encoding tests.
|
|
|
|
|
|
| |
Share the code between encoding and decoding. Instead of checking every
stream's options dictionary (which is also used for other purposes),
track all used options in a dedicated dictionary.
|
|
|
|
| |
It conflicts with the AVCodecContext option of the same name.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This allows one complex filtergraph's output to be sent as input to
another one, which is useful in certain situations (one is described in
the docs).
Chaining filtergraphs was already effectively possible by using a
wrapped_avframe encoder connected to a loopback decoder, but it is ugly,
non-obvious and inefficient.
|
|
|
|
|
| |
Will be useful for filtergraph chaining that will be added in following
commits.
|
|
|
|
|
|
|
| |
First bind all inputs in all filtergraphs, only then check that all
outputs are bound.
Needed by the following commit.
|
|
|
|
|
| |
Store simple filtergraphs in the stream they feed. Keeping the two
separate will be useful in following commits.
|
|
|
|
|
| |
All remaining code accessing it only needs to know whether this
filtergraph output has been bound or not.
|
|
|
|
|
|
| |
Stop digging through encoder options manually.
Will allow decoupling filtering from encoding in future commits.
|
|
|
|
|
| |
It is no longer used outside of the muxing code (where we can access the
muxer directly).
|
|
|
|
| |
It is no longer needed outside of of_open() and its children.
|
|
|
|
|
|
| |
The decision whether -apad actually does anything is made based on muxer
properties, and so more properly belongs there. Filtering code only
receives the result.
|
|
|
|
|
|
| |
Do not read them from OutputStream directly.
Will allow decoupling filtering from encoding in future commits.
|
|
|
|
|
|
| |
Do not read it from OutputStream directly.
Will allow decoupling filtering from encoding in future commits.
|
|
|
|
|
|
| |
Do not read them from OutputStream directly.
Will allow decoupling filtering from encoding in future commits.
|
|
|
|
| |
OutputFilter.type contains the same information.
|
|
|
|
|
|
|
| |
Use it for logging where appropriate, avoid logging to OutputStream as
we do not own it.
This is a step towards decoupling filtering from encoding.
|
| |
|
|
|
|
|
| |
fg_finalise_bindings() already checks that all filtergraph outputs are
connected.
|
|
|
|
|
|
| |
Do not construct it from OutputStream manually.
Will allow decoupling filtering from encoding in future commits.
|
|
|
|
|
| |
It is used in a single place in the filtering code, so it is better to
inline it there.
|
|
|
|
|
|
| |
Do not read it from OutputStream directly.
Will allow decoupling filtering from encoding in future commits.
|
|
|
|
|
|
| |
Pass all the necessary value through OutputFilterOptions.
Will allow decoupling filtering from encoding in future commits.
|
|
|
|
| |
That, if anywhere, is a more appropriate place for it.
|
|
|
|
|
| |
Reduces the need to access OutputStream, which will allow decoupling
filtering from encoding in future commits.
|
|
|
|
|
| |
Can do it as soon as that option is parsed, no need to postpone it until
opening the encoder.
|
|
|
|
|
| |
Reduces the need to access OutputStream, which will allow decoupling
filtering from encoding in future commits.
|
|
|
|
|
| |
Reduces the need to access OutputFile, which will allow decoupling
filtering from encoding in future commits.
|
|
|
|
| |
For simple filtergraphs. For complex filtergraphs they always match.
|
|
|
|
|
|
|
| |
Instead pass the encoder through a newly-added output options struct,
analogous to previously added input options.
Will allow decoupling filtering from encoding in future commits.
|
|
|
|
| |
It only needs a list of allowed layouts and the requested layout.
|