refactor: rm x265 for Bernard

This commit is contained in:
Rémi Heredero 2025-04-27 23:34:32 +02:00
parent c9fd7c319a
commit 3c4cc4b331
Signed by: Klagarge
GPG Key ID: 735B36B074A65F0F

9
encode_video.py Executable file → Normal file
View File

@ -22,11 +22,6 @@ def encode(input_file, codec, remove_source=False, save_log=False):
extra_params = [ extra_params = [
] ]
elif codec == "x265-amd":
ffmpeg_codec = "hevc_amf"
folder = "h265"
extra_params = ["-quality", "quality"]
elif codec == "av1": elif codec == "av1":
ffmpeg_codec = "av1_nvenc" ffmpeg_codec = "av1_nvenc"
cq = 32 cq = 32
@ -63,6 +58,8 @@ def encode(input_file, codec, remove_source=False, save_log=False):
"-cq", str(cq), "-cq", str(cq),
] + extra_params + [ ] + extra_params + [
"-c:v", ffmpeg_codec, "-c:v", ffmpeg_codec,
"-preset", "p4",
"-cq", str(cq),
"-rc", "vbr", "-rc", "vbr",
"-b:v", "0", "-b:v", "0",
"-c:a", "copy", "-c:a", "copy",
@ -130,7 +127,7 @@ def main():
parser = argparse.ArgumentParser(description="Encode video(s) to x265 or AV1.") parser = argparse.ArgumentParser(description="Encode video(s) to x265 or AV1.")
parser.add_argument("input", nargs="?", help="Path to input file") parser.add_argument("input", nargs="?", help="Path to input file")
parser.add_argument("-d", "--directory", help="Path to a directory for batch encoding") parser.add_argument("-d", "--directory", help="Path to a directory for batch encoding")
parser.add_argument("--codec", choices=["x265", "x265-amd", "av1"], default="x265", help="Codec to use") parser.add_argument("--codec", choices=["x265", "av1"], default="x265", help="Codec to use")
parser.add_argument("--remove-source", action="store_true", help="Remove the source file after successful encoding") parser.add_argument("--remove-source", action="store_true", help="Remove the source file after successful encoding")
parser.add_argument("--save-log", action="store_true", help="Save ffmpeg logs to a .log file") parser.add_argument("--save-log", action="store_true", help="Save ffmpeg logs to a .log file")
args = parser.parse_args() args = parser.parse_args()