Hi! as I needed to create bulk previews of long videos, like short cuts merged on one scaled video. As i searched for some examples to do this using ffmpeg, stumbled upon a common problem on every snippet there and here... long story short: seeking will make you waste a lot of time unless you seek cleverly.
This script will do the only fast seeking method seeming to work, -ss
from input, pipe a chunk and exit that process. Several chunks are piped the encoder process that writes final file. Theres no temporary files, and if your source is h264, also no transcoding on input reading.