5
0

yt_common: keyframe generator

This commit is contained in:
louis f 2021-06-05 17:31:29 -04:00
parent 010673efa4
commit 75a0d3b2aa
Signed by: louis
GPG Key ID: 44D7E1DE4E23D6F2

View File

@ -9,7 +9,7 @@ import string
import subprocess import subprocess
import tempfile import tempfile
from lvsfunc.render import clip_async_render from lvsfunc.render import clip_async_render, find_scene_changes
from typing import Any, BinaryIO, Callable, List, NamedTuple, Optional, Sequence, Set, Tuple, cast from typing import Any, BinaryIO, Callable, List, NamedTuple, Optional, Sequence, Set, Tuple, cast
@ -229,8 +229,17 @@ class SelfRunner():
Will search for the output file to include in comparison, if present.", Will search for the output file to include in comparison, if present.",
action="store_true") action="store_true")
parser.add_argument("-a", "--audio-only", help="Only process audio, no video.", action="store_true") parser.add_argument("-a", "--audio-only", help="Only process audio, no video.", action="store_true")
parser.add_argument("--keyframes", nargs="?", default=None,
help="Generate keyframes and exit", const="keyframes.txt")
args = parser.parse_args() args = parser.parse_args()
if args.keyframes:
kf = find_scene_changes(source.source())
with open(args.keyframes, "w", encoding="utf-8") as kfo:
for f in kf:
kfo.write(f"{f:d} I\n")
return
self.workraw = args.workraw if workraw_filter else False self.workraw = args.workraw if workraw_filter else False
self.profile = "workraw" if self.workraw else "final" self.profile = "workraw" if self.workraw else "final"
self.profile = args.profile or self.profile self.profile = args.profile or self.profile