The atachments is my transcoding graph and error messege.
Base on the graphI tried the resolution 640x480, it can render. But not with 720p.
The error is from intel H264 encoder: the m_bStop is TRUE, and return MFX_ERR_ABORTED.
(in base_encoder.cpp, CBaseEncoder::RunEncode)
Please help me to fix this problem.
Thanks for your reply!!
This may or may not help but I debugged an issue where m_bStop was getting set unexpectedly and it turned out the entire graph
was being shut down by the downstream components. In my case, the Renderer didnt like the timestamps I was experimenting with.
The graph manager was calling StopStreaming which set m_bStop.
I notice the downstream component in your graph is not the MSDK decoder, are you sure it can handle 720p? Try to swap that decoder with the MSDK filter and let us know if the problem still occurs.
In "Base_encoder.cpp - CBaseEncoder::DeliverNextFrame",
line: sts = pEncoder->m_mfxVideoSession.SyncOperation(*it->psyncP, 0),
It returns -1(MFX_ERR_UNKNOWN), so "pEncoder->m_bStop = true".
I think the error happens when encoder reads input frame surface data. It happens because surface buffer provided by CSC is smaller than encoder expects based on frame sizes.
To explain on your particular 720p example: MSDK encoder is initialized with frameInfo.W=1280 and H=736 and so is the input surface (H is aligned at 32 to cover Media SDK encoder requirement for interlaced input video). MSDK Encoder filter provides the requirement for MediaSample buffer through CEncoderInputPin->GetAllocatorRequirements method to be 1280*736*3/2 bytes. But I guess CSC filter allocates buffer of 1280*720*3/2 bytes. So when input mfxFrameSurface planes pointers are pointed at this buffer encoder crosses the boundary when reading the data.
Please try to modify your CSC filter to account for downstream filter buffer requirement (Intel Decoder sample filter does so please see DecideBufferSize method).
I hope this is the right reason, please let me know if suggested fix works.