So that each I frame is every 25 frames and all I frames are IDR frames (2 = every 1 I frame is an IDR. I am not sure what the value 1 does for the key_frame_controls.idr_interval...? But setting it to that seems to make no difference).
Any of the other I frames are of much larger size and look much less blocky.
Any ideas? It means that when you first see the stream the quality looks much worse than it is.
Thanks for your help, but what I'm saying is that I have it set so that every 25th frame is an I frame and I have it set so that every I frame is an IDR.
However, my first frame is very blocky. The next I frame - 25 frames on - quality is fine and so are the rest of the I frames.
This happens even if I increase the bitrate.
This is for a product producing H.264 versions of HD film camera footage and needs to be at full rate (1920x1080) and must be H.264 not MPEG.4. If I don't get any further answers I'll check at lower res and with MPEG4 maybe but I'm hoping someone will know the answer to this with out me having to do that...?
The quantization value for the first frame is calculated in the H264_AVBR_GetInitQP functions in umc_h264_avbr.cpp. Not knowing anything about the actual sequence to be encoded the quantization parameter choosenis rather conservative to avoid generating huge frames.
Future IDR generated will benefit from statistics of the stream. Also the rate control algorithm ensure that there is not too much difference in term of quality between the successive frame by caping the difference of quantization value between two frames.
You might be able to tweak the return value of H264_AVBR_GetInitQP function to get the quality you want for the first frame (the lower the q the higher the quality).