Wow, that’s amazing!
Are you doing anything with your camera setup to reduce flicker or ramping the exposure from sunset to dusk or does the keyframes and script/algorithm handle all this?
I’m definitely going to have to try this out!!!
Wow, that’s amazing!
Are you doing anything with your camera setup to reduce flicker or ramping the exposure from sunset to dusk or does the keyframes and script/algorithm handle all this?
I’m definitely going to have to try this out!!!
Thank you!
As for my camera setup, it depends. When I’m lazy I just use Aperture (A mode). My Sony does a pretty good job for ramping and rarely requires deflickering. But if it occurs you can use either darktable’s exposure module in automatic mode or the script.
I set White Balance always to AWB, because that way I get an idea of what the White Balance should look like. Especially for Sunrise / Sunset WB changes over time. However, the automatic algorithm seems to be less stable than the light meter. This results in what I call “color flicker”. This can be solved using this script and was the actual reason for writing this script.
I hope you enjoy using this script and get something out of it!
Ok, dtlapse actually came right on time! I have toyed some with it last week, but now I have a real use case!
I shot a timelapse of the build-up of a tv studio yesterday. So: controlled lighting, easy right? Nope, they assembled a white backdrop, so darktable’s auto-exposure/deflicker came up with a different exposure between the beginning and the end of the video. Keyframing the auto-exposure percentile did the job!
BTW, what are you using to make the final video? Plain ffmpeg or something like Shotcut or Blender?
That’s awesome, I’m so happy to hear that!
I export my pictures in full resolution to 16bit TIFFs. Then I create a video with ffmpeg:
ffmpeg -framerate 24 -f image2 -i '%04d'.tif -c:v ffv1 output.mkv
Notes:
Check out darktable’s ${SEQUENCE} export variable
ffmpeg does not handle color profiles properly (at least for me) so I set the output color profile to my monitor profile which is probably not the right thing to do but with that I get consistent colors in my videos.
Using FFv1 will generate a huge file, you’ve been warned
It’s a lossless intra-frame codec, i.e. only compresses the video on a per-frame basis and does not consider the previous or following frames like inter-frame codecs e.g. mpeg. But I haven’t found a lossless inter-frame codec (for linux) yet. Expect the file size to be equal to the size of your TIFF files.
After that I usually generate a smaller video file for editing in Shotcut:
ffmpeg -i output_ffv1_fullres.mkv -c:v libx264 -vf "scale=2560:-1" output_x264_2560x.mkv
I use a symlink for proxy editing:
ln -s output_x264_2560x.mkv output.mkv
shotcut output.mkv
<edit edit edit close shotcut>
rm output.mkv
ln -s output_ffv1_fullres.mkv output.mkv
shotcut output.mkv
<export video with the 4K preset, high quality resampling etc>
There are some filters in Shotcut which work on absolute parameters, but that’s fixable even on a large file. Using the proxy file can give you a good estimate where you want to go especially for placing the soundtracks.
very good work! a simple GUI would be nice to have
This is, what I am struggling with atm… I shoot over night and import in different subfolders acc. to date with RPD. For dt that is not a problem, as I import the next higher folder with all subfolders, but for dtlapse, I donno how to fetch them (maybe I am lacking too much bash know-how)
Indeed I was, but darktable on IRC helped
dtlapse temperature --xmps ./2020-07-[2][0123456789]/*{9059..9331}*xmp --smooth --plot
Dear @jchnkl,
I am editing with current master of dt (3.3.0+651~gb6bbd0d56) and got the following errors ( I have used that modules):
$ dtlapse bilat --xmps ./2020-07-[2][0123456789]/*{9059…9331}*xmp --smooth --plot
Traceback (most recent call last):
File "/home/gerber/.local/bin/dtlapse", line 8, in <module>
sys.exit(main())
File "/home/gerber/.local/lib/python3.7/site-packages/dtlapse/dtlapse.py", line 209, in main
params = get_params(history, iop.operation)
File "/home/gerber/.local/lib/python3.7/site-packages/dtlapse/dtlapse.py", line 76, in get_params
raise ValueError
ValueError
$ dtlapse colorbalance --xmps ./2020-07-[2][0123456789]/*{9059…9331}*xmp --smooth --plot
Traceback (most recent call last):
File "/home/gerber/.local/bin/dtlapse", line 8, in <module>
sys.exit(main())
File "/home/gerber/.local/lib/python3.7/site-packages/dtlapse/dtlapse.py", line 209, in main
params = get_params(history, iop.operation)
File "/home/gerber/.local/lib/python3.7/site-packages/dtlapse/dtlapse.py", line 76, in get_params
raise ValueError
ValueError
$ dtlapse hazeremoval --xmps ./2020-07-[2][0123456789]/*{9059…9331}*xmp --smooth --plot
Traceback (most recent call last):
File "/home/gerber/.local/bin/dtlapse", line 8, in <module>
sys.exit(main())
File "/home/gerber/.local/lib/python3.7/site-packages/dtlapse/dtlapse.py", line 209, in main
params = get_params(history, iop.operation)
File "/home/gerber/.local/lib/python3.7/site-packages/dtlapse/dtlapse.py", line 76, in get_params
raise ValueError
ValueError
$ dtlapse filmicrgb --xmps ./2020-07-[2][0123456789]/*{9059…9331}*xmp --smooth --plot
Could not find modversion 4 for the filmicrgb module.
for filmic, here is my excerpt of the xmp (with modversion=4"):
<rdf:li
darktable:num="7"
darktable:operation="filmicrgb"
darktable:enabled="1"
darktable:modversion="4"
darktable:params="gz02eJybNXOyIwPDjwO2XMsdGBgcoPiEEwRDwCygGv1lFTYgse+8QSB5x7Nn1tgzMCg4guTPnjljywykGaGYAUozMaCCJ+wMDAAfRBW1"
darktable:multi_name=""
darktable:multi_priority="0"
darktable:blendop_version="9"
darktable:blendop_params="gz11eJxjYGBgkGAAgRNODGiAEV0AJ2iwh+CRyscOAAdeGQQ="/>
what am I doing wrong
Sorry, if too many noob questions:
what does the following tell me (I get the same for temperature)?
$ dtlapse exposure --xmps ./2020-07-2[12]/*{8540..8870}.NEF.xmp --no-backup --plotTraceback (most recent call last):
File "/home/gerber/.local/bin/dtlapse", line 8, in <module>
sys.exit(main())
File "/home/gerber/.local/lib/python3.7/site-packages/dtlapse/dtlapse.py", line 236, in main
kind=args.interp_method)
File "/home/gerber/.local/lib/python3.7/site-packages/scipy/interpolate/interpolate.py", line 529, in __init__
check_finite=False)
File "/home/gerber/.local/lib/python3.7/site-packages/scipy/interpolate/_bsplines.py", line 817, in make_interp_spline
"match: expected %s, got %s+%s" % (nt-n, nleft, nright))
ValueError: The number of derivatives at boundaries does not match: expected 1, got 0+0
Hi @AxelG,
basically nothing, but didn’t get around to update dtlapse’s modules to the latest modules for darktable (I did not even update my copy of darktable yet…). So for now, all the modules are on 3.0.2.
That probably means that you’re not using enough keyframes and / or didn’t not include the first and the last frame as keyframes.
For interpolation with anything else than “linear” to work you need at least three values, at least afair. One value doesn’t make sense and two values would result in a straight line, you can try “linear” mode for that and see if the algorithm accepts this.
The error output is quite raw and unpolished, there’s certainly room for improvement, sorry for that
I’ve had the idea to read darktable’s database, to eliminate the need for globbing wizardry. But my To-Do list is already pretty long
Hi there,
I also have a nooby question:
My files (raw and xmp) are located at:
~/Bearbeiten/Zeitraffer/2021_04_02/RAW
When I execute dtlapse:
dtlapse exposure --xmps *.xmp
following error appears:
Traceback (most recent call last):
File “/home/coco/.local/bin/dtlapse”, line 8, in
sys.exit(main())
File “/home/coco/.local/lib/python3.8/site-packages/dtlapse/dtlapse.py”, line 209, in main
params = get_params(history, iop.operation)
File “/home/coco/.local/lib/python3.8/site-packages/dtlapse/dtlapse.py”, line 76, in get_params
raise ValueError
ValueError
Files look like “DSCxxx.ARW” and “DSCxxx.ARW.xmp”. Keyframe “Keyframe” is added to around 45 images, included first and last image.
Darktable version is 3.0.1
Kind regards,
Coco
Another question:
is it possible that 692 files are too much?
Certainly not, I just do not get around to maintain the script anymore. It’s based on dt 3 (?) and probably not working well or at all with newer versions. Sorry!
Hi!
I’m currently trying out dtLapse. To get it working with Python 3.12 I replaced the attrdict
package with attrdictionary
. Now I’m trying to add the channelmixerrgb
module, aka. color calibration, as explained in your readme based on the module’s C code.
This is what I have so far:
{ "operation": "channelmixerrgb"
, "iopdata": [ { "modversion": 3
, "iop_order": 42.0
, "smooth": "eval: 6 * 4 * [True] + 6 * [False] + 4 * [False] + 4 * [True] + 2 * [False]"
, "cformat": "eval: 6 * 4 * 'f' + 6 * '?' + 4 * 'i' + 4 * 'f' + '?i'"
}
]
, "help": "Smoothing for the channelmixerrgb module (color calibration)."
, "license": "GPL-3.0-or-later"
, "copyright": []
}
Unfortunately, struct.unpack
in xcoder.py
complains: “struct.error: unpack requires a buffer of 144 byte”
The length of the variable ps
is 160. Do I understand correctly that I’m missing 16 B in my definition? Did I miss something in my interpretation of the C struct?
I also arbitrarily set iop_order
to 42 because I couldn’t find it in my XMP files. Maybe this has been removed in newer versions of Darktable? What does this value mean exactly and how important is it?
Figured it out, I think! gboolean
s appear to be 4 Bytes, so I changed the '?'
s to 'i'
s. Seems to work nicely with Darktable 4.6.1 and linear interpolation on the exposure and channelmixerrgb modules, at least. Thank you very much for your work!
I’ll open a merge request tomorrow