🟡 Command line
✅ As DepthFlow is a ShaderFlow "spin-off" - a custom Scene - most of its documentation on commands, behavior, issues and options are shared between the two.
- The examples of each section shows a single functionality, but you can combine them1.
Simplest command¶
Start a realtime window with the default image and animation with:
1 |
|
- Walk around with W A S D or Left click + Drag
- Drag and drop image files or URLs to load them
- Press Tab for a dev menu with some options
Using your images¶
Load an input image, and start the main event loop with:
1 2 |
|
1 2 |
|
- Note: Make sure the image path exists, relative paths (not starting with
C:\
or/
) are relative to where the the executable or current working directory of the shell or is.
Exporting a video¶
Render 10 seconds of the animation to a video file with default settings with:
1 |
|
See all rendering options with depthflow main --help
Resolution¶
The output resolution, by default, will match the input image's one. You can send either -w
or -h
to force one component and fit the other based on the image's aspect ratio:
1 2 |
|
1 2 |
|
Looping¶
The output video will scale and loop perfectly, with a period set by the --time
parameter:
1 2 |
|
1 2 |
|
Video encoder¶
You can also easily change the video encoder:
You can see all available codecs in depthflow --help
!
1 2 |
|
1 2 |
|
1 2 |
|
Quality¶
The video is eternal, so getting the best render quality even if it takes longer is important. There's a couple of main factors that defines the final video quality:
-
Resolution: A combination of the input image and the exported video's resolution. Rendering at a higher resolution than the input image will not improve quality.
-
Super Sampling Anti Aliasing: Rendering at a higher internal resolution and then downscaling to the output target mitigates edge artifacts and smooths them. The default is 1.2, and the maximum quality gains happen at 2.0, don't go above it.
-
Quality parameter: The
depthflow main --quality 50
parameter defines how accurate calculating the projection's intersections are. A value of 0 is sufficient for subtle movements, and will create 'layers' artifacts at higher values. The default is 50, which is actually overkill for most cases, given how much optimized the code is. -
Depth map: Defines the accuracy of the parallax effect. The default estimator is a state of the art balance of speed, portability, quality, and should be enough.
-
Video codec: The encoder compresses the video from unimaginably impractical sizes of raw data to something manageable. Briefly, CPU encoders yields the best compression, file sizes, and quality, but are slow(er) than GPU encoders, which are "worse" in every other situation. There's no better quality than the realtime window itself.
1 2 |
|
Using an upscaler¶
Upscale the input image before rendering the video with:
1 2 |
|
1 2 |
|
Custom animations¶
🚧 Animations are work in progress, and will change substantially 🚧
You can use a couple of high quality presets with:
See any of depthflow 'preset' --help
for more options!
1 2 |
|
1 2 |
|
1 2 |
|
1 2 |
|
1 2 |
|
Batch processing¶
⚠️ Note: Batch exporting feature is experimental and might have issues!
You can also batch process images and videos with:
Selecting inputs¶
1 2 3 4 5 |
|
1 2 |
|
1 2 |
|
Exporting¶
Let's assume there are foo.png
, bar.png
, and baz.png
in the ./images
folder:
- Always have
-b all
or--batch all
in themain
command (or a range like0-5
images) - The output video basename will become a suffix of the exported video
1 2 |
|
The prefix is enforced mainly as there's no 'empty' file in a directory, but also useful in:
1 2 3 |
|
Or even set the output folder to the same input, so videos sorts nicely alongside images:
1 |
|
It might be a good idea to specify a common height for all exports:
1 2 |
|
Loving what you see? Help me continue this Full-Time Open Source Work!
-
For example, when exporting a video, you can also input your image on the command chain. ↩