DaVinci Resolve and MP4 under Linux

If you try to import mp4 file to DaVinci Resolve under Linux, you will be greeted with audio-only experience if you’re lucky or nothing at all if you’re not. Unless you’re paying customer of DaVinci Resolve Studion, MP4 and AAC are not supported at all.

Conversion to an intermediate format is needed and good old ffmpeg can help here:

$ ffmpeg -i input.mp4 \
      -c:v dnxhd -profile:v dnxhr_hq -pix_fmt yuv422p \
      -c:a pcm_s16le \
      -f mov output.mov

Here I use DNxHR with HQ settings. Even this will generate file that’s much bigger than source. How much bigger depends on the source, but don’t be surprised to see it grow 16-fold or even higher.

Smaller alternative can be MPEG4 format but with a drop in quality even at its best settings:

$ ffmpeg -i input.mp4 \
      -c:v mpeg4 -qscale:v 1 \
      -c:a pcm_s16le \
      -f mov output.mov

These files can now be used as input to Resolve and editing can commence.

Once done with rendering a conversion to MP4 might be in order again. For this I use settings discussed on Video StackExchange. While the original discussion was for YouTube, I find their recommendations quite good as a starting point:

$ ffmpeg -i render.mp4 \
      -c:v libx264 -pix_fmt yuv420p -crf 16 \
      -force_key_frames 'expr:gte(t,n_forced/2)' -bf 2 \
      -vf yadif -use_editlist 0 \
      -movflags +faststart \
      -c:a aac -q:a 1 \
      -ac 2 -ar 48000 \
      -f mp4 out.mp4

Mind you, all my cameras use YUV 4:2:0 and I don’t do any major editing so increasing YUV to 4:2:2 or even 4:4:4 makes no sense nor does increase to 10-bit resolution. Depending on which equipment you have, your mileage may vary.

Installing DaVinci Resolve on Ubuntu Dell XPS

When I first installed DaVinci Resolve on my Dell XPS under Ubuntu 19.04 I was greeted with stuck splash screen. What was I missing?

Well, the first issue was missing OpenCL. Fortunately that was easy to solve:

$ sudo apt install ocl-icd-opencl-dev

Other issue was missing nVidia driver. For some reason Resolve really dislikes nouveau driver. Therefore we have to upgrade driver a bit. I found that auto-install works perfectly for me:

$ sudo ubuntu-drivers autoinstall

Those who like to be more precise can always check which drivers are available and install only those:

$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001C8Dsv00001028sd000007BEbc03sc02i00
vendor   : NVIDIA Corporation
model    : GP107M [GeForce GTX 1050 Mobile]
driver   : nvidia-driver-390 - distro non-free
driver   : nvidia-driver-418 - distro non-free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin

$``  sudo apt install nvidia-driver-418

With these two changes my DaVince Resolve can finally start properly.

PS: Interestingly, installing non-free nVidia driver solved Ubuntu getting stuck booting after incorrect password got entered.

Switching to Linux Desktop?

I’ve been playing with Linux/Unix servers for a long time now – both at work and home. I even switched almost completely to Linux at work – Outlook and Excel being the only reason why I still have Windows VM. However, at home I still used Windows 10 as my main OS. With Linux Desktop getting better and better while Windows 10 is getting more and more annoying, I figured I need to revisit installing Linux at home too.

And no, I didn’t go full-in. However, for the first time in the last 10 years I am dual booting again.

Ubuntu with ZFS was Linux of my choice primarily because of the ZFS support. Running ZFS on my NAS has been a pure joy (as much as any file system can be) and that’s what moved needle from Linux Mint toward Ubuntu. Other benefits include a huge install base and prepackaged software support.

While Linux is rather enjoyable, I don’t see Windows going away from my computer for a while. And the major reason is Visual Studio – there is simply nothing equivalent for C# development. Visual Studio Code does try but that’s like saying butcher is an equivalent of a surgeon. It’s simply a difference between IDE and really good text editor.

While running under Wine is an option, DipTrace still works better under Windows. And this goes for the whole “electronics tools” category. Whether it’s MPLAB (which actually has a Linux version), PicoScope (Linux version in beta), or just some stupid utility, making it work under Windows is simply easier with less issues present.

Another stumbling point was Vegas Movie Studio in particular and media editing in general. These applications are few and far between. I did find DaVinci Resolve to be actually extremely powerful and free alternative. It definitely has a steeper learning curve and does require a bit of getting used to. However, at this moment it actually doesn’t support H.264 and MP4 file format under Linux. :(

I am still looking for a good alternative to Paint.NET as Gimp doesn’t really work for me. It’s excellent software if you need to do a major work, but it’s really annoying when it comes to simple operations. As Windows 10 image viewer is pure shit, I didn’t need to search long to find a substitute.

WinRAR was another stupidly simple utility that doesn’t really work properly under Linux. Yes, you can get other archivers but there is nothing that really offers the same features; archive locking and preview without extracting to temporary directory being my favorites.

And lastly, there is nothing as good on Linux as Explorer. Yes, Nautilus does come close when it comes to pure file browsing but just trying to do something in Open and Save dialog brings tears to my eyes. No, there is no rename, full right-click menu, or even pasting file there. Nope, you can just open and save files. As I often remember things I want to adjust only when saving other file, this seems overly restricting.

End result is that for Visual Studio, electronics, and gaming I still use Windows. For all other purposes I simply switch to Linux as my preferred environment. It’s something I wouldn’t believe just a few years ago – oh, how times change.

PS: If you’re curious as to what I find annoying in Windows 10, here are the first couple of things coming to mind without any specific order: Windows update reboots my computer overnight time and time again, every major update randomly resets my settings, local account requires THREE damn password reminders, it keeps forgetting my damn network credentials (despite checking the “remember” checkbox), Start menu cannot find applications that are freshly installed, damn settings are distributed between multiple apps and programs with each holding some settings, it uses every opportunity to shove Edge and Skype app down my throat, and the list goes on.

I Pronounce You Hausband And Wife

In order to prove my marriage to US government I had to obtain a marriage certificate from my home country – Croatia. Instead of getting standard certificate and translating it myself, I decided to get a fancy international one.

As it was agreed way back in 1976, its format leaves a lot to be desired. The front side is written in Croatian (official Croatian language) with French right below it. What makes it international is fact there are a few more languages, including English, on the other side included as the legend. On the front side you have numbered fields and in legend on the back you see what that field corresponds to in multiple languages.

While I would personally expect any computerized office to simply print the marriage certificate in any language directly on the front page, I guess legend on the back is not the worst solution out there. And I’m sure there is some obscure legal reason behind why the French language that almost nobody in Croatia speaks gets the front page treatment instead of German or English. But that’s not what pisses me off about this form.

The most annoying thing there is number of errors visible on the first glance.

Let’s start with the first field. This one has name of the country written in Croatian, French, German, English, Spanish, etc. All fields following it have their corresponding meaning printed in German, English, Spanish, etc. Notice what’s missing? Yes – other fields have no Croatian or French description as those are already written on the front page. But the first field gets to be inconsistent.

And no, this minor issue is not where the fun stops.

Second fields has English translation of “Extract from the marriage registratica n°.” This field is generous enough to give us two mistakes, the first one being decidedly non-English (or probably any language) word registratica. Second error is n° abbreviation. In English it can be written as №, Nº, N° (for non-Unicode folks), No., no., and probably many more forms. But it’s almost never written in the French “n°” style. Yep, English translation of this field offers an unique mix between non-existent word and abbreviation in the wrong language.

And I will finish with my favorite error.

Field 5 has its English translation listed as “Hausband”. Since field following it has translation “Wife”, I can only assume it was meant to say “Husband” rather than something that could be interpreted as German house band. How the heck you can have word husband misspelled in the country where 97% kids in 2014 were supposedly taught English? While I don’t have stats for my generation, I doubt it was lower than 75% even in 2K days.

And don’t tell me that was just an accident – the same darn mistake is also on the front page as part of a smaller legend translated as “Death of the hausband” – which does sound like a good band name when I think about it.

Croatia has been an independent country for 28 years now. I am not sure when exactly international marriage certificate was introduced but it has been present for at least 10 years now, if not since the very beginning. I can imagine semi-valid excuses for the first person doing the translation – maybe it was simply some clerk who wasn’t aware how bad his English was.

However, persisting these errors through god-knows how many reprints is something that cannot be excused.

PS: And no, I didn’t check all fields nor I bothered with other languages. However, since English translation is this butchered, I can only imagine all the levels of wrongness for other languages.

PPS: If you want to see both front and back page for yourself you can download example form from Croatian government website.

PPPS: If you want to see better translated marriage certificate there is one from the Macedonian government.