VideoHelp Forum




+ Reply to Thread
Page 2 of 3
FirstFirst 1 2 3 LastLast
Results 31 to 60 of 63
  1. Member Skiller's Avatar
    Join Date
    Oct 2013
    Location
    Germany
    Search PM
    Actually the DVD-spec doesn't say anything about this, it's the MPEG2-spec that does. And it does so coming from a "computer perspective" where DAR makes much more sense than analog signal timings that define how video is digitized and returned into analog... But DVD was, in it's hey-day anyways, not a medium for computer playback but to return an analog signal for display on a CRT.
    It's all based on that (and then came HDMI and HDTV downscales that started doing it the computer/DAR way).

    So you can guess which standard I am favoring.
    Quote Quote  
  2. Originally Posted by Firestorm View Post
    Therefore, my rule of thumb is based on the presence of vertical black bars on the DVD. If the full 720 frame is used, I would use generic PAR, if there are vertical black bars on each side of the frame (not sure if width matters), I would use MPEG-4/ITU PAR.
    ... and if you reencode (to mpeg4 for example) in the latter case, crop 8 pixels from the left and 8 pixels from the right and encode as 704x480, mpeg4/ITU PAR to eliminate the ambiguity.
    Fair enough as a rule of thumb, I think.
    Quote Quote  
  3. My "if in doubt" logic for 4:3 DVDs is based on the majority of them having some black on each side, so starting with a 15:11 DAR provides a 16 pixel width cropping buffer before the remaining picture is 4:3, and if a bit of height cropping is also required what's left is usually 4:3 or greater. Starting with a 4:3 DAR often means the cropped picture has a DAR of less than 4:3, and according to my DAR OCD that's fairly mental.
    Quote Quote  
  4. Originally Posted by Skiller View Post
    Actually the DVD-spec doesn't say anything about this
    Actually it does -- it says to see the MPEG 2 spec!

    Personally, if it's obvious the 4:3 DAR DVD content is rec.601 analog cap (~8 pixels of black borders at each edge, not so sharp picture, oversharpening halos), I'll crop to 704x480 and encode with 10:11 SAR. My comment to Firestorm was more tongue-in-cheek than serious. But it's another way of looking at the issue.

    By the way, all the upscaling DVD/BD players I've checked (granted, only a handful) follow the MPEG 2 spec. For example, to produce a 1920x1080 output the full 720x480 or 720x576 frame is scaled to 1440x1080 and padded left and right to fill the rest of the frame.
    Quote Quote  
  5. Can you still manually add command line options to the Handbrake GUI? I'm wondering, because under Picture Options....
    https://handbrake.fr/docs/en/latest/cli/command-line-reference.html
    Code:
       --custom-anamorphic     Store pixel aspect ratio in video stream and
                               directly control all parameters.
       --display-width <number>
                               Set display width in pixels, for custom anamorphic.
                               This determines the display aspect during playback,
                               which may differ from the storage aspect.
       --keep-display-aspect   Preserve the source's display aspect ratio
                               when using custom anamorphic
       --no-keep-display-aspect
                               Disable preset 'keep-display-aspect'
       --pixel-aspect <par_x:par_y>
                               Set pixel aspect for custom anamorphic
                               (--display-width and --pixel-aspect are mutually
                               exclusive.
       --itu-par               Use wider ITU pixel aspect values for loose and
                               custom anamorphic, useful with underscanned sources
       --no-itu-par            Disable preset 'itu-par'
       --modulus <number>      Set storage width and height modulus
                               Dimensions will be made divisible by this number.
                               (default: set by preset, typically 2)
    Quote Quote  
  6. Originally Posted by hello_hello
    Can you still manually add command line options to the Handbrake GUI?
    Looks like it does! Good pickup. Presume I just turn on anamorphic=custom, manually set PAR 10/11, and type "itu-par" in the advanced options section? I've never strayed outside of a GUI to go command line.
    Quote Quote  
  7. Originally Posted by Firestorm View Post
    Originally Posted by hello_hello
    Can you still manually add command line options to the Handbrake GUI?
    Looks like it does! Good pickup. Presume I just turn on anamorphic=custom, manually set PAR 10/11, and type "itu-par" in the advanced options section? I've never strayed outside of a GUI to go command line.
    You have all the options for cropping, PAR setting, frame size definition and adding borders (padding) in the "Dimensions" Tab of Handbrake. And you can preview before encoding.
    Attachments are for mpeg4 and ITU PAR.
    Image Attached Thumbnails Click image for larger version

Name:	Screenshot 2022-08-21 124058.png
Views:	34
Size:	57.3 KB
ID:	66384  

    Click image for larger version

Name:	SS 2022-08-21 131005.png
Views:	24
Size:	56.6 KB
ID:	66385  

    Last edited by Sharc; 21st Aug 2022 at 06:13.
    Quote Quote  
  8. Originally Posted by Sharc View Post
    You have all the options for cropping, PAR setting, frame size definition and adding borders (padding) in the "Dimensions" Tab of Handbrake. And you can preview before encoding.
    According to Firestorm, setting a custom PAR of 10:11 in the GUI didn't work, but I don't know if that's because Handbrake ignores it for DVD resolutions or if it was because something wasn't configured correctly.
    Quote Quote  
  9. Originally Posted by hello_hello View Post
    Originally Posted by Sharc View Post
    You have all the options for cropping, PAR setting, frame size definition and adding borders (padding) in the "Dimensions" Tab of Handbrake. And you can preview before encoding.
    According to Firestorm, setting a custom PAR of 10:11 in the GUI didn't work, but I don't know if that's because Handbrake ignores it for DVD resolutions or if it was because something wasn't configured correctly.
    Don't know why. For full freedom one has to set 'Cropping' and 'Anamorphic' to 'Custom' and untick 'Optimal Size' and 'Allow upscaling'.
    I don't have much experience with Handbrake though as I hardly ever use it.
    Quote Quote  
  10. Thanks again for helping me get to the bottom of this gents. Your comments inspired me to take another crack at this and I think I've finally worked it out.

    I followed Sharc's settings but noticed that manually changing the PAR to 10/11 will just make Handbrake scale the resolution from 720/480 to 704/480 to keep the DAR at 4/3.

    What you have to do is uncheck "automatic" under "final dimensions" which will let you stretch the picture back out to 15/11 DAR as per below:

    Image
    [Attachment 66394 - Click to enlarge]


    Can you take a look and let me know if I've done this correctly? Hate to think I've stretched the picture incorrectly.
    Image Attached Thumbnails Click image for larger version

Name:	Screenshot 2022-08-22 150504.jpg
Views:	20
Size:	108.3 KB
ID:	66393  

    Last edited by Firestorm; 22nd Aug 2022 at 23:09.
    Quote Quote  
  11. Originally Posted by Firestorm View Post
    Can you take a look and let me know if I've done this correctly? Hate to think I've stretched the picture incorrectly.
    It doesn't look very reasonable to me (or at least I have some doubts), because:
    - the 'storage size' became 718x480 which is certainly not DVD compliant (if you care). DVD should be 704x480 or 720x480, but nothing in between. It may be ok for computer playback though.
    - you cropped 2 pixels from the right. From this one could conclude that the picture of the 720x480 source had almost no black side pillars, hence the PAR was probably 8/9 rather than 10/11, means there is no reason to change it to 10/11. At least it conflicts with the 'rule of thumb' stated earlier.
    - you still left the 'Optimal Size' selected. I would deselect it, and select 'Allow upscale' for more width/hight freedom.

    But all this really depends on the source, so my comments are partly speculative. Upload a short sample of the source (preferably a scene which includes a circular shape like a clock, wheel, ball .... if you can find one) for better advice or more speculation.....
    Last edited by Sharc; 22nd Aug 2022 at 03:17.
    Quote Quote  
  12. I recommend avoiding mod2 frame sizes. Some devices will choke on that. Use mod4 at least.
    Quote Quote  
  13. I could only install Handbrake 1.4.2 on my Win7 laptop. I tried hard to configure anamorphic encoding, but I must be too mentally challenged. I remember using anamorphic encoding in the past and thinking the way it worked wasn't very intuitive, as different options such as display width and PAR can't be independent even though they seemed to be in the GUI, but I couldn't get version 1.4.2 to do anything sensible in respect to custom anamorphic.

    With the "final dimensions" set to automatic, Handbrake was obviously trying to maintain the original DAR (adjusting the width and height together), so the PAR was being ignored, and without the automatic option checked I could increase the width to more than 32 pixels, or I could increase the height to more than 32 pixels, but not both at the same time. Checking "optimal size" produced yet another flavour of WTF.

    Image
    [Attachment 66397 - Click to enlarge]


    Vidcoder on the other hand, was happy to output the PAR I told it to. Well.... I think the approach is wrong but at least it works.
    Vidcoder chooses the input PAR just as Handbrake does, but from there you're free to enable "manual" resizing and create as big a mess of the aspect ratio as you wish to, as the user is obviously responsible for doing the math. I think the way MeGUI works is a better approach. You can tell it to assume a different DAR for the source, and when you crop and/or resize it still does the math for you, but it's calculations are based on the source DAR it's been told to use. Anyway.....

    Image
    [Attachment 66398 - Click to enlarge]
    Quote Quote  
  14. No problem to the same with Handbrake v 1.5.1 here:
    Image Attached Thumbnails Click image for larger version

Name:	Screenshot 2022-08-22 205432.png
Views:	24
Size:	56.9 KB
ID:	66399  

    Quote Quote  
  15. Originally Posted by hello_hello
    With the "final dimensions" set to automatic, Handbrake was obviously trying to maintain the original DAR
    That's exactly what I found too. Setting a custom PAR 10/11 but leaving "scaled size" on "automatic," Handbrake then scales the resolution down from 720 to 704 to keep the AR at 4:3. How it does this without cropping is beyond my mathematical abilities. If you know how it does this let me know.

    I have another question for you. If an active 4:3 analogue NTSC resolution is 704x480 (MPEG-4 spec) with PAR of 10/11, then ripping a DVD and using the full 720x480 DVD frame with PAR 10/11 DAR 15/11 would be incorrect right?

    Originally Posted by Sharc
    you cropped 2 pixels from the right. From this one could conclude that the picture of the 720x480 source had almost no black side pillars, hence the PAR was probably 8/9
    I agree, I'm thinking now that as virtually the whole 720x480 frame was used it's probably generic PAR.
    Last edited by Firestorm; 23rd Aug 2022 at 05:41.
    Quote Quote  
  16. Setting a custom PAR 10/11 but leaving "scaled size" on "automatic," Handbrake then scales the resolution down from 720 to 704 to keep the AR at 4:3. How it does this without cropping is beyond my mathematical abilities. If you know how it does this let me know.
    It does exactly what it is supposed to and what you tell it to do.
    You set the PAR, and the "Final Dimensions" (on or off) scale the full frame size horizontally to adjust the DAR. This has nothing to do with cropping, but has a lot to do with PAR, framesize (width x height), DAR "~2% ambiguity" (or however we call it) discussed throughout this thread.

    Attached 7 files you can (obscessively) practice with.......
    Image Attached Files
    Last edited by Sharc; 24th Aug 2022 at 02:57. Reason: Name of file 0) corrected
    Quote Quote  
  17. Thanks again. I'm sure what Handbrake is doing is correct. But how can it resize from 720 to 704 without cropping? The 18 extra pixels have to go somewhere so it can't just be changing the PAR alone can it?

    Also these are 7 great examples to look at. I've tested my knowledge against each one below by focussing on the DAR of the active picture.
    1. Example 1: Full frame 4:3. Could probably be labeled "640x480" as these are non-anamorphic, square pixels.
    2. Example 2: Cropped from 720 with MPEG-4 PAR stretches to correct 4:3.
    3. Example 3: Cropped from 720 with generic PAR stretches to 1.30 (too thin).
    4. Example 4: Full frame with generic PAR stretches to correct 4:3.
    5. Example 5: Full frame with MPEG-4 PAR stretches to 15/11 (too wide).
    6. Example 6: Full frame with MPEG-4 PAR. Active picture stretches to correct 4:3 (same as example 2).
    7. Example 7: Full frame with generic PAR. Active picture stretches to 1.3 (same as example 3).
    Quote Quote  
  18. Originally Posted by Firestorm View Post
    Thanks again. I'm sure what Handbrake is doing is correct. But how can it resize from 720 to 704 without cropping? The 18 extra pixels have to go somewhere so it can't just be changing the PAR alone can it?
    It simply resizes the frame.
    Quote Quote  
  19. Originally Posted by Firestorm View Post
    But how can it resize from 720 to 704 without cropping?
    Resizing and cropping are totally different and independent procedures. One can resize to (almost) any width and hight (like 120x440 or whatever) without cropping anything off the picture.
    Cropping keeps the PAR intact, resizing changes the PAR.

    And how you eventually see it depends on the player, i.e. whether the player forces the frame to 4:3 (1.333..) during playback, or whether it follows the PAR (assuming it can read the PAR signalling).

    And yes, I will change the name of file 0) in my post. The name was a copy/paste mistake.
    Last edited by Sharc; 23rd Aug 2022 at 16:49.
    Quote Quote  
  20. Member Skiller's Avatar
    Join Date
    Oct 2013
    Location
    Germany
    Search PM
    Originally Posted by Firestorm View Post
    If an active 4:3 analogue NTSC resolution is 704x480 (MPEG-4 spec) with PAR of 10/11, then ripping a DVD and using the full 720x480 DVD frame with PAR 10/11 DAR 15/11 would be incorrect right?
    Not really incorrect (for example MiniDV and Digital8 camcorders do it like that) but the stored picture is of course slightly wider (1.36:1 – 15:11). This would need to be taken into account during playback which it does not for many playback scenarios and is played at DAR 4:3 instead. It would be correct out-of-the-box when played out through an analog connection to a TV though or when making an MKV or MP4 with SAR 10/11.
    Last edited by Skiller; 23rd Aug 2022 at 12:28.
    Quote Quote  
  21. Originally Posted by Firestorm View Post
    I have another question for you. If an active 4:3 analogue NTSC resolution is 704x480 (MPEG-4 spec) with PAR of 10/11, then ripping a DVD and using the full 720x480 DVD frame with PAR 10/11 DAR 15/11 would be incorrect right?
    Most modern media players will display it with the correct DAR, ~1.36:1. A media player upscaling to 1080p will enlarge the frame to ~1472x1080 plus black borders, rather than 1440x1080 with black borders.
    Quote Quote  
  22. Originally Posted by Firestorm View Post
    Originally Posted by hello_hello
    With the "final dimensions" set to automatic, Handbrake was obviously trying to maintain the original DAR
    That's exactly what I found too. Setting a custom PAR 10/11 but leaving "scaled size" on "automatic," Handbrake then scales the resolution down from 720 to 704 to keep the AR at 4:3. How it does this without cropping is beyond my mathematical abilities. If you know how it does this let me know.
    You can't tell Handbrake to use a different DAR/PAR for the source other than the one it's decided to use, unlike the resize calculator where you can pick the PAR to use for the source and that's what it's calculations will be based on.

    So in "automatic" mode Handbrake wants to maintain the 4:3 DAR, and to do that if you change the shape of the pixels, it must resize the width to compensate. Resizing does change the number of pixels, but by resampling them, so the same amount of picture is spread out over a greater or fewer number of pixels, depending on whether you resize up or down, and the wider you make the pixels the more width has to be reduced to maintain the original 4:3 DAR.

    A simpler example would be an image with a 2:1 display aspect ratio, and assuming it's 1000x500, it'd be non anamorphic (square pixels). If you halve the width by resizing it to 500x500 the width would be "squished". To keep it displaying with a 2:1 DAR, the 500 remaining pixels need to be twice as wide, so the pixels themselves would have a 2:1 aspect ratio. Of course halving the width by resizing it down halves the number of horizontal pixels even if you do change the PAR, so the picture would have the same display width, but at a lower resolution.

    That's what happening for the DVD. The pixels get a bit wider so the width is reduced a bit, and of course it works out that 720 pixels with an 8:9 aspect ratio result in display width of 640, but you only need 704 of them to achieve the same display width when the PAR is 10:11.

    So resizing on it's own changes the PAR if you don't want to distort the picture (unless of course the width & height are resized in proportion to each other). Cropping on it's own does the opposite as it doesn't change the shape of the pixels, therefore cropping changes the DAR.

    Originally Posted by Firestorm View Post
    I have another question for you. If an active 4:3 analogue NTSC resolution is 704x480 (MPEG-4 spec) with PAR of 10/11, then ripping a DVD and using the full 720x480 DVD frame with PAR 10/11 DAR 15/11 would be incorrect right?
    I think "active" is the key word there.
    https://lurkertech.com/lg/pixelaspect/#not720_640_720_768_how
    If you scroll up a bit and read the section on apertures, he seems to be saying the SMPTE RP 187-1995 standard specified the same production aperture for both square and non-square pixels (although I couldn't find a free copy of it to download) but the industry practice was to use an exact 4:3 aperture for square pixels and a slightly wider one for non-square pixels, which means 720 non-square pixels would be wider than 4:3, or something..... I'm still trying to wrap my brain around that one.

    There's also the fact that 704x480 is a very seldom used, but perfectly complaint resolution for 4:3 DVDs, which implies 720x480 should be wider than 4:3 if the same PAR is assumed for both. Either that or 704x480 would have to be narrower than 4:3, but I followed the 4CIF link and it says 704x480 is 4:3.
    https://en.wikipedia.org/wiki/DVD-Video#Video_data
    Following the D-1 link it says D-1 follows the rec.601 standard at 720x480, which makes it wider than 4:3.
    Last edited by hello_hello; 23rd Aug 2022 at 16:18.
    Quote Quote  
  23. Thanks everyone for the responses. I'm starting to understand yet another aspect of SD video processing now (resizing).

    On subject of PAR, we know the MPEG-4 digital resolution that corresponds exactly to the active analog NTSC signal is 704×480. This means that the whole 720x480 DVD resolution (including inactive pixels) needs to be stretched to 1.364 DAR to ensure the active part of the final resolution corresponds to 4:3 DAR. Would this mean that any active picture DAR greater than 4:3 is actually wrong and likely has the wrong PAR?

    Following on from this, if the PAR is wrong, would forcing the DAR back to 4:3 at the mkv container level correct this to some extent?
    Quote Quote  
  24. Originally Posted by Firestorm View Post
    Thanks everyone for the responses. I'm starting to understand yet another aspect of SD video processing now (resizing).

    On subject of PAR, we know the MPEG-4 digital resolution that corresponds exactly to the active analog NTSC signal is 704×480. This means that the whole 720x480 DVD resolution (including inactive pixels) needs to be stretched to 1.364 DAR to ensure the active part of the final resolution corresponds to 4:3 DAR.
    Yes.

    Would this mean that any active picture DAR greater than 4:3 is actually wrong and likely has the wrong PAR?
    Not necessarily. If the source is (mini)DV from Camcorders for example rather than analog, the active picture is 720x480. Nevertheless the PAR is 10/11 by the DV specification. The usual black side pillars of 2x8 pixels which are typical for analog transfers is just filled with useful picture data, but the PAR is kept from analog world (Rec. 601).

    Take example 5) of post#46 and imagine that the green pillars contain useful picture material.

    if the PAR is wrong, would forcing the DAR back to 4:3 at the mkv container level correct this to some extent?
    Examples 2) and 4) in post#46 would be 'fixed' with a forced 4:3 playback; the wrong PAR signalling would be corrected. So yes, when you remux with mkvtoolnix and set 'Aspect ratio'=4/3 it will adjust the incorrect PAR signalling at container level (i.e. flag it correctly at container level). MediaInfo will report the remuxed example 2) of post#46 like
    Sampled_Width : 704
    Sampled_Height : 480
    Pixel aspect ratio : 0.909
    Original pixel aspect ratio : 0.889

    Display aspect ratio : 1.333
    Display aspect ratio : 4:3
    Original display aspect ratio : 1.304
    and example 4) like
    Sampled_Width : 720
    Sampled_Height : 480
    Pixel aspect ratio : 0.889
    Original pixel aspect ratio : 0.909

    Display aspect ratio : 1.333
    Display aspect ratio : 4:3
    Original display aspect ratio : 1.364
    Last edited by Sharc; 24th Aug 2022 at 18:03.
    Quote Quote  
  25. Originally Posted by Sharc
    Examples 2) and 4) in post#46 would be 'fixed' with a forced 4:3 playback; the wrong PAR signalling would be corrected.
    Right on Sharc, thanks for confirming.

    I suppose the only things to be aware of when "retconning" the video stream this way is that any cropping made to the 1.364 picture will be stretched/distorted when locked at 1.33 (although I presume less distorted than having the wrong PAR). Also some players do not natively support mkv and will ignore the container flag. Direct play on Plex for Roku is one I know of for sure.

    Do you know of any way to correct the PAR at the video stream level or is it too late once encoded?
    Last edited by Firestorm; 24th Aug 2022 at 20:48.
    Quote Quote  
  26. Originally Posted by Firestorm View Post
    Do you know of any way to correct the PAR at the video stream level or is it too late once encoded?
    Patchers which cross my mind for adjusting certain parameters/flags without reencoding:

    for mpeg2:
    - DVDPatcher
    - Restream
    - MKVToolNix
    - IFOEdit/VOBEdit (for DVD)

    for mpeg4/AVC:
    - MKVToolNix
    - tsMuxeR
    - H.264 Patcher and BD-Tools (h264Modify.exe) found here:
    https://forum.doom9.org/showthread.php?t=174563

    More serious flaws may require full reencoding (starting from the original as the source to avoid accumulation of artifacts and reduction of quality).
    Last edited by Sharc; 25th Aug 2022 at 02:10.
    Quote Quote  
  27. There's also the ffmpeg version I linked to in post #13.
    Quote Quote  
  28. Ah yes I see the command you mentioned. Ffmpeg and the command line in general is a bit intimidating to me. Have never learned to use it before.
    Quote Quote  
  29. If you feel like trying AnotherGUI, it's a GUI for pretty much any command line thingy.
    For the ffmpeg version I linked to, creating an AnotherGUI preset would look like this:

    i "<FullSourceFileName>" -y -vcodec copy -acodec copy -vbsf h264_changesps=colormatrix=6/colorprim=2/transfer=2/fps=24000:1001/cfr/sar=10:11 "<OutputPath><OutputFileName>.mkv"

    Once the preset is working you can do them in batches if you like, although you'll probably still have to run the through MKVToolNix individually to set the container aspect ratio, assuming ffmpeg only changes the video stream aspect ratio.
    Quote Quote  
  30. Perhaps it's worth mentioning that DVD authoring tools like AVS2DVD or DVDStyler will resize the picture of example 5) in post#46 vertically and pad it vertically for DVD compliant 720x480 full framesize, such that the resulting AR of the active picture will be undistorted i.e. circles and squares are preserved when the full frame is played back as 4:3.
    Last edited by Sharc; 1st Sep 2022 at 03:21.
    Quote Quote  



Similar Threads

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