Please describe the problem you are having in as much detail as possible:
As described in #867, seeking is quite slow, and from my tests it still is now. I believe I found the problem:
The FFMPEG docs https://trac.ffmpeg.org/wiki/Seeking describe input and output seeking. Which one is performed depends on the position of the seek -ss argument. In the current code, the argument is supplied after the input argument, so output seeking is performed, which is slow. I think, with input seeking, the performance should be much better, unless I'm missing something.
So I propose to move the seek argument before the input argument.
Code in BasePlayer.js where argument is supplied:
const args = isStream ? FFMPEG_ARGUMENTS.slice() : ['-i', input, ...FFMPEG_ARGUMENTS];
if (options.seek) args.push('-ss', String(options.seek));
Change to something like:
const args = isStream ? FFMPEG_ARGUMENTS.slice() : ['-i', input, ...FFMPEG_ARGUMENTS];
if (options.seek) args.unshift('-ss', String(options.seek));
Further details:
Fixed in the above commit :)
Great, I tested it, and even seeking to the 2 hour mark in a 24h long video is pretty fast!
Most helpful comment
Great, I tested it, and even seeking to the 2 hour mark in a 24h long video is pretty fast!