From b822faa6cfdae2c530d68f257a811c6184d237a6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 16 Aug 2014 17:07:36 +0200 Subject: demux: add option to control the readahead buffer by a duration value --demuxer-readahead-secs now controls how much the demuxer should readahead by an amount of seconds. This is based on the raw packet timestamps. It's not always very exact. For example, h264 in Matroska does not store any linear timestamps (only PTS values which are going to be reordered by the decoder), so this heuristic is usually off by several hundred milliseconds. The decision whether to readahead is basically OR-ed with the other --demuxer-readahead-packets options. Change the manpage descriptions to subtly convey these semantics. --- DOCS/man/options.rst | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'DOCS') diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 9320a244ac..edbbc35419 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -2048,11 +2048,21 @@ Demuxer Run the demuxer in a separate thread, and let it prefetch a certain amount of packets (default: no). +``--demuxer-readahead-secs=N`` + If ``--demuxer-thread`` is enabled, this controls how much the demuxer + should buffer ahead in seconds (default: 0.2). As long as no packet has + a timestamp difference higher than the readahead amount relative to the + last packet returned to the decoder, the demuxer keeps reading. + + (This value tends to be fuzzy, because many file formats don't store linear + timestamps.) + ``--demuxer-readahead-packets=N`` If ``--demuxer-thread`` is enabled, this controls how much the demuxer - should buffer ahead. If the number of packets in the packet queue exceeds - ``--demuxer-readahead-packets``, or the total number of bytes exceeds - ``--demuxer-readahead-bytes``, the thread stops reading ahead. + should buffer ahead. As long as the number of packets in the packet queue + doesn't exceed ``--demuxer-readahead-packets``, and the total number of + bytes doesn't exceed ``--demuxer-readahead-bytes``, the thread keeps + reading ahead. Note that if you set these options near the maximum, you might get a packet queue overflow warning. -- cgit v1.2.3