Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > New and alternative video codecs
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th February 2006, 18:46   #1  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Aspect Ratio Signalling (ARS) Calculation Tool

In response to all those people who have enquired about how to calculate the required, aspect ratio signalling (aka: PAR, SAR and DAR) values for their "anamorphic" encodes. And how to correct the aspect ratio of their existing "square pixel" encodes.... I have conceived the first version of my ARS Calculator (see link below).




What's it for?
Essentially, if you have an encode that's displayed at the wrong shape (see the port-hole).... like this say: -

[IMG][/IMG]


.... The ARS calculator will enable you to work out the required "Aspect Ratio Signalling" (ARS) value needed to correct the shape.... to this say: -

[IMG][/IMG]


How do I use the ARS Calculator?
First: You need to determine the "Pixel Frame Size (PFS) of your MPEG-4 encode - Preferably without the black mattes.
Second: You need to determine the actual aspect ratio of the movie. Known as the, "Movie Aspect Ratio" (MAR). This can often be found on the back of the DVD cover, or on Amazon.
Third: You enter both these values into the "ARS Calculator" and then press the "Calculate" button to obtain the required "Aspect Ratio Signalling (ARS) value.

Here's an example: -
[IMG][/IMG]


What do I do next with this ARS value?
You will need to use another application called MPEG4 Modifier

First: Feed (drag and drop) your MPEG-4 source into MPEG4 Modifier.
Second: Enter your "ARS value" into the "Custom" boxes (as shown below).
Third: Press the "Save..." button.

Please Note
At the time of writing both applications require Micro$oft's .NET Framework 2.0 in order to run.

Anyway..... I hope you will find a use for it

Cheers


With Thanks
My profound thanks goes to Moitah. Who was able to turn my design concept into a working reality. Many, many thanks mate
Attached Files
File Type: zip ARS_Calculator_v1.0.0.zip (5.4 KB, 5862 views)
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 9th October 2019 at 22:35.
SeeMoreDigital is offline   Reply With Quote
Old 11th February 2006, 11:38   #2  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
hm shouldnt it for a standard dvd encode (cropped or not) never be necessary to use a custom par?

btw why do you introduce new ar names and not use simply the already known ones, like
pixel frame size -> resolution
movie aspect ratio -> display aspect ratio
aspect ratio signalling -> pixel aspect ratio
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 11th February 2006, 12:32   #3  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Quote:
Originally Posted by bond
hm shouldnt it for a standard dvd encode (cropped or not) never be necessary to use a custom par?

btw why do you introduce new ar names and not use simply the already known ones, like
pixel frame size -> resolution
movie aspect ratio -> display aspect ratio
aspect ratio signalling -> pixel aspect ratio
Many people seem to have pre-defined ideas as to what terms such as DAR and PAR represent.

In the case of MPEG-2 DVD images, the "theatrical" aspect ratio of the source movie (Movie Aspect Ratio) does not necessarily relate to the Display Aspect Ratio of the disc!

The source movie could have a "theatrical" aspect ratio of say, 1.33:1, 1.771, 1.85:1, 2.35:1, 2.40:1 etc, etc. But the DVD disc will have a display aspect ratio of either 1.33:1 (4:3) or 1.77:1 (16:9).

Whether it be PAR, SAR, DAR... at the end of the day they are all forms of "Aspect Ratio Signalling"



Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 11th February 2006, 12:33   #4  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
whats the difference between movie and disc aspect ratio???
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 11th February 2006, 12:56   #5  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Quote:
Originally Posted by bond
whats the difference between movie and disc aspect ratio???
The DVD format contains two levels of display aspect ratio signalling, which are either 4:3 or 16:9.

However, the DAR signalling levels will be different for PAL and NTSC disc's because they offer different resolutions (or pixel frame sizes).

Think of it this way, the image element (which is theory can be any aspect ratio) is laid over a fixed pixel sized background of either 720x576 or 720x480 pixels
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 11th February 2006 at 13:01.
SeeMoreDigital is offline   Reply With Quote
Old 11th February 2006, 13:10   #6  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
so the point of your tool is to allow the user to find a par that is better fitting the movie than the standard dvd 4:3/16:9 pal/ntsc one?
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 11th February 2006, 14:01   #7  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Quote:
Originally Posted by bond
so the point of your tool is to allow the user to find a par that is better fitting the movie than the standard dvd 4:3/16:9 pal/ntsc one?
As you know, a DVD source contains black mattes as well as the "all important" image.

When cropping the black mattes away, it's not always possible to obtain the "theatrical" aspect ratio, within the confines of a "mod16" encode.

For example, an anamorphic (16:9) widescreen NTSC DVD with a 2.35:1 movie on it.... like this one: -



... "should" mathematically contain an image of 720x363 (give or take a few vertical) pixels... like this: -



However, the nearest "mod16" pixel calculation is 720x368.... so it's five vertical pixels out.

Admittedly five vertical pixels is not very much at all.... but in reality, the movie aspect ratio quoted on the back of the DVD cover can often be quite a bit out. And in the case of some DVD's.... miles out. Plus the boundary between the matte and the image could be really messy (noisy)!

Here's what I do first
Before generating an "cropped and resized" encode, I often find it useful to establish the actual aspect ratio of the "image" element on the disc. Using the following method: -
  • Play the DVD source in VLC (software media) player
  • Navigate to a nice light section of the movie, and select "Snapshot" via the "Video" tab.
  • Paste/open the captured image into a reasonable quality imaging software application.
  • Use the "auto cropping" tool in your imaging software application.
  • Save the cropped image and make a note of it's "pixel frame size" (PFS)
  • Grab a calculator and divide the pixel image frame "width" by the pixel image frame "height".
The resulting calculation will be "the" Movie Aspect Ratio (MAR). Which you can enter into the ARS Calculator


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 12th February 2006 at 11:37.
SeeMoreDigital is offline   Reply With Quote
Old 11th February 2006, 14:20   #8  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
thats obvious but doesnt answer my question
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 11th February 2006, 14:47   #9  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Quote:
Originally Posted by bond
thats obvious but doesnt answer my question
I think it does....

As I said, when you crop away the black mattes, it's not always possible for the encoded image to fall within the confines of a "mod16" resolution...

I've have also seen (so I'm sure you must have seen them too) many cropped and resized "square pixel" samples provided by forum users, that have been generated at resolutions that bear no relation to the actual aspect ratio of the movie.

By aplying the correct level of aspect ratio signalling you can correct this.


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 11th February 2006, 15:22   #10  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
Quote:
Originally Posted by bond
so the point of your tool is to allow the user to find a par that is better fitting the movie than the standard dvd 4:3/16:9 pal/ntsc one?
yes or no?
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 11th February 2006, 15:37   #11  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Quote:
Originally Posted by bond
so the point of your tool is to allow the user to find a par that is better fitting the movie than the standard dvd 4:3/16:9 pal/ntsc one?
Quote:
Originally Posted by bond
yes or no?
I find your question is too general... Can you be more specific!
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 11th February 2006, 15:46   #12  |  Link
mod
keep manzo
 
mod's Avatar
 
Join Date: Sep 2005
Location: Florence, IT
Posts: 528
Ok, I think it's time for someone else to post!
If I've understood, the idea is simple: crop the black, see what's the AR of the sample, calculate it as a ratio between 2 integers. Stop. This because the 16/9 or 4/3 AR isn't really observed in every DVD. Is this right?
mod is offline   Reply With Quote
Old 11th February 2006, 15:59   #13  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
well from my point of view the thing is very easy:
if you have a 4:3 pal dvd tick 4:3 pal in pixel aspect ratio of mpeg4modifier, if you have a 16:9 ntsc dvd tick 16:9 ntsc in mpeg4modifier aso (doesnt matter if the pic is cropped or not)
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 11th February 2006, 16:17   #14  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Quote:
Originally Posted by bond
...doesnt matter if the pic is cropped or not)
Depending on whether you select from MPEG4 Modifiers "Pixel AR" options or "Display AR" options.... Actually, yes it does!
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 11th February 2006, 16:23   #15  |  Link
Backflip
Registered User
 
Join Date: May 2005
Posts: 157
Hey, I've got an anmorphic encode of Flight Of The Phoenix. Just for confirmation which out of these would be correct (i.e. - give the AR closest to 0% error):

1:1 option in GKnot chosen - cropped down to 720x432 (if I switch to square or PAL anamorphic (16:9) option is says 2.370 is the AR) Have tried:

1. Giving PAR of 2.35:1. On playback I get 1016x432 (using MPlayer)
2. Giving PAL (16:9). On playback I get 1048x432.
3. Calculating 720 x 432 by MAR (2.35:1) using ARS (141:100). On playback I get 1016x432.

Should I not just be using the DAR GKnot gives? So 720 x 432 by 2.37:1 (155:109) or something?

Last edited by Backflip; 11th February 2006 at 17:01.
Backflip is offline   Reply With Quote
Old 11th February 2006, 16:34   #16  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Quote:
Originally Posted by Backflip
Should I not just be using the DAR GKnot gives? So 720 x 432 by 2.37:1 (155:109) or something?
Yes... 720/432 would equate to 2.37:1, so when you add aspect ratio signalling of 155:109, your encode will be reported as being 1023x432 pixels upon playback
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 11th February 2006, 16:40   #17  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
Quote:
Originally Posted by SeeMoreDigital
Depending on whether you select from MPEG4 Modifiers "Pixel AR" options or "Display AR" options.... Actually, yes it does!
when talking about pixel aspect ratio (as i did) it doesnt matter whether the picture is cropped or not

so as you propose to use the par option of mpeg4modifier with your tool's output i wondered about what it does?
maybe you can clearify things by writing how exactly your tool calculates the "ARS"
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 11th February 2006, 21:20   #18  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Given that "a picture speaks a thousand words"

Here are what the "corrected" captured images look like using VLC player: -

00 - The 720x576 DVD source


01 - The 720x432 encode with ARS @ 155.109


02 - The 720x432 encode with PAR @ 16.9 PAL


03 - The 720x432 encode with DAR @ 2.35.1



But just to confirm that no cheating is going on, here are what the "corrected" images look like using Media Player Classic when captured using "Print Screen": -

00 -The 720x576 DVD source


01 - The 720x432 encode with ARS @ 155.109


02 - The 720x432 encode with PAR @ 16.9 PAL


03 - The 720x432 encode with DAR @ 2.35.1



Now, copy, rename and paste the first set of four images into one folder and the second set of four images into another folder. Then quickly flick thru the images in "Windows Picture and Fax Viewer". And then tell me which of the encoded images more closely matches the aspect ratio of the source?!


Cheers

EDIT: Images uploaded to ImageShack (which was down yesterday)
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 12th February 2006 at 13:24.
SeeMoreDigital is offline   Reply With Quote
Old 12th February 2006, 06:00   #19  |  Link
Backflip
Registered User
 
Join Date: May 2005
Posts: 157
The 720x432 encode with ARS @ 155.109 looks closest for me.

Interesting one though, I did a rip myself of Sith a while ago and only got (1:1) - 704x416 (0.0% AR error, w/ AR indicated as 1.692) or (PAL anamorphic (16:9) w/ AR indicated as 2.407) - 704x288. This was with all black and messy edges cropped out I think.
Backflip is offline   Reply With Quote
Old 12th February 2006, 13:27   #20  |  Link
ricardo.santos
Registered User
 
ricardo.santos's Avatar
 
Join Date: Mar 2005
Location: Portugal
Posts: 907
Hi everyone!

Interesting thread, like SeeMoreDigital said:
Quote:
Originally Posted by SeeMoreDigital
Many people seem to have pre-defined ideas as to what terms such as DAR and PAR represent.
@SeeMoreDigital

Quote:
Originally Posted by SeeMoreDigital
Here's what I do first
Before generating an "cropped and resized" encode, I often find it useful to establish the actual aspect ratio of the "image" element on the disc. Using the following method: -

Play the DVD source in VLC (software media) player
Navigate to a nice light section of the movie, and select "Snapshot" via the "Video" tab.
Paste/open the captured image into a reasonable quality imaging software application.
Use the "auto cropping" tool in your imaging software application.
Save the cropped image and make a note of it's "pixel frame size" (PFS)
Grab a calculator and divide the pixel image frame "width" by the pixel image frame "height".
The resulting calculation will be "the" Movie Aspect Ratio (MAR). Which you can enter into the ARS Calculator
I think theres an easier and less complicated way of finding out the movie aspect ratio. I use a tool called ASPECT for that,just manually crop the picture and it will tell you the correct aspect ratio of the movie on the dvd and the which resolutions you should use on your conversion to divx/xvid.



Just thought of sharing this as i find this tool extremely usefull when finding out the aspect of the movie and which resolution to use on my divx conversion.

Ricardo

Ps: Another neat function is that it can make an avisynth script based on the cropping made manually, example:

1- rip your "main movie"from your dvd to your Pc and use Dgindex to creat a d2v script
2- open aspect, click on the Aspect ratio dropdown menu and select "advanced"
2- click on open and select "d2v project" and delect the d2v script, manually crop and click on ok.
3-back on main menu select autosize and it wiil find the best resolution, click on "save" and it wiil produce an avisynth script based on the cropping you made that can be "fed" on to virtualdub to convert to divx/xvid without going in to the filters section, just select the codec and you´re away.

Quote:
Originally Posted by ASPECT homepage

calculate frame size according given aspect ratio
evaluate aspect errors
check frame size for compliance with codec (i.e. ensures that frame height/width is multiple of 4, 16, etc.)
calculate aspect ratio according given frame size
calculate avi video bitrate/size and bits/pixel value
automatically calculate frame size
evaluate interleave overhead for legacy and opendml avis
adjust aspect ratio for cropped movies
access unencrypted vob, mpeg2, d2v, png and bmp files
retrieve video resolution, aspect ratio, fps and duration from supported video files
show frame preview
generate avisynth scripts out of d2v files .
Enjoy, its freeware

Last edited by ricardo.santos; 12th February 2006 at 14:26.
ricardo.santos is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:28.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.