Hi,
I'm trying to encode video with H.265 encoder MFT on Win10 Pro Insider Preview.
- Originally I create/init an H.265 encoder in my own program and call ProcessInput/ProcessOuput and it crashed inside ProcessOuput (It didn't crash on first frame, instead it crashed after several frames have been processed).
- To simplify the question, I used IMFSinkWriter to create a sink, so frame encoding/writing thus is totally handled by sinkwriter. But unfortunately crash still happened inside mfh265enc.dll.
Please note that in above 2 cases, the change I made was on a program which can successfully encode H.264 video. I only changed the output media type for Encoder/SinkWriter (changed subtype from H.264 to H.265). The way video frames got constructed, supplied to encoder/sinkwriter keep same. When encoding with H.264 everything was good, but once changed to H.265 it crashed.
- Then I turned to the sample program comes with Win7 SDK: MFCaptureToFile which could capture video into a MP4 file.
I'm sure the video format from camera is acceptable to H.265 encoder. The only change I've done is to the outputmedia type which is passed to SinkWrite.AddStream.
I've changed the subtype to MFVideoFormat_HEVC, and set MF_MT_MPEG2_PROFILE to 1 (eAVEncH265VProfile_Main_420_8).
But with the 2 changes above, the program still crashes. Showing "Unhandled exception at 0x5A025085 (mfh265enc.dll) in MFCaptureToFile.exe: 0xC0000005: Access violation reading location 0xFFFFFFFF"
======================================
Here's the change I've made to the MFCaptureToFile program.
https://www.dropbox.com/s/oytqen13m7bcs23/DIFF.PNG?dl=0