View Single Post
Old 12th July 2019, 11:59   #23570  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,342
TS, as a format, is not designed for seeking. Its designed for broadcast and streaming. If you want local file playback with perfect seeking, use a format that is designed for these tasks. I have said that repeatedly over the years. I will not spend excessive amount of time trying to improve TS seeking, because its fundamentally not a concept helped by the container. There are perfect formats/tools for each job, use the right ones.

Seeking in a format like MPEG-TS is always just guess work. You "randomly" (with some educated guesses) look around in the file for a timestamp that matches the one you are interested in, because there is no index or any other clues where your target time is. This is a balance between the amount of file IO you perform to find it, obviously I could just read from the start and stop when I find it, but that would be slow, and the accuracy. Sometimes it finds one a bit too early, or a bit too late, which then takes the playback chain a bit to "catch up", or it just missed the previous key frame (and due to container inadequacy, it also has no clue where those are), hence "slow seeking".

There is a reason Blu-ray, for example, which uses MPEG-TS carries an external seeking index in a seperate file, so it can actually do seeking using that information.

LAV uses the FFmpeg MPEG-TS demuxer, so you know where to send improvements.

One final note, for example the cited "LWLibavVideoSource" in an earlier post which does "perfect seeking" - you know how it does that? It reads the entire TS file and builds a complete seeking index. A video processing tool can certainly afford to be a bit slow to do this, but something focused on playback like LAV is not in a position to be that slow on file opening or first seek.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders

Last edited by nevcairiel; 12th July 2019 at 12:14.
nevcairiel is online now   Reply With Quote