Written by Thierry Delran, DevOps Engineer

Due to the increasing demand for high-quality video content, efficient transcoding solutions have become essential in the media and entertainment industry. DaVinci Resolve, known for its advanced editing and color correction capabilities, is a popular tool used in video editing and production. Integrating this powerful software with AWS cloud infrastructure offers significant advantages such as scalability and faster processing times. Exploring how to set up DaVinci Resolve on AWS is a valuable topic for professionals seeking to optimize their video workflows.

The guide blow will walk readers through the process of setting up an environment to transcode videos using DaVinci Resolve on AWS.

Step 1: Setup an Amazon S3 Bucket

  1. Log into your AWS Management Console.
  2. Navigate to the S3 service.
  3. Create a new S3 bucket:
    • Click on “Create bucket”.
    • Name the bucket (must be unique across all AWS users).
    • Choose the AWS Region.
    • Leave the default settings or configure as per requirements.
    • Click “Create bucket”.
  4. Create an AMI role for the instance S3 access:
    • On the AWS management Console, access IAM service
    • On the left panel, select Roles
    • On the Roles window, select Create role
    • On the ‘select Trusted entity window’, select AWS service, and EC2 as a use case, then click next.
    • On the Add permissions window, tick the AmazonS3FullAccess AWS managed policy, this will allow instances with the IAM role to access the S3 buckets on the account. Then click next.
    • For role details, the role can be given a name and a short description, then click on Create role.

Step 2: Setup an Amazon EC2 Instance and Configure It

  1. Create a Key Pair:
    • Go to the EC2 Dashboard.
    • Click on “Key Pairs” under “Network & Security”.
    • Click “Create key pair”.
    • Provide a name for the key pair and select “RSA” for key type.
    • Download the .pem file and save it securely.
  2. Launch the EC2 Instance:
    • In the EC2 Dashboard, click “Launch Instance”.
    • Choose an AMI (Amazon Machine Image). For this setup, choose a Windows Server AMI.
    • Select an instance type with GPU support (e.g., g4dn.xlarge).
    • For key pair, select the one that was created earlier
    • Configure the instance network details by clicking edit next the network settings:
      • Make sure that a public subnet (or a subnet that has access to a NAT gateway) is being used.
      • Ensure that “Auto-assign Public IP” is enabled.
      • Configure the Security Group to allow RDP (port 3389) and for NICE DCV (port 8443) from the IP.
    • Adjust the storage based on workflow requirements
    • Within Advanced details, select the role created earlier to allow the instance to connect to the S3 bucket.
    • Review and launch the instance.
  3. Connect to the instance through RDP to configure it
    • In the EC2 Dashboard, once the instance is running and operational, select the instance and click Connect
image.png
    • On the Connect to instance window, Select “Connect using RDP client”, click on “Download remote desktop file” and run the download file. To get the password, select ‘Get password’ and upload the keypair created earlier.
image.png
  1. Install the AWS CLI
  2. Install the Nice DCV Server:
    • Download and install the Nice DCV server for Windows from the official website. For this tutorial, the default option will be used during installation.
  3. Install NVIDIA GRID Drivers:
    • On the instance, open a PowerShell window.
    • the following script will download the drivers to the desktop
$Bucket = "ec2-windows-nvidia-drivers"$KeyPrefix = "latest"$LocalPath = "$home\Desktop\NVIDIA"$Objects = Get-S3Object -BucketName $Bucket -KeyPrefix $KeyPrefix -Region us-east-1foreach ($Object in $Objects) {    $LocalFileName = $Object.Key    if ($LocalFileName -ne '' -and $Object.Size -ne 0) {        $LocalFilePath = Join-Path $LocalPath $LocalFileName        Copy-S3Object -BucketName $Bucket -Key $Object.Key -LocalFile $LocalFilePath -Region us-east-1    }}
  1. Install Davinci Resolve:
    • Download the installer from the DaVinci Resolve website.
    • Install DaVinci Resolve on the EC2 instance.
    • If using the Studio version, an activation/licensing pop up will appear when the software is launched.
  2. Optional: Create an AMI:
    • After setting up and configuring the instance, an AMI can be created to save the current state:
      • Go to the EC2 Dashboard.
      • Right-click on the instance and select “Create Image”.
      • Provide a name and description, then create the image.

Step 3: Connect to the Instance via Nice DCV

  • In the EC2 Dashboard, select the instance and note its public IP.
  • Use the DCV client to connect to the instance, use the public IP as server to connect to.
image.png
  • The Username is Administrator and the password is the same one used to connect through RDP into the instance.
image.png

Step 4: Upload a Video File to S3 and Download it on the Instance

  1. Upload Video File to S3:
    • Navigate to the S3 bucket.
    • Click “Upload” and select the video file from the local machine.
  2. Download Video File on the Instance:
    • On the EC2 instance, use the AWS management console or a PowerShell window.
    • Use the following command to download the file:
aws s3 cp s3://your-bucket-name/your-video-file .

Step 5: Transcode the Video File with DaVinci Resolve and Upload it to S3

  1. Open DaVinci Resolve on the EC2 instance.
  2. Open a new or existing project
  3. Import the Video File:
    • Use the “Media” workspace to import the video file downloaded from S3.
  4. Create a timeline for that video file
    • Use the “Edit” workspace to add the video to the project timeline (right click on the clip and select “Create New Timeline Using Selected Clips…”
image.png
  1. Transcode the Video File:
    • Use the “Deliver” workspace to configure the transcoding settings.
    • Choose the desired format and settings, then select “Add to Render Queue”
image.png
    • Then within the Render queue panel, Select “Render All”
image.png
  1. Upload the Transcoded Video to Amazon S3:
    • After the transcoding is complete, locate the output file.
    • Use the AWS CLI or connect to the AWS console through the workstation to upload the file back to S3:
aws s3 cp your-transcoded-video-file s3://your-bucket-name/

Note on Containerized Transcoding Jobs with DaVinci Resolve on AWS

Licensing could be a significant issue if the objective is to use DaVinci Resolve in a containerized environment. Below is an outline of the technical considerations and an alternative approach using FFmpeg, including the use of AWS Batch for job orchestration.

Licensing Challenges with DaVinci Resolve

DaVinci Resolve requires a specific license for each installation. When used in a containerized environment, the ephemeral nature of containers complicates the licensing process:

  • Persistent Licensing: Containers are typically stateless and short-lived, conflicting with DaVinci Resolve’s persistent licensing mechanism.
  • Activation: Each new container instance would require manual activation, which is impractical for scaling and automation.

Potential Workarounds with On-Demand Instances

To use DaVinci Resolve while mitigating some of the containerization issues, On-Demand EC2 instances can be used:

  1. Instance Setup:
    • Create and configure a base EC2 instance with DaVinci Resolve installed and activated.
    • Ensure all necessary dependencies and configurations are in place.
  2. Creating an AMI:
    • Once the base instance is configured and activated, create an Amazon Machine Image (AMI) to capture the state of the instance.
    • This AMI can be used to launch new instances with DaVinci Resolve pre-installed and activated.
  3. Headless Operation:
    • Use the AMI to launch instances as needed for transcoding tasks.
    • Configure these instances to operate in a headless mode, performing transcoding jobs without requiring a graphical user interface.
  4. Automation:
    • Utilize AWS services such as EC2 Auto Scaling and AWS Lambda to automate the instance lifecycle, ensuring instances are launched and terminated based on job requirements.

Alternative Approach with FFmpeg

Given the complexities associated with DaVinci Resolve, FFmpeg presents a simpler and likely more cost-effective solution:

  1. Containerization:
    • FFmpeg can be easily containerized using Docker, allowing for flexible and scalable deployment.
    • A Docker image can be created with FFmpeg and necessary dependencies.
  2. Job Orchestration with AWS Batch:
    • Using AWS Batch helps efficiently run hundreds or thousands of batch computing jobs. AWS Batch dynamically provisions the optimal quantity and type of compute resources (e.g., CPU, GPU or memory optimized instances) based on the volume and specific resource requirements of the batch jobs submitted.
    • Job queues can be implemented using AWS Batch to manage transcoding tasks.
  3. Automation and Scaling:
    • The entire pipeline can be automated, from uploading videos to S3, triggering transcoding jobs, and storing the results back in S3.
    • The auto-scaling features of AWS Batch will seamlessly handle varying workloads.

Closing Thoughts

While using DaVinci Resolve in a containerized setup poses licensing challenges, utilizing on-demand instances with AMIs can provide a viable workaround. However, the alternative of using FFmpeg, particularly with AWS Batch, offers a more streamlined and cost-effective solution for video transcoding tasks on AWS. FFmpeg’s flexibility and ease of containerization, combined with AWS Batch’s powerful job orchestration and scaling capabilities, make it a preferable choice for scalable and automated transcoding workflows. demonstrated expertise in the Media & Entertainment (M&E) vertical to ensure a successful implementation.

About TrackIt

TrackIt is an international AWS cloud consulting, systems integration, and software development firm headquartered in Marina del Rey, CA.

We have built our reputation on helping media companies architect and implement cost-effective, reliable, and scalable Media & Entertainment workflows in the cloud. These include streaming and on-demand video solutions, media asset management, and archiving, incorporating the latest AI technology to build bespoke media solutions tailored to customer requirements.

Cloud-native software development is at the foundation of what we do. We specialize in Application Modernization, Containerization, Infrastructure as Code and event-driven serverless architectures by leveraging the latest AWS services. Along with our Managed Services offerings which provide 24/7 cloud infrastructure maintenance and support, we are able to provide complete solutions for the media industry.

About Thierry Delran

Thierry Photo

DevOps engineer at TrackIt since 2022, with master’s degrees in computer science, Thierry has deep expertise in building and managing AWS Studio in the cloud environments as well as setting up large-scale Deadline render farms.

Thierry thrives in situations when Chaos needs Order and Automation (across fields).