Search code examples
copencvvideo-capture

How to get number of channels for a video file in opencv?


How can I get the number of channels used by my video before initiating a capture? I thought I could use cvGetCaptureProperty but there is no property_id I could set to get the number of channels.


Solution

  • Yes, you're right - there are no property_id for number of channels. You can get number of channels only from single frame of capture.