If you’re using the free version DaVinci Resolve on Linux or any other OS for that matter, you may have stumbled upon the various limitations that come with this version.
One of the biggest limitations of all is the fact that the free version doesn’t come with any sort of support for the MP4 file format.
This was a huge struggle for me since my entire workflow was based on the usage of MP4 files, from the screen-casting with OBS and file recording on my video camera, to the render and export for YouTube or Vimeo, which love a properly compressed MP4 file.
Solving the issue with OBS was quite easy, involving the changes of some settings by selecting the proper codecs for audio and video rendering.
Dealing with the files coming from my camera, a Canon Rebel T6i, was a whole other story. There’s no way to change the recording format directly within the camera, so I needed to find a solution that allowed me to convert those MP4 files into a format digestible by DaVinci Resolve, without losing too much quality.
FFmpeg to the rescue!
On the official website, FFmpeg is described as “…the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.”
And holy cow if it isn’t true.
If you’re running any modern Linux distro, FFmpeg should already be included in your system and you should be able to run it via terminal. The hard part was to understand all the options, and those are a lot, and find the correct settings to convert files from a format to another, by keeping the quality high and the MegaByte count low.
Convert MP4 to MOV
This is the command I use to convert a MP4 file recorded from a video camera to a MOV format of the same quality that DaVinci Resolve can import and read.
ffmpeg -i input.mp4 -vcodec dnxhd -acodec pcm_s16le -s 1920x1080 -r 30000/1001 -b:v 36M -pix_fmt yuv422p -f mov output.mov
Convert MOV to MP4
When it comes to rendering a file from DaVinci Resolve, I was forced to stick with the MOV format with some high video/audio codec settings. The rendered file is not small, but nonetheless, FFmpeg is more than capable of handling it and converting it into a slim and crisp MP4.
The settings I’m using are those recommended by YouTube for a fast upload and a almost zero processing.
ffmpeg -i input.mov -vf yadif -codec:v libx264 -crf 1 -bf 2 -flags +cgop -pix_fmt yuv420p -codec:a aac -strict -2 -b:a 384k -r:a 48000 -movflags faststart output.mp4
While searching around, I found this super useful list of FFmpeg commands with also a short explanation. If you’re a nerd like me and love these stuff, you’ll be pleased to learn all the different options and what all those weird letters mean and how to fully control the conversion of your files.
I hope this guys can be helpful to someone else other than myself.
Happy Video Editing on Linux!