Making diving video colours better in Linux
Diving videos tend to be blueish. There are tools to automatically fix it, or at least – enhance the video so that the colours appear more natural. Unfortunately, most of these tools either don’t work well with Linux, or with my phone.
After a short investigation, I was able to produce a satisfactory result with the Linux program ‘Shotcut’ (available here)
Based on tips by the following blog and forum, I am able to produce a reasonable result out of my SJCam4000 action video camera, which has inferior sensors with lower light levels.
Still – it works.
I am using the ‘snap’ version of Shotcut, and the following filter is a very good baseline for modifications. Of course – the actual parameters depend on the light levels, depths (and thus – how many colours get absorbed), the level of white-balance your camera can get – and so on. Just paste the value below on Shotcut’s ‘filters’ area, and you should have a go:
<?xml version="1.0" encoding="utf-8"?>
<mlt LC_NUMERIC="C" version="7.5.0" root="" parent="producer0" in="00:00:00.000" out="00:08:19.967"><producer id="producer0" in="00:00:00.000" out="00:08:19.967"><property name="length">15000</property><property name="eof">pause</property><property name="resource">black</property><property name="aspect_ratio">1</property><property name="mlt_service">color</property><property name="shotcut:filtersClipboard">1</property><filter id="filter0" out="00:00:41.967"><property name="version">0.1</property><property name="mlt_service">frei0r.colgate</property><property name="threads">0</property><property name="0">#0aa5ee</property><property name="1">0.433333</property><property name="disable">0</property></filter><filter id="filter1" out="00:00:41.967"><property name="mlt_service">avfilter.hue</property><property name="av.h">-4</property><property name="av.b">-0.5</property><property name="av.s">1.5</property></filter><filter id="filter2" out="00:00:41.967"><property name="lift_r">0</property><property name="lift_g">0</property><property name="lift_b">0</property><property name="gamma_r">1</property><property name="gamma_g">1</property><property name="gamma_b">1</property><property name="gain_r">1</property><property name="gain_g">1</property><property name="gain_b">1</property><property name="mlt_service">lift_gamma_gain</property><property name="shotcut:filter">contrast</property></filter><filter id="filter3" out="00:00:41.967"><property name="lift_r">-0.253986</property><property name="lift_g">-0.253986</property><property name="lift_b">-0.253986</property><property name="gamma_r">1.106</property><property name="gamma_g">1.09001</property><property name="gamma_b">1.183</property><property name="gain_r">264=1.79556</property><property name="gain_g">264=1.79556</property><property name="gain_b">264=1.79556</property><property name="mlt_service">lift_gamma_gain</property></filter></producer></mlt>
Hope it helps someone 🙂