Add Avisynth video encoding workflow
This commit is contained in:
+13
-1
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timedelta
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
@@ -16,6 +16,18 @@ def format_filename_stem(dt: datetime) -> str:
|
||||
return naive_wall_time(dt).strftime("%Y%m%d_%H%M%S")
|
||||
|
||||
|
||||
def round_datetime_to_second(dt: datetime) -> datetime:
|
||||
rounded = dt.replace(microsecond=0)
|
||||
if dt.microsecond >= 500_000:
|
||||
rounded += timedelta(seconds=1)
|
||||
return rounded
|
||||
|
||||
|
||||
def format_rounded_filename_stem(dt: datetime) -> str:
|
||||
rounded = round_datetime_to_second(dt)
|
||||
return format_filename_stem(rounded)
|
||||
|
||||
|
||||
def normalized_extension(path: Path) -> str:
|
||||
return path.suffix.lower()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user