Add Linux/Windows support
This commit is contained in:
@@ -21,7 +21,7 @@ def _encode_video(
|
||||
hentai_title: str,
|
||||
input_aspect: str = "16:9"
|
||||
):
|
||||
print(f'Encoding {preset['h']}p AV1')
|
||||
print(f"Encoding {preset['h']}p AV1")
|
||||
|
||||
cmd = [
|
||||
"ffmpeg",
|
||||
@@ -33,12 +33,12 @@ def _encode_video(
|
||||
"-map", "1:t?", # Attachments from source video (optional)
|
||||
"-map", "1:d?", # Other Data from source video (optional)
|
||||
"-disposition:v:0", "default", # Mark video as default in mkv container
|
||||
"-metadata", f'Title=\"{hentai_title} [hstream.moe]\"',
|
||||
"-metadata", f"Title={hentai_title} [hstream.moe]",
|
||||
"-c:v", "libsvtav1",
|
||||
"-crf", preset['crf'],
|
||||
"-preset", "4",
|
||||
"-pix_fmt", "yuv420p10le", # 10bit
|
||||
"-vf", f"scale=\'min({preset['w']},iw)\':-2,setsar=1:1",
|
||||
"-pix_fmt", "yuv420p10le",
|
||||
"-vf", f"scale=min({preset['w']}\\,iw):-2,setsar=1:1",
|
||||
"-aspect", input_aspect,
|
||||
"-c:a", "libopus",
|
||||
"-b:a", "160k",
|
||||
@@ -46,10 +46,8 @@ def _encode_video(
|
||||
output_video
|
||||
]
|
||||
|
||||
print(cmd)
|
||||
|
||||
try:
|
||||
subprocess.run(cmd, shell=True, check=True)
|
||||
subprocess.run(cmd, check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"\nffmpeg failed with error code {e.returncode}", file=sys.stderr)
|
||||
sys.exit(e.returncode)
|
||||
|
||||
Reference in New Issue
Block a user