Resolve Video Editor: (Ubuntu) Distrobox install

I know there is a ‘davincibox’ install out there somewhere, but it doesn’t seem to fully work at the moment and I think it uses RHEL7 (or worse, CENTOS7) as a base (while these are supported distros by Blackmagic Resolve, and I think Redhat is doing some limited support, not sure how safe it is to use these distros without a support contract from Black magic, so I prefer to use Ubuntu (better user level support for those of us who use Studio and know that Linux is less than a the top priority for Davinci Resolve.)

So here are the steps I use to install my versions of Resolve (note: copied from Obsidian, so uses Obsidian markdown, so now sure how formatted it will appear on this form. if it’s messed up, just copy it to a better markdown editor and see if that helps.

Ubuntu 22.04 - Resolve 18 & 19

Installing DaVinci Resolve (Free or Studio) in a distrobox

Create the distro box as follows:

** --image:** Recommend 22.04 as it seems to be the least hassle for missing libraries and confusion with package naming, but if you are familiar with how to search out how to install Ubuntu packages and can figure out how to trace which packages hold the needed libraries, then you can use a newer version if you want.

** --name:** can be whatever you want, I usually try to keep it consistent with my ‘resolve --home directory’ to prevent confussion in case I install more than one version of Resolve or Studio

–nvidia: needed to install all the nvidia components and allow the container to access the GPU

** --home:** A custome $HOME directory for the distrobox, by default it uses you hose home directory, which may be fine in some cases, but if you ever want to install multiple version it would be best to keep their homes separate (you will need to address sharing project artifacts in some way, which I haven’t fully figured out yet, since Resolve expects all resources to be within its own home directory context, so I just copy needed resources between home areas for now.)

distrobox create --image ubuntu:22.04 --name <container name> --nvidia --home /var/home/<some directory in your homer are>/<container name>

distrobox enter DRv19Free

Prepare for the install of Resolve (Free ot Studio)

cd
pwd
sudo apt update
sudo apt upgrade
sudo apt install libfuse2

Download the Resolve Free/Studio installer.
Copy and unarchive the DaVinci installer zip file into your Resolve home directory

The following command will fail, but it should provide a list of Linux libraries that the installer thinks it is missing. You can just install then using ‘sudo apt install …’ as I do below. Your list might be different depending upon the Ubuntu version and Resolve version you are installing, so it’s best to make your own list.

Note: some packages might have alternative packages, or belong to a ‘group’ that the Resolve installer doesn’t recognize. so watch carefully as you may have installed the packages and the installer will tell you it’s not installed. If you are sure it is installed you can just use the ‘sudo SKIP_PACKAGE_CHECK=1 ./DaVinci_Resolve_Studio_19.0_Linux.run -i’ to run the installer. (in Ubuntu 22.04, Resolve 19, which this is based on you should not see any missing libraries)

Note 2: You can run this command as often as needed to check which packages are missing … if some still are, then it will tell you, if none are missing then it will start installing Resolve.

sudo DaVinci_Resolve_19.0_Linux/DaVinci_Resolve_19.0_Linux.run -i

This is the package (library) installation I used, yours may differ. NOTE: libxt6 was not detected as missing by the Resolve installer, but it is needed by some fusion operators, so you should install the library

sudo apt install libapr1 libaprutil1 libglu1-mesa libgomp1 libice6 libnuma1 libsm6 libasound2 libxcb-composite0 libxcb-cursor0 libxcb-damage0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-shape0 libxcb-util1 libxcb-xinerama0 libxcb-xinput0 libxcb-xkb1 libxkbcommon-x11-0 libxkbcommon0 libxtst6 ocl-icd-libopencl1 libxt6

should be able to install Resolve now

Davinci Resolve Install

Install Davinci Resolve as per normal using the installer (this is the CLI installer)

sudo DaVinci_Resolve_19.0_Linux/DaVinci_Resolve_19.0_Linux.run -i

External programs you might/will need

Now install some other external but useful apps that you will need in order to have a useful Resolve Workflow on Linux (ie. mostly to overcome the codec limitations of Resolve on Linux, especially the free version)

ffmpeg because of licensing issues Blackmagic does not deliver support for some codes (even if you legally have them on your system) so things like AAC audio codecs will need to be converted to a PCM codec. ffmpeg is useful for doing this. (I believe the Free versions also has video codec limitations, possibly even H.624, which may have to be converted to an OGG or maybe it supports H.635? Not sure, I have Studio so it’s just the AAC codec I have had to mess with.)

pulseaudio Resolve runs using ALSA … if you just let it run ALSA in a container it grabs the ALSA sound-system and hogs it all to itself. Which results in the audio on your host not having access to an audio system, and you get no sound on your host, only audio within the container works (so Resolve will work, but at the sacrifice of listening to anything in the background) Installing pulseaudio and running it lets the container be a better member of the ‘audio community’ so you can run audio both within and outside (host) of the container. (note: we are starting the pulseaudio server manually, but subsequent container start ups should start the pulseaudio server automatically, but if you ever have issues you can start it manually)

sudo apt install ffmpeg
sudo apt install pulseaudio
pulseaudio --start

Clean up some broken libraries

clean up some linked libraries that conflict with the system (up to date) versions of the libraries

cd /opt/resolve/libs/
sudo rm libglib-2.0.so*
sudo rm libgio-2.0.so*
sudo rm libgmodule-2.0.so*

Restart the distobox

exit, stop the container and re enter it again to allow make sure everything starts on ‘boot’ of the container.

exit
distrobox stop <container name>
distrobox enter <container name>

Run Resolve

Let’s try Resolve now

cd
pwd

_NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia /opt/resolve/bin/resolve

Note: if you are having issues with running Resolve and the audio from your host machine at the same time, make sure ‘pulse is started’ (ie. 'pulseaudio --start’)

pulseaudio --start

FFMPEG Conversion

Some suggestions for using FFMPEG. Studio users should only have to worry about ACC audio codecs, the Free version users have will have to look into the codec support and adjust the commands as needed depending upon the media codes you are given to use.

FFMPEG (simple convert for compressed videos ie. )

In this case we are given video using a compressed format … we can just convert to a .mov container and switch out the ACC for PCM. Since we are just copying the video codec we should have no loss in the already low quality

Davinci Resolve has codec limitations on Linux, most notably is the AAC audio codec (ie. you video plays fine in other apps but has not sound in Resolve … this is usually because the audio is encoded in AAC)

Solution: Convert to Compatible Video Codec

You can change the video codec to H.264 while keeping the audio codec as PCM. Here’s the updated command:

bash

ffmpeg -i input.mp4 -c:v libx264 -c:a pcm_s16le output.mov

Explanation of the Command:
  • -c:v libx264: This specifies that the video codec should be H.264, which is compatible with the MOV format.
  • -c:a pcm_s16le: This keeps the audio codec as PCM (16-bit signed little-endian).
Additional Options

If you want to maintain the original quality as much as possible, you can add the -preset option for faster encoding or better quality:

bash

ffmpeg -i input.mp4 -c:v libx264 -preset slow -crf 18 -c:a pcm_s16le output.mov

  • -preset slow: This option balances encoding speed and compression efficiency. You can choose from ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, and veryslow.
  • -crf 18: This sets the Constant Rate Factor for quality. Lower values result in better quality (range is typically 18-23 for H.264).
FFMPEG (Alternative method to convert videos with uncompressed video codes and AAC audio. )

Sometimes you have uncompressed video codecs and don’t want to compress the video just to change the audio codec, so in this case we will extract the video and audio into separate files, ten we can convert the audio to PCM and combine the two files on the Resolve timeline.

Step 1: Extract Video

Use this command to extract the video stream while keeping the original codec:

bash

ffmpeg -i input.mp4 -c:v copy -an output_video.mp4

  • -c:v copy: Copies the video stream without re-encoding.
  • -an: Disables audio in the output file.
Step 2: Extract Audio and Convert to PCM

Next, use this command to extract the audio stream and convert it to PCM format:

bash

ffmpeg -i input.mp4 -c:a pcm_s16le -vn output_audio.wav

  • -c:a pcm_s16le: Converts the audio stream to PCM (16-bit signed little-endian).
  • -vn: Disables video in the output file.
Summary of Commands
  1. Extract video:bash

    ffmpeg -i input.mp4 -c:v copy -an output_video.mp4

  2. Extract audio as PCM:

    bash

    ffmpeg -i input.mp4 -c:a pcm_s16le -vn output_audio.wav