[FFmpeg-devel] [PATCH 2/2] avcodec/utils: Pretty print analog overscan style display aspect ratios

Michael Niedermayer michaelni at gmx.at
Sun Jan 18 15:54:07 CET 2015


On Sun, Jan 18, 2015 at 02:18:19PM +0000, Kieran Kunhya wrote:
> > iam not trying to look for anything, iam just trying to fix bugs
> > and as is ffmpeg displays the wrong DAR in the printout for the
> > overscan case (i belive this is a big part of the misuderstandings),
> > you would get bt601 with some crazy nonsense DAR
> > values instead of 16:9 and 4:3, this patch is intended to fix it
> 
> Wrong.

Please calm down

ATM its this way:
Stream #0:0[0xd4]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, smpte170m), 720x480 [SAR 10:11 DAR 15:11], 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc

after the patch its this way:
Stream #0:0[0xd4]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, smpte170m), 720x480 [SAR 10:11 DAR(overscan) 4:3], 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc

Thats what the H264 spec says in its table as well

If theres a problem with the patch please elaborate


> 
> > internally ffmpeg only uses SAR which should already be correct for
> > all cases
> 
> For BT601 you can only work on the basis that there is no direct
> relationship between SAR and DAR owing to approximations and the fact
> that the DAR applies to the active image.

yes, thats 100% true

but the specs require the mathematical relation, this is "normative"
not something you can ignore or you simply violate the specs

ISO/IEC 13818-2: 1995 (E)
6.3.3 Sequence header
...
* If sequence_display_extension() is not present then it is intended that the entire reconstructed
  frame is intended to be mapped to the entire active region of the display. The sample aspect ratio
  may be calculated as follows:

            horizontal _ size
SAR = DAR * ------------------
             vertical_ size


* If sequence_display_extension() is present then the sample aspect ratio may be calculated as
  follows:
                                      display_ horizontal _ size
                       SAR = DAR * ------------------------------
                                       display _ vertical _ size

...
    display_horizontal_size -- See display_vertical_size.
    display_vertical_size -- display_horizontal_size and display_vertical_size together define a rectangle
    which may be considered as the "intended display" active region. If this rectangle is smaller than the
    encoded frame size then the display process may be expected to display only a portion of the encoded
    frame. Conversely if the display rectangle is larger than the encoded frame size then the display process
    may be expected to display the reconstructed frames on a portion of the display device rather than on the
    whole display device.

i hope very much that we implement this correctly, if not i need
samples that are handled wrongly and ill try my best to fix them

the active area is stored in mpeg1/2 and should be used, its in the
pan scan variables IIRC, that way there is a very close to correct
mathematical relation between SAR, DAR and the active area in the
BT601 case
There should be no problem here with complying to BT601 and the
video coding specs

I hope i dont miss anything but its surely possible that i do and
i intend to fix (or help fix if its unexpectedly non trivial) any
issues that are in there if people report them


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150118/4d19f598/attachment.asc>


More information about the ffmpeg-devel mailing list