[FFmpeg-user] cannot seek into png 'video'

Thorsten von Eicken tve at voneicken.com
Tue Oct 1 19:12:21 EEST 2019

On 10/1/19 8:37 AM, Carl Eugen Hoyos wrote:
> Am Di., 1. Okt. 2019 um 16:48 Uhr schrieb Thorsten von Eicken
> <tve at voneicken.com>:
>> On 10/1/19 12:35 AM, Moritz Barsnick wrote:
>>> Moin Thorsten,
>>> On Tue, Oct 01, 2019 at 00:56:33 +0000, Thorsten von Eicken wrote:
>>>> I'm trying to put an overlay over a video and I'm having difficulties
>>>> seeking into the png in order to time-shift the video and overlay
>>>> relative to one another.
>>> I don't really understand what you are trying to do, neither from this
>>> sentence:
>>>> If I'd now like to skip the first 10 seconds of the overlay in order to
>>>> line up the timing better I try to use:
>>> "Line up timing" or "time shift" are nice terms, but all "-ss" does it
>>> to shift the starting point of the input file to a certain point. E.g.
>>> "-ss 10" skips the first 10 seconds.
>> The png input is not a single static image, it is a sequence of images,
>> i.e. a video in png format. Like mjpeg but png.
> You cannot (in general) seek in such a stream.
> Use files that can be accessed with %d instead, seeking works
> with img2dec for multiple files.
> Carl Eugen

I did figure it out, the way to synchronize the two videos with 
one-another is to use the setpts filter. Instead of:

-filter_complex "[0:v]setpts=PTS-STARTPTS[top]; 

I can use something like the following to make the overlay start 5 
minutes 51 seconds into the 'base' video:

-filter_complex '[0:v]setpts=PTS-STARTPTS[top]; 

Note that 351 frames corresponds to 351 seconds due to the 1 fps and 1 
tbn of the overlay and 351 seconds = 5 minutes 51 secs.

Thanks for the replies!


More information about the ffmpeg-user mailing list