PDA

View Full Version : can I crop first and then render?


canoner
8th May 2003, 19:50
if I have a 2.35:1 and I want only 1.8:1, can I crop off both sides and then render? I think this will give better quality because no bits are wasted on areas that I won't view. I use TMPG 2.51 the lastest dvd2svcd.

RB
8th May 2003, 21:54
No, this would result in video with non-standard resolution.

jsoto
9th May 2003, 00:41
Hi canoner,

May be RB does not understand your question or may be I, but...

If you are asking how to encode a SVCD loosing part of the sides of the screen and keeping the aspect ratio (so the picture will be a little bit higher), you can easily do it using avisynth commands in dvd2svcd (and you can save them in dvd2svcd.ini for the future…)

Example:
Source DVD: MPEG aspect ratio 16:9, movie 2,35:1 coded with borders (PAL standard 720x576 )
Destination SVCD: Aspect ratio 4:3 (PAL standard 480x576)

Loosing 10% (5% per each side):
0=BicubicResize(528,476,^b_value,^c_value)
1=Crop(24,0,480,476)
2=AddBorders(0,50,0,50)
^b_value=0.00
^c_value=0.75

Loosing 15% (7,5% per each side: 42/564):
0=BicubicResize(564,490,^b_value,^c_value)
1=Crop(42,0,480,490)
2=AddBorders(0,43,0,43)
^b_value=0.00
^c_value=0.75

Resizing must be proportional to 480x432 (432=576-2x72)
Horizontal resolution after crop must be 480
Borders should be added until 576 lines

Hope it helps

canoner
9th May 2003, 07:27
Originally posted by jsoto
Hi canoner,

May be RB does not understand your question or may be I, but...

If you are asking how to encode a SVCD loosing part of the sides of the screen and keeping the aspect ratio (so the picture will be a little bit higher), you can easily do it using avisynth commands in dvd2svcd (and you can save them in dvd2svcd.ini for the future?

Example:
Source DVD: MPEG aspect ratio 16:9, movie 2,35:1 coded with borders (PAL standard 720x576 )
Destination SVCD: Aspect ratio 4:3 (PAL standard 480x576)

Loosing 10% (5% per each side):
0=BicubicResize(528,476,^b_value,^c_value)
1=Crop(24,0,480,476)
2=AddBorders(0,50,0,50)
^b_value=0.00
^c_value=0.75

Loosing 15% (7,5% per each side: 42/564):
0=BicubicResize(564,490,^b_value,^c_value)
1=Crop(42,0,480,490)
2=AddBorders(0,43,0,43)
^b_value=0.00
^c_value=0.75

Resizing must be proportional to 480x432 (432=576-2x72)
Horizontal resolution after crop must be 480
Borders should be added until 576 lines

Hope it helps


Hi Jsoto,

I think this might be what I want. Just to clarify it: My purpose is to increase the quality of rendered video given the space limit. For example, if I can get CQ=90 without croping (90 min DVD on 2 CD), I should be able to get higher CQ with croping on the same job, right?

One more thing: I am using NTSC 480x480, and I haven't figured out how I should change the numbers in your suggestion. I mean, it is not that clear how you calculated those numbers. Can you elaborate a little bit? Thanks a lot.

RB
9th May 2003, 11:42
Cropping from both sides of a 2.35:1 movie will not give you better quality, actually, it will require more bitrate. Reason is, cropping from the sides and still maintaining aspect ratio means you are "zooming" into the motion area, resulting in a larger motion area. That is, the more you crop from the sides, the less borders you can add on top and bottom and it's the black borders that actually require little bitrate (you can see this in jsoto's example). The effect will be visible if you use my AutoFitCD plugin (see sig). Install it, follow the instructions and when in the preview window with the FitCD controls at the bottom, use the vertical resize up/down arrows to increase the vertical resolution.

canoner
9th May 2003, 17:51
Originally posted by RB
Cropping from both sides of a 2.35:1 movie will not give you better quality, actually, it will require more bitrate. Reason is, cropping from the sides and still maintaining aspect ratio means you are "zooming" into the motion area, resulting in a larger motion area. That is, the more you crop from the sides, the less borders you can add on top and bottom and it's the black borders that actually require little bitrate (you can see this in jsoto's example). The effect will be visible if you use my AutoFitCD plugin (see sig). Install it, follow the instructions and when in the preview window with the FitCD controls at the bottom, use the vertical resize up/down arrows to increase the vertical resolution.

RB, that makes sense, so croping will likely to yield a lower CQ after croping, with other settings unchanged. There is just one more twist. What I do now with rendered svcd from 2.35:1 format is: I use the 2X zoom on the DVD player (APEX 2500) to view it on TV! So the image is digitally blown up. Do you still think by croping I will get worse than now?

jsoto
9th May 2003, 19:20
Hi canoner,

I think RB has already answer all your doubts, so I really do not have anything to add, except I also recommend you to use his tool (thanks for all of them, toolman!)

Anyway (for your information, may be useful for other users), I will try to explain how the correct numbers of resizing/cropping must be calculated (I am not sure if my english will be enough to do it clearly...)

Well, these are your data (I hope):
Source NTSC DVD 720x480 resolution, aspect ratio 16:9
Destination NTSC SVCD 480x480 resolution, aspect ratio 4:3

To fit the movie without any deformation, you need to add borders at the top and the bottom, but how many lines?
An aspect ratio 16:9 is the same than 4:2,25, so you must fill with borders the rest, just until the “3” of 4:3. That is, you should fill 480*0,75/3, which gives you 120 lines (60 at the top and 60 at the bottom).
So, you have to:
1st) Resize to 480x360 (keep the aspect ratio, fit the movie in a 16:9 window inside the 4:3 screen)
2nd) AddBorders (0,60,0,60) (to fill the lines until 480)

To “zoom” the movie 10% :
a) First, the resizing should be 10% higher in both directions, so it will be 528x396. This will keep the aspect ratio, but the resulting video is 10% higher in horizontal and in vertical. The avisynth command is BicubicResize (528,396)
b) Crop only in horizontal, (eliminate 528-480=2x24 pixels), but do not crop anything in vertical, so the avisynth command is Crop (24,0,480,396)
c) Fill with borders from 396 up to 480 lines. Addborders (0,42,0,42)

I use the 2X zoom on the DVD player (APEX 2500) to view it on TV!
Using the 2x zoom of your player is the worst situation, you are loosing a lot of quality: the original SVCD is 480x480, but, in fact, you are only seeing 240x240, because your player have only this information to do the zoom.

Regards

EDIT:
A speed optimization (but negligible, I think) could be done if you crop first and resize after, but the parameter calculations are a little bit more complex and not so clear.

canoner
9th May 2003, 21:45
I downloaded the tools RB provided, and they are handy! The only glitch is TMPG 2.51 tell me avisynth script not supported. I guess I have to add "converttoRGB24()" somewhere to make it work. I will try that later.

Jsoto, you are right. 240x240 is low. However, without the zooming, 480x480 actually give me only 480x240 because the other half is black borders. It may look smoother without zooming, but the image is a bit too small. When I get the CQ close to 100, it looks pretty good even after zooming, as good as VHS to my eyes. If the CQ is lower than 80, than the digital noice becomes unberable after zooming.

Thanks to both of you for your kind help.

RB
12th May 2003, 21:32
DVD2SVCD should add the ConvertToRGB() automatically if you set it up to use TMPGEnc for the encoding, probably a bug in DVD2SVCD. Are you using AVISynth 2.5?

canoner
13th May 2003, 06:47
I manually edit script and add that line in. It works fine now.

canoner
13th May 2003, 06:59
BTW, I think it is worth the effort. With 2.35:1 movies, the SVCD without croping looks just too small on TV to my eyes. Half of the screen is black. With croping, I can get a much bigger view area. The first movie I tried, CQ droped from 93 to 90 after cropping, but the final viewing quality is much much better, at least to me. I think this will be my standard procedure for 2.35:1 movies from now on. THanks all for your help.