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

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, 15:22   #8  |  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, 16:23   #9  |  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   #10  |  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 12th February 2006, 06:00   #11  |  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   #12  |  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
Old 12th February 2006, 14:40   #13  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Thanks for that ricardo.....

I like that it's able to physically introduce a visible (red) matte over the existing black matte, while providing a "Target AR" at the same time... That's very useful

It's a shame you have to navigate thru' so many options (ie: the "Aspect Ratio" down-arrow, the "Advanced..." option and then click on the "Open" button) to bring up the "Video Window": -




It would have been much easier to have a tool which immediately opens a "video window" and allows you to drag and drop different types of video formats


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 12th February 2006, 15:31   #14  |  Link
ricardo.santos
Registered User
 
ricardo.santos's Avatar
 
Join Date: Mar 2005
Location: Portugal
Posts: 907
Quote:
Originally Posted by SeeMoreDigital
Thanks for that ricardo.....

I like that it's able to physically introduce a visible (red) matte over the existing black matte, while providing a "Target AR" at the same time... That's very useful
very usefull indeed, altough the videi conversion program i use (avi.Net) gets the Targer AR spot on every time i always check one vob with this tool just to make sure the resolution choosen is ok.

Quote:
Originally Posted by SeeMoreDigital
It's a shame you have to navigate thru' so many options (ie: the "Aspect Ratio" down-arrow, the "Advanced..." option and then click on the "Open" button) to bring up the "Video Window": , It would have been much easier to have a tool which immediately opens a "video window" and allows you to drag and drop different types of video formats
yes i agree but i got so used to it it doesnt really bother me anymore and because its for free we cant really complain about it, but you´re right it could do with a "makeover".
ricardo.santos is offline   Reply With Quote
Old 13th February 2006, 11:15   #15  |  Link
yaz
n00b ever
 
Join Date: May 2002
Posts: 627
Quote:
Originally Posted by SeeMoreDigital
It would have been much easier to have a tool which immediately opens a "video window" and allows you to drag and drop different types of video formats...
gordian knot does it. (and much more) it's worth to give it a try. i use it for crop/resize and haven't found any problem. all the ar distortion i've experienced came from the mod32/mod16/... rounding.

the bests
y

ps. i'm w/bond here. he's right (as usual). cropping doesn't affect anything if par is used for resizing. of course, badly tailored dvd-s are of different kinds. (i have some of them )
yaz is offline   Reply With Quote
Old 18th February 2006, 21:08   #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 yaz
ps. i'm w/bond here. he's right (as usual). cropping doesn't affect anything if par is used for resizing. of course, badly tailored dvd-s are of different kinds. (i have some of them )
But as I've proved in the images on the previous page... it does!

The objective is to find the correct "aspect ratio signalling" (PAR) value...


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; 18th February 2006 at 21:11.
SeeMoreDigital is offline   Reply With Quote
Old 12th February 2006, 20:22   #17  |  Link
kurt
sidekick
 
kurt's Avatar
 
Join Date: Apr 2004
Location: old Europe
Posts: 610
Could someone plz approve ARS Calculator? I'd like to try this out

__________________

thx!
__________________
greets, kurt.
Pioneer PDP-427 XA | Popcorn Hour NMT C-200 | Sony STR-DB 840 QS | Canton Ergo 91 DC

Last edited by kurt; 12th February 2006 at 21:17.
kurt is offline   Reply With Quote
Old 19th February 2006, 00:57   #18  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
But as I've proved in the images on the previous page... it does!
No, it does not. Using the usual definition of PAR or SAR, they don't change after cropping.

Perhaps i should reiterate the question of Bond which you refused to answer:
Quote:
maybe you can clearify things by writing how exactly your tool calculates the "ARS"
I hope you will answer this, because i'm interested too. But if this quantity changes after cropping, it is certainly not equivalent with the standard definition of PAR (or SAR).
Wilbert is offline   Reply With Quote
Old 19th February 2006, 01:25   #19  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Actually Bond did make another response, confirming my obsevations but removed it before I could respond....

But before answering the question in more detail I must enquire as to whether you accept that software media players display MPEG-2 DVD's in accordance to the ITU specs, or not.

I would respectfully ask you to play a DVD in you favourite software DVD player and make a full screen grab of what your display sees.... because what your display sees, is what you see. You could even play a DVD in VLC player and capture what it see's!

Then please post these images here and we will work out their aspect ratios.

It would also be helpful if you elevated the brightness level in your media player before making a full screen grab, so we can work out where the DVD matte meets the black of your 4:3 monitor....

Like this say: -




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 19th February 2006, 02:30   #20  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
But before answering the question in more detail I must enquire as to whether you accept that software media players display MPEG-2 DVD's in accordance to the ITU specs, or not.
You already showed me that software dvd players are not in accordance with the ITU specs. Ie, 720x576 is resized to 768x576 (or a scaling of it), etc ... I don't see what this has to do with PAR though.

Ok, i will give you an example. Imagine a screenshot from a dvd (720x576 with DAR 16x9), and the actual picture (without black borders) is 720x432.
Wilbert is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 04:13.


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