Making a video to loop infinitely

Hello!

Is there any way to make a video clip to loop infinitely or at least a number of times?

My use case is that I have an animated logo that needs to be overlaid on a corner of the screen and the animation should run during all video.

Thanks,
Joaquim

There is no automatic way to make a clip repeat itself after it has finished playing. If you set the asset length longer than the actual clip length it will only show the last frame as a still image.

In order to achieve the effect you want you would need to repeat the asset multiple times throughout the video so that when it finishes playing you have a new video asset that plays from the beginning to end again.

You will need some basic maths to work out how long the final video will be and how many times you will need to repeat the asset. Also if the final asset will need to be shorter in length.

If you don’t know the length of any of the assets, wither the overlay or the background asset you can use the probe endpoint and get the duration.

The probe endpoint looks like this: https://api.shotstack.io/v1/probe/https%3A%2F%2Fgithub.com%2Fshotstack%2Ftest-media%2Fraw%2Fmain%2Fcaptioning%2Fscott-ko.mp4

Where the url at the end is URL encoded and change v1 to stage as required.

Hello,

I have a similar use case where I am trying to build an app that merges videos and I need these videos to be played multiple times in loop, until the specified length for the asset is finished.

I have managed to merge them using Shotstack’s API, and just sent the images repeated times, as you suggested. Shotstack returned this error:

{"success":true,"message":"Payload Too Large","response":"JSON exceeds maximum allowed payload size of 390kb"}

Of course it is a very large payload, I don’t think repeating the asset every time we want it to appear is a good practice.

Just by adding a parameter like "play_in_loop_until_length_ends" = true to an asset would solve this.

Just a suggestion, this is very important for my project and I now it will be for many others.

Thanks!