Questions about the effects of Avisynth scripts

This forum is for questions and discussion of all the aspects of handling and cleaning up your footage with Avisynth.
Locked
jediphoenix
Joined: Fri Oct 15, 2004 1:44 pm
Org Profile

Questions about the effects of Avisynth scripts

Post by jediphoenix » Sat Mar 13, 2010 11:05 pm

I'm not sure if this is entirely the correct forum, but it deals mostly with what I'm doing in Avisynth.
I'm currently making an AMV for convention purposes, thus I want it at 720 x 480.

1)Now, when I look at the amv guide talking about Aspect Ratios, it recommends: Crop(8,0,-8,-0) Spline36Resize(640,480). I know that 640x480 is for online distribution, so I assume the guide's recommendation is based on putting it online and not for a convention?

In AvsP, I did the Crop Editor and then Resize Calc to get 704x528 with the lowest % of error. The thing is, I still have to scale it to fit - so is the point of doing the resizing to make sure that once I import the cropped video into Premiere, that it will scale correctly to 720x480? Does that mean it doesn't matter whether I do the recommended way (640x480) or use the Resize Calc myself to get 704x528?

2)After de-interlacing using AMVDeint(mode=1), the guide makes it seem like making it progressive puts it at 23.976fps, but upon opening it in Premiere, it says it's 29.97. Is it supposed to change to 23.976 after de-interlacing, and does it matter given how Premiere can edit in either?


Thank in advance, hope I wasn't too confusing. :|

User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Re: Questions about the effects of Avisynth scripts

Post by Scintilla » Sun Mar 14, 2010 12:35 am

I'm going to assume that you're using a 4:3 (fullscreen) source.
jediphoenix wrote:I'm not sure if this is entirely the correct forum, but it deals mostly with what I'm doing in Avisynth.
I'm currently making an AMV for convention purposes, thus I want it at 720 x 480.

1)Now, when I look at the amv guide talking about Aspect Ratios, it recommends: Crop(8,0,-8,-0) Spline36Resize(640,480). I know that 640x480 is for online distribution, so I assume the guide's recommendation is based on putting it online and not for a convention?
Yes. That said, though, there's nothing wrong with editing at 640x480, exporting at 640x480, and then resizing the finished export to 720x480 for the convention version only. Or you could just keep it at 720x480 the whole way (the "Keep DVD Resolution and PAR" option on the aspect ratios page). It's all a matter of your own preference.
jediphoenix wrote:In AvsP, I did the Crop Editor and then Resize Calc to get 704x528 with the lowest % of error. The thing is, I still have to scale it to fit - so is the point of doing the resizing to make sure that once I import the cropped video into Premiere, that it will scale correctly to 720x480? Does that mean it doesn't matter whether I do the recommended way (640x480) or use the Resize Calc myself to get 704x528?
What do you mean, you have to scale it to fit? You can create a Premiere project with whatever resolution you want, and you should be setting it to be equal to the resolution of your source -- there should be no scaling going on.
Also, I don't know why you would want to resize to 704x528. If your goal is to get it to square pixels, it's safer to go the 640x480 route, as then you're only resizing horizontally rather than vertically.
jediphoenix wrote:2)After de-interlacing using AMVDeint(mode=1), the guide makes it seem like making it progressive puts it at 23.976fps, but upon opening it in Premiere, it says it's 29.97. Is it supposed to change to 23.976 after de-interlacing, and does it matter given how Premiere can edit in either?
Deinterlacing alone doesn't reduce the frame rate. You're thinking of inverse telecine (IVTC). The AMVapp contains a separate function for that, AMVIVTC() (more on that here).
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

jediphoenix
Joined: Fri Oct 15, 2004 1:44 pm
Org Profile

Re: Questions about the effects of Avisynth scripts

Post by jediphoenix » Sun Mar 14, 2010 12:49 am

ah, ok. Much thanks.

jediphoenix
Joined: Fri Oct 15, 2004 1:44 pm
Org Profile

Re: Questions about the effects of Avisynth scripts

Post by jediphoenix » Fri Mar 19, 2010 12:46 am

Sorry, but I have another question about aspect ratios that is still somewhat confusing to me. Currently what I plan to do is leave edit my clips at 720x480. Now, I have very slight black edges as I view then in AvSP, and can get rid of them with the crop editor putting in the Crop(2, 2, -2, -0) puts the ratio at 716x478. Is it therefore a good idea to just add LanczosResize(720,480) after that instead of going into the resize calculator? Or I'm also considering just editing without any cropping and then after exporting my final video from Premiere, going in to AvSP and cropping and then resizing back up to 720x480.
I'm just confused by the resize calculator and the actual point of using it after cropping if I have to have my video at 720X480 (or 640x480, etc), since the resize calculator will give me a weird number like before (704x528).

jediphoenix
Joined: Fri Oct 15, 2004 1:44 pm
Org Profile

Re: Questions about the effects of Avisynth scripts

Post by jediphoenix » Fri Mar 19, 2010 1:00 am

And to add, since the crop tool and resize calculator are mentioned in the post-production page of the guide, I assume it's better to not crop and resize before editing? Thus I would leave all my clips as is (720x480) without cropping, and then after exporting from Premiere would then crop(2,2,-2,0)and resize to 720x480 again?

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Gallarate (VA), Italy
Contact:
Org Profile

Re: Questions about the effects of Avisynth scripts

Post by mirkosp » Fri Mar 19, 2010 3:51 am

Cropping and resizing before or after editing is a choice up to you, really. I personally do it before, Zarxrax and others do it after, either way is fine. As for the calculator, as long as the amount you crop is small (which is true in your case) you don't really need to use it. You can just resize back to 720x480. The AR difference will be minimal, and unless comparing with the original source no one would be able to tell that the aspect ratio isn't 100% correct, and no one would actually care. It starts to become important to use the calculatore when you have bigger numbers like say Crop(16,6,-10,-4). At that point you can use the resize calculator, or you could calculate the AR manually. What I do personally when I need to set the AR perfectly correct, is doing the math to get the DAR, then resize back to 720x480, edit at that, and then flag the AR of the proper DAR. For example, what I had to do with a 16:9 DVD:

Code: Select all

#SAR: 1.500
#DAR: 1.778
#PAR: 1.185
Crop(2, 12, -2, -8)
#SAR: 1.557
#DAR: 1.845
#PAR: 1.185
spline36resize(720,480)
#SAR: 1.500
#DAR: 1.845
#PAR: 1.230
And here to explain:
DAR = PAR * SAR
DAR is the Display Aspect Ratio, the size that the video gets viewed at in playback.
PAR is the Pixel Aspect Ratio, the size that the pixels should be to view the stored image properly. It can also be called Sample Aspect Ratio, as it in fact it specifies the ratio of a sample (a pixel) in the video.
SAR is the Storage Aspect Ratio, the size that the image is stored at when saved. Don't get it mixed up with the Sample Aspect Ratio! :nono:
The first 3 info are the standard info of a 16:9 DVD. When you crop, the DAR and SAR change, but the PAR stays the same. So you can just copy the PAR. Next you can easily calculate the SAR, as all it takes is doing width/height. 720/480 is 1.500, but once cropped I got 716x460, so 716/460 = 1.557 (rounded up, of course). Now that you have both PAR and SAR, you can just do the math above and get the DAR (in this case 1.845).
Next, we resize back to 720x480. Doing this will keep the DAR the same, but will change the SAR and the PAR. Again, the SAR can be easily calculated again, and we know that 720/480 is 1.500. PAR now can be calculated with an inverse function of the one above: PAR = DAR / SAR. So we get 1.230 of PAR.
You keep this info written down, and just edit 720x480. Then, when you encode, you can set the aspect ratio flag. Depending on what you actually use to encode, you might need to specify the PAR or the DAR. x264 asks you for the Sample Aspect Ratio, and we know that it is just another name for the Pixel Aspect Ratio. It asks you for the x:y amounts. The max amount that either x or y can assume here is 250, and you need integer numbers. The number we got before is the X value assuming that the Y is 1 so to get integer numbers, you can just multiply by 1000 and so X:Y would be 1230:1000 in this case. We need to get it under 250, which we can do by simplifying. It's pretty easy in this case, as we can just do /10 on both and get a 123:100, but in other cases it can be harder and you might have to round a bit to get it down. Rounding a bit here and there won't really harm the aspect ratio as long as you keep enough decimals along the way, and 3 is a fair amount, since we're still talking about pixels, which aren't decimal in size. :)
Again, I wrote this up in the case you needed to crop in different amounts between width and height (a lot on one, few in the other, or vice versa). If the cropping amounts are similar, you can just think of it as if the DAR hasn't changed at all, as doing the whole math for a couple pixel difference isn't really worth it for anymore. :wink:
Also, one thing to keep in mind is that some DVDs have an actual area of 704x480, with 8 black pixels on the left and 8 black pixels on the right. In this case, the pixels are just an overscan, and are not meant to be considered for the math. You just crop them, then save your video as 704x480 and set the AR of your need (you can easily pick standard AR to flag in zarxgui from the pulldown box in the Sample Aspect Ratio part). The guide doesn't go over this too well, as it just says to always crop 8 from left and 8 from the right, but this isn't always true: some DVDs have the overscan, others don't. You just need to check the amounts of the black. If you're getting some huge borders all around (ghibli stuff has like 16 pixel every side...) then assume that you have overscan. It can help to crop the overscan, and then start doing the other crops and math at that point, with the SAR calculated from the 704x480.
Hopefully I was able to get it down easy enough, but if all this sounds too confusing... then just disregard, I guess. :P
Image

jediphoenix
Joined: Fri Oct 15, 2004 1:44 pm
Org Profile

Re: Questions about the effects of Avisynth scripts

Post by jediphoenix » Fri Mar 19, 2010 1:54 pm

Well, I think I somewhat understand most of that. :book:
Most of my clips are cropped at the Crop(2, 2, -2, -0), though one or two are at Crop(8, 2, -8, -0), but it doesn't appear to have a noticeable difference once I go back to 720x480.
I'm currently using LanczosResize, though is it better to do Spline36Resize?

User avatar
Enigma
That jolly ol' bastid
Joined: Sat Mar 07, 2009 3:55 pm
Status: Free
Location: California
Org Profile

Re: Questions about the effects of Avisynth scripts

Post by Enigma » Fri Mar 19, 2010 2:42 pm

As far as i know it's the same thing, Try both of them.

Take pics
Compare
?????
Profit.

jediphoenix
Joined: Fri Oct 15, 2004 1:44 pm
Org Profile

Re: Questions about the effects of Avisynth scripts

Post by jediphoenix » Fri Mar 19, 2010 3:23 pm

One thing I'm noticing with some of my clips is that they are 16:9 at a resolution of 848x480. The guide recommends resizing to 640x480. Now this is somewhat frustrating as my other clips are at 720x480. I've tried resizing the 848x480 files to 720x480 and 640x480 and they look slightly squished either way (the 640x480 even moreso). Is there something I'm missing here or will the 16:9 files always look slightly squished, regardless of whether I resize to 720x480 or 640x480?

User avatar
Scintilla
(for EXTREME)
Joined: Mon Mar 31, 2003 8:47 pm
Status: Quo
Location: New Jersey
Contact:
Org Profile

Re: Questions about the effects of Avisynth scripts

Post by Scintilla » Fri Mar 19, 2010 4:26 pm

I can't think of a situation in which you would ever want to resize a 16:9 clip to 640x480. 720x480 is fine if ALL of your sources are anamorphic 16:9 and you plan to resize or set AR flags appropriately for distribution, in which case you'll just have to deal with the squishedness during editing.

But, when you say "some of my clips", do you mean that you've also got sources that are 4:3? If so, you need to figure out whether you want your video to be 4:3 or 16:9 and what resolution you want to edit at, and then resize some of the clips accordingly. Here is the EADFAG page that deals with that.
In short, you can't just take 4:3 clips and 16:9 clips and resize them both to the same resolution without doing some major cropping. If some sources look squished but others look fine (or worse, stretched), then you have a problem.

I should mention that, if the version of Premiere you're using is Premiere Pro, then you don't need to crop the sources that you blow up when using this method.
For example, if you want to make your video 4:3 and edit at 640x480 (so square pixels), and you therefore resize all your 16:9 sources up to 848x480, you DON'T need to crop the edges off to get them back to 640x480. This is because Premiere Pro does not resize clips to fit the project resolution unless you tell it to: you can just import the 848x480 clips and use them as is. That way, instead of always losing the leftmost 104 pixels and the rightmost 104 pixels, you can use the Motion effect to move each clip left or right to decide just which part of each scene you want to lose. I used this method myself to work the The End of Evangelion footage into this 4:3 video.
ImageImage
:pizza: :pizza: Image :pizza: :pizza:

Locked

Return to “AviSynth Help”