0

I want to add multiple file sequences in single ffmpeg command, below is my code, video is getting created but only first image sequence is getting used, second is getting ignored

ffmpeg -y -i input.mp4 -start_number 0000001 -i 1/%07d.png -i 2/%07d.png -filter_complex "[0][1]overlay=x=10:y=10:enable='between(t,0,3)'[v1];[v1][2]overlay=x=10:y=10:enable='between(t,3.8561422222222,6.9761777777778)'[v2]" -map "[v2]" -map 0:a out.mp4

Now the problem is FFMPEG wants continous images, which i don't have i have images starting from 0000001.png in each folder, how can i accomplish this without changing much in my images

llogan
  • 121,796
  • 28
  • 232
  • 243
rathodbhavikk
  • 416
  • 7
  • 20

2 Answers2

1

Try the glob pattern to deal with inconsistent numbering and pad the PTS with setpts so the overlay doesn't get consumed before it is displayed:

ffmpeg -y -i input.mp4 -pattern_type glob -i "1/*.png" -pattern_type glob -i "2/*.png" -filter_complex "[0][1]overlay=x=10:y=10:enable='between(t,0,3)'[v1];[2]setpts=PTS+3.856/TB[fg];[v1][fg]overlay=x=10:y=10:enable='between(t,3.8561422222222,6.9761777777778)'[v2]" -map "[v2]" -map 0:a out.mp4
llogan
  • 121,796
  • 28
  • 232
  • 243
0

Can you pipe the images to -f image2pipe ?

cat $(find 1 2 -name '*.png' -print) | ffmpeg -y -i input.mp4 \
-f image2pipe -vcodec png -i - \    
-filter_complex "[0][1]overlay=x=10:y=10:enable='between(t,0,3)'[v1];[v1][2]overlay=x=10:y=10:enable='between(t,3.8561422222222,6.9761777777778)'[v2]" \
-map "[v2]" -map 0:a out.mp4
L. Scott Johnson
  • 4,213
  • 2
  • 17
  • 28
  • @l-scott-johnson `Invalid file index 2 in filtergraph description [0][1]overlay=x=10:y=10:enable='between(t,0,3)'[v1];[v1][2]overlay=x=10:y=10:enable='between(t,3.8561422222222,6.9761777777778)'[v2]` – rathodbhavikk Mar 19 '19 at 15:07
  • Try breaking it down (i.e., remove the maps, remove the filter_complex, remove the first input, etc. until you have a working piece, then build it back up.) – L. Scott Johnson Mar 19 '19 at 15:19