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

Function test_api_stats_manager

tests/test_api.py:107–118  ·  view source on GitHub ↗

Demonstrate using a StatsManager to save per-frame statistics to disk.

(test_video_file: str)

Source from the content-addressed store, hash-verified

105
106
107def test_api_stats_manager(test_video_file: str):
108 """Demonstrate using a StatsManager to save per-frame statistics to disk."""
109 from scenedetect import ContentDetector, SceneManager, StatsManager, open_video
110
111 video = open_video(test_video_file)
112 scene_manager = SceneManager(stats_manager=StatsManager())
113 scene_manager.add_detector(ContentDetector())
114 scene_manager.detect_scenes(video=video)
115 # Save per-frame statistics to disk.
116 filename = f"{test_video_file}.stats.csv"
117 assert scene_manager.stats_manager is not None
118 scene_manager.stats_manager.save_to_csv(csv_file=filename)
119
120
121def test_api_scene_manager_callback(test_video_file: str):

Callers

nothing calls this directly

Calls 7

add_detectorMethod · 0.95
detect_scenesMethod · 0.95
open_videoFunction · 0.90
SceneManagerClass · 0.90
StatsManagerClass · 0.90
ContentDetectorClass · 0.90
save_to_csvMethod · 0.80

Tested by

no test coverage detected