summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_opt.c
Commit message (Collapse)AuthorAge
* fftools/ffmpeg: support applying container level croppingJames Almer2024-07-08
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* fftools/ffmpeg_opt: add missing codec type to some optionsJames Almer2024-07-03
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* fftools/ffmpeg: rewrite checking whether codec AVOptions have been usedAnton Khirnov2024-07-03
| | | | | | 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.
* fftools: Fix implicit-const-int-float-conversion warningZhao Zhili2024-04-23
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* fftools/ffmpeg_filter: change processing order in fg_finalise_bindings()Anton Khirnov2024-04-09
| | | | | | | First bind all inputs in all filtergraphs, only then check that all outputs are bound. Needed by the following commit.
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-31
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_opt: Check before accessing union memberAndreas Rheinhardt2024-03-17
| | | | | | | | | | | OptionDef.u is only an offset (i.e. its off member) iff OPT_FLAG_OFFSET is true. Otherwise, the pointer arithmetic can be undefined behaviour. UBSan warns about this (on 32bit arches): src/fftools/ffmpeg_opt.c:102:15: runtime error: pointer index expression with base 0xffa4db10 overflowed to 0x56059a50 This commit fixes this by checking for OPT_FLAG_OFFSET first. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg: add loopback decodingAnton Khirnov2024-03-13
| | | | | This allows to send an encoder's output back to decoding and feed the result into a complex filtergraph.
* fftools/ffmpeg_opt: merge init_complex_filters() and check_filter_outputs()Anton Khirnov2024-03-13
| | | | | | | | | | | | | | | The first of these binds inputs of complex filtergraphs to demuxer streams (with a misleading comment claiming it *creates* complex filtergraphs). The second ensures that all filtergraph outputs are connected to an encoder. Merge them into a single function, which simplifies the ffmpeg_filter API, is shorter, and will also be useful in following commits. Also, rename misleadingly-named init_input_filter() to fg_complex_bind_input().
* fftools/ffmpeg: remove options deprecated before 6.0Anton Khirnov2024-03-01
|
* fftools/ffmpeg: optimize inter-thread queue sizesAnton Khirnov2024-01-28
| | | | | | | Use 8 packets/frames by default rather than 1, which seems to provide better throughput. Allow -thread_queue_size to set the muxer queue size manually again.
* fftools/ffmpeg_opt: improve wording in option descriptionsAnton Khirnov2024-01-20
|
* fftools/ffmpeg_opt: briefly mention stream specifier syntax in help outputAnton Khirnov2024-01-20
|
* fftools/ffmpeg_opt: add more structure to long help outputAnton Khirnov2024-01-20
| | | | | | | | Split the "Per-file main options" section into * per-file input and output * per-file input-only * per-file output-only * per-stream
* fftools/cmdutils: drop alt_flags parameter from show_help_options()Anton Khirnov2024-01-20
| | | | | No user sets it to more than one flag, so it is redundant with req_flags.
* fftools/cmdutils: add a flag for per-stream optionsAnton Khirnov2024-01-20
| | | | | Not all OPT_SPEC options are per-stream, this will allow identifying those that are, which will be useful in following commits.
* fftools/cmdutils: hide some information listing options from basic helpAnton Khirnov2024-01-20
| | | | They are for advanced usage only and should not clutter basic output.
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-20
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* fftools/ffmpeg: deprecate -filter_scriptAnton Khirnov2024-01-20
| | | | It is equivalent to -/filter.
* fftools/ffmpeg: deprecate -filter_complex_scriptAnton Khirnov2024-01-20
| | | | It is equivalent to -/filter_complex.
* fftools/cmdutils: add option syntax for loading arbitrary arguments from a fileAnton Khirnov2024-01-20
| | | | Aligned with analogous feature for filter options in ffmpeg CLI.
* fftools/ffmpeg: make attachment filenames dynamically allocatedAnton Khirnov2024-01-20
| | | | | Do not store the supplied arg pointer directly. While that is valid for now, it will become ephemeral in the future commits.
* fftools/ffmpeg_opt: mark -stream_group as expert optionAnton Khirnov2024-01-19
|
* fftools/ffmpeg_demux: implement -bsf for inputAnton Khirnov2024-01-19
| | | | | Previously bitstream filters could only be applied right before muxing, this allows to apply them right after demuxing.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-22
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg: remove deprecated -[av]bsfAnton Khirnov2023-12-22
| | | | They were marked as deprecated over 10 years ago.
* fftools/ffmpeg: mark -vsync for future removalAnton Khirnov2023-12-22
| | | | It has already been deprecated over a year ago.
* fftools/ffmpeg_opt: fix -dn flagsAnton Khirnov2023-12-22
| | | | It's a data, not video option.
* fftools/ffmpeg_opt: print a section for data-stream optionsAnton Khirnov2023-12-22
| | | | | Only show it with show_advanced (triggered by -h long), since data streams themselves are an advanced topic.
* fftools/ffmpeg_opt: refine printing type-specific optionsAnton Khirnov2023-12-22
| | | | | | * filter subtitle/data options out of main, video and audio sections * add filters that were missing entirely from the subtitle section * add a missing section for advanced subtitle options
* fftools/ffmpeg_opt: mark more options as OPT_EXPERTAnton Khirnov2023-12-22
| | | | | Reduces the basic help output to a reasonable size and stops confusing users with options the vast majority will not need.
* fftools/ffmpeg_opt: update program description to match manpageAnton Khirnov2023-12-22
| | | | Cf. 2244722f1f3
* fftools/ffmpeg: improve WARN_MULTIPLE_OPT_USAGE()Anton Khirnov2023-12-22
| | | | | | | | | | | | Currently it requires every single OPT_SPEC option to be accompanied by an array of alternate names for this option. The vast majority of options have no alternate names, resulting in a large numbers of unnecessary single-element arrays that merely contain the option name. Extend the option parsing API to allow marking options as having alternate names, or as being the canonical name for some existing alternatives. Use this new information to avoid the need for abovementioned unnecessary single-element arrays.
* fftools/ffmpeg: change the MATCH_PER_TYPE_OPT macro into a functionAnton Khirnov2023-12-22
| | | | | There is no reason for it to be a macro anymore, this makes the code using it cleaner and simpler.
* fftools/cmdutils: add a struct for a list of SpecifierOptAnton Khirnov2023-12-22
| | | | Significantly simplifies the code dealing with OPT_SPEC.
* fftools/cmdutils: include OPT_PERFILE in OPT_OFFSETAnton Khirnov2023-12-22
| | | | | And analogously OPT_OFFSET in OPT_SPEC. Previously the inclusion would be implicit and required all code to remember this.
* fftools/cmdutils: rename HAS_ARG to OPT_FUNC_ARGAnton Khirnov2023-12-22
| | | | | For consistent namespacing with other option flags. Also, document and enforce that it can only be set for func-type options.
* fftools: split off option types from other flagsAnton Khirnov2023-12-22
| | | | | These values are not actually flags, as only one of them can be meaningfully set.
* fftools/ffmpeg_opt: move deprecated options to the end of the listAnton Khirnov2023-12-22
| | | | This way they don't clutter this already-cluttered code even further.
* fftools/cmdutils: simplify handling of the HAS_ARG option flagAnton Khirnov2023-12-22
| | | | | | | | | | This option flag only carries nontrivial information for options that call a function, in all other cases its presence can be inferred from the option type (bool options do not have arguments, all other types do) and is thus nothing but useless clutter. Change the option parsing code to infer its value when it can, and drop the flag from options where it's not needed.
* fftools/ffmpeg_opt: drop HAS_ARG from auto{scale,rotate}Anton Khirnov2023-12-22
| | | | | | | | | | | It causes those options to be parsed as either * -autofoo 0/1 (with an argument) * -noautofoo (without an argument) This is unnecessary, confusing, and against the documentation; these are also the only two bool options that take an argument. This should not affect the users, as these options are on by default, and are supposed to be used as -nofoo per the documentation.
* ffmpeg: add support for muxing AVStreamGroupsJames Almer2023-12-18
| | | | | | Starting with IAMF support. Signed-off-by: James Almer <jamrial@gmail.com>
* fftools/ffmpeg: deprecate -fps_mode/vsync dropAnton Khirnov2023-12-18
| | | | | It depends on the ability of muxers to generate timestamps, which is itself deprecated.
* fftools/ffmpeg: convert to a threaded architectureAnton Khirnov2023-12-12
| | | | | | | | | | Change the main loop and every component (demuxers, decoders, filters, encoders, muxers) to use the previously added transcode scheduler. Every instance of every such component was already running in a separate thread, but now they can actually run in parallel. Changes the results of ffmpeg-fix_sub_duration_heartbeat - tested by JEEB to be more correct and deterministic.
* fftools/ffmpeg: add thread-aware transcode scheduling infrastructureAnton Khirnov2023-12-12
| | | | | | | | | | | | | | | See the comment block at the top of fftools/ffmpeg_sched.h for more details on what this scheduler is for. This commit adds the scheduling code itself, along with minimal integration with the rest of the program: * allocating and freeing the scheduler * passing it throughout the call stack in order to register the individual components (demuxers/decoders/filtergraphs/encoders/muxers) with the scheduler The scheduler is not actually used as of this commit, so it should not result in any change in behavior. That will change in future commits.
* fftools/ffmpeg: deprecate the -top optionAnton Khirnov2023-09-18
| | | | | | It is badly named (should have been -top_field_first, or at least -tff), underdocumented and underspecified, and (most importantly) entirely redundant with the setfield filter.
* fftools/ffmpeg_opt: Reduce scope of variables for deprecated codeAndreas Rheinhardt2023-07-23
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_opt: Fix leak on errorAndreas Rheinhardt2023-07-23
| | | | | | | Fixes Coverity id #1539096. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_opt: Fix leak on errorAndreas Rheinhardt2023-07-23
| | | | | | | Fixes Coverity issue #1539097. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/cmdutils: return AVERROR_EXIT for OPT_EXIT options instead of aborting()Anton Khirnov2023-07-20
|