This repository will follow this blog to automate media workflows using Google Cloud Functions.
A sample application for Google Cloud Functions to use Dolby.io's Media APIs to automatically transcode any new files uploaded to a Cloud Storage Bucket.
To begin, there should be a familiarity with web development and JavaScript. An active Dolby.io account to access the Dolby.io Media Processing APIs as well as a Google Cloud Platform (GCP) account and project with the appropriate permissions.
You will need to use your own Google Cloud project as the basis of this automation.
Ensure that in configuring the automation, the Trigger type is set to Cloud Storage and Event type is set to Finalize/Create.
You will also want to ensure your requirements.txt
contains the required packages.
This application was made using the Python 3.9 runtime. All other versions have not been tested for compatibility.
The code used for the Google Cloud Function lives in the cloud-function
folder.
main.py
: The main file used to call the Dolby.io APIsignedUrls.py
: A helper file containing code to create Presigned URLs to read and write the files fromrequirements.txt
: The list of Python packages Cloud Functions needs to install for the run to be successful.
Upon execution, the function will log a job id that will contain the status. To see the job's status, use the get status endpoint.
Logic to ensure no post-processed files are ran through the pipeline is necessary to prevent infinite loops. Depending on your workflow, modify the logic to exit on a processed file, whether that be by file extension, name or other methods.
In the case any bugs occur, report it using Github issues, and we will see to it.
We welcome your interest in trying to experiment with our repos.
If there are any suggestions or if you would like to deliver any positive notes, feel free to open an issue and let us know!
For a deeper dive, we welcome you to review the following:
- Media API
- API Reference
- Getting Started with GCP
- Transcoding Files Using Zapier, Google Drive, and Dolby.io
- Visualizing Media Diagnose Workflows with Postman Flows
Using decades of Dolby's research in sight and sound technology, Dolby.io provides APIs to integrate real-time streaming, voice & video communications, and file-based media processing into your applications. Sign up for a free account to get started building the next generation of immersive, interactive, and social apps.