Send seek command to running ffmpeg instance Send seek command to running ffmpeg instance windows windows

Send seek command to running ffmpeg instance


Actually a seek command is kind of documented in the ffmpeg documentation:

Both movie and amovie support the following commands:

  • seek Perform seek using "av_seek_frame". The syntax is: seek stream_index|timestamp|flags

    • stream_index: If stream_index is -1, a default stream is selected, and timestamp is automatically converted from AV_TIME_BASE units to the stream specific time_base.
    • timestamp: Timestamp in AVStream.time_base units or, if no stream is specified, in AV_TIME_BASE units.
    • flags: Flags which select direction and seeking mode.
  • get_duration Get movie duration in AV_TIME_BASE units.

I have tried running a command like this:

ffmpeg -f lavfi -i 'movie=filename=myvid.mp4' -codec:v libx264 -an -f mpegts - > /dev/null

Then I press c and enter the command all -1 seek 0|3|0, but no matter which combination I try, I get back the same error Command reply for stream 0: ret:-78 res:

I've also tried this command, but it gives the same error when trying to seek:

ffmpeg -i myvid.mp4 -codec:v libx264 -an -f mpegts - > /dev/null

There is very little information about the seek operation on the internet, but I managed to find this: http://ffmpeg.org/pipermail/ffmpeg-devel/2013-September/148070.html

Here he says that:

the "lavfi" demuxer has its own private filtergraph and provides nomeans (that i know of) to inject command from the outside of thisfiltergraph into it.

So all this indicates that may or may not be possible to seek on a running ffmpeg instance. At least those who may have succeeded with it have kept how to do it to themselves.


If you hit a '?' while ffmpeg is running, you'll get all available options.

As of my locally installed version:

key    function?      show this help+      increase verbosity-      decrease verbosityc      Send command to first matching filter supporting itC      Send/Que command to all matching filtersD      cycle through available debug modesh      dump packets/hex press to cycle through the 3 statesq      quits      Show QP histogram

so basically, no.