good progress
This commit is contained in:
@@ -117,6 +117,18 @@ def extract_scene_frames(input_path, output_dir, scene_threshold=0.10,
|
||||
return stdout.decode("utf-8", errors="replace"), stderr.decode("utf-8", errors="replace")
|
||||
|
||||
|
||||
def extract_frame_at(input_path, output_path, timestamp):
|
||||
"""Extract a single frame at the given timestamp."""
|
||||
output = (
|
||||
ffmpeg.input(str(input_path), ss=timestamp)
|
||||
.output(str(output_path), vframes=1, **{"q:v": "2"})
|
||||
.overwrite_output()
|
||||
.global_args(*QUIET_ARGS)
|
||||
)
|
||||
log.info("extract_frame_at: %s", " ".join(output.compile()))
|
||||
output.run(capture_stdout=True, capture_stderr=True)
|
||||
|
||||
|
||||
def run_async(output_node, pipe_stdout=False, pipe_stderr=False):
|
||||
"""Start an ffmpeg pipeline asynchronously via ffmpeg-python's run_async."""
|
||||
log.info("run_async: %s", " ".join(output_node.compile()))
|
||||
|
||||
Reference in New Issue
Block a user