algan_utils¶
Top-level authoring helpers and render results.
RenderResult is the value returned by
save_video() and
save_frame(): its status, output_path,
walltime_seconds and render_plan describe what was written and how it was
rendered.
The rest is scene-level tooling: algan_scene for declaring a renderable
scene, combine_scenes and concatenate_videos for assembling a long video
out of separately authored parts (see
Multi-Scene Projects), and profile_func for
timing a render.
Classes
Outcome metadata returned by |
Functions
- algan_scene(function=None, *, name=None)[source]¶
Mark a zero-argument function as an Algan scene entry point.
render_all_funcsprefers explicitly decorated functions and falls back to its historical zero-argument scan only when a module has no decorated scenes.Named
algan_scenerather thansceneso that the decorator does not collide with the conventional variable name for a Scene instance.
- concatenate_videos(directory, threads=None, reencode=False, output_file='output.mp4', input_files=None)[source]¶
Concatenate all .mp4 files in a directory into output.mp4.
Files are sorted by their numeric prefix (e.g., 1_intro.mp4, 2_scene.mp4). Uses ffmpeg with multithreading support.
- Parameters:
directory (str) – Path to directory containing .mp4 files
threads (int) – Number of threads for ffmpeg (default: CPU count)
reencode (bool) – If True, re-encode videos with multithreading. If False, use stream copy (faster, no re-encoding)
input_files – Optional explicit iterable of videos to concatenate. Paths default to
directorywhen relative. When omitted, all MP4 files directly insidedirectoryare used.
- Returns:
Path to output file if successful, None otherwise