我正在将 OpenCV 用于一个项目,但我完全是初学者。
我的大容量存储库中有一个视频文件,并且想编写一个方法来访问由输入中给定采样间隔分隔的视频流的所有帧。
视频可以是多种格式(AVI – WMV – MPEG-2 – MPEG-4)。
我在想该方法应该像这样工作:
1. Have as input a desired sampling interval
2. Access the video at timestamp corresponding to the sampling interval
3. Save selected frame of video as an image
4. Go to next frame as determined from sampling frequency.
您能帮我提供一些代码,或者至少说明使用 OpenCV 方法实现这种方法的方法吗?