First of all, my problem is very similar to the following post:
https://software.intel.com/en-us/forums/intel-media-sdk/topic/560923
I'm trying to use the latest version of ffmpeg to encode video using the H264 Quick Sync encoder. Although I am able to successfully encode my video some of the time, the ffmpeg hangs or fails during the avcodec_encode_video2 call. When the function fails, it returns MFX_ERR_DEVICE_FAILED.
I have a Windows 10 64-bit computer with Version 3 (Haswell) of Quick Sync hardware. This machine hangs whenever the Quick Sync encoding fails.
I have a Windows 7 64-bit computer with Version 5 (Skylake) of Quick Sync hardware. This machine returns MFX_ERR_DEVICE FAILED whenever the Quick Sync encoding fails. The command line reads "EncodeFrameASync" returned -17".
I have compiled ffmpeg myself from here: https://ffmpeg.org/releases/ffmpeg-3.1.tar.gz
and I have tested using pre-built ffmpeg files for Windows found here:
https://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-20160711-5939878-win32-shared.zip
The results were the same for 32-bit or 64-bit regardless of whether I built ffmpeg, or I used one of the prebuilt versions of ffmpeg.
I have a test application which encodes 1000 frames of size 256x256 to an AVI file using the Quick Sync encoder. I posted my test application code online that I used to demonstrate the errors that I have been getting which can be found here:
Running my test on the Version 3 (Haswell) computer worked successfully on 8 of the 40 tests run. When it failed, the hang would usually occur in the first 100 frames encoded.
Running my test on the Version 5 (Skylake) computer worked successfully on 31 of the 40 tests run.
I ran the Intel Media SDK system analysis on each system. The Version 3 (Haswell) computer had software and hardware supported for Version 1.0 to Version 1.16. The Version 5 (Skylake) computer had software and hardware supported for all versions (1.0 to 1.19).
Is there anything I can do to prevent the QuickSync encoding from failing? Any assistance would be greatly appreciated.