Video Playback via Microsoft Media Foundation (msmf)

asked 2017-02-06 18:25:32 -0500

JayHuangYC gravatar image

updated 2017-02-06 18:36:20 -0500


Have anyone successfully playbacked video using Media Foundation (CV_CAP_MSMF) of VideoCapture on Windows 10? My goal is to use only media foundation and remove ffmpeg dependency for video decoding.


    VideoCapture cap(fileName, CV_CAP_MSMF);

By rebuilding from source of OpenCV 3.0, 3.1, 3.2 (-with_msmf), I always get cap.isOpened() to return false.

When digging into the cap_msmf.cpp source, in line 3864, my multiple video(s) can not match this particular MFVideoFormat_RGB24. It makes me wonder if there is a limitation of OpenCV's media foundation implementation.

    MediaType MT = FormatReader::Read(pType.Get());
    // We can capture only RGB video.
    if( MT.MF_MT_SUBTYPE == MFVideoFormat_RGB24 )

I had spent couple days on investigating this issue, and hope to get some confirmation and experience shared from this forum. Thanks a lot!


edit retag flag offensive close merge delete