vikit.postprocessing.subtitles.simple_video_subtitle_renderer ============================================================= .. py:module:: vikit.postprocessing.subtitles.simple_video_subtitle_renderer Overview -------- .. list-table:: Classes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`SimpleVideoSubtitleRenderer ` - A subtitle renderer with sensible parameter defaults for simple use cases. .. list-table:: Attributes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`FONT_SIZE_RATIO ` - \- * - :py:obj:`PIXEL_TO_POINT ` - \- Classes ------- .. py:class:: SimpleVideoSubtitleRenderer(font_path=ARIAL_TTF_PATH, font_size_pt=None, margin_bottom_ratio=0.04, margin_h_ratio=0.05) A subtitle renderer with sensible parameter defaults for simple use cases. Delegates the rendering to the VideoSubtitleRenderer class which can also be used directly if finer control is needed. .. rubric:: Overview .. list-table:: Methods :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`add_subtitles_to_video `\ (input_video_path, subtitle_srt_filepath, output_video_path, text_color, highlight_color, highlight_opacity) - \- .. rubric:: Members .. py:method:: add_subtitles_to_video(input_video_path: str, subtitle_srt_filepath: str, output_video_path: str, text_color: str = 'white', highlight_color: str = 'black', highlight_opacity: float = 0.7) -> None Attributes ---------- .. py:data:: FONT_SIZE_RATIO :value: 0.045 .. py:data:: PIXEL_TO_POINT :value: 0.75