Questions about the effects of Avisynth scripts
-
- Joined: Fri Oct 15, 2004 1:44 pm
Re: Questions about the effects of Avisynth scripts
I plan to have all my clips at 4:3. That's why I'm confused, because the guide says to make 16:9 to 640x480.
I had planned to edit at 720x480 since most of my files are that resolution, but now I'm thinking it might just be easier to make all of those at 640x480. Adding in Crop(8,0,-8,-0) Spline36Resize(640,480) as it says in the guide, however, still leaves a slight black bar on top, so I'm unsure if it's ok to continue to crop that out and then keep the resize at 640x480.
Question: You say that by using Premiere Pro, which I will be doing, that I don't need to resize the 848x480 files. Does this hold true if my premiere settings are set to edit at 720x480 as well?
I had planned to edit at 720x480 since most of my files are that resolution, but now I'm thinking it might just be easier to make all of those at 640x480. Adding in Crop(8,0,-8,-0) Spline36Resize(640,480) as it says in the guide, however, still leaves a slight black bar on top, so I'm unsure if it's ok to continue to crop that out and then keep the resize at 640x480.
Question: You say that by using Premiere Pro, which I will be doing, that I don't need to resize the 848x480 files. Does this hold true if my premiere settings are set to edit at 720x480 as well?
- Scintilla
- (for EXTREME)
- Joined: Mon Mar 31, 2003 8:47 pm
- Status: Quo
- Location: New Jersey
- Contact:
Re: Questions about the effects of Avisynth scripts
It says to crop 16:9 sources from 848x480 to 640x480, not resize them down -- a world of difference there. And again, that's only if you're editing with square pixels (a 1.0 PAR).jediphoenix wrote:I plan to have all my clips at 4:3. That's why I'm confused, because the guide says to make 16:9 to 640x480.
Doing the crop in AVISynth like this means you always lose the leftmost 104 and rightmost 104 pixels from your 16:9 sources, and in a lot of cases that's probably fine. My tip about Premiere Pro was just a suggestion in case you want more control, or if there are certain scenes that have things happening on one edge or the other of the frame that you don't want to lose.
Premiere will still treat them the same way, BUT if you're keeping the 4:3 clips at 720x480 (0.9 PAR) and you want to go this route, then you should be resizing your 16:9 clips up to 960x480 (0.9 PAR) instead of 848x480 (1.0 PAR). The key is to keep the PAR of all your source clips consistent.jediphoenix wrote:Question: You say that by using Premiere Pro, which I will be doing, that I don't need to resize the 848x480 files. Does this hold true if my premiere settings are set to edit at 720x480 as well?
(And if you do the fixed crop, follow up the resize with Crop(120,0,-120,0) to get to 720x480.)
- Qyot27
- Surreptitious fluffy bunny
- Joined: Fri Aug 30, 2002 12:08 pm
- Status: Creepin' between the bullfrogs
- Location: St. Pete, FL
- Contact:
Re: Questions about the effects of Avisynth scripts
Alternately, if you don't want to lose picture information, you can resize to 640x352, which retains a 16:9 aspect ratio*, and then add 64-pixel borders to the top and bottom. Thus you fit a 16:9 image properly inside 640x480. But the video will be switching back and forth from letterboxed to non-letterboxed. Maybe that's ok, maybe it isn't.
*technically, 16:9 = 640x360, but for compression reasons it's better to use multiples of 16. So you're left with either 640x368 or 640x352 - if you want to be anal about it you can resize to 640x360 and then crop 4 pixels from the top and bottom, but nobody really cares/notices anyway. But wait, the borders should also be multiples of 16 so they can be cleanly encoded too. 56 (what the borders would be if you chose 640x368) isn't a multiple of 16, but 64 (which is what you use for 640x352) is.
(note: if this is fitting into a 0.9 PAR/720x480 project, then the 640's would be changed to 720's with no change to the height value - 720x352 instead of 640x352, and so on)
With Scintilla's comments about Premiere Pro in mind, think of Premiere Pro's action area (where the video appears) just like you'd think of the Canvas in Photoshop - an image can be larger than the canvas and moved around to get different parts of the image to fit inside of it. The same action in Premiere Pro would be achieved using the Motion tool to place the video in a different part of the canvas/action area instead of always in the center.
*technically, 16:9 = 640x360, but for compression reasons it's better to use multiples of 16. So you're left with either 640x368 or 640x352 - if you want to be anal about it you can resize to 640x360 and then crop 4 pixels from the top and bottom, but nobody really cares/notices anyway. But wait, the borders should also be multiples of 16 so they can be cleanly encoded too. 56 (what the borders would be if you chose 640x368) isn't a multiple of 16, but 64 (which is what you use for 640x352) is.
(note: if this is fitting into a 0.9 PAR/720x480 project, then the 640's would be changed to 720's with no change to the height value - 720x352 instead of 640x352, and so on)
With Scintilla's comments about Premiere Pro in mind, think of Premiere Pro's action area (where the video appears) just like you'd think of the Canvas in Photoshop - an image can be larger than the canvas and moved around to get different parts of the image to fit inside of it. The same action in Premiere Pro would be achieved using the Motion tool to place the video in a different part of the canvas/action area instead of always in the center.
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog
-
- Joined: Fri Oct 15, 2004 1:44 pm
Re: Questions about the effects of Avisynth scripts
So basically I can either 1) crop my 848x480 files to 640x480, and then crop and resize my 720x480 files to 640x480 or 2)Add LanczosResize(960,480) Crop(120,0,-120,0) to my 848x480 files and keep my other clips at 720x480.
My goal really is to not have to use the resize calculator at all, since it really confuses the hell out of me. Also, if I choose option 1, when I resize and crop my 720x480 files using Crop(8,0,-8,-0) Spline36Resize(640,480), I still get a small black bar on top, which I don't know if I should just manually crop and then use the resize calculator, or just adjust it to crop(8,4,-8,0) slightly and keep Spline36Resize.
Here's what confuses me with the resize calculator for this - if I choose option 1: I manually crop the 720x480 files to get Crop(4, 2, -4, -0). I then check the resize calculator and see this:
http://img.photobucket.com/albums/v195/ ... x/avsp.jpg
Now, these resolutions make it so that it's in multiples of 16 in order to be compatible, correct? So is the resize calculator mainly for after editing, when it's been exported from premiere and ready to be encoded for the net? Otherwise I don't see how using the resize calculator fits in to the picture here when I want to edit it in premiere, because it'll give me some different resolution, like 720x544 for example in the screenshot. Thus this just leads me to want to do option 2 and edit at 720x480.
My goal really is to not have to use the resize calculator at all, since it really confuses the hell out of me. Also, if I choose option 1, when I resize and crop my 720x480 files using Crop(8,0,-8,-0) Spline36Resize(640,480), I still get a small black bar on top, which I don't know if I should just manually crop and then use the resize calculator, or just adjust it to crop(8,4,-8,0) slightly and keep Spline36Resize.
Here's what confuses me with the resize calculator for this - if I choose option 1: I manually crop the 720x480 files to get Crop(4, 2, -4, -0). I then check the resize calculator and see this:
http://img.photobucket.com/albums/v195/ ... x/avsp.jpg
Now, these resolutions make it so that it's in multiples of 16 in order to be compatible, correct? So is the resize calculator mainly for after editing, when it's been exported from premiere and ready to be encoded for the net? Otherwise I don't see how using the resize calculator fits in to the picture here when I want to edit it in premiere, because it'll give me some different resolution, like 720x544 for example in the screenshot. Thus this just leads me to want to do option 2 and edit at 720x480.
- Qyot27
- Surreptitious fluffy bunny
- Joined: Fri Aug 30, 2002 12:08 pm
- Status: Creepin' between the bullfrogs
- Location: St. Pete, FL
- Contact:
Re: Questions about the effects of Avisynth scripts
Then simple: don't use the resize calculator. It's obviously too confusing. I don't (and have never) used the kind of complex script generators that seem to get relied on. Not in VDubMod, not in AvsP, nowhere. Same goes for resize calculators - the closest I get to that are the VDMod_Resize filter for VDub/VDubMod and the Resize function in the newer versions of VDub which has more advanced AR functions built into it. Otherwise, I write all my scripts manually. I always stick to standard resolutions, so I always know what my output is going to be, and therefore can adjust accordingly.jediphoenix wrote:My goal really is to not have to use the resize calculator at all, since it really confuses the hell out of me. Also, if I choose option 1, when I resize and crop my 720x480 files using Crop(8,0,-8,-0) Spline36Resize(640,480), I still get a small black bar on top, which I don't know if I should just manually crop and then use the resize calculator, or just adjust it to crop(8,4,-8,0) slightly and keep Spline36Resize.
The fact you're getting two different crop values for the same video means the resize calculator is wrong. Don't put blind trust in a software program to do this for you.
Resize calculators are meant to preserve aspect ratio. That's it. They aren't meant to stick to using PAL or NTSC standard resolutions, although you can use them for that - if you know how. But more often than not, it's not worth the trouble. You can specify an exact aspect ratio which will then give you the output you need to resize to. Either you define the AR manually and then decide what proportion you want, or you define the AR by the video you've cropped and then decide the proportion. This is where you're getting confused, because once you've cropped the black away from a DVD source, the aspect ratio changes (very little if you're dealing with 4:3, but it changes), and the calculator is basing its calculations on this new aspect ratio. This is why I don't bother.Now, these resolutions make it so that it's in multiples of 16 in order to be compatible, correct? So is the resize calculator mainly for after editing, when it's been exported from premiere and ready to be encoded for the net? Otherwise I don't see how using the resize calculator fits in to the picture here when I want to edit it in premiere, because it'll give me some different resolution, like 720x544 for example in the screenshot. Thus this just leads me to want to do option 2 and edit at 720x480.
(And 720x540 is a 4:3 ratio - it is telling you that if you decide to use Square Pixels and a width of 720 pixels, you need to change the height to 540 in order to make the image look correct; 544 is simply the closest multiple of 16 to 540)
So let's start over, way back at the beginning. Try to forget all this confusing stuff the resize calculator is telling you and all this other weirdness.
A PC monitor has Square Pixels. A TV has rectangular pixels. The reason why 720x480 is considered 4:3 with a 0.9 pixel aspect ratio is because of this rectangular pixel issue on TVs - otherwise, 720x480 is actually 3:2, not 4:3; it's the display flagging in the MPEG-2 stream that makes it look correct when played back on a computer or on your DVD player. Square Pixels is considered as a 1.0 PAR, not 0.9. If you multiply 720 (the width) by 0.9, you end up with 648. 640x480 makes more sense when you realize that you aren't supposed to factor in those black bars on the 720x480 image. So if it was, say, 712x480 (i.e. the picture minus the 4-pixel black borders on the right and left, the most common way you'll find them these days), 712x0.9=640.8, which is just rounded down to an even 640*.
Cropping a few pixels off any of the four sides and resizing either back to 720x480 or 640x480 (or 848x480, if you're dealing with 16:9) isn't perceptually a lot, and people usually won't notice. Go ahead and do it.
Any aspect ratio is not intimately tied to a resolution. 4:3 means '4 units wide, 3 units high', 16:9 means '16 units wide, 9 units high'. All it takes to compute the end result of these ratios for any resolution is to have either the desired width, or the desired height. Height is generally what gets used because it determines the resolution standards (720p and 1080p, the HD standard resolutions, mean the images are 720 pixels high or 1080 pixels high; the width is then computed from the height depending on the aspect ratio given; 720p and 1080p are 16:9 resolutions in common parlance, so that means 1280x720 and 1920x1080 - if you divide 1920 by 16 and 1080 by 9 you should come up with the same number...namely, 120 in this case; likewise, 1280/16 and 720/9 both equal 80). You usually use the width value as the determiner when you need to fit a larger image or greater aspect ratio into a smaller one - like trying to fit a 16:9 image into a 4:3 frame or a 2.35:1 image into a 16:9 frame, which is why you have letterboxing in both cases. The width value is made the fit the frame, and then the height is computed from the width using the aspect ratio of the original image.
To use a resize calculator well, you have to think in these terms. This is why it's recommended to make sure all footage you work with is in Square Pixels, because it always looks correct on a PC monitor, which is what one normally uses while editing. Adjusting for the sometimes odd PAR values of the final product is then left for the part of the process immediately needing it (Premiere can use other resolutions than 720x480 while editing; as long as you make Premiere match the resolution of your source files, provided you've worked out these aspect ratio differences beforehand, then you can export properly and then do the necessary adjustments for the final encodes, whether that means hard letterboxing, anamorphic widescreen, or typical 4:3 'fullscreen' content). If you don't want to edit with Square Pixels, then you have to make sure to be constantly aware of what PAR the footage you're using is in, or else you'll get messed up proportions.
In basic terms, Square Pixels always look right on a PC monitor, and you have to either conform to Square Pixels (which means you're looking at a corrected image) or you have to mentally keep track of the difference between your source and Square Pixels. I used to edit at 720x480 and 0.9 PAR when I first started with Premiere, but I switched to only using Square Pixels while editing because I found it easier to follow.
Crop the small borders off entirely; use these values for Crop() in the script. As long as you weren't cropping a ton of pixels off (and no, crop(8,4,-8,0) is not a ton), then resize to 640x480 for Square Pixels or 720x480 for 0.9 PAR. No one will know or care about the difference. To make the 16:9 stuff fit, you can do several things:
A) Crop the files from 848x480 to 640x480 for Square Pixels.
B) Resize from 848x480 to 960x480 and crop to 720x480 for 0.9 PAR.
C) Import the 848x480 files directly into Premiere Pro and use them on the 640x480 Square Pixels project you've created. Premiere will do the cropping. You can adjust the video on the canvas Premiere gives you to do uneven cropping, in case you want to keep some of the picture information on one or the other side (you can do this in AviSynth in point A or B, too, but it takes more work and should be done on a clip-by-clip basis).
D) Resize the 848x480 files to 960x480 and import into Premiere Pro to use with your 720x480 0.9 PAR project. The same stuff I said about moving the video around the canvas in point C applies.
I feel like I'm talking in circles and repeating myself. Aspect Ratio is all about making footage look correct. This is what you should be striving for. To know exactly how to do this, you need to know what it's being displayed on.
If you care about it looking correct during the editing phase, use Square Pixels and 640x480 for 4:3 and 848x480 for 16:9, and make sure that your project settings in Premiere match either 640x480 or 848x480 and use Square Pixels as the PAR (and if you want to mix the two, either crop 848x480 down to 640x480 or move it around the 640x480 canvas in Premiere). After you've exported from Premiere, you can resize the finished product back to 720x480 and encode to MPEG-2 for the convention.
If you only care about the end equipment the convention uses (which would be a TV/DVD player), then use 720x480 for 4:3, 960x480 for 16:9 and have Premiere project settings set to use 720x480 or 960x480 and 0.9 as the PAR (and if you want to mix the two, either crop 960x480 down to 720x480 or move it around the 720x480 canvas in Premiere). After you've exported from Premiere, you can give the video right to the MPEG-2 encoder, since it's already at the right resolution for the TV/convention.
*In the real world, this actually works in reverse - 640x480 is the base because if a signal is 4 units wide by 3 units tall and has a height of 480 pixels, it has a width of 640. The PAR difference of a TV is then factored in and the image is made to conform to TV standards.
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog
-
- Joined: Fri Oct 15, 2004 1:44 pm
Re: Questions about the effects of Avisynth scripts
Thanks - sorry to be a bother, I don't mean to make all you guys repeat the same stuff over and over.
One last thing, I promise.
I have ONE of my 848x480 clips that needs to be cropped slightly off the top. Since I wish to do the LanczosResize(960,480) Crop(120,0,-120,0) option from above, and since it needs to be in multiples of 16, is it possible to do LanczosResize(960,496) Crop(120, 16, -120, -0)? This would give me 720x480 and get rid of that black bar on top that needs to be cropped, but I'm just curious if I'm thinking this through correctly or am totally off base with the multiples of 16 thing.
One last thing, I promise.

I have ONE of my 848x480 clips that needs to be cropped slightly off the top. Since I wish to do the LanczosResize(960,480) Crop(120,0,-120,0) option from above, and since it needs to be in multiples of 16, is it possible to do LanczosResize(960,496) Crop(120, 16, -120, -0)? This would give me 720x480 and get rid of that black bar on top that needs to be cropped, but I'm just curious if I'm thinking this through correctly or am totally off base with the multiples of 16 thing.
- Scintilla
- (for EXTREME)
- Joined: Mon Mar 31, 2003 8:47 pm
- Status: Quo
- Location: New Jersey
- Contact:
Re: Questions about the effects of Avisynth scripts
I've been hesitant to say anything so far about the prospect of cropping a black bar off the top and/or vertically resizing, because it's a tricky thing. You generally don't want to resize your image vertically in the prep stage unless you are ABSOLUTELY SURE that there is no combing whatsoever in your footage (all interlacing has been removed), and even then it probably isn't optimal due to the way the original image was encoded on the DVD in fields.
In fact, I'm finding in my current project that my Code Geass R1s have a slight black bar across the top, and I'm doing my best to simply ignore it. I'll probably end up cropping 4 pixels off the top of the finished product and then replacing it with a black border of 4 pixels to get it back to 480 lines, so as to make everything easier later on down the line.
In fact, I'm finding in my current project that my Code Geass R1s have a slight black bar across the top, and I'm doing my best to simply ignore it. I'll probably end up cropping 4 pixels off the top of the finished product and then replacing it with a black border of 4 pixels to get it back to 480 lines, so as to make everything easier later on down the line.
- Qyot27
- Surreptitious fluffy bunny
- Joined: Fri Aug 30, 2002 12:08 pm
- Status: Creepin' between the bullfrogs
- Location: St. Pete, FL
- Contact:
Re: Questions about the effects of Avisynth scripts
480 is a multiple of 16 (16x30=480). If you crop something slightly from 480, then just resize back to 480. For example:jediphoenix wrote:I have ONE of my 848x480 clips that needs to be cropped slightly off the top. Since I wish to do the LanczosResize(960,480) Crop(120,0,-120,0) option from above, and since it needs to be in multiples of 16, is it possible to do LanczosResize(960,496) Crop(120, 16, -120, -0)? This would give me 720x480 and get rid of that black bar on top that needs to be cropped, but I'm just curious if I'm thinking this through correctly or am totally off base with the multiples of 16 thing.
Crop(120,2,-120,0).Lanczos4Resize(720,480)
The Crop would take it down to 478, the resize goes back to 480. If you took it up to 496, then the proper width would be approximately 992 (I think).
Basically, mod16 only requires the resolution to be a multiple of 16. It only gets more complex if you want to letterbox something, because you can save more bitrate on the compression step if the borders themselves fully occupy their own macroblocks (a macroblock can indeed be of varying sizes, especially with newer video compression formats, but the most established size is 16px x 16px, so if both borders and real video are multiples of 16, then the encoding app doesn't have to work as hard with the separation between the two). It's not necessary to make sure everything adheres to multiples of 16, it's just a good habit to get into and provides a more optimal encode.
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog