Merge pull request #23172 from lilohuang:master

Adding HEVC/H265 FourCC support to MSMF video writer

* Adding HEVC/H265 fourcc to MSMF video writer

Adding HEVC/H265 fourcc to MSMF video writer. I have verified it with my own video input stream, and it works well on my workstation.

* Update video io testing

* Adding macro fence to get rid of compiler error

H265/HEVC encoder is only available in Windows or later. https://learn.microsoft.com/en-us/windows/win32/medfound/h-265---hevc-video-encoder

* Update test_video_io.cpp
pull/23168/head
Lilo Huang 2 years ago committed by GitHub
parent 8ffc06ff72
commit cb7fe597a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      modules/videoio/src/cap_msmf.cpp
  2. 2
      modules/videoio/test/test_video_io.cpp

@ -2469,6 +2469,12 @@ const GUID CvVideoWriter_MSMF::FourCC2GUID(int fourcc)
#endif
case CV_FOURCC_MACRO('H', '2', '6', '4'):
return MFVideoFormat_H264; break;
#if defined(NTDDI_WIN10)
case CV_FOURCC_MACRO('H', '2', '6', '5'):
return MFVideoFormat_H265; break;
case CV_FOURCC_MACRO('H', 'E', 'V', 'C'):
return MFVideoFormat_HEVC; break;
#endif
case CV_FOURCC_MACRO('M', '4', 'S', '2'):
return MFVideoFormat_M4S2; break;
case CV_FOURCC_MACRO('M', 'J', 'P', 'G'):

@ -388,6 +388,7 @@ static Ext_Fourcc_PSNR synthetic_params[] = {
{"wmv", "WMV3", 30.f, CAP_MSMF},
{"wmv", "WVC1", 30.f, CAP_MSMF},
{"mov", "H264", 30.f, CAP_MSMF},
// {"mov", "HEVC", 30.f, CAP_MSMF}, // excluded due to CI issue: https://github.com/opencv/opencv/pull/23172
#endif
#ifdef HAVE_AVFOUNDATION
@ -991,6 +992,7 @@ static Ext_Fourcc_PSNR hw_codecs[] = {
#ifdef _WIN32
{"mp4", "MPEG", 29.f, CAP_MSMF},
{"mp4", "H264", 29.f, CAP_MSMF},
{"mp4", "HEVC", 29.f, CAP_MSMF},
#endif
};

Loading…
Cancel
Save