MCPcopy Index your code
hub / github.com/Breakthrough/PySceneDetect / test_api_detect_start_end_time

Function test_api_detect_start_end_time

tests/test_api.py:26–34  ·  view source on GitHub ↗

Demonstrate usage of the `detect()` function to process a subset of a video.

(test_video_file: str)

Source from the content-addressed store, hash-verified

24
25
26def test_api_detect_start_end_time(test_video_file: str):
27 """Demonstrate usage of the `detect()` function to process a subset of a video."""
28 from scenedetect import ContentDetector, detect
29
30 # Times can be seconds (float), frames (int), or timecode 'HH:MM:SSS.nnn' (str).
31 # See test_api_timecode_types() for examples of each format.
32 scene_list = detect(test_video_file, ContentDetector(), start_time=10.5, end_time=15.9)
33 for i, scene in enumerate(scene_list):
34 print(f"Scene {i + 1}: {scene[0].get_timecode()} - {scene[1].get_timecode()}")
35
36
37def test_api_detect_stats(test_video_file: str):

Callers

nothing calls this directly

Calls 3

detectFunction · 0.90
ContentDetectorClass · 0.90
get_timecodeMethod · 0.80

Tested by

no test coverage detected