Transcoding files can be a pain, especially when you’re working with multiple different file types. Through a new integration with Zapier, you can upload many files to a Google Drive folder and quickly get back transcoded files to your specifications, all without writing a single line of code. Keep reading to learn how to start transcoding files with Zapier!
Setting up Zapier, Google Drive, and Dolby.io to Start Transcoding Files
For this guide, you’ll need a free Google Drive account, a Zapier account, and a Dolby.io account. Both Zapier and Dolby.io have a free trial feature – so you can try them out before deciding to make a purchase.
First, navigate to the Zapier website and sign into your account. You should see the following dashboard:
Let’s click ‘Create zap’ to start transcoding files!
Using Google Drive as a Trigger in Zapier
The first block in every zap is called a ‘trigger.’ This trigger reacts to an event and causes all the following steps in your zap to run. We’ll select Google Drive as our trigger for this zap.
Once you’ve chosen Google Drive, select the event as ‘New File in Folder.’ Now the zap will activate anytime you upload a new file to the folder you specify.
Zapier will now ask you to log into your Google Drive account before continuing. After that, choose the following settings for the rest of the trigger:
I chose ‘My Google Drive’ as the drive to use and the folder ‘Files to Transcode,’ but choose the drive and folder that is applicable to you.
Anytime a file gets uploaded to this folder in the future, the zap will attempt to run. There are some nuances to this when using Google Drive, however. More complete information about how Google Drive is integrated with Zapier can be found here. A common misconception is that the zap will run for every new file uploaded to Google Drive.
In short, the zap determines whether or not to run using a set of rules based on:
- Modification date
- Where the file originated from
- Whether it is a Google file or a non-google file
Be sure to keep this in mind when setting up your zap to trigger with Google Drive!
If you want your zap to run every time a new file is uploaded, regardless of modification date, try using DropBox or OneDrive as the trigger. An example of using DropBox as the trigger can be found in the blog post that introduced the Dolby.io media API Zapier integration.
Another limitation to be aware of is that the Google Drive folder you use for storing must be made public. The Dolby.io platform will attempt to write the transcoded output files directly into the folder you choose. If it is read-only or requires credentials, the integration will not work.
Now we are ready to start transcoding files with Zapier.
Transcoding Different Types of Files Using Paths
Not every file needs to be transcoded the same way. For example, if you are planning on transcoding files that are both audio and video formats using your zap, you wouldn’t want them both to be transcoded to MP3. Instead of making two separate zaps to handle these different file types, you can add a ‘Path’ action. This is a built-in tool provided by Zapier.
Below you can see that there are two different paths set up for this zap. One is for transcoding files with audio formats and one is for transcoding files with video formats.
Feel free to add more paths as you need them! In this guide we’ll learn how to set these two paths up.
Transcoding Audio Files with Dolby.io
To set up a path to complete audio transcoding from other formats to MP3, the following steps will be taken:
- Setting up Path Rules
- Adding the Transcode Action
- Giving Dolby.io Time to Transcode Your Files
- Testing to Ensure Transcoding was Successful
- Preparing Transcoded Files for Download
- Uploading Transcoded Files to Google Drive
Step 1 – Setting Up Path Rules
We only want this path to run if the file that has been uploaded is an audio file. To do this, set the following rules:
As you can see, the path is checking for certain file extensions to make sure that the new upload is an audio file. I want to transcode audio files to MP3, but set your rules according to what files you would like to transcode.
Zapier Tip : Make sure to have a test file uploaded to your Google Drive folder to test the zap on as you go. This will ensure that every step is working as expected once you go to publish your zap at the end!
Step 2 – Adding The Transcode Action
Next we want to add our first action to our path. Since we want to start transcoding, our action will be from Dolby.io. You can find this app by typing ‘dolby’ into the search bar.
Once you add the action, choose ‘Start Transcoding in Dolby.io’ as the event.
This is where your personal Dolby.io account comes in. To be able to use Dolby.io’s integration with Zapier, you must authenticate your account with your unique media API key. This can be found in the Dolby.io Dashboard once you log in.
Click on ‘Get API keys.’ This is where both your app key and app secret key are kept. Once you’ve done so, return to Zapier. There will be a pop up asking for access to your Dolby.io account – this is where you will paste your app keys and specify how long you would like Zapier to be authenticated for. Below, I used the maximum value to allow Zapier to access my account for 30 days. When this time runs out, Zapier will automatically make a new token, so don’t worry about having to reauthenticate later on.
With your account now authenticated, choose the following settings for the remainder of this action block:
Feel free to change the ‘File Type’ to match what you need.
Step 3 – Giving Dolby.io Time to Transcode Your Files
Transcoding files isn’t instantaneous, so let’s add a delay to give Dolby.io ample time to process our file. This can be done with another built-in tool from Zapier, called ‘Delay.’ Choose the following settings:
For my zap, I will be using a delay of one minute. This is because the files I’m using are fairly short. Adjust this delay block to be longer, if needed, to accommodate your transcoding needs!
Step 4 – Testing to Ensure Transcoding was Successful
It’s recommended to add the next two blocks, but they are included for error checking purposes. The first block will check the status of transcoding and the second block only allows the zap to continue if transcoding was completed successfully. This prevents the zap from accidentally attempting to download a file that is not transcoded yet.
First, we’ll check the status of our transcoding. Add another Dolby.io action with the event ‘Get Transcode Status’ and choose the following settings:
The job ID needed in the ‘Set up action’ menu is returned by the code block ‘Start Transcoding in Dolby.io.’
Next, add the ‘filter’ action. This is also a built-in tool provided by Zapier.
Choose the following settings for the filter:
These settings will only allow the zap to continue if the ‘Status’ result from ‘Get Transcode Status in Dolby.io’ returns as successful.
Step 5 – Preparing Transcoded Files for Download
Before being able to upload our transcoded files to Google Drive, we must download them from Dolby.io’s temporary media cloud. To do so, add a new action from Dolby.io and choose the following settings:
Make sure the URL here matches the one you specified in the action ‘Start Transcoding in Dolby.io.’
Step 6 – Uploading Transcoded Files to Google Drive
Now the only thing we have left to do is upload our transcoded files to Google Drive.
Add a Google Drive action and choose the following settings:
Choose the drive and folder name that work best for you. It should be a public folder so that the file can be written to it. The file URL is the URL returned by ‘Get Media Download in Dolby.io.’
It’s recommended to add some sort of indicator to the filename to show that the file has been transcoded, like I did above. Additionally, don’t forget to specify the new file extension! I chose MP3 as the extension because it matches the type of transcoding I decided to do in the action ‘Start Transcoding in Dolby.io.’
Configuring Transcoding for Video Files – Path B
We have transcoding for audio files all set up now!
Let’s hop over to Path B and configure it to transcode video files into MP4s. This path will be almost identical to Path A. All the actions are the same – they just have slightly different settings.
Here are the steps we will have to take:
- Setting up Path Rules
- Adding the Transcode Action
- Giving Dolby.io Time to Transcode Your Files
- Testing to Ensure Transcoding was Successful
- Preparing Transcoded Files for Download
- Uploading Transcoded Files to Google Drive
The italicized steps will be the same as before. Feel free to look back at the previous sections for a reminder of how to set each step up. This portion of the guide will focus on steps 1, 2, and 6.
Step 1 – Setting up Path Rules
The first difference will be in the path rules. Open up Path B and set the rules according to the file extensions you are looking for. In my case, I want to convert video files that aren’t MP4 into MP4. Here are the rules I chose for my case:
Make sure you have a sample file in your Google Drive to test this path with like we did for path A.
Step 2 – Adding The Transcoding Files Action
The next change will be when we call the action ‘Start Transcoding in Dolby.io.’ Add the action like before and choose the following settings:
Step 6 – Uploading The Transcoded Video Files
Steps 3-5 are going to be the same as path A. Feel free to look back at the guide for these steps as you include them into path B.
Once you have transcoded the file, waited for transcoding to finish, checked to ensure the file is ready to be downloaded, and downloaded the file, you are ready to upload the transcoded file to Google Drive.
Add a Google Drive action like before and choose the following settings:
The folder you choose to write to must be made public in order for Dolby.io to write the transcoded output file to that drive location.
The difference for this action from path A is I changed the file extension to MP4 to match the type of transcoding we chose.
Publishing Your Zap and Transcoding Files
Both paths of our zap have now been configured! Hit the publish button to make your own personal zap ready for use.
Now, if you look at your dashboard, you should be able to see that your zap is published and turned on. Below, you can see I have two zaps that use Dolby.io! There is a post explaining the other zap listed if you are interested in learning how to use Zapier, OneDrive, and Dolby.io to enhance your audio files.
Let’s test out the zap to see if it’s working. I’ll upload a couple files that need to be transcoded to the Google Drive folder I specified as the trigger for my new zap.
To see the zap in action, you can go to the ‘Zap History’ tab of the dashboard to see what zaps have already run and which ones are in progress. Keep in mind – it may take a few minutes for the tab to update!
Zap runs will be reflected in the ‘Zap History’ tab once they have finished. Additionally, you will be able to see the transcoded files in the folder you specified.
Now that you have this workflow set up using Google Drive, Zapier, and Dolby.io, all you have to do anytime you need files transcoded is upload them to Google Drive. Additionally, if you end up needing to transcode more unique file types, you can simply add an extra path or more rules to accommodate your new transcoding needs.
The new Dolby.io integration with Zapier is great for transcoding files, but there are lots of different actions available as well! If you are interested in learning more about what is possible with the Dolby.io media APIs, check out our documentation.
What can you build with Zapier and Dolby.io?