Here´s another script roundtrip to obtain a flicker free HDR output using ffmpeg tblend average filter instead of applying enfuse. I´m using a combination of hugin align_image and then I crop and scale back to original aspect ratio leaving a prores file ready to use. The issue with enfuse is that interpolation of borders will cause flicker and tblend does not:
#Scripts for testing purposes
#Drop HDR MOV files into a folder and run the script i terminal from within the folder with MOV files. Hit enter when prompted
#The script will create three different types of HDR files. Please compare and report results
#All scripts combines consecutive frames so original fps is kept
#dependencies:
#install homebrew if not already:
#in terminal:
#/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#Then install:
#brew install exiftool
#brew install ffmpeg
#brew cask install hugin
cat <<'EOF' > HDR_script
#!/bin/bash
for FILE in `ls *.MOV 2>/dev/null`; do
ffmpeg -i $(ls *.MOV | head -1) -pix_fmt rgb24 %06d.tif
#crop and rescale is needed is needed after aligning. Will take place in #output cropped and aligned images section
cr_W=$(echo $(exiftool $(ls *.MOV | head -1) | awk '/Image Size/ { print $5; exit }' | cut -d "x" -f1 ))
cr_H=$(echo $(exiftool $(ls *.MOV | head -1) | awk '/Image Size/ { print $5; exit }' | cut -d "x" -f2 ))
cr_Ws=$(echo $cr_W*0.98 | bc -l | cut -d "." -f1)
cr_Hs=$(echo $cr_H*0.98 | bc -l | cut -d "." -f1)
crp_fix=$(echo crop=$cr_Ws:$cr_Hs,scale=$cr_W:$cr_H)
#First script combines enfused and aligned tif files then exports it to a prores mov file
while grep -E "tif" <<< $(find . -maxdepth 1 -iname '*.tif')
do
#align images and rename
/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack -a aligned.tif $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 1') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 2') && mv aligned.tif0000.tif 1.tiff && mv aligned.tif0001.tif 2.tiff & pid1=$!
/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack -a aligned2.tif $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 2') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 3') && mv aligned2.tif0000.tif 01.tiff && mv aligned2.tif0001.tif 02.tiff & pid2=$!
/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack -a aligned3.tif $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 3') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 4') && mv aligned3.tif0000.tif 001.tiff && mv aligned3.tif0001.tif 002.tiff & pid3=$!
/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack -a aligned4.tif $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 4') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 5') && mv aligned4.tif0000.tif 0001.tiff && mv aligned4.tif0001.tif 0002.tiff & pid4=$!
/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack -a aligned5.tif $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 5') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 6') && mv aligned5.tif0000.tif 00001.tiff && mv aligned5.tif0001.tif 00002.tiff & pid5=$!
/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack -a aligned6.tif $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 6') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 7') && mv aligned6.tif0000.tif 0000001.tiff && mv aligned6.tif0001.tif 0000002.tiff & pid6=$!
/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack -a aligned7.tif $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 7') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 8') && mv aligned7.tif0000.tif 00000001.tiff && mv aligned7.tif0001.tif 00000002.tiff & pid7=$!
/Applications/Hugin/Hugin.app/Contents/MacOS/align_image_stack -a aligned8.tif $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 8') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 9') && mv aligned8.tif0000.tif 000000001.tiff && mv aligned8.tif0001.tif 000000002.tiff & pid8=$!
#wait for jobs to end
wait < <(jobs -p)
#output cropped and aligned images
ffmpeg -i %09d.tiff -pix_fmt rgb24 -vf tblend=all_mode=average,$crp_fix $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 8' | cut -d "." -f2 | tr -d "/").tiff
ffmpeg -i %08d.tiff -pix_fmt rgb24 -vf tblend=all_mode=average,$crp_fix $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 7' | cut -d "." -f2 | tr -d "/").tiff
ffmpeg -i %07d.tiff -pix_fmt rgb24 -vf tblend=all_mode=average,$crp_fix $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 6' | cut -d "." -f2 | tr -d "/").tiff
ffmpeg -i %05d.tiff -pix_fmt rgb24 -vf tblend=all_mode=average,$crp_fix $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 5' | cut -d "." -f2 | tr -d "/").tiff
ffmpeg -i %04d.tiff -pix_fmt rgb24 -vf tblend=all_mode=average,$crp_fix $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 4' | cut -d "." -f2 | tr -d "/").tiff
ffmpeg -i %03d.tiff -pix_fmt rgb24 -vf tblend=all_mode=average,$crp_fix $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 3' | cut -d "." -f2 | tr -d "/").tiff
ffmpeg -i %02d.tiff -pix_fmt rgb24 -vf tblend=all_mode=average,$crp_fix $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 2' | cut -d "." -f2 | tr -d "/").tiff
ffmpeg -i %01d.tiff -pix_fmt rgb24 -vf tblend=all_mode=average,$crp_fix $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 1' | cut -d "." -f2 | tr -d "/").tiff
#remove unwanted files
rm 000000001.tiff 000000002.tiff 00000001.tiff 00000002.tiff 0000001.tiff 0000002.tiff 00001.tiff 00002.tiff 0001.tiff 0002.tiff 001.tiff 002.tiff 01.tiff 02.tiff 1.tiff 2.tiff
rm $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 8') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 7') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 6') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 5') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 4') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 3') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 2') $(find -s . -maxdepth 1 -iname '*.tif' | awk 'FNR == 1')
done
#output to prores
ffmpeg -r $(exiftool $(ls *.MOV | head -1) | grep 'Video Frame Rate' | cut -d ":" -f2) -i %06d.tiff -vcodec prores -pix_fmt yuv422p10le HDR_enfuse_$(ls *.MOV | head -1 | cut -d "." -f1).mov
mkdir -p HDR_ORIGINALS
mv $(ls *.MOV | head -1) HDR_ORIGINALS
rm *.tiff
done
EOF
sleep 0.2 && clear && echo "Hit enter" &
. HDR_script && rm HDR_script
I´m curious if 30 fps could work somewhat ok with this script so if there could be some testing around that it would be cool.