pptx2mp4 プログラム仕様

概要:

Windows版PowerPointを使って、PPTXファイルをMP4へ変換します。

詳細説明:

必要条件として pip install pywin32 を実行してモジュールをインストールしてください。

関連リンク:

pptx2mp4_usage

pptx2mp4.convert_pptx_to_mp4(input_path: Path, output_path: Path, *, resolution: int = 720, fps: int = 30, quality: int = 100, default_slide_duration: int = 5, use_timings_and_narrations: bool = True, overwrite: bool = False) → None
概要:

PowerPointのCreateVideoを使ってPPTXをMP4に変換します。

詳細説明:

入力されたPowerPointファイルを指定された設定でMP4動画ファイルに変換します。 変換の進捗状況を標準出力に表示し、完了するまで待機します。

引数:
param input_path:

入力となるPowerPointファイルのパス。

type input_path:

pathlib.Path

param output_path:

出力するMP4ファイルのパス。

type output_path:

pathlib.Path

param resolution:

動画の縦解像度。

type resolution:

int

param fps:

動画のフレームレート。

type fps:

int

param quality:

動画の品質設定。

type quality:

int

param default_slide_duration:

タイミング未設定時の1スライドの秒数。

type default_slide_duration:

int

param use_timings_and_narrations:

記録済みのタイミングとナレーションを使用するかどうか。

type use_timings_and_narrations:

bool

param overwrite:

既存の出力ファイルがある場合に上書きするかどうか。

type overwrite:

bool

戻り値:
returns:

なし。

rtype:

None

例外:
raises FileNotFoundError:

入力ファイルが存在しない場合に発生します。

raises ValueError:

入出力ファイルの拡張子が適切でない場合に発生します。

raises FileExistsError:

出力ファイルがすでに存在し、overwriteがFalseの場合に発生します。

raises RuntimeError:

PowerPointのビデオ作成処理に失敗した場合、またはMP4ファイルが作成されなかった場合に発生します。

pptx2mp4.main() → int
概要:

スクリプトのメイン処理を実行します。

詳細説明:

コマンドライン引数を取得し、変換関数を呼び出します。 キーボード割り込みや予期せぬエラーが発生した場合はキャッチして終了コードを返します。

戻り値:
returns:

終了コードとコマンドライン引数のタプル。

rtype:

tuple

pptx2mp4.parse_args() → Namespace
概要:

コマンドライン引数を解析します。

詳細説明:

argparseを使って、入力ファイル、出力ファイル、解像度などの変換オプションを読み取ります。

戻り値:
returns:

解析されたコマンドライン引数を格納した名前空間オブジェクト。

rtype:

argparse.Namespace