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

RenderResult

Outcome metadata returned by algan.scene.Scene.save_video().

Functions

algan_scene(function=None, *, name=None)[source]

Mark a zero-argument function as an Algan scene entry point.

render_all_funcs prefers explicitly decorated functions and falls back to its historical zero-argument scan only when a module has no decorated scenes.

Named algan_scene rather than scene so that the decorator does not collide with the conventional variable name for a Scene instance.

combine_scenes(directory)[source]
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 directory when relative. When omitted, all MP4 files directly inside directory are used.

Returns:

Path to output file if successful, None otherwise

get_file_writer(temp_file_path, video_settings_resolution, codec, fps, with_mask, ffmpeg_params, audiofile, audio_codec)[source]
profile_func(func)[source]
render_all_funcs(module_name, video_settings=None, profile=False, overwrite=True, start_index=0, max_rendered=-1, output_directory=None, output_root=None, file_extension='mp4', smoke_test=False, prefix=None, funcs=None, speech_source=None, **kwargs)[source]