summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_opt.c
Commit message (Collapse)AuthorAge
* fftools/ffmpeg: drop mistakenly added empty lineAnton Khirnov2022-03-22
|
* fftools: move opt_timelimit from cmdutils to ffmpegAnton Khirnov2022-03-22
| | | | This option is only supported by ffmpeg.
* fftools/cmdutils: split common option handlers into their own fileAnton Khirnov2022-03-22
|
* ffmpeg: make the ac option set the demuxer's ch_layout AVOptionJames Almer2022-03-22
| | | | | | channels is deprecated on all supported raw demuxers. Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg: add a ch_layout option as an alias to channel_layoutJames Almer2022-03-22
| | | | | | This ensures it's parsed as a CLI option instead of the AVCodecContext AVOption. Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg: replace custom channel_layout code with an SpecifierOpt based oneJames Almer2022-03-22
| | | | | | This is cleaner and allows fine tuning which stream the option is applied to. Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg: convert to new channel layout-APIJames Almer2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* fftools/ffmpeg_opt: Apply copyinkf for all stream typesAndreas Rheinhardt2022-03-04
| | | | | | | | | | The earlier code has ignored it for all stream types except video and subtitles, probably because audio was presumed to only consist of keyframes. Yet this assumption is not true for e.g. TrueHD. Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_opt: Simplify adding complex filtergraphAndreas Rheinhardt2022-03-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_opt: Simplify adding new input/output streamsAndreas Rheinhardt2022-03-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffmpeg: flush delayed frames in codec copy scenariosJames Almer2022-02-28
| | | | | | | Bitstream filters inserted between the input and output were never drained, resulting in packets being lost if the bsf had any buffered. Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg: switch to new FIFO APIAnton Khirnov2022-02-07
|
* ffmpeg: move setting video sync method to new_video_stream()Anton Khirnov2021-12-07
| | | | | | do_video_out() is the wrong place for it, since the necessary information is already known when creating the stream and its value should never change.
* ffmpeg: deprecate passing numbers to -vsyncAnton Khirnov2021-12-07
| | | | | There is never a reason to do this, using symbolic names is always preferred.
* ffmpeg: change vsync value to an enumAnton Khirnov2021-12-07
| | | | | Stop explicitly defining VSCFR and DROP values, which were never documented.
* fftools/ffmpeg_opt: Improve alloc/truncation checks when reading linesAndreas Rheinhardt2021-12-07
| | | | | | | | Do this by switching from the dynamic buffer API to the AVBPrint API; the former has no defined way to check for errors. This also avoids allocating an AVIOContext. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_opt: Improve checks for truncation/alloc errorAndreas Rheinhardt2021-12-07
| | | | | | | | Do this by switching from the dynamic buffer API to the AVBPrint API; the former has no defined way to check for errors. This also avoids allocating an AVIOContext. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg: Avoid allocating+freeing frame, check allocationsAndreas Rheinhardt2021-12-05
| | | | | | Fixes a potential crash upon av_frame_alloc() failure. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/cmdutils: Make allocate_array_elem() return ptr to new elementAndreas Rheinhardt2021-12-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_(filter|opt): Use dedicated pointer for array elem accessAndreas Rheinhardt2021-12-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/cmdutils: Atomically add elements to list of pointers, fix crashAndreas Rheinhardt2021-12-05
| | | | | | | | | | | | | | Currently, adding a (separately allocated) element to a list of pointers works by first reallocating the array of pointers and (on success) incrementing its size and only then allocating the new element. If the latter allocation fails, the size is inconsistent, i.e. array[nb_array_elems - 1] is NULL. Our cleanup code crashes in such scenarios. Fix this by adding an auxiliary function that atomically allocates and adds a new element to a list of pointers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffmpeg: make -bits_per_raw_sample a per-output-stream optionAnton Khirnov2021-12-04
| | | | Also, document it and make it apply to audio in addition to video.
* fftools/ffmpeg_opt: Don't set source_index redundantlyAndreas Rheinhardt2021-11-30
| | | | | | It is already set in new_output_stream(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_opt: Don't duplicate array unnecessarilyAndreas Rheinhardt2021-11-30
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffmpeg: remove ffmpeg_videotoolboxrcombs2021-11-28
| | | | | | This was almost completely redundant. The only functionality that's no longer available after this removal is the videotoolbox_pixfmt arg, which has been obsolete for several years.
* fftools/ffmpeg: Take type limitations of AVFifo API into accountAndreas Rheinhardt2021-11-26
| | | | | | | | | | | | The types used by the AVFifo API are inconsistent: av_fifo_(space|size)() returns an int; av_fifo_alloc() takes an unsigned, other parts use size_t. This commit therefore ensures that the size of the muxing_queue FIFO never exceeds INT_MAX. While just at it, also make sure not to call av_fifo_size() unnecessarily often. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffmpeg: drop -isync, which did nothing since 2012Anton Khirnov2021-11-23
|
* ffmpeg: drop -sameq/-samequant optionsAnton Khirnov2021-11-23
| | | | They did nothing but return an error since 2012.
* ffmpeg: drop the -tvstd optionAnton Khirnov2021-11-23
| | | | It is undocumented and has been deprecated since 2012.
* ffmpeg: drop the -vc optionAnton Khirnov2021-11-23
| | | | It is undocumented and has been deprecated since 2012.
* ffmpeg: drop the -deinterlace optionAnton Khirnov2021-11-23
| | | | It is undocumented and has been deprecated since 2013.
* ffmpeg: drop the -intra optionAnton Khirnov2021-11-23
| | | | It is undocumented and has been marked as deprecated since 2012.
* fftools/ffmpeg: Avoid temporary frameAndreas Rheinhardt2021-11-20
| | | | | | | | | | | | | | | send_frame_to_filters() sends a frame to all the filters that need said frame; for every filter except the last one this involves creating a reference to the frame, because av_buffersrc_add_frame_flags() by default takes ownership of the supplied references. Yet said function has a flag which changes its behaviour to create a reference itself. This commit uses this flag and stops creating the references itself; this allows to remove the spare AVFrame holding the temporary references; it also avoids unreferencing said frame. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffmpeg: Allocate InputStream.decoded_frame earlyJames Almer2021-11-19
| | | | | | Based on a commit by Andreas Rheinhardt. Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg: Allocate (In|Out)putStream.filter_frame earlyJames Almer2021-11-19
| | | | | | Based on a commit by Andreas Rheinhardt. Signed-off-by: James Almer <jamrial@gmail.com>
* fftools: Constify values from av_dict_get()Chad Fraleigh2021-11-18
| | | | | | | | Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh <chadf@triularity.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffmpeg: fix loosing gaps between audio frame timestamps when filteringPaul B Mahol2021-11-18
|
* ffmpeg: rewrite setting the stream dispositionAnton Khirnov2021-11-16
| | | | | | | | | | | | | | | | | | | | | Currently, the code doing this is spread over several places and may behave in unexpected ways. E.g. automatic 'default' marking is only done for streams fed by complex filtergraphs. It is also applied in the order in which the output streams are initialized, which is effectively random. Move processing the dispositions at the end of open_output_file(), when we already have all the necessary information. Apply the automatic default marking only if no explicit -disposition options were supplied by the user, and apply it to the first stream of each type (excluding attached pics) when there is more than one stream of that type and no default markings were copied from the input streams. Explicitly document the new behavior. Changes the results of some tests, where the output file gets a default disposition, while it previously did not.
* fftools/ffmpeg_opt: Fix copyinkf option name in warning messageAndreas Rheinhardt2021-11-10
| | | | | Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg, ffmpeg_opt: Allocate (In|Out)putStream.pkt earlyAndreas Rheinhardt2021-10-08
| | | | | | | Avoids checks lateron in the hot path. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_opt: Remove write-only variableAndreas Rheinhardt2021-10-02
| | | | | | | | Unused since 6b35a83214f1bc3fb38c9ea9c2cd3676f28709fa (the removal of ffserver). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_opt: Add missing AV_OPT_SEARCH_FAKE_OBJAndreas Rheinhardt2021-09-20
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-20
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffmpeg: let AVFilterGraph parse the filter_threads optionJames Almer2021-09-04
| | | | | | | | | This way the CLI accepts for "filter_threads" the same values as for the libavcodec specific option "threads". Fixes FATE with THREADS=auto which was broken in bdc1bdf3f5. Signed-off-by: James Almer <jamrial@gmail.com>
* fftools: Remove remnants of resample_optsAndreas Rheinhardt2021-09-03
| | | | | | | | | | | | | | These were intended to pass options to auto-inserted avresample resampling filters. Yet FFmpeg uses swresample for this purpose (with its own AVDictionary swr_opts similar to resample_opts). Therefore said options were not forwarded any more since commit 911417f0b34e611bf084319c5b5a4e4e630da940; moreover since commit 420cedd49745b284c35d97b936b71ff79b43bdf7 avresample options are not even recognized and ignored any more. Yet there are still remnants of all of this. This commit gets rid of them. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* qsvdec: add support for HW_DEVICE_CTX methodHaihao Xiang2021-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows user set hw_device_ctx instead of hw_frames_ctx for QSV decoders, hence we may remove the ad-hoc libmfx setup code from FFmpeg. "-hwaccel_output_format format" is applied to QSV decoders after removing the ad-hoc libmfx code. In order to keep compatibility with old commandlines, the default format is set to AV_PIX_FMT_QSV, but this behavior will be removed in the future. Please set "-hwaccel_output_format qsv" explicitly if AV_PIX_FMT_QSV is expected. The normal device stuff works for QSV decoders now, user may use "-init_hw_device args" to initialise device and "-hwaccel_device devicename" to select a device for QSV decoders. "-qsv_device device" which was added for workarounding device selection in the ad-hoc libmfx code still works For example: $> ffmpeg -init_hw_device qsv=qsv:hw_any,child_device=/dev/dri/card0 -hwaccel qsv -c:v h264_qsv -i input.h264 -f null - /dev/dri/renderD128 is actually open for h264_qsv decoder in the above command without this patch. After applying this patch, /dev/dri/card0 is used. $> ffmpeg -init_hw_device vaapi=va:/dev/dri/card0 -init_hw_device qsv=hw@va -hwaccel_device hw -hwaccel qsv -c:v h264_qsv -i input.h264 -f null - device hw of type qsv is not usable in the above command without this patch. After applying this patch, this command works as expected. Reviewed-by: Soft Works <softworkz@hotmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg_opt: restore documented stream selection behaviourGyan Doshi2021-08-01
| | | | | | | | | | | | | | | | 11d3b03fcb added consideration of default stream disposition for audio and video when choosing the 'best' stream among all the inputs. This can lead to video streams with lower resolution or audio streams with fewer channels being selected. Stream disposition, however, only sets a priority for a stream among all other streams in the *same input*. It cannot set a priority for a stream across all inputs. This patch sets a middle-way and selects the best stream from each file with default disposition considered. Then it discards disposition weight and selects best stream as per the original criteria of highest resolution for video and most channels for audio.
* avcodec/avcodec: Stop including bsf.h in avcodec.hAndreas Rheinhardt2021-07-22
| | | | | | Also include bsf.h directly wherever it is used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffmpeg: add option readrateGyan Doshi2021-07-17
| | | | | | | Allows to read inputs at arbitrary rates. -re is equivalent to -readrate 1 Tested with -copyts {+ start_at_zero}, -ss, streamcopied & decoded streams.
* ffmpeg: add option recast_mediaGyan Doshi2021-07-11
| | | | | Allows forcing decoders of different media type. Needed to decode media data muxed as data streams.