Classifies a stream by what reaching an arbitrary frame costs. More...
Detailed Description
Classifies a stream by what reaching an arbitrary frame costs.
Scrubbing to a frame means decoding from the keyframe before it, so the longest run of non-keyframes bounds the cost of any seek, on every machine.
AV_CODEC_PROP_INTRA_ONLY is not set for CineForm, PNG, FFV1 or all-intra H.264 / HEVC / MPEG-2 (AVC-Intra, XAVC-I, IMX), so the stream itself is read: a container index covering every frame (MP4, MOV) when there is one, else the keyframe flags of the first demuxed packets. Matroska indexes only some keyframes; MPEG-TS and MXF have no index.
Go to the source code of this file.
Classes | |
| struct | Video::FrameAccessProbe |
Functions | |
| FrameAccess | Video::keyframe_probe::fromGap (int gap) noexcept |
| bool | Video::keyframe_probe::canSeek (const AVFormatContext &fmt) noexcept |
| FrameAccessProbe | Video::keyframe_probe::fromIndex (const AVStream &st) noexcept |
| Longest non-keyframe run from an index that lists every frame. | |
| FrameAccessProbe | Video::keyframe_probe::fromPackets (const char *url) noexcept |
| FrameAccessProbe | Video::classifyFrameAccess (AVFormatContext &fmt, AVStream &st, const char *url) noexcept |
Variables | |
| constexpr int | Video::keyframe_probe::max_short_gop = 15 |
| XDCAM HD and HDV use 12- to 15-frame GOPs: still worth replaying on a seek. | |
Function Documentation
◆ classifyFrameAccess()
|
inlinenoexcept |
- Parameters
-
url what fmtwas opened from; the packet probe opens it again so thatfmtis not moved.
◆ fromPackets()
|
inlinenoexcept |
Reads keyframe flags off the first packets of the first video stream, through a context of its own: some demuxers cannot be rewound afterwards (no timestamps to seek on, no byte seeking either).