Demonstrate using a StatsManager to save per-frame statistics to disk.
(test_video_file: str)
| 105 | |
| 106 | |
| 107 | def 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 | |
| 121 | def test_api_scene_manager_callback(test_video_file: str): |
nothing calls this directly
no test coverage detected