scholium.video_generator.VideoGenerator#
- class VideoGenerator(resolution=(1920, 1080), fps=30, video_config=None)[source]#
Bases:
objectGenerates videos from slides and audio using ffmpeg.
Initialize video generator.
- Parameters:
Methods
Create video from slides and audio segments.
Probe ffmpeg and verify configured codecs are available.
- probe_dependencies()[source]#
Probe ffmpeg and verify configured codecs are available.
Mirrors
SlideBackend.probe_dependencies()so the CLI’svideo listdoctor command can render the results identically.- Return type:
List[Probe]
- create_video(slides, segments, output_path, temp_dir=None)[source]#
Create video from slides and audio segments.
- Parameters:
segments (
List[Dict[str,Any]]) – List of segments with timing info: - audio_path: Path to audio file (None for silent) - audio_duration: Duration of audio - duration: Total duration (includes pre/post delays, respects min_duration) - pre_delay: Seconds to pause before audio - post_delay: Seconds to pause after audio - slide_number: Slide index (1-based) - fixed_duration: If set, overrides calculated durationoutput_path (
str) – Path for output videotemp_dir (
str) – Directory for temporary files
- Return type:
- Returns:
Path to generated video
- Raises:
RuntimeError – If video generation fails