April 8, 2024

Video - DaVinci Resolve - first attempt to use it on linux

I see a new directory /home/tom/Videos.
DaVinci is up and running with a red "Untitled Project" ready for me.

I shot some test video with my Canon R5. I haven't bothered to see what the camera settings are yet. I plug in my new CF express card reader and see:

cd /run/media/tom/EOS_DIGITAL/DCIM/100CANON
ls -l
-rwxr-xr-x 1 tom tom 32022620 Apr  7 16:55 581A5991.MP4
-rwxr-xr-x 1 tom tom 22395272 Apr  7 16:56 581A5992.MP4
cp *.MP4 /home/tom/Videos
I fool around with DR, but it is clear that I will need to read some tutorials. DR has an "import" function, and I can guide that to the mounted flash card. This may be better than copying as I did above, but we shall see.

Why is the screen so dark and unreadable?

It is a feature, not a bug -- or that is what they say. I thought something was wrong, but they think dark grey on black is a good idea! Many complain about this. Some abandon DR because of this. There are various suggestions. Turn all the lights in the room out. Kick up your monitor brightness. Crank up the zoom setting in preferences to 200 percent.

Clearly they should make the color scheme user selectable, but thus far they have not responded to this need.

Take a video with my Sony A6600

Again, I pay no attention to camera settings and just use the button with a red dot to start and stop the video. I talk a bit while photographing objects in my office.

When I plug the card into my USB card reader, I see a crazy tangle of files and directories, and use "ls -lR" on my linux system to see the whole mess at once and find an MP4 file. It is:

cd /run/media/tom/disk/PRIVATE/M4ROOT/CLIP
ls -l
-rwxr-xr-x 1 tom tom      1438 Apr  9 01:01 C0001M01.XML
-rwxr-xr-x 1 tom tom 113259811 Apr  9 01:01 C0001.MP4
cp *.MP4 /home/tom/Videos
I fire up DR and use File -- import -- media and navigate to /home/tom/Videos. I select C0001.MP4 and import it. I get a spinning progress wheel, but don't see any image or video anywhere. I do find ways to hear the sound (which was recorded in stereo by the A6600).

Try the Sony again, but with XAVCHD selected

Now we get a crazy mess of files on the SD card. I am guessing now based on the biggest file I find. I think it is:
cd /run/media/tom/disk/PRIVATE/AVCHD/BDMV/STREAM
ls -l
-rwxr-xr-x 1 tom tom 33964032 Apr  9 03:53 00000.MTS
cp *.MTS /home/tom/Videos
This does not work either ....

Big trouble: codec support

My videos get imported, but only with audio, no video. I search on this and learn that codec support under linux for the free version is severely limited.

My Canon R5 generates video with h264 encoding.
My Sony A6600 generates video with my choice of AVCHD, XAVC S HD, or XAVC S 4K. I check my camera, and it is set to XAVC S HD.

This document is confusing, but it lists the supported video formats by operating system and whether they are "studio only".

When I search on "264" I find H.264 listed as a format with file extension ".mp4" and under linux they say "Studio only (GPU accelerated on Nvidia hardware)". So that is that for the Canon R5. Under windows it would be supported by DR, but only GPU accelerated if I use Studio.

Figuring out what this document is trying to tell me about the Sony formats is entirely confusing. So the thing to do is experiment. And I do. And none of the three choices given by my A6600 will work.

Try using ffmpeg to convert the format

I do this:
BAD = 581A5991.MP4
ffmpeg -i $(BAD) -vcodec libaom-av1 -acodec pcm_s16le good.avi
The "bad" video is from my Canon R5. Note that the output file extension is "avi" not "av1". This works, but takes forever! This is only about an 8 second video, so I can imagine how long converting a real video might take -- it would be overnight or longer. Once it is done, I can look at "good.avi" using the vlc program, but DaVinci Resolve won't import it! It just doesn't do anything at all when I use media import. No error messages, no results. So this is worse than useless.

Now I try this:

BAD = 581A5991.MP4
ffmpeg -i $(BAD) -vcodec h264 -acodec pcm_s16le good.mkv
This goes at least a million times faster, yields audio that I can hear, but still no video that DR is happy with.

A Reddit post says: "Convert your file to DNxHR with Shutter Encoder (available on Linux and free) it will work like a charm."

And see this for DNxHD and DNxHR: This actually yields something that WORKS!. The recipe is:
BAD = 581A5991.MP4
OPTIONS = -c:v dnxhd -profile:v dnxhr_hqx -pix_fmt yuv422p10le -c:a pcm_s16le
ffmpeg -i $(BAD) $(OPTIONS) good.mxf
I can media import this into DR and get both video and audio!
Feedback? Questions? Drop me a line!

Tom's Digital Photography Info / [email protected]