I am trying to process some FHD video on Win10 in Python. I enabled the integrated GPU in BIOS, installed latest driver through Intel driver support, installed Intel Media SDK successfully and rebooted. Then I downloaded OpenCV 4.5 with all hardware codecs from here and added to a dummy project (made sure no other OpenCV exists). When I tried to use it for decoding/encoding, I had the following errors.
In decoding, I got error like
decoder = cv.VideoCapture('myfile.hevc', cv.CAP_INTEL_MFX)
# MFX: LoadPlugin failed for codec: 1129727304
but using cv.CAP_FFMPEG worked ok.
In encoding, I got error like
writer = cv.VideoWriter('output.hevc', apiPreference = cv.CAP_INTEL_MFX, fourcc = cv.VideoWriter_fourcc('h','v','c','1'), fps = 20.0, frameSize = (640,480))
# MFX: Unsupported FourCC: hvc1 (0x31637668)
# 'hevc' or 'h265' give same error code
# write to 'output.mp4' with 'mp4v' yield a different error code 0x7634706d
While writing with ffmpeg works
writer = cv.VideoWriter('C:/testData/output.mp4', apiPreference = cv.CAP_FFMPEG , fourcc = cv.VideoWriter_fourcc('m','p','4','v'), fps = 20.0, frameSize = (640,480))
# success
Much appreciated.
[Edit 01]
is the screenshot of running mediasdk_system_analayzer_64.exe.
[Edit 02]
Even though HW decoder does not show up in the analyzer, it works after I disable all monitors but 1 as suggested here.
.\sample_multi_transcode.exe -i::h265 myfile.hevc -o::h265 output.hevc -hw
# session 0 [0000023D33FCA130] PASSED (MFX_ERR_NONE) 8.34417 sec, 226 frames, 27.085 fps
VideoCapture with cv.CAP_INTEL_MFX works now. Yet VideoWriter gives the same error.