Merge pull request #105 from n9Mtq4/fix/firstpasserrorreporting

Explicitly terminate on aom keyframe split failure
This commit is contained in:
Zen 2020-07-06 20:37:19 +03:00 committed by GitHub
commit c6043f14dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,7 @@ from tqdm import tqdm
from .compose import compose_aomsplit_first_pass_command from .compose import compose_aomsplit_first_pass_command
from .logger import log from .logger import log
from .utils import frame_probe from .utils import frame_probe, terminate
# This is a script that returns a list of keyframes that aom would likely place. Port of aom's C code. # This is a script that returns a list of keyframes that aom would likely place. Port of aom's C code.
# It requires an aom first-pass stats file as input. FFMPEG first-pass file is not OK. Default filename is stats.bin. # It requires an aom first-pass stats file as input. FFMPEG first-pass file is not OK. Default filename is stats.bin.
@ -185,6 +185,11 @@ def aom_keyframes(video_path: Path, stat_file, min_scene_len, ffmpeg_pipe, video
er = f"\nAom first pass encountered an error: {pipe.returncode}\n{enc_hist}" er = f"\nAom first pass encountered an error: {pipe.returncode}\n{enc_hist}"
log(er) log(er)
print(er) print(er)
if not stat_file.exists():
terminate()
else:
# aom crashed, but created keyframes.log, so we will try to continue
print("WARNING: Aom first pass crashed, but created a first pass file. Keyframe splitting may not be accurate.")
# aom kf-min-dist defaults to 0, but hardcoded to 3 in pass2_strategy.c test_candidate_kf. 0 matches default aom behavior # aom kf-min-dist defaults to 0, but hardcoded to 3 in pass2_strategy.c test_candidate_kf. 0 matches default aom behavior
# https://aomedia.googlesource.com/aom/+/8ac928be918de0d502b7b492708d57ad4d817676/av1/av1_cx_iface.c#2816 # https://aomedia.googlesource.com/aom/+/8ac928be918de0d502b7b492708d57ad4d817676/av1/av1_cx_iface.c#2816