Sign In

Citizen's Aspect Ratio Calculator Tool for your browser

Replies
44
Author
Time

Because the source of the SW letterbox laserdiscs aren't in a true 2.35:1 aspect ratio I had to do some calculating when rescaling to anamorphic so everythign looks fine, I've taken that one step further and been working on more aspect ratio calculation and finally started putting them into some javascript, this is my first stab at coding javascript so you'll have to bear with me

ARCT - Aspect Ratio Calculator Tool

It's just at the first stage of completion, calculation of the aspect ratio, the next stage I'll be adding is outputting the rescaling needed for if you want to output it as PAL or NTSC which is letterboxed or anamorphic, including what size borders to add.

Any comments or helpful hints most welcome.


edit: now completed

This post has been edited.

http://www.haku.co.uk/pics/LukeCruise.gif http://www.haku.co.uk/pics/dontcare.gif
***Citizen's NTSC DVD/PAL DVD/XviD Info and Feedback Thread***
Author
Time
Thanks dude, it should turn into a very useful tool.
Author
Time
Going to add an extra table of information sometime, one that contains necessary border additions to get a letterbox image up to PAL & NTSC resolutions, ie for if you're working with AviSynth.
Also refine the output calculation so you can input 4:3 resolution and get anamorphic output with borders on the sides instead of cropping the top/bottom, for when you want to create a 100% widescreen DVD - it's a slight annoyance having to change the aspect ratio on my tv viewing some DVDs when viewing the bonus extras.

Just occured to me, could add HD resolution calculation, but I don't know the resolutions involved.
http://www.haku.co.uk/pics/LukeCruise.gif http://www.haku.co.uk/pics/dontcare.gif
***Citizen's NTSC DVD/PAL DVD/XviD Info and Feedback Thread***
Author
Time
Easy: 1920 x 1080, and 1280 x 720. Both are 16:9 square pixel formats. 720 is always 720p; 1080 can be either 1080i or 1080p. Both can be various framerates, but you don't need to care.
Author
Time
Thank you for this great tool. It's realy usefull.

A new release of Star Wars is like a box of chocolates, you never know what you're gonna get.

Author
Time
thanks

As far as I'm concerned it's now finished, I've completed what I wanted to create. Latest and (currently) last addition to the tool is an Addborders(0,0,0,0) AviSynth type output for directly putting into an AviSynth script or using with whatever other tool you're using to expand the footage up to full PAL/NTSC/HD resolution.
Along with being able to put 4:3 footage into anamorphic by adding side borders instead of zooming in and cropping the top/bottom.

Before I set out to write this I had a look round and was surprised there weren't any tools that did this exact task, most were just concerned with the basic 4:3, 16:9 & 2.35:1 ratios and weren't flexible enough with the source x,y values.
http://www.haku.co.uk/pics/LukeCruise.gif http://www.haku.co.uk/pics/dontcare.gif
***Citizen's NTSC DVD/PAL DVD/XviD Info and Feedback Thread***
Author
Time
Originally posted by: Citizen
Would be nice to have a realtime update when you enter in the source x,y numbers but I don't know if Javascript can do that and I don't know Java.


Yep, Javascript is capable of that, in fact the automatic updating of data is sort of the 'big thing' in the world of web design at the moment (most famous examples would be Gmail and Google Suggest). If you really do want to add that capability then just Google up AJAX as that is the name most people have started calling the now more popular method.

http://www.kineticpast.com/starwars/thecheatlaserdisc.gif
Ooh, a laserdisc. The Cheat's playin' something on a laserdisc.
Everything is better on a laserdisc. Whatever happened to the laserdisc? Laserdisc!

Author
Time
@citizen:

This calculator's rockin'. I like the AviSynth code. Makes it almost impossible to screw up. If you're going to that level of detail already, would you consider adding the LanczosResize() line you'll need, as well? There's a new syntax for Lanczos that I haven't figured out yet. Even with the old one, I can never remember which numbers come in which order...

Blue skying a bit for a second:

Imagine a sort of "AviSynth for Dummies" automatic script-generating page, where a nearly-non-user of AviSynth could enter the dimensions of the source and desired output, click on a few checkboxes to pick stuff like sharpening or smoothing or saturation increases/decreases, and have a pretty much full-blown AviSynth script magically appear in a box at the bottom, ready for cutting and pasting.

I'm in no way suggesting you *should* or even *should want to* put together something like that. I'm just sayin' it would be cool, and it was inspired by your already-cool AR calculator makin' life simpler.
Author
Time
I think (without going to the trouble of checking...) that while Lanczos4Resize() is pretty new (v2.55, maybe?) that there's an even newer, more general and flexible syntax for v2.56 that will allow functionality like either LanczosResize() or Lanczos4Resize() or something more like LanczosNResize().
Author
Time
Originally posted by: Karyudo
Blue skying a bit for a second:

Imagine a sort of "AviSynth for Dummies" automatic script-generating page, where a nearly-non-user of AviSynth could enter the dimensions of the source and desired output, click on a few checkboxes to pick stuff like sharpening or smoothing or saturation increases/decreases, and have a pretty much full-blown AviSynth script magically appear in a box at the bottom, ready for cutting and pasting.

I'm in no way suggesting you *should* or even *should want to* put together something like that. I'm just sayin' it would be cool, and it was inspired by your already-cool AR calculator makin' life simpler.


Sounds like a great idea, if I had some experience with AviSynth I'd put my hand up for the job right now.

You could even skip the copying and pasting stage and just have the script generate the .AVS automatically, though then newbies wouldn't learn if they never open the file up.

I know you didn't specify an online script (which is all I'd be capable of), but I wonder if a regular GUI could be created for AviSynth. Maybe even something node based like Shake so orders of filters could be easily specified and multiple sources could be used in the right order. That could end up being both a learning tool for newbies and and easy tool for advanced users that simply don't like to 'code'. Add a side panel with the actual code so you can both see what the program is doing plus manually edit it.

Hmmm, I wonder if I could convince one of my younger friends to work on it...

http://www.kineticpast.com/starwars/thecheatlaserdisc.gif
Ooh, a laserdisc. The Cheat's playin' something on a laserdisc.
Everything is better on a laserdisc. Whatever happened to the laserdisc? Laserdisc!

Author
Time
I submitted the link to ARCT to a couple of websites, digital-digest.com and http://www.videohelp.com/tools?tool=ARCT, the first comment on videohelp.com has got me thinking, they mention 352x576 which is a format some digital broadcasters use and some standalone DVD recorders use, now I haven't added that resolution to the calculator yet but apart from that 352x2=704 which some capture devices use for the width instead of 720.

If someone could get their thinking cap on and have a muse over this; if you capture letterbox footage at 720x576 and the same footage at 704x576 the pixel width of the actual letterbox image will be the same (if there's sufficient empty space on either side), so which width resolution (704 or 720) should be used to calculate the aspect ratio of the footage?
http://www.haku.co.uk/pics/LukeCruise.gif http://www.haku.co.uk/pics/dontcare.gif
***Citizen's NTSC DVD/PAL DVD/XviD Info and Feedback Thread***
Author
Time
I say you go from where it's not black. That is, if your whole image fits in 704, then use 704 (or whatever the actual edges are). If it fits in 720 (like I hope most things do, eventually), then use that.

I could be missing the point; but if I'm not, then that's my 2¢.
Author
Time
Originally posted by: zion
Gillean, that is the best sig ever.


Hehe, thought you'd appreciate it, zion!

It was my first conversion of a Flash animation to GIF, all done manually (including modifying the disc hub to be transparent over the default OT.com blues, which of course can't be seen at all now at the shrunk size!). I wonder if there are any automated Flash to GIF programs that are capable of extracting elements out of the background, would speed up the process a lot! I actually have a vague idea for yet another HR/OT.com related animated sig which I'll either make a rotating image script for or just give to someone else.

[edit]By the way, if anyone wants it, you can grab the 10 sec MP3 of The Cheat's Playin' Something on a Laserdisc I quickly ripped.[/edit]

http://www.kineticpast.com/starwars/thecheatlaserdisc.gif
Ooh, a laserdisc. The Cheat's playin' something on a laserdisc.
Everything is better on a laserdisc. Whatever happened to the laserdisc? Laserdisc!

Author
Time
Originally posted by: Citizen
I've updated it further now with true calculation source numbers because PAL 720x576 & NTSC 720x480 aren't true 4:3 resolutions.


I think I have a little problem with that. I know you've been looking at a super-technical page (from Finland) and have made adjustments accordingly, but I think I'd like to ask you to reconsider. Here is my rationale:

For a fixed-pixel display (such as a projector, which I don't own yet but will someday), the aspect ratio is fixed, and there is effectively no overscan. So the source material should ideally be full width (i.e. 720, say) with no black at all. Given that, then the height is the only variable that can affect the AR, and it does so in a non-CCIR way.

Once things are digital, then we have the flexibility to make sure round things stay round -- and I don't see a lot of hand-wringing about CCIR specs built in there. For example, many projectors are 854 x 480, which is 16:9 square pixel. It's clear that the source is meant to be DVD, with no overscan.

Now, for a real TV, getting the AR "right" is sorta pointless, because a CRT can be (and is) adjusted to mess with the AR, and the edges hidden by a bezel. So the minute differences made by CCIR-compliant calculations sorta make no difference at all, when some doofus at the factory wasn't all that careful, and your TV is actually displaying 4.2:3 already!

Given the additional fact that an increasing number of masters never actually exist as NTSC or PAL until they're converted to DVD (since they come via an HD master), and the people doing the conversion are probably computer nerds and not broadcast engineers, isn't it likely that a lot of the CCIR rules are sort of irrelevant, and therefore things are being done strictly on a straight math calculation (i.e. 720 x 480 is 3:2; figure out the PAR for NTSC at 4:3; convert on that basis)?

That's my take. Don't know if I'm right. Hope it contributes to the project, by at least making you think and/or explain why I'm out to lunch!

Author
Time
I think I can sum up a reply in just 7 words, from the page: "This JavaScript utility is designed for me."



In the case of fixed pixel displays of LCD panels & plasma displays, like CRTs the width/height can be adjusted and they can also have overscan areas where the edges of NTSC/PAL footage isn't displayed so for normal DVD content it's still up to the the screen itself to do the scaling of the input source because as far as I know they haven't made any flatscreens (LCD/plasma) that are perfect full NTSC or PAL resolutions so no scaling is done by the panel.
Which is why I'm not too fussed about that aspect of this tool.

As for outputting video at the right aspect ratio for projectors powered by PCs, they're 1:1 which is why there's a PC (1:1) output box on the page and I'll be producing a set of XviD files from the trilogy for myself that are 1024 pixel width at 1:1 aspect for my projector so it doesn't need to do any scaling.


I've changed the calculations so that they use the ITU-R BT.601-4 standards because that applies to the source material I'm working with, laserdiscs and for the moment I'm not working with recent high quality source such as HD or DVDs produced from HD masters.
Under the original set of calculations the aspect ratio of my French SW LDs came out at 2.29:1 but with the ITU-R BT.601-4 standards they come out at 2.35:1.
A friend of mine knows how to code javascript very well so I will ask him about beefing up the code so there's more input/output flexibilty without cluttering up the screen with a million and one options.
http://www.haku.co.uk/pics/LukeCruise.gif http://www.haku.co.uk/pics/dontcare.gif
***Citizen's NTSC DVD/PAL DVD/XviD Info and Feedback Thread***
Author
Time
Originally posted by: Karyudo
Now, for a real TV, getting the AR "right" is sorta pointless, because a CRT can be (and is) adjusted to mess with the AR, and the edges hidden by a bezel. So the minute differences made by CCIR-compliant calculations sorta make no difference at all, when some doofus at the factory wasn't all that careful, and your TV is actually displaying 4.2:3 already!
I'm sort of with Karyudo on this bit, there's no point in doing the calculations to n-th degree accuracy if the tolerance the display device can be up to 5% out.

Plus the fact that many people will find this useful for converting downloaded AVIs into DVD, and many AVIs have aspect ratios that are slightly off to begin with to comply with the mod-16 size requirement.

However I think it would be nice to have a checkbox to say "correct values for CCIR compliancy" so that users have the option to use it or not.

Guidelines for post content and general behaviour: read announcement here

Max. allowable image sizes in signatures: reminder here

Author
Time
Uusing the ITU-R BT.601-4 doesn't really change the relationship between PAL & NTSC (both 4:3 and 16:9), if you input letterbox PAL values you'll get virtually the same results for PAL/NTSC 4:3/16:9 outputs as with the previous aspect ratio calculations, it's the relationship between 4:3/16:9 and 1:1 resolutions that change, you get a more true PC aspect ratio when converting PAL/NTSC source to PC.

The checkbox is an option I'm intending to impliment in a future revision, you can still access the first version here if you need it: http://www.haku.co.uk/ARCT1.0.html
http://www.haku.co.uk/pics/LukeCruise.gif http://www.haku.co.uk/pics/dontcare.gif
***Citizen's NTSC DVD/PAL DVD/XviD Info and Feedback Thread***
Author
Time
OK can someone check if this is correct?

I have a PAL clip, fullscreen, 2.35:1 aspect ratio. When I cut of all the black bars (horizontal and vertical) this is what's left: 693:324.
This I resize to 720:488 and add black bars to make it 720:576. Is it now anamorphic widescreen with the original aspect ratio intact?
Fez: I am so excited about Star Whores.
Hyde: Fezzy, man, it's Star Wars.
Author
Time
Huh? Something is not right. Now my video is vertically stretched! 693:324 is only image without black bars.
Fez: I am so excited about Star Whores.
Hyde: Fezzy, man, it's Star Wars.
Author
Time
If the aspect ratio is 2.35:1, how much of the 576 vertical resolution is actual image in an anamorphic video? +/- 408 lines right?
Fez: I am so excited about Star Whores.
Hyde: Fezzy, man, it's Star Wars.
To the top