Movie Creator
Movie Creator
Movie generation entry point. Allows creation of movies from a jsonConfig at various resolutions.
- class movie.creation.movieCreator.MovieCreationFactory(browser, domain, jsonconfig)
Bases:
object
Holds expensive-to-create resources necessary to create a movie
- make_one_movie_at_resolution(width, height)
Create a movie at a specific resolution
- classmethod save_and_upload(movie, slug, mp4FileObject, gifFileObject, titleImageFileObject)
Saves data to the given movie object and uploads the video and image to the movie model.
- exception movie.creation.movieCreator.ProbablyFailedToLaunchBrowser
Bases:
Exception
A common error when the browser has an issue.
- class movie.creation.movieCreator.SingleMovieCreator(browser, textToSpeechFactory, jsonconfig, size)
Bases:
object
Class for creation of a single movie at a single resolution.
- make_gif(gifFilename)
Creates a gif without titles or captions, just the rounds
- make_movie(mp4Filename, staticPngFilename)
Create a movie at a specific resolution
Text-to-Speech
Text-to-speech via Amazon Polly.
- exception movie.creation.textToSpeech.AudioGenerationFailedException
Bases:
Exception
AWS Polly returned an audio generation failure.
- exception movie.creation.textToSpeech.AudioGenerationTimedOutException
Bases:
Exception
Waited too long without a response
- class movie.creation.textToSpeech.GeneratedAudioWrapper(pollyClient, s3Client, text)
Bases:
object
To facilitate asynchronous waiting for Polly audio generation. Initializaton spawns the AWS job, and there are various methods to poll for the result. Always checks TextToSpeechCachedFile first.
- download_if_ready(toFilename)
Download the result if it’s ready. Can only be called once, then deletes the result from S3.
- download_synchronously(timeoutSeconds=20)
Wait up to timeoutSeconds, waiting for the task to complete. @return a tempfile object: the file will be deleted once the object is destructed.
- prefix = 'generated_speech'
- region = None