Use x265 for downloads
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 x265")
|
||||
|
||||
cmd = [
|
||||
"ffmpeg", "-v", "quiet", "-stats",
|
||||
@@ -34,14 +34,14 @@ def _encode_video(
|
||||
"-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]",
|
||||
"-c:v", "libsvtav1",
|
||||
"-c:v", "libx265",
|
||||
"-crf", preset['crf'],
|
||||
"-preset", "4",
|
||||
"-preset", "slow",
|
||||
"-pix_fmt", "yuv420p10le",
|
||||
"-vf", f"scale=min({preset['w']}\\,iw):-2,setsar=1:1",
|
||||
"-aspect", input_aspect,
|
||||
"-c:a", "libopus",
|
||||
"-b:a", "160k",
|
||||
"-b:a", "128k",
|
||||
"-c:s", "copy",
|
||||
output_video
|
||||
]
|
||||
@@ -62,13 +62,13 @@ def encode_downloads(
|
||||
input_aspect: str = "16:9"
|
||||
):
|
||||
presets = [
|
||||
{"w": "1920", "h": "1080", "crf": "24", "name": "[1080p-AV1]", "input_video": upscaled_video},
|
||||
{"w": "1920", "h": "1080", "crf": "24", "name": "[1080p-AV1][48fps]", "input_video": interpolated_video},
|
||||
{"w": "3840", "h": "2160", "crf": "26", "name": "[2160p-AV1]", "input_video": upscaled_video},
|
||||
{"w": "1920", "h": "1080", "crf": "22", "name": "[1080p-x265]", "input_video": upscaled_video},
|
||||
{"w": "1920", "h": "1080", "crf": "22", "name": "[1080p-x265][48fps]", "input_video": interpolated_video},
|
||||
{"w": "3840", "h": "2160", "crf": "24", "name": "[2160p-x265]", "input_video": upscaled_video},
|
||||
]
|
||||
|
||||
if interpolated_uhd_video is not None:
|
||||
presets.append({"w": "3840", "h": "2160", "crf": "26", "name": "[2160p-AV1][48fps]", "input_video": interpolated_uhd_video})
|
||||
presets.append({"w": "3840", "h": "2160", "crf": "24", "name": "[2160p-x265][48fps]", "input_video": interpolated_uhd_video})
|
||||
|
||||
for preset in presets:
|
||||
file_name = f"{hentai_title} {preset['name']}[hstream.moe].mkv"
|
||||
@@ -76,7 +76,7 @@ def encode_downloads(
|
||||
mux_out = os.path.join('2-Out', folder_name, 'Muxed', file_name)
|
||||
|
||||
if os.path.exists(mux_out):
|
||||
print(f'Skipped {preset['h']}p AV1 Encode')
|
||||
print(f'Skipped {preset['h']}p x265 Encode')
|
||||
continue
|
||||
|
||||
_encode_video(preset, source_video, tmp_out, hentai_title, input_aspect)
|
||||
|
||||
Reference in New Issue
Block a user