Nice handbrake process

This commit is contained in:
Julian Mutter 2022-08-27 20:04:05 +02:00
parent aa51ecd279
commit 14607bd91d

View File

@ -12,6 +12,7 @@ RAW_DIR = "raw"
TRANSCODED_DIR = "transcoded"
LOGFILE = "transcode.log"
NICE_HANDBRAKE_PROCESS = "True"
HANDBRAKE_PRESET = "General/HQ 1080p30 Surround"
HANDBRAKE_AUDIO_LANG_LIST = "de,en"
OUT_VIDEO_FORMAT = ".m4v"
@ -26,7 +27,6 @@ def main():
for dvd_type in ("movie", "series"):
for dvd in filter(is_dvd_files_not_locked, list_ripped_dvds(dvd_type)):
print(f"Transcoding {dvd}")
# TOOD: nice transcoding process so it does not block server
output_files = transcode_ripped_dvd(dvd)
if output_files:
mv_videos_from_tmp_to_transcoded_dir(output_files, dvd.dvd_type)
@ -88,7 +88,7 @@ class Dvd:
return (series, episodes)
def transcode_command_args_without_title_number(self, output_file):
return [
args = [
"HandBrakeCLI",
"--preset",
HANDBRAKE_PRESET,
@ -100,6 +100,10 @@ class Dvd:
"--output",
output_file,
]
if NICE_HANDBRAKE_PROCESS:
args = ["nice"] + args
return args
def chdir_to_script_dir():