Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-18fftools/ffmpeg: remove the output_streams globalAnton Khirnov
Replace it with an array of streams in each OutputFile. This is a more accurate reflection of the actual relationship between OutputStream and OutputFile. This is easier to handle and will allow further simplifications in future commits.
2022-10-04fftools/ffmpeg: drop the -async optionAnton Khirnov
It has been deprecated in favor of the aresample filter for almost 10 years. Another thing this option can do is drop audio timestamps and have them generated by the encoding code or the muxer, but - for encoding, this can already be done with the setpts filter - for muxing this should almost never be done as timestamp generation by the muxer is deprecated, but people who really want to do this can use the setts bitstream filter
2022-09-23fftools/ffmpeg_filter: configure min_hard_comp unconditionallyZhao Zhili
There are two issues here. Firstly, the floating-point comparison is always true. Seconly, the code depends on the default value of min_hard_comp implicitly, which can be dangerous. Partially fixes ticket 9859. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-09-01fftools: Use report_error_then_exit_program() for allocation failuresAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-29fftools/ffmpeg: drop OutputStream.encAnton Khirnov
It is either equal to OutputStream.enc_ctx->codec, or NULL when enc_ctx is NULL. Replace the use of enc with enc_ctx->codec, or the equivalent enc_ctx->codec_* fields where more convenient.
2022-08-29fftools/ffmpeg_filter: remove an always-true checkAnton Khirnov
ost->enc is always non-NULL here, since - this code is never called for streamcopy - opening the output file will fail if an encoder cannot be found, so filters are never initialized
2022-08-29fftools/ffmpeg_filter: remove an always-false checkAnton Khirnov
This code cannot be triggered, since after 90944ee3ab7 opening the output file will abort if an encoder cannot be found and streamcopy was not explicitly requested.
2022-08-22fftools/ffmpeg: call av_guess_frame_rate() when opening the fileAnton Khirnov
It is currently called when configuring the filter, which races with the demuxer thread.
2022-07-28fftools/ffmpeg_filter: drop a block commented out since 2012Anton Khirnov
Since the option it relates to is deprecated, it is highly unlikely to become useful.
2022-07-28fftools/ffmpeg: deprecate the -map_channel optionAnton Khirnov
It is now entirely redundant with audio filters, and is in fact implemented by setting up a 'pan' filter instance.
2022-07-28fftools/ffmpeg: drop the -vol optionAnton Khirnov
It has been deprecated in favor of the volume filter since 2012.
2022-07-28fftools/ffmpeg_filter: do not pass the entire AVCodecContext to ↵Anton Khirnov
choose_pixel_fmt() It only uses strict_std_compliance, so pass just that value. Makes it more clear what fields are accessed.
2022-07-28fftools/ffmpeg_filter: remove unused function argumentAnton Khirnov
2022-07-23fftools/ffmpeg: make the muxer AVFormatContext private to ffmpeg_mux.cAnton Khirnov
Since the muxer will operate in a separate thread in the future, the muxer context should not be accessed from the outside.
2022-03-15ffmpeg: convert to new channel layout-APIJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2022-02-28ffmpeg: flush delayed frames in codec copy scenariosJames Almer
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>
2022-02-15fftools/ffmpeg: fix (a)buffer src namesAnton Khirnov
2022-02-07ffmpeg: switch to new FIFO APIAnton Khirnov
2021-12-23fftools/ffmpeg_filter: Avoid inserting hflip filterAndreas Rheinhardt
The transpose filter has modes equivalent to "rotation by 90°/270°" followed by horizontal flips. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-23fftools/ffmpeg_filter: Fix autorotationAndreas Rheinhardt
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>
2021-12-05fftools/cmdutils: Make allocate_array_elem() return ptr to new elementAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-05fftools/ffmpeg_(filter|opt): Use dedicated pointer for array elem accessAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-05fftools/cmdutils: Atomically add elements to list of pointers, fix crashAndreas Rheinhardt
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>
2021-12-04ffmpeg: only copy bits_per_sample from decoder when it remains validAnton Khirnov
I.e. when the only filters that are applied do not modify the frame data.
2021-12-03fftools/ffmpeg_filter: Avoid DynBuf API to improve error checksAndreas Rheinhardt
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>
2021-12-03fftools/ffmpeg_filter: Avoid DynBuf-API for writing stringsAndreas Rheinhardt
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>
2021-11-23ffmpeg: drop the -deinterlace optionAnton Khirnov
It is undocumented and has been deprecated since 2013.
2021-11-18fftools: Constify values from av_dict_get()Chad Fraleigh
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>
2021-09-21ffmpeg_filter: don't try to autorotate frames with hwaccel pixel formatsJames Almer
The transpose, rotate, hflip, and vflip filters don't support them. Fixes ticket #9432. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-16ffmpeg: take into account image flipping in the display matrixJames Almer
This covers only standard rotations. Fixes part of ticket #6945. Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-16ffmpeg: use display matrix frame side data for autorotationJames Almer
And give it priority over stream side data when present. Fixes part of ticket #6945. Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-04ffmpeg: let AVFilterGraph parse the filter_threads optionJames Almer
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>
2021-09-03fftools: Remove remnants of resample_optsAndreas Rheinhardt
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>
2021-08-30Revert "fftools/ffmpeg_filter: fix the flags parsing for scaler"Linjie Fu
This reverts commit b3a0548a981db52911dd34d9de254c4fee0a8f79. This breaks the usage of swscale options, scale_sws_opts should be passed to auto-inserted scale-filters. Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
2021-08-29ffmpeg_filter: do not override -filter_threads with -threadsAnton Khirnov
When both -filter_threads and -threads are specified, the latter takes effect. Since -threads is an encoder option and -filter_threads is a filter option, it makes sense for the -filter_threads to take precedence.
2021-08-29ffmpeg: reset the dict iterator before useAnton Khirnov
2021-08-25fftools/ffmpeg_filter: silence valgrind warningPaul B Mahol
2021-08-07fftools/ffmpeg_filter: add a return at the end of non-void functionsJames Almer
Fixes compilation with GCC 11 when configured with --disable-optimizations Signed-off-by: James Almer <jamrial@gmail.com>
2021-08-05fftools/ffmpeg_filter: fix the flags parsing for scalerLinjie Fu
Scaler relys on "-sws_flags" option to pass the flags to swscale and scale filter. Currently passing "sws_flags=xxx" as a filter option to scaler leads to an incorrect option parsing. Check and change the string to "flags=xxx" and dumped flags information. (Refer to parse_sws_flags()) CMD: $ffmpeg -v verbose -i input.mp4 -sws_flags lanczos+bitexact+accurate_rnd \ -vf format=yuv420p,scale=800x600 -an -vframes 10 -f md5 - Before: [auto_scaler_0 @ 0x7f96c3808680] w:iw h:ih flags:'' interl:0 [auto_scaler_0 @ 0x7f96c3808680] w:1920 h:1080 fmt:yuvj420p sar:0/1 -> w:1920 h:1080 fmt:yuv420p sar:0/1 flags:0x0 [Parsed_scale_1 @ 0x7f96c3806e40] w:1920 h:1080 fmt:yuv420p sar:0/1 -> w:800 h:600 fmt:yuv420p sar:0/1 flags:0x0 MD5=ff1d6091690c6fcd36d458d2a9f648ce After: [auto_scaler_0 @ 0x7fe94563b4c0] w:iw h:ih flags:'lanczos+bitexact+accurate_rnd' interl:0 [auto_scaler_0 @ 0x7fe94563b4c0] w:1920 h:1080 fmt:yuvj420p sar:0/1 -> w:1920 h:1080 fmt:yuv420p sar:0/1 flags:0xc0200 [Parsed_scale_1 @ 0x7fe945639d00] w:1920 h:1080 fmt:yuv420p sar:0/1 -> w:800 h:600 fmt:yuv420p sar:0/1 flags:0xc0200 MD5=ff1d6091690c6fcd36d458d2a9f648ce Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
2021-04-27libavresample: Remove deprecated libraryAndreas Rheinhardt
Deprecated in c29038f3041a4080342b2e333c1967d136749c0f. The resample filter based upon this library has been removed as well. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-13fftools/ffmpeg_filter: Fix check for mjpeg encoderAndreas Rheinhardt
The MJPEG encoder supports some pixel format/color range combinations only when strictness is set to unofficial or less. Before commit 059fc2d9da5364627613fb3e6424079e14dbdfd3 said encoder's pix_fmts array only included the pixel formats supported with default strictness. When strictness was <= unofficial, fftools/ffmpeg_filter.c used an extended list of pixel formats instead of the encoder's including the pixel formats only supported when strictness <= unofficial. Said commit turned the logic around: The encoder's pix_fmts array now included all pixel formats and fftools/ffmpeg_filter.c instead used a small list of all pixel formats supported when strictness is > unofficial and the encoder's pixel formats instead. In particular, the codec's pix_fmt is not used when strictness is normal. This works for the mjpeg encoder; yet it did not work for other (hardware-based) mjpeg encoders, because the check for whether one is using the MJPEG encoder is wrong: It just checks the codec id. So if one used strict unofficial with a hardware-accelerated MJPEG encoder before commit 059fc2d9da53, the unofficial (non-hardware) pixel formats of the MJPEG encoder would be used; since said commit the codec's pixel formats are overridden at ordinary strictness by the ordinary MJPEG pixel formats. This leads to format conversion errors lateron which were reported in #9186. The solution to this is to check AVCodec.name instead of its id. Fixes ticket #9186. Tested-by: Eoff, Ullysses A <ullysses.a.eoff@intel.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-10fftools/ffmpeg_filter: Don't needlessly copy stringAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-10fftools/ffmpeg_filter: Don't write string that is never usedAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-10fftools/ffmpeg_filter: Avoid allocations when configuring output filtersAndreas Rheinhardt
Use an AVBPrint to handle the (typically short) strings involved here. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-10avcodec/mjpegenc: Include all supported pix_fmts in mpegenc pix_fmtsAndreas Rheinhardt
Currently said list contains only the pixel formats that are always supported irrespective of the range and the value of strict_std_compliance. This makes the MJPEG encoder an outlier as all other codecs put all potentially supported pixel formats into said list and error out if the chosen pixel format is unsupported. This commit brings it therefore in line with the other encoders. The behaviour of fftools/ffmpeg_filter.c has been preserved. A more informed decision would be possible if colour range were available at this point, but it isn't. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-02-26fftools/ffmpeg_filter: Don't use deprecated functionAndreas Rheinhardt
avcodec_find_best_pix_fmt_of_2 has been moved to libavutil in 617e866e25b72fa5d9f9d6bbcbd7e4bd69e63a54. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-03fftools/ffmpeg_filter: Make functions only used locally staticAndreas Rheinhardt
Also remove some declarations of inexistent functions while at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-03fftools/ffmpeg_filter: Remove ist_in_filtergraphAndreas Rheinhardt
Unused since af1761f7b5b1b72197dc40934953b775c2d951cc. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-03fftools/ffmpeg_filter: Remove choose_sample_fmtAndreas Rheinhardt
Unused since 6b35a83214f1bc3fb38c9ea9c2cd3676f28709fa. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-31ffmpeg: remove dead code for -volGyan Doshi
It is applied via configure_input_audio_filter()