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.

2
  • Currently this requires scripting, so answer depends on your OS or preferred scripting language. Or wait for the pending crossfade filter patch to get applied and it will make things easier.
    – llogan
    Oct 28, 2019 at 18:29
  • Aha, great. So I should break it down into each task and make a shell script or python script then. Thanks for answering, I'll be sure to report back if I get it worked out.
    – Pete
    Nov 1, 2019 at 14:44

1 Answer 1

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

1
  • Sorry yes, I should have stated I was on Mac.
    – Pete
    Nov 4, 2019 at 10:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .