2

I want to create seamless loops with FFMPEG but am unsure of the right way of approaching it.

If I can pseudocode it out for y'all would someone be able to help me with the correct invocation?

ffmpeg -i input.mp4 --get-midway-point --put-second-half-of-film-first --put-first-half-of-film-second --overlap-part1-and-part2-by-n-milliseconds ---transition-transparency-from-100-to-0-over-n-milliseconds -o output.mp4

I'm sort of presuming that it's possible but I'm really stumped.

Giacomo1968
  • 58,727
Pete
  • 21

1 Answers1

1

This needs to be scripted, but I'm unsure of your OS/shell/scripting language so I can't give you a turnkey answer to copy and paste. Here are the basic steps:

  1. Get duration of input.

  2. Divide the result in half. Example using bc.

  3. Create segments with (a)trim filters.

  4. Crossfade

llogan
  • 63,280