VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Member
    Join Date
    Sep 2016
    Location
    Barcelona, Spain
    Search Comp PM
    Hi there,

    I've been aware of the Pixel Aspect Ratio issue for quite a time. When facing the common VHS/DVD source with black borders, you have to be careful with cropping and resizing if you don't want to mess it up.

    I can think of three ways of getting the proper aspect ratio out of a cropped / yet-to-crop video. Let's imagine I'm processing the video in AviSynth and I want the final encode to have the proper aspect ratio.
    1. Crop the video and encode it as is. Then, use the MKV container's ability to force a certain display aspect ratio during playback. I guess display aspect ratio would be .

    2. Crop the video and then resize with AvsPmod's Resize Calculator.

    3. Resize the video and then crop. For example, if the source is NTSC with 4:3 video, resize from 720x480 to 720x540, then crop the borders.

    Each of these have advantages and disadvantages. I would say 1 & 2 are correct but I'm not sure if 3 preserves the aspect ratio in the right way.

    For example, 1 seems the most neat to me since you avoid storing more pixels than there originally were. On the other hand, it might give compatibility issues, since many editing programs in the hands of unaware users will ignore the flag and assume square pixels. 2 overcomes this disadvantage but you might have problems finding a not-too-big resolution with minimal aspect ratio error. Finally, I have found no proof that 3 is correct; if it was, it would only have the advantages of 2.

    Thus, right now I can't choose one of them because I'm not sure of it.

    I think this is a difficult subject to Google for, so I decided to ask here. What's your favorite/proved way of keeping the right display aspect ratio?
    Quote Quote  
  2. You're opening a huge can of worms here. In theory, all three give the same result (I assuming avspmod's calculator works correctly). There are lots of little details involved but they make only a very small difference in the final display aspect ratio (on the order of 1 percent, which isn't really visible).

    1) I would use PAR (SAR, Sampling Aspect Ratio, in more modern terms) rather than DAR flags. For a 4:3 PAL ITU capture that's usually considered to be 12:11. This PAR assumes the 4:3 image is in a 704x576 portion of the frame. Some programs use slightly more accurate 128:117. That assumes the 4:3 dar is in a 702x576 portion of the frame. But in reality, the 4:3 image is in a non-integer portion of the frame, 702.915254x576, so both of those are approximations (you can't have partial pixels and many chroma subsampling schemes require mod2 or mod4 for the width, so 703 is out). The good thing about using PAR is that it doesn't change regardless of how much you crop. So you can always specify the same PAR and don't have to calculate anything. The down side is that some players don't pay any attention to DAR/PAR flags. Your video will play with the wrong aspect ratio on such devices.

    2 and 3 are essentially the same thing. When scaling manually 3 is a little easier as it doesn't require any calculations.

    Then to complicate matters, the DVD spec refers to the MPEG 2 spec regarding aspect ratios. The MPEG 2 spec clearly states the full frame represents the DAR (only the frame size and DAR are specified in MPEG 2). This discrepancy is usually ignored when DVDs are made. ITU caps are made from studio video tapes, then the 720x576 frame is written to DVD flagged as 4:3 DAR.
    Quote Quote  
  3. Member
    Join Date
    Sep 2016
    Location
    Barcelona, Spain
    Search Comp PM
    Originally Posted by jagabo View Post
    1) I would use PAR (SAR, Sampling Aspect Ratio, in more modern terms) rather than DAR flags.
    It doesn't look like MKVToolNix provides such an option but it would be useful.

    Originally Posted by jagabo View Post
    But in reality, the 4:3 image is in a non-integer portion of the frame, 702.915254x576
    Now I'm curious about this. What specifies it?
    Quote Quote  
  4. You have to specify the PAR (SAR in x264 and x265) when you encode the video.

    Regrading the 702.9... pixel wide picture, keep in mind that there are no pixels in an analog signal, just horizontal and vertical scan frequencies. The value comes from the horizontal scan rate of the analog signal and the digital sampling rate specified by ITU-601, aka BT-601. Here's where I got the 702.9... value (702+54/59):

    http://www.mir.com/DMG/aspect.html#definitions

    But if you take the PAL active picture line length of 52 microseconds and 13.5 MHz sampling (74.074074... ns/sample) you get exactly 702. Other web sites list slightly different values. For example:

    https://forum.doom9.org/showpost.php?p=1058927&postcount=11
    Last edited by jagabo; 1st Sep 2017 at 21:08.
    Quote Quote  
  5. Member
    Join Date
    Sep 2016
    Location
    Barcelona, Spain
    Search Comp PM
    Some calculations with Pixel Aspect Ratio seem to indicate that a correct resolution to 'force' the proper aspect ratio by resizing is 720x528:

    NTSC:


    PAL:


    However, that's considering the SAR values of 10:11 and 12:11, respectively -- it's impossible to get round values with the 'more precise' ratios.

    But does this mean, for example, that resizing 720x480 NTSC video to 640x480 or 720x540 (DAR 4:3) is wrong? Nevertheless, it's a very common behaviour.

    EDIT:

    Originally Posted by jagabo View Post
    Crop 8 pixels off the left and right borders leaving a 704x480 frame. That's what the ITU spec is based on.

    Or leave the frame at 720x480 and set the DAR to 4:3 or SAR to 8:9. That's what most commercial DVDs do. Ie, they ignore the ITU spec and assume the MPEG 2 spec.
    So, should I understand that there are two types of DVDs? The ones based on 10:11 SAR and the ones based on 4:3 DAR? In that case, not all 640x480 and 720x540 DVD rips would be wrong. A worse question emerges, though: is there a certain way to determine which type the DVD in my hands is?
    Last edited by magiblot; 23rd Sep 2017 at 19:23.
    Quote Quote  
  6. It depends on whether the video uses ITU or MPEG 2 aspect ratios. In an ITU cap the 3:2 image is in a 704x480 portion of the 720x480 frame. With MPEG the it's the entire 720x480 frame.

    ITU: 704 * 3 / 4 = 528
    MPEG: 720 * 3 / 4 = 540
    Quote Quote  
  7. Member
    Join Date
    Sep 2016
    Location
    Barcelona, Spain
    Search Comp PM
    Thanks, jagabo.

    Regarding my previous question on how to determine the type of source (ITU/MPEG), which I added in an edit while you were writing the reply (that was unlucky), I guess one can just check the shape of geometrical bodies, for example:



    In the case above the error of assuming 10:11 SAR is very little, as desired. In the case of that source, since it's a (direct) VHS capture, it could also be argued that the MPEG2 way doesn't apply.

    I applied the test to a DVD source:



    Although this is a mere qualitative analysis, it can be seen that this DVD needs to be resized / encoded assuming the ITU specs.
    Last edited by magiblot; 23rd Sep 2017 at 19:52.
    Quote Quote  
  8. Analog video capture almost always follows the ITU spec, even if it's direct to MPEG. The difference between the ITU spec and the MPEG spec is mostly ignored by the DVD industry. When DVDs are made from analog tape they capture with the ITU spec and just write the 720x480 frame to the DVD flagged as 4:3 DAR. Finding an object of known aspect ratio and measuring it like you did above is the best method to determine the correct aspect ratio. In the absence of that you can look for other hints. ~8 pixel wide back bars at the left and right of the frame are a pretty good indicator of an ITU cap. A not so sharp image is a pretty good indicator that the source was video tape and hence is a ITU cap.

    By the way, the DVD spec refers you to the MPEG 2 spec regarding aspect ratios. The MPEG 2 spec only allows four aspect ratios: 4:3 DAR, 16:9 DAR, 2.21:1 DAR, and 1:1 SAR. Of those, only two are allowed on DVD 4:3 DAR, and 16:9 DAR. And the MPEG 2 spec is very clear the flagged DAR refers to the enitre frame, not a 704x480 portion of it. This is probably why DVD allows for 704x480 or 704x576 frames (where the DVD and ITU spec's meet), though nobody uses them.
    Last edited by jagabo; 23rd Sep 2017 at 20:13.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!