Combining templates easily

Hey there, I have a number of templates which provide intro animations, lower thirds, etc. They are all customizable via merge fields.

I have code that generates a sequence of clips, but unadorned with any animations.

What’s the easiest way of combining the animation templates with the ‘main’ video json? Im coding it in python, and while its not a big deal to create a whole json object each time, it would be cool to ‘invoke’ templates at different times in the main video, passing merge fields as appropriate. I kinda assumed that is what templates are for but I’m not seeing how to do that.

Hi, not quite sure I follow but are you just trying to render a template by it’s ID and just send the merge fields. That is possible like this: Templates | Shotstack Documentation

Just send a request with the ID of the template which you can get from the Studio editor list and then just pass the merge fields.

There is no way to create a template within a template or anything like that. You can of course program pretty much anything using Python by itself or with the Python SDK.

If this doesn’t help I think I need more info and examples before I fully understand what you are after and if it is possible.

Yeah so lets say I have a template with a lower third animation.

I also have a composite of a number of images and videos which, when made with shotstack, makes a 10 minute video. I would then like to apply the following lower third animations:

At 2 minutes, animate a lower third with “text 1”

At 3 minutes, animate a lower third with “text 2”

At 7 minutes, animate a lower third with “text 3”

Now I can make a json object with all the assets / tracks / clips etc laid out. But it would seem convenient to just “apply” a template at 2/3/7 minutes rather than recreate it into one large json.

Templates only work for the entire video and not for small parts, features or snippets of a video like how you are describing. You could certainly code up a solution like this but it would require custom code.

1 Like