Home » Php » php – Is it possible to run AfterEffects on a server to render videos on the fly with dynamic images?

php – Is it possible to run AfterEffects on a server to render videos on the fly with dynamic images?

Posted by: admin July 12, 2020 Leave a comment

Questions:

I’m trying to figure out if this is possible:

  • web server running PHP collects a number of images from user input
  • web server takes those images, runs AfterEffects which uses the images instead of placeholders in a template video to create a personalised video for the user
  • web server makes the video available for download to the user.

Cheers,
Mark.

How to&Answers:

This would be mighty complex, but I think it might be possible. Here’s how I think the process might go down:

  1. Make your After Effects project, importing some placeholder images. Save the project.
  2. Client uploads images. Those images need to be converted to the same image filetype (PNG, JPEG, TIFF, whatever) as your placeholder images, renamed to the same name as your placeholder images, and placed in the same directory as the placeholder images that were referenced in your After Effects project.
  3. Run After Effects from the command line using aerender. More info on that here.
  4. Render to a public directory and give the link to the client.
  5. Delete the client’s uploaded images to make room for the next client.

Heres where things would get tricky:

  • I don’t think it’s feasible to edit the After Effects project file, so I think the client would be limited to the exact number of images you made in your template. Any more would not appear in the rendered movie, and any less would give a media offline error. I do not think it is possible to have After Effects import media via a script.

Answer:

Yes. It is possible, our stack is fairly involved. We are doing it at my startup, lumin8.me. Doable but complex, yet fun 🙂