summaryrefslogtreecommitdiff
path: root/fftools
Commit message (Collapse)AuthorAge
* 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: Don't presume frame_queue to have been allocatedAndreas Rheinhardt2022-03-03
| | | | | | Fixes segfaults upon allocation failure. 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>
* fftool/ffprobe: support for CUVA HDR Vivid metadataLimin Wang2022-03-01
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* ffmpeg: ensure a keyframe was not seen before skipping packetsJames Almer2022-02-28
| | | | | | | A keyframe could be buffered in the bsf and not be output until more packets had been fed to it. Signed-off-by: James Almer <jamrial@gmail.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>
* fftools/ffprobe: Remove redundant checksAndreas Rheinhardt2022-02-23
| | | | | | | A decoder is only opened if there is a decoder for the codec, so every AVCodecContext here has AVCodecContext.codec set. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffprobe: Flush decoder after drainingAndreas Rheinhardt2022-02-23
| | | | | | | | | This is a prerequisite to continue using the decoder at all to decode the next interval (if any). This fixes a regression introduced in commit 2a88ebd096f3c748a2d99ed1b60b22879b3c567c and reported in ticket #8657. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg: fix (a)buffer src namesAnton Khirnov2022-02-15
|
* fftools/ffmpeg: Restore DTS correction for VP9 copiesDanny Wu2022-02-13
| | | | | | | | | | | | | | | | | | Fixes ticket 9086. Since early 2021, some of YouTube's VP9 encodes have non-monotonous DTS. This makes ffmpeg fatally fail when trying to copy or encode the V9 video. ffmpeg already includes functionality to correct this, however it was disabled without explanation for VP9 stream copies in 2e6636aa87303d37b112e79f093ca39500f92364 This patch restores the DTS correction logic, and allows ffmpeg to correctly encode (invalid) videos produced by youtube.com. I have verified that frames are NOT being cut (so it does not re-introduce 4313). Reviwed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* ffmpeg: switch to new FIFO APIAnton Khirnov2022-02-07
|
* ffplay: switch to new FIFO APIAnton Khirnov2022-02-07
|
* ffprobe: allow side-data selection by elementGyan Doshi2022-02-03
| | | | | | | | | | At present, side data printing forces display for all levels i.e. stream, packets and frames. This can bloat output and also force decode of all frames in selected streams. Now, stream_side_data[=type], packet_side_data[=type] & frame_side_data[=type] can be used with -show_entries to specify carrier element.
* fftools/cmdutils: Fix undefined 1 << 31Andreas Rheinhardt2022-01-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffmpeg: remove a redundant assignment of interrupt_callbackAnton Khirnov2022-01-10
| | | | It is already set in open_output_file().
* ffprobe: Support AV_FRAME_DATA_DOVI_METADATAJan Ekström2022-01-04
| | | | | Co-authored-by: Niklas Haas <git@haasn.dev> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools: provide media type info for devicesDiederick Niehorster2021-12-24
| | | | | | | | fftools now print info about what media type(s), if any, are provided by sink and source avdevices. Signed-off-by: Diederick Niehorster <dcnieho@gmail.com> Reviewed-by: Roger Pack <rogerdpack2@gmail.com>
* fftools/ffmpeg_filter: Avoid inserting hflip filterAndreas Rheinhardt2021-12-23
| | | | | | | The transpose filter has modes equivalent to "rotation by 90°/270°" followed by horizontal flips. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_filter: Fix autorotationAndreas Rheinhardt2021-12-23
| | | | | | | | | | | | | | | | | | | | | | | | | | In case of an orthogonal transformation av_display_rotation_get() returns the (anticlockwise) degree that the unit vector in x-direction gets rotated by; get_rotation in cmdutils.c makes a clockwise degree out of this. So if one inserts a transpose filter corresponding to this degree, then the x-vector gets mapped correctly and there are two possibilities for image of the y-vector, namely the two unit vectors orthogonal to the image of the x-vector. E.g. if the x-vector gets rotated by 90° clockwise, then the two possibilities for the y-vector are the unit vector in x direction or its opposite. The latter case is a simple 90° rotation for both vectors* whereas the former is a simple 90° clockwise rotation followed by a horizontal flip. These two cases can be distinguished by looking at the x-coordinate of the image of the y-vector, i.e. by looking at displaymatrix[3]. Similarly for the case of a 270° clockwise rotation. These two cases were previously wrong (they were made to match wrongly parsed exif rotation tag values). *: For display matrices, the y-axis points downward. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffprobe: add missing separator when printing side data in compact outputJames Almer2021-12-22
| | | | | | Should fix ticket #7153 Signed-off-by: James Almer <jamrial@gmail.com>
* fftools/cmdutils: Avoid crash when opts could not be allocatedYu Yang2021-12-16
| | | | | | | | If 'opts' could not be allocated, exiting the program to avoid crash when release it. Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Signed-off-by: Yu Yang <yuyang14@kuaishou.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg: close output files before cleanupMarton Balint2021-12-12
| | | | | | This allows us to check the return value of avio_closep(). Signed-off-by: Marton Balint <cus@passwd.hu>
* ffmpeg: handle errors in print_sdp()Anton Khirnov2021-12-07
| | | | Do not continue as if nothing happened.
* 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.
* ffmpeg: drop useless framerate assignmentsAnton Khirnov2021-12-07
| | | | | | If the input stream framerate is known, it will be configured on the relevant filtergraph input and get propagated to the output stream in the above line. That makes these assignments redundant.
* 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 creating unnecessary referenceAndreas Rheinhardt2021-12-05
| | | | | | | The only caller of do_video_out() doesn't need the frame afterwards, ergo one can replace an av_frame_ref() by av_frame_move_ref(). 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: Use av_dynarray_add_nofree()Andreas Rheinhardt2021-12-05
| | | | | | | Simplifies code and reduces the number of allocations a bit by overallocating. 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: only copy bits_per_sample from decoder when it remains validAnton Khirnov2021-12-04
| | | | | I.e. when the only filters that are applied do not modify the frame data.
* 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_filter: Avoid DynBuf API to improve error checksAndreas Rheinhardt2021-12-03
| | | | | | | | | | | | | | | | | choose_pix_fmts() used the dynamic buffer API to write strings; as is common among uses of this API, only opening the dynamic buffer was checked, but not the end result, leading to crashes in case of allocation failure. Furthermore, some static strings were duplicated; the allocations performed here were not properly checked: Allocation failure would be treated as "could not determine pixel format". The first issue is fixed by switching to the AVBPrint API which allows to easily perform checks at the end. Furthermore, the internal buffer avoids almost all allocations in case the AVBPrint is used. The AVBPrint also allows to solve the second issue in an elegant way, because it allows to return the static strings directly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg_filter: Avoid DynBuf-API for writing stringsAndreas Rheinhardt2021-12-03
| | | | | | | | It is not really natural, it requires internal allocations of its own and its error handling is horrible (i.e. the implicit (re)allocations here are unchecked). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* ffmpeg: fix usage of -shortest in codec copy scenariosJames Almer2021-12-01
| | | | | | | | | Don't mark all streams as finished, instead make sync_opts keep track of the stream's duration, and set recording_time to it, same as in transcoding paths. Fixes tickets #9512 and #9513. Signed-off-by: James Almer <jamrial@gmail.com>
* 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>
* fftools/ffprobe: print size of attachment streams (extradata_size)softworkz2021-11-29
| | | | | Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* 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 obsolete rotation API remnantsAnton Khirnov2021-11-23
| | | | No demuxers export the "rotate" metadata tag anymore.
* 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.