Send seek command to running ffmpeg instance
Actually a seek command is kind of documented in the ffmpeg documentation:
Both
movie
andamovie
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 no means (that i know of) to inject command from the outside of this filtergraph 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.