HandBrake gets 4:3 aspect NTSC wrong

Discuss encoding for devices and presets.
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
markfilipak
Bright Spark User
Posts: 313
Joined: Thu Aug 01, 2019 8:58 pm

HandBrake gets 4:3 aspect NTSC wrong

Post by markfilipak »

Description of problem or question:

This issue does not fit the standard of an ordinary trouble report.

Encoding a 720x480 video loses 11% of its horizontal resolution when SAR = 8/9. It produces a 640x480 display instead of a 720x540 display.

This issue is apparently caused by the mistaken belief that all DARs are W/480.

It is compounded by the belief that 8/9 is PAR. It is not. 8/9 (& 64/45 & 16/15 & 32/27) is SAR. The PAR-instead-of-SAR mistake doesn't really matter if the math used is correct. The math used is not correct.

Here is the logic:
For 16:9 PAL, SAR = 64/45
For 4:3 PAL, SAR = 16/15
For 16:9 NTSC, SAR = 32/27
For 4:3 NTSC, SAR = 8/9 // this is the only case of SAR < 1

// DAR = W/H*SAR (source: ITU H.262)

if SAR > 1, DAR = (W*SAR)/H // Dots per line = W*SAR. Lines per display = H
else, DAR = W/(H/SAR) // Dots per line = W. Lines per display = H/SAR

Cases:
For SAR = 64/45 & W = 720 & H = 576, DAR = 720*64/45/576 = 1024/576 (i.e., 16:9)
For SAR = 16/15 & W = 720 & H = 576, DAR = 720*16/15/576 = 768/576 (i.e., 4:3)
For SAR = 32/27 & W = 720 & H = 480, DAR = 720*32/27/480 = 853/480 (i.e., 16:9)
For SAR = 8/9 & W = 720 & H = 480, DAR = 720/(480/(8/9)) = 720/540 (i.e., 4:3)

If you don't believe me, view any 4:3 aspect NTSC VOB in MPV and look at MPV's "Scaled Resolution" report when the display window is not full screen.
If you still don't believe it, ask yourself this question: Do you really think that an encoder would rescale from 720 to 640 and thereby throw away 11% of the horizontal resolution?

I have tried to trick HandBrake into not throwing away horizontal resolution but have failed every time.
markfilipak
Bright Spark User
Posts: 313
Joined: Thu Aug 01, 2019 8:58 pm

Re: HandBrake gets 4:3 aspect NTSC wrong

Post by markfilipak »

I'm being prevented from making a correction.

In the next to last sentence, "encoder" should be "decoder". In other words, the decoded picture is 720x540, not 640x480.
mduell
Veteran User
Posts: 8207
Joined: Sat Apr 21, 2007 8:54 pm

Re: HandBrake gets 4:3 aspect NTSC wrong

Post by mduell »

An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided
markfilipak
Bright Spark User
Posts: 313
Joined: Thu Aug 01, 2019 8:58 pm

Re: HandBrake gets 4:3 aspect NTSC wrong

Post by markfilipak »

Ah! I was able to trick the Linux version of HandBrake into doing the right thing by making 'Dimensions'->'Display Geometry'->'Width" = 640. That's nonsense, but HB did the right thing.
markfilipak
Bright Spark User
Posts: 313
Joined: Thu Aug 01, 2019 8:58 pm

Re: HandBrake gets 4:3 aspect NTSC wrong

Post by markfilipak »

mduell wrote: Tue Oct 10, 2023 3:39 am An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided
It's not a support request.
Post Reply