mirror of
https://github.com/master-of-zen/Av1an.git
synced 2024-11-25 02:29:40 +00:00
Explicitly terminate on aom keyframe split failure
This commit is contained in:
parent
f72ff74216
commit
5bdef02e48
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue