mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-02 03:06:28 +02:00
Mirror of https://git.ffmpeg.org/ffmpeg.git
a3db9f62a4
Currently, resyncing during reading packets works as follows: The current position is recorded, then a call to matroska_parse_cluster is made and if said call fails, the demuxer tries to resync from the earlier position. If the call doesn't fail, but also doesn't deliver a packet, then this is looped. There are two problems with this approach: 1. The Matroska file format aims to be forward-compatible; to achieve this, a demuxer should simply ignore and skip elements it doesn't know about. But it is not possible to reliably distinguish unknown elements from junk. If matroska_parse_cluster encounters an unknown element, it can therefore not simply error out; instead it returns zero and the loop is iterated which includes an update of the position that is intended to be used in case of errors, i.e. the element that is skipped is not searched for level 1 element ids to resync to at all if later calls to matroska_parse_cluster return an error. Notice that in case that sync has been lost there can be a chain of several unknown/possibly junk elements before an error is detected. 2. Even if a call to matroska_parse_cluster delivers a packet, this does not mean that everything is fine. E.g. it might be that some of the block's data is missing and that the data that was presumed to be from the block just read actually contains the beginning of the next element. This will only be apparent at the next call of matroska_read_packet, which uses the (false) end of the earlier block as resync position so that in the (not unlikely) case that the call to matroska_parse_cluster fails, the data believed to be part of the earlier block is not searched for a level 1 element to resync to. To counter this, a "last known good" position is introduced. When an element id that is known to be allowed at this position in the hierarchy (according to the syntax currently in use for parsing) is read and some further checks (regarding the length of the element and its containing master element) are passed, then the beginning of the current element is treated as a "good" position and recorded as such in the MatroskaDemuxContext. Because of 2., only the start of the element is treated as a "good" position, not the whole element. If an error occurs later during parsing of clusters, the resync process starts at the last known good position. Given that when the header is damaged the subsequent resync never skips over data and is therefore unaffected by both issues, the "last known good" concept is not used there. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> |
||
---|---|---|
compat | ||
doc | ||
ffbuild | ||
fftools | ||
libavcodec | ||
libavdevice | ||
libavfilter | ||
libavformat | ||
libavresample | ||
libavutil | ||
libpostproc | ||
libswresample | ||
libswscale | ||
presets | ||
tests | ||
tools | ||
.gitattributes | ||
.gitignore | ||
.travis.yml | ||
Changelog | ||
configure | ||
CONTRIBUTING.md | ||
COPYING.GPLv2 | ||
COPYING.GPLv3 | ||
COPYING.LGPLv2.1 | ||
COPYING.LGPLv3 | ||
CREDITS | ||
INSTALL.md | ||
LICENSE.md | ||
MAINTAINERS | ||
Makefile | ||
README.md | ||
RELEASE |
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 a mean to alter decoded Audio and Video through chain of 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
andqt-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.