Closed aaronpenne closed 3 years ago
That’s something I’ve also needed at times. Might be worth adding as a function or some documentation at least.
What you could perhaps do for now is to set a longer duration and calculate your own playhead setting , eg
playhead = ((time / (duration/5)) % 1)
You might also need to keep track of the { frame }
prop to reset any state once you reach the end of your short loop.
There might be a nicer way by wrapping your sketch in a ‘higher order’ sketch. Let me think on it.
That seems like a reasonable approach, thanks for the idea.
One use case I have is to concatenate a loop so it plays N times in an mp4 file. I achieve this currently by using the ffmpeg concat demuxer and repeatedly putting the same mp4 into a longer mp4.
Wonder if this export functionality already exists or if there is a way to trick ffmpeg into doing it for me from canvas-sketch?
BTW this library has dramatically improved my workflow, thank you for keeping it up to date!
For example, I have a sketch that exported an mp4 file:
2021.02.21-08.19.47.mp4
. This mp4 contains one iteration of the loop. I want 5 iterations of the loop in one mp4.I then create a file
mp4_list.txt
containing:And finally do the concat from the terminal: