videovideo-codecsvfw

How to add other codecs to the dialog window?


When I call dlg window with video formats list from VFW (WM_CAP_GET_VIDEOFORMAT), then I have 2 positions only, one of those - MJPG (Motion JPG), when selected, as a result, makes video capture as black screen, what means - it doesn't work, but selectable. YUY2 works ok, and I know how to manage it.

DLG_GET_VIDEOFORMAT

From other side, if I see the list of all installed codecs, it has much more than just MJPG and YUY2

  1. ICM Microsoft RLE MRLE msrle32.dll 6.1.7601.17514
  2. ICM Microsoft Video 1 MSVC msvidc32.dll 6.1.7601.17514
  3. ICM Microsoft YUV UYVY msyuv.dll 6.1.7601.17514
  4. ICM Кодек Intel IYUV IYUV iyuv_32.dll 6.1.7601.17514 ICM Toshiba
  5. ICM YUV Codec Y411 tsbyuv.dll 6.1.7601.17514
  6. ICM Кодек Cinepak, made by Radius cvid iccvid.dll 1.10.0.13

ICM (Image Color Management) and there is RLE - bitmap compression of 8 bits. And others. But the dialog shows only 2 (and MJPG is not workable).

How does it work? How to add other codecs to the dialog window, and how to make it activated from VFW? I tried SET_VIDEOFORMAT vainly.. only one - YUY2 is accepted and could be set.

Pls, tell me more about camera - driver - vfw COM Graph builder principles. How can I add, say, ICM Microsoft RLE codec?


Solution

  • The window shows encodings in which the camera itself can be set to deliver video. This does not include software codecs available that can process/convert the video feed. MJPG might not work (blackness) because of faulty driver, or because the picture is lost in further processing steps (decoder is unable to decode it for whatever reason).

    The other codecs you discovered work separately from the camera source, you can use them in code to do the conversion or encoding. You might need to deal with pixel format/encoding fitting: the camera gives YUY2 and not every encoder would accept it directly, it might need something else, e.g. RGB.