video#
- mediautils.video.rotate_video(path: str | PathLike, angle: int = 90, out_dir: str | PathLike = 'out', out_name: str | None = None) Path[source]#
Write a rotated copy of a video.
- Parameters:
path (str | os.PathLike) – Path to the source video.
angle (int) – Rotation angle in degrees (90, 180, or 270).
out_dir (str | os.PathLike) – Directory where the rotated video is saved. Created if it does not exist.
out_name (str | None) – Output file name. If
None, the original file name is kept.
- Returns:
Path to the output file.
- Return type:
Path
- mediautils.video.set_time_video(path: str | PathLike, dt: datetime, out_dir: str | PathLike = 'out', out_name: str | None = None) Path[source]#
Write a copy of a video with its timestamps set to dt.
Sets the filesystem modification/access times and the MP4 container
creation_timemetadata (via ffmpeg).- Parameters:
path (str | os.PathLike) – Path to the source video.
dt (datetime) – The datetime to write into the metadata.
out_dir (str | os.PathLike) – Directory where the modified copy is saved. Created if it does not exist.
out_name (str | None) – Output file name. If
None, the original file name is kept.
- Returns:
Path to the output file.
- Return type:
Path