On Feb 11, 2008 9:09 PM, Reinhard Nissl rnissl@gmx.de wrote:
In case the decoder doesn't provide the image aspect ratio (and it looks like that as you had to provide the image size too), you'll have to extract it from the H.264 data yourself (as you did already for the image size).
OK - thanks for your help and patience Reinhard.
We are on the right track here. If I hardcode the this->ratio to be 1.8181 all looks good for my channels. However it is a hack and I have come this far, so I might as well get the rest correct!
I used xinelibout for my H264 parser but Petri Hintukainen skips parsing of the VUI! I am looking in your h264parser.c in VDR and you also seem to comment this stuff out!
So, here is my code: -
if (br_get_bit(&br)) { /* VUI parameters */ if (br_get_bit(&br)) { /* Aspect Info */ uint32_t aspect_ratio_idc = br_get_u8(&br); printf("H.264 SPS: -> Aspect Ratio IDC %d\n", aspect_ratio_idc); const uint32_t Extended_SAR = 255; if (aspect_ratio_idc == Extended_SAR) { uint32_t sar_width = br_get_u16(&br); uint32_t sar_height = br_get_u16(&br); printf("H.264 SPS: -> SAR_Size = %dx%d\n", sar_width, sar_height); } } }
I am getting an Aspect Ratio IDC of 11 so the sar width and height calcs are not called. What do I need to do here to get the aspect (~1.818181)?
Thanks again!
Bye.
Dipl.-Inform. (FH) Reinhard Nissl mailto:rnissl@gmx.de
vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr