1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Go to file
Anton Khirnov 4740fea7dd fftools/ffmpeg: rework -shortest implementation
The -shortest option (which finishes the output file at the time the
shortest stream ends) is currently implemented by faking the -t option
when an output stream ends. This approach is fragile, since it depends
on the frames/packets being processed in a specific order. E.g. there
are currently some situations in which the output file length will
depend unpredictably on unrelated factors like encoder delay. More
importantly, the present work aiming at splitting various ffmpeg
components into different threads will make this approach completely
unworkable, since the frames/packets will arrive in effectively random
order.

This commit introduces a "sync queue", which is essentially a collection
of FIFOs, one per stream. Frames/packets are submitted to these FIFOs
and are then released for further processing (encoding or muxing) when
it is ensured that the frame in question will not cause its stream to
get ahead of the other streams (the logic is similar to libavformat's
interleaving queue).

These sync queues are then used for encoding and/or muxing when the
-shortest option is specified.

A new option – -shortest_buf_duration – controls the maximum number of
queued packets, to avoid runaway memory usage.

This commit changes the results of the following tests:
- copy-shortest[12]: the last audio frame is now gone. This is
  correct, since it actually outlasts the last video frame.
- shortest-sub: the video packets following the last subtitle packet are
  now gone. This is also correct.
2022-07-23 11:53:19 +02:00
compat avfilter: add chromakey_cuda filter 2022-07-10 17:20:15 +02:00
doc fftools/ffmpeg: rework -shortest implementation 2022-07-23 11:53:19 +02:00
ffbuild ffbuild/common: Fix CPPFLAGS applied for compiling C++ files 2022-05-24 21:30:52 +02:00
fftools fftools/ffmpeg: rework -shortest implementation 2022-07-23 11:53:19 +02:00
libavcodec avcodec/hevc_filter: copy_CTB() only within width&height 2022-07-22 17:25:25 +02:00
libavdevice lavd: use AVFrame.duration instead of AVFrame.pkt_duration 2022-07-19 12:27:17 +02:00
libavfilter lavf/sr: fix the segmentation fault caused by incorrect input frame free. 2022-07-22 08:15:04 +08:00
libavformat avformat/mpc8: Check and propagate more errors 2022-07-21 19:28:52 +02:00
libavutil lavu/frame: add a duration field to AVFrame 2022-07-19 12:27:17 +02:00
libpostproc Bump versions after 5.1 branch 2022-07-13 00:29:05 +02:00
libswresample Bump versions after 5.1 branch 2022-07-13 00:29:05 +02:00
libswscale swscale: add NV16 input/output 2022-07-19 12:20:16 +02:00
presets
tests fftools/ffmpeg: rework -shortest implementation 2022-07-23 11:53:19 +02:00
tools tools/target_dec_fuzzer: Adjust threshold for MWSC 2022-07-21 19:27:38 +02:00
.gitattributes
.gitignore gitignore: add config_components.h 2022-03-17 18:35:41 -03:00
.mailmap mailmap: add entry for myself 2021-03-09 02:09:55 +00:00
.travis.yml
Changelog fftools/ffmpeg: rework -shortest implementation 2022-07-23 11:53:19 +02:00
configure avfilter/vsrc_ddagrab: check for existence of DPI_AWARENESS_CONTEXT 2022-07-19 13:57:38 +02:00
CONTRIBUTING.md
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS
INSTALL.md
LICENSE.md avfilter/vf_geq: Relicense to LGPL 2019-12-28 11:20:48 +01:00
MAINTAINERS MAINTAINERS: add myself as maintainer for LoongArch. 2022-06-08 18:29:30 +02:00
Makefile Makefile: Prompt for reconfigure on lavc/hwaccels.h modification 2022-07-01 00:34:38 +02:00
README.md README: fix typo and description of libavfilter 2021-10-08 09:44:34 +05:30
RELEASE RELEASE: update after 5.1 branch 2022-07-13 00:31:42 +02:00

FFmpeg README

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides means to alter decoded audio and video through a directed graph of connected filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

The online documentation is available in the main website and in the wiki.

Examples

Coding examples are available in the doc/examples directory.

License

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Patches should be submitted to the ffmpeg-devel mailing list using git format-patch or git send-email. Github pull requests should be avoided because they are not part of our review process and will be ignored.