我想獲取我的網絡攝像頭支持的所有FPS值的列表。獲取Microsoft Media Foundation中相機的所有支持的FPS值
在How to Set the Video Capture Frame Rate msdn文章它說,我可以查詢系統的最大和最小支持特定相機的FPS。
它還說:
設備可能在此範圍內支持其他的幀速率。
而且在MF_MT_FRAME_RATE_RANGE_MIN它說:
該設備不保證支持此範圍內每遞增。
所以,它聽起來就像是沒有辦法通過相機在媒體基金會,只是最大值和最小值,以獲得支持的FPS值所有。
我知道,在Linux v4l2-ctl --list-formats-ext
命令打印更多的支持FPS不只是最小和最大。使用不同的相機從Linux的只是幾個例子
這裏是:
$ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUV 4:2:2 (YUYV)
Size: Discrete 160x120
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.036s (27.500 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.044s (22.500 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.057s (17.500 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.080s (12.500 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.133s (7.500 fps)
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 176x144
Interval: Discrete 0.033s (30.000 fps)
...
和
$ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUV 4:2:2 (YUYV)
Size: Discrete 640x360
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 320x240
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 160x120
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 960x544
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
和
$ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUV 4:2:2 (YUYV)
Size: Discrete 1280x720
Interval: Discrete 0.111s (9.000 fps)
Size: Discrete 160x120
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 320x240
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x800
Interval: Discrete 0.111s (9.000 fps)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Index : 1
Type : Video Capture
Pixel Format: 'MJPG' (compressed)
Name : MJPEG
Size: Discrete 1280x720
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 160x120
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 320x240
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x800
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
那麼,有沒有辦法讓所有的微軟媒體基金會的相機支持FPS,還是在這方面受到限制?
請仔細閱讀該問題,並在回答之前嘗試理解其中的含義。 –
如果你在幾臺攝像機上試過上面的代碼,你不會發表評論。我會編輯答案過於明確。 – Jeff
如果您閱讀我的問題,您會看到我想爲相機獲取** ALL **有效的FPS值,而不僅僅是MF_MT_FRAME_RATE,MF_MT_FRAME_RATE_RANGE_MIN和MF_MT_FRAME_RATE_RANGE_MAX。你的答案對我來說毫無用處,因爲它只有'MF_MT_FRAME_RATE','MF_MT_FRAME_RATE_RANGE_MIN'和'MF_MT_FRAME_RATE_RANGE_MAX',我已經知道如何獲得。 –