1 of 1 people found this helpful
Hi, 1. Easiest way to do it is to use the H264 Parser present in the MediaSDK 1.1 in addition to decode component. 2. If you are using an external parser, then present NAL units to the decoder BUT remember to put the length of the NAL unit at the head of NAL buffer in 4 bytes 3. If this doesn’t help, then set SPS/PPS as extra-data parameters in the first frame Regarding latency You have problem providing the correct SPS/PPS. There are many streaming protocols but all standard ones deliver SPS/PPS via initial negotiation outside of elementary H264 stream. For example, RTP protocol usually is preceded by SDP negotiation protocol. SDP includes SPS/PPS in form of extradata – similar to FFMEG, AMF, etc. If this is not possible and you have to wait till SPS/PPS comes in the stream you should delay decoding and drop all frames coming before SPS/PPS. They normally come in IDR frame. All delays that you see can be attributed to your synchronization. You should take in account dropped frames and adjust time stamps before you passing them to the presenter. Hope this helps. Please feel free to get in touch with us for any further query. Thank You
I tried your suggstion #1, and take AvcParser as the 'H264 parser' as you mentioned. It finally works, after tweaking the code a little. That is inisde the constructor of AvcParser, changing
while( this->m_Extradata.GetSize() == 0 )
The purpose is to block the decoder's initialization untile the SPS and PPS is got. The video is presented perfectly after such an initialization is completed. But in constrast to original video, the picture brightness is somewhat darker. Is it adjustable?
Ofcause, putting an endless loop in constructor is not a good sulution, I will seek the better one afterwards.
Anyway, thanks a lot for your helpful guidance!
BTW, are you Israelite?
Relaying the reply from Amit:
"I'm not sure if the picture brightness can be controlled.
Nonetheless, I'm glad your issue got resolved.
Please do get in touch with us for any further help.
Nope, I'm an Indian!
Thank you all, Amit and Prasad!
I am glad to have you two, professional support engineers in touch.
I would go on with further technical discussions with you if any more issues.