Exporting
-> DepthFlow supports realtime previews and video exporting.
After creating your Animation (or using a #preset), and sending Inputs images to a scene instance, it's time to run the animation and export them to a shareable video!
Ensure you have FFmpeg installed and available in PATH for video encoding
- For licensing and size reasons, it cannot be easily distributed, and isn't a hard requirement.
- Get from your package manager, or put executables in your working directory.
Video¶
Simply send an output="video.mp4" argument to the scene.main method/command:
Note: See all available options with
depthflow main --help, most you already expect:
Batch¶
For exporting multiple videos, you can follow something similar to the batch.py example script, where a scene is reused on many renders over globbing image directories - some notes:
- Always initialize the scene with a
backend=headlessfor compatibility. - Always reset the scene's state before rendering again, as the previous animation ending could leave changes in the camera parameters a second animation doesn't enforce.
Codec¶
Very large topic, until ShaderFlow documentation is written, you can:
Use your IDE linter to explore the shaderflow.ffmpeg module!
Quality¶
The main things that affect the final video quality are:
- Depthmap precision: DepthFlow is highly sensitive to good relative depths between any two points on the scene, and not object sillhouette precision. Learn more at Inputs/#depth.
- SSAA Value: Render at a higher resolution and downscales to output, default being 1.0 (pure). Must only go as high1 as
2 * subsample(default 2), the downscale kernel size, hurts quality otherwise. A value of 2.0 is plenty for final exports. - Resolution: No gains in videos larger than input sources, should at least match it. When using SSAA, zooming, or with large #heights or #offsets, a larger input image has benefits.
- Quality parameter: Explained in Camera/#quality.
- Image contents: Explained in Inputs/#image.
- Encoder settings: Explained in #codec.
Some settings are O(N²) - know your hardware limits!
- Doubling the resolution is ~4x RAM, CPU usage.
- Doubling SSAA is exactly 4x GPU usage.
OpenGL driver implementations have a maximum texture size, commonly 16384 or 32768 pixels depending on your GPU. Values above 2.0 may cause crashes for 4k or 8k output videos. ↩