sitcom_simulator.video.video_generator

Functions

render_video(script, font[, output_path, ...])

Renders a video from the given script and returns the path to the rendered video.

sitcom_simulator.video.video_generator.render_video(script, font, output_path='output.mp4', resolution=1080, orientation='portrait', speed=1.0, pan_and_zoom=True, clip_buffer_seconds=0.35, min_clip_seconds=1.5, speaking_delay_seconds=0.12, caption_bg_style='text_shadow', caption_bg_alpha=0.6, caption_bg_color='black', caption_bg_shadow_distance_x=5, caption_bg_shadow_distance_y=5, max_zoom_factor=1.3, min_zoom_factor=1.05, max_pan_speed=6, bgm_volume=-24, audio_codec='mp3')

Renders a video from the given script and returns the path to the rendered video.

Parameters:
  • script (Script) – The script to render

  • font (str) – The path to the font file to use

  • output_path – The path to save the rendered video to

  • resolution (int) – The width of the video to render assuming portrait mode. This takes into account the orientation parameter.

  • orientation (str) – The orientation of the video. “landscape”, “portrait”, or “square”.

  • speed (float) – The speed of the final video. 1.0 is normal speed.

  • pan_and_zoom (bool) – If True, the pan and zoom effect on images will be enabled.

  • clip_buffer_seconds (float) – How much time to wait after characters finish talking

  • min_clip_length – The minimum time to hold on a clip

  • speaking_delay_seconds (float) – How much time to wait after a character starts talking

  • caption_bg_style (Literal['box_shadow', 'text_shadow', 'none']) – The style of the background behind the captions

  • caption_bg_alpha (float) – The alpha of the background behind the captions

  • caption_bg_color (str) – The color of the background behind the captions

  • caption_bg_shadow_distance_x (float) – The x distance of the shadow behind the captions

  • caption_bg_shadow_distance_y (float) – The y distance of the shadow behind the captions

  • max_zoom_factor (float) – The maximum zoom factor for pan and zoom

  • min_zoom_factor (float) – The minimum zoom factor for pan and zoom

  • max_pan_speed (float) – The maximum pan speed for pan and zoom

  • bgm_volume (float) – The volume of the background music

  • audio_codec (Literal['mp3', 'aac']) – The audio codec to use for the video. mp3 seems to be more compatible with more video players, but aac is higher quality and is necessary for viewing videos in an iPhone browser.

  • min_clip_seconds (float)