streamio/streamio-ffmpeg — pull request #94 by gmcnaughton (2014-12-10 21:27:13+00:00)
Title: Fix for #81 (start time offset seeking slow)

Fix for #81 (start time offset seeking slow)

Move the -ss (seek time) param ahead of the -i (input file) param in the command line. This causes ffmpeg to use faster input seeking rather than slower output seeking (see https://trac.ffmpeg.org/wiki/Seeking). The speedup is dramatic; end-of-video screenshots that took minutes on my computer are almost instantaneous (because it seeks rather than playing through the whole video).

Possible downsides, per the docs:

> As of FFmpeg 2.1, the main advantage [of slower output seeking] is that when applying filters to the output stream, the timestamps aren't reset prior to filtering (i.e. when ​burning subtitles into a video, you don't need to modify the subtitle timestamps), but the drawback is that it will take a lot of time until it finally reaches that time point. The bigger the seeking time is, the longer you will have to wait.

Sorry for the lack of specs! Many existing specs fail on my machine, then rake locks up trying to simulate ffmpeg freezing.