IVideoIndexer Interface
VideoIndexer interface. Use this interface to queue index requests and control video indexing.
Methods
Adding Videos
| Method |
Returns |
Description |
AddVideoFile(string path, string title, string url, string desc) |
void |
Add a video file to the index queue |
AddFolder(string folder, bool include_subfolders, bool skip_added) |
void |
Scan a folder and add videos to the queue |
StartIndexing() |
void |
Start processing the index queue |
Frame Capture
| Method |
Returns |
Description |
CaptureSingleFrame(long video_id, double position) |
void |
Capture a frame at the given position to the catalog |
CaptureSingleFrameToFile(long video_id, double position, string output_file) |
void |
Capture a frame to a JPEG file |
Transcription
| Method |
Returns |
Description |
SetTranscription(long video_id, string path) |
void |
Set transcription from an SRT file |
Callbacks
| Method |
Returns |
Description |
SetIndexingCallbacks(IVideoIndexerCallbacks callbacks) |
void |
Set callback interface for indexing events |
IVideoIndexerCallbacks Interface
Implement this interface to receive callbacks during indexing:
| Method |
Description |
StartingIndexing(VideoEntry video) |
Called before indexing. Return true to proceed, false to skip. |
ProcessFrame(int frame, double sample_time, ref Bitmap image) |
Called for each frame. Return true to store frame. |
VideoIndexedEnd(VideoEntry video) |
Called when a video finishes indexing |
EndingIndexing() |
Called when all videos in queue are done |
Example
IVideoIndexer indexer = scripting.GetVideoIndexer();
// Add a single video
indexer.AddVideoFile(@"C:\Videos\myvideo.mp4", "My Video", "", "Description");
// Add a folder of videos
indexer.AddFolder(@"C:\Videos", true, true); // Include subfolders, skip already added
// Start indexing
indexer.StartIndexing();
// Capture a frame from existing video
long videoId = 123;
indexer.CaptureSingleFrame(videoId, 30.0); // Capture at 30 seconds
// Export frame to file
indexer.CaptureSingleFrameToFile(videoId, 60.0, @"C:\frame.jpg");
// Add transcription
indexer.SetTranscription(videoId, @"C:\subtitles.srt");
See Also