3D LUTs for MLV -> Prores?

Started by sgofferj, March 20, 2015, 08:13:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sgofferj

@Danne:
Very nice! You probably still used a relatively long lens, didn't you? The goshawk seems completely undisturbed by you. If you like nature / animal photography, did you notice my "The girl and the wolves"-film that I posted last year? It starts Finnish but most of it is in English and we have some very cute scenes :). I'm currently trying to raise the budget for a second part.
18+ years Linux user, wolf-fan, hobby photographer and -filmmaker
EOS 6D, EOS 7D

Danne

Amazing. Didn,t see it before. I will watch the whole thing later. There,s some piece of land between finland and Russia with a lot of wolves and bears I heard and seen pictures. I really feel for that animal. It is very mistreated. In Sweden they recently shot about 40 wolves, most of them healthy young ones.
I,ve seen one in the wild once. Blessed moment really.

The place with the goshawk actually had a Lynx coming multiple times to eat. This was taken with a mms cam https://www.youtube.com/watch?v=CvUdzVvIbPI

sgofferj

Did an update of my script and included the white balance settings:
#!/bin/bash

SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
LUTSDIR=${SCRIPTPATH}/LUTS

if [ ${1} ]; then
  FPS=${1}
else
  echo "Warning: FPS not specified, using 23.976"
  FPS=23.976
fi

if [ ${2} ]; then
  LUT="-vf lut3d=${LUTSDIR}/${2}.cube"
fi

MLVBASE=$(echo ${PWD##*/} | sed "s/\.MLV//g")
OUTPUT=${MLVBASE}.mov
FIRSTDNG=${MLVBASE}_000000.dng

WTEMP=$(dcraw -T -a -v -c ${FIRSTDNG} 2>&1 | awk '/multipliers/ { print $2,$3,$4,$5 }')

dcraw -a -c -H 0 -6 -W -q 3 -r ${WTEMP} *.dng | \
ffmpeg -f image2pipe -c:v ppm -r ${FPS} -i pipe:0 \
-c:v prores_ks -profile:v 3 -vendor ap10 -pix_fmt yuv444p10 \
${LUT} -y -r ${FPS} ${OUTPUT}
18+ years Linux user, wolf-fan, hobby photographer and -filmmaker
EOS 6D, EOS 7D

Danne

dcraw -a -c -H 0 -6 -W -q 3 -r ${WTEMP}

skip -a because it will
-a        Average the whole image for white balance
You already have the multipliers for wb here -r ${WTEMP}

* I was answering this
http://magiclantern.fm/forum/index.php?topic=15222.msg148134;topicseen#msg148134

sgofferj

18+ years Linux user, wolf-fan, hobby photographer and -filmmaker
EOS 6D, EOS 7D

Danne

Your welcome. Also if you like to try out a log pack I created.
https://drive.google.com/file/d/0B4tCJMlOYfircjFuQW83a1JuN3M/view?usp=sharing

They all work with ffmpeg. A lot of log luts but also white balance and contrast(rec709ish) luts.
All logs starts with 01_, White balance luts are 02_, and contrast luts are 03_. Should be applied in that order. log, wb, contrast. Or skip the wb luts.
I recommend davinci reslove lite for creating luts.

sgofferj

Sooo much to test and learn (Resolve...) :D. And in about a month we're planning to go shooting Tyttö ja sudet 2... I still haven't decided if I should dare shoot it in raw. One big concern is that at 23.976, the 6D only does 1472x626 continuously. I can't make up my mind how the softness through the upscaling compares to the h.264 ALL-I...
18+ years Linux user, wolf-fan, hobby photographer and -filmmaker
EOS 6D, EOS 7D

Danne

Interesting. Maybe do specific 3x zoom shots and rest in h.264?
Regarding davinci I mostly applied a contrast to a log print screen with curve tool. Done in five minutes. But if I want to mimic a look there are waveform and scopes to help out. It is the fun part of film making :)

sgofferj

Ran into an interesting issue with my script. I shot 3 clips in the same setting and after conversion they all came out with a little different white balance. Nothing I couldn't correct in post but unnecessary additional work. Now I'm pondering what would be a good default value to use in the script... Having all clips of a shoot in the same wrong white balance isn't as bad as having each clip with different values, especially, if I shoot 2 or 3 cards full. Kdenlive allows white balance correction per track :).
18+ years Linux user, wolf-fan, hobby photographer and -filmmaker
EOS 6D, EOS 7D

Danne

Hi sgofferj. I implemented so you can include a raw cr2 still image which will apply the same wb for all clips. I even made possible to simply use a dng frame from a mlv/raw file which would work as a master wb setting. Additionally I added so you can group mlv/raw files with multiple different cr2 wb files. Workflow is that before you film take a cr2 still image. Film as many clips you want. Then when changing wb take another cr2 file. In postprocess simply add all cr2 files together with mlv/raw files. It will automatically select corresponding cr2 files.You can check cr2hdr-r source regarding this. I, m not by my computer at the moment.

sgofferj

Interesting idea! I think, I'll do that too...
18+ years Linux user, wolf-fan, hobby photographer and -filmmaker
EOS 6D, EOS 7D

Danne

Here are my different ways of applying white balance. Maybe helpful. Best would be to work out something like MLVS in which dmilligan finds kelvin numbers and rgb numbers and through some algorithms obtained via ufraw he nails wb from cam settings from mlv files.

First it gets wb multipliers from the first dng file in the folder
dcraw -T -a -v -c ${BASE}"$date_02"_000000.dng 2>&1 | awk '/multipliers/ { print $2,$3,$4,$5 }' > /tmp/magic_l_MLV/mltpl_a
Wtemp_2=$(cat /tmp/magic_l_MLV/mltpl_a)


If one or more CR2 are present next to the mlv/raw files it skips the dng multiplier and lists the CR2 according to filmed closest in time to the mlv/raw file. In the listing procedure it will move the CR2 used to an ORIGINALS folder when a group is finished
if ls ../*.CR2
then
dcraw -i -v ../*.CR2 2>&1 | awk '/Camera multipliers/ { print $3,$4,$5,$6 }' > /tmp/magic_l_MLV/wB_03
Wtemp_2=$(cat /tmp/magic_l_MLV/wB_03)
ls -tr ../*.RAW ../*.MLV ../*.CR2 | awk 'NR==2' > /tmp/magic_l_MLV/wB_a_02b
ls -tr ../*.RAW ../*.MLV ../*.CR2 | awk 'NR==1' > /tmp/magic_l_MLV/wB_a_02c

ls ../*.RAW ../*.MLV > /tmp/magic_l_MLV/wB_a_02d
if ! grep 'MLV\|RAW' /tmp/magic_l_MLV/wB_a_02d
then
mv ../*.CR2 ../ORIGINALS
fi

if grep 'CR2' /tmp/magic_l_MLV/wB_a_02b
then
wB_01=$(cat /tmp/magic_l_MLV/wB_a_02c)
mv $wB_01 ../ORIGINALS
fi
fi




The multipliers can be calculated and applied to a dng file as well (asshotneutral value) but it has to involve some basic math. I found out how through a white balance thread from chmee.
The "else" tail is calculating the asshotneutral values through a dng file creating auto white balance through dcraw to the dng files if no CR2 file is present.

if ls ../*.CR2
then
dcraw -i -v ../*.CR2 | awk '/Camera multipliers/ { print $3; exit }' > /tmp/magic_l_MLV/wB_p_01
wB_p_01=$(cat /tmp/magic_l_MLV/wB_p_01)

dcraw -i -v ../*.CR2 | awk '/Camera multipliers/ { print $5; exit }' > /tmp/magic_l_MLV/wB_p_02
wB_p_02=$(cat /tmp/magic_l_MLV/wB_p_02)

echo 1024.000000/$wB_p_01 | bc -l | awk 'FNR == 1 {print}' > /tmp/magic_l_MLV/wB_p_result_01
wB_p_res_01=$(cat /tmp/magic_l_MLV/wB_p_result_01)

echo 1024.000000/$wB_p_02 | bc -l | awk 'FNR == 1 {print}' > /tmp/magic_l_MLV/wB_p_result_02
wB_p_res_02=$(cat /tmp/magic_l_MLV/wB_p_result_02)


echo "-AsShotNeutral=$wB_p_res_01 1 $wB_p_res_02" > /tmp/magic_l_MLV/wB_p_result_03
wip_01=$(cat /tmp/magic_l_MLV/wB_p_result_03)


ls -tr ../*.RAW ../*.MLV ../*.CR2 | awk 'NR==2' > /tmp/magic_l_MLV/wB_a_p
ls -tr ../*.RAW ../*.MLV ../*.CR2 | awk 'NR==1' > /tmp/magic_l_MLV/wB_a_pp


ls ../*.RAW ../*.MLV > /tmp/magic_l_MLV/wB_a_pi
if ! grep 'MLV\|RAW' /tmp/magic_l_MLV/wB_a_pi
then
mv ../*.CR2 ../ORIGINALS
fi

if grep 'CR2' /tmp/magic_l_MLV/wB_a_p
then
wB_p=$(cat /tmp/magic_l_MLV/wB_a_pp)
mv $wB_p ../ORIGINALS
fi

else


dcraw -T -a -v -c ${BASE}"$date_01"_000000.dng 2>&1 | awk '/multipliers/ { print $2 }' > /tmp/magic_l_MLV/a_wb
num_01=$(cat /tmp/magic_l_MLV/a_wb)

dcraw -T -a -v -c ${BASE}"$date_01"_000000.dng 2>&1 | awk '/multipliers/ { print $3 }' > /tmp/magic_l_MLV/a_wb
num_02=$(cat /tmp/magic_l_MLV/a_wb)

dcraw -T -a -v -c ${BASE}"$date_01"_000000.dng 2>&1 | awk '/multipliers/ { print $4 }' > /tmp/magic_l_MLV/a_wb
num_03=$(cat /tmp/magic_l_MLV/a_wb)

dcraw -T -a -v -c ${BASE}"$date_01"_000000.dng 2>&1 | awk '/multipliers/ { print $5 }' > /tmp/magic_l_MLV/a_wb
num_04=$(cat /tmp/magic_l_MLV/a_wb)

echo $num_02/$num_01 | bc -l | awk 'FNR == 1 {print}' > /tmp/magic_l_MLV/wB_p_result_0_a
num_01=$(cat /tmp/magic_l_MLV/wB_p_result_0_a)

echo $num_04/$num_03 | bc -l | awk 'FNR == 1 {print}' > /tmp/magic_l_MLV/wB_p_result_0_b
num_02=$(cat /tmp/magic_l_MLV/wB_p_result_0_b)


echo "-AsShotNeutral=$num_01 1 $num_02" > /tmp/magic_l_MLV/wB_p_result_04
wip_01=$(cat /tmp/magic_l_MLV/wB_p_result_04)

fi