From f3d06e3e913ea061a716935a561c9d5c1758f718 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 9 Jul 2015 22:47:41 +0200 Subject: demux_mkv: improve video duration detection heuristic Extend the --demuxer-mkv-probe-video-duration behavior to work with files that are partial and are missing an index. Do this by finding a cluster 10MB before the end of the file, and if that fails, just read the entire file. This is actually pretty trivial to do and requires only 5 lines of code. Also add a mode that always reads the entire file to estimate the video duration. --- DOCS/man/options.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'DOCS') diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 8a0587e383..ae1147543d 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -2137,13 +2137,18 @@ Demuxer ``--demuxer-mkv-subtitle-preroll-secs=`` See ``--demuxer-mkv-subtitle-preroll``. -``--demuxer-mkv-probe-video-duration`` +``--demuxer-mkv-probe-video-duration=`` When opening the file, seek to the end of it, and check what timestamp the last video packet has, and report that as file duration. This is strictly for compatibility with Haali only. In this mode, it's possible that opening will be slower (especially when playing over http), or that behavior with broken files is much worse. So don't use this option. + The ``yes`` mode merely uses the index and reads a small number of blocks + from the end of the file. The ``full`` mode actually traverses the entire + file and can make a reliable estimate even without an index present (such + as partial files). + ``--demuxer-mkv-fix-timestamps=`` Fix rounded Matroska timestamps (enabled by default). Matroska usually stores timestamps rounded to milliseconds. This means timestamps jitter -- cgit v1.2.3