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.![]()
+ Reply to Thread
Results 31 to 60 of 63
-
-
-
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.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
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. -
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)
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Originally Posted by hello_hello
-
Last edited by Sharc; 21st Aug 2022 at 06:13.
-
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
-
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:
[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.Last edited by Firestorm; 22nd Aug 2022 at 23:09.
-
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.
-
I recommend avoiding mod2 frame sizes. Some devices will choke on that. Use mod4 at least.
-
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.
[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.....
[Attachment 66398 - Click to enlarge]Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
Originally Posted by hello_hello
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 SharcLast edited by Firestorm; 23rd Aug 2022 at 05:41.
-
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 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.......Last edited by Sharc; 24th Aug 2022 at 02:57. Reason: Name of file 0) corrected
-
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.
- Example 1: Full frame 4:3. Could probably be labeled "640x480" as these are non-anamorphic, square pixels.
- Example 2: Cropped from 720 with MPEG-4 PAR stretches to correct 4:3.
- Example 3: Cropped from 720 with generic PAR stretches to 1.30 (too thin).
- Example 4: Full frame with generic PAR stretches to correct 4:3.
- Example 5: Full frame with MPEG-4 PAR stretches to 15/11 (too wide).
- Example 6: Full frame with MPEG-4 PAR. Active picture stretches to correct 4:3 (same as example 2).
- Example 7: Full frame with generic PAR. Active picture stretches to 1.3 (same as example 3).
-
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.
-
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.
-
-
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.
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.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
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? -
Yes.
Would this mean that any active picture DAR greater than 4:3 is actually wrong and likely has the wrong PAR?
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?
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
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.364Last edited by Sharc; 24th Aug 2022 at 18:03.
-
Originally Posted by Sharc
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.
-
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.
-
There's also the ffmpeg version I linked to in post #13.
Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
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.Avisynth functions Resize8 Mod - Audio Speed/Meter/Wave - FixBlend.zip - Position.zip
Avisynth/VapourSynth functions CropResize - FrostyBorders - CPreview (Cropping Preview) -
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.
Similar Threads
-
DVDs are scratched!
By Caius in forum Newbie / General discussionsReplies: 12Last Post: 14th Jun 2022, 15:39 -
Copy My DVDs
By biferi in forum Newbie / General discussionsReplies: 21Last Post: 23rd Nov 2021, 17:55 -
Desperate,I now want to back up some DVDS
By bearcat22 in forum Authoring (DVD)Replies: 3Last Post: 12th Sep 2019, 00:37 -
Backing up Non-Anamorphic DVDs
By koberulz in forum Newbie / General discussionsReplies: 24Last Post: 9th Feb 2019, 00:29 -
How to put two DVDs onto one DVD
By dexterdoo in forum Authoring (DVD)Replies: 2Last Post: 14th Jan 2019, 07:43