A
A
Alexander Pavlyuk2019-01-16 17:23:34
linux
Alexander Pavlyuk, 2019-01-16 17:23:34

How to synchronize video and image sequence through ffmpeg?

I'm trying to overlay a video using ffmpeg. I have a video in mp4 and a sequence of pictures, each of which is already mapped to each frame of the video.
I do it like this:

ffmpeg \
  -i video.mp4 \
  -framerate 30000/1001 \
  -i %05d.png \
  -filter_complex [0:v]overlay=x=0:y=0:[out] \
  -map [out] -map 0:a \
  out.mp4

The problem is that if you do not explicitly specify -framerate, then images and videos will be out of sync. the framerate listed here is just taken from ffprobe on video.mp4. That is, this is the original frame rate of video.mp4.
How can I make ffmpeg just map every frame of a png sequence to every frame of the video? Regardless of the frame rate of the original video. So that you don’t have to tear out the frame rate of the video every time and substitute it here.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question