Log in

View Full Version : Cropping and Resizing m2v -> wmv


tominator
9th August 2006, 13:43
Hello.
I am having great trouble with this so I would be very thankful for any comments at all.

I use DVD-Decrypter to rip an m2v- and an ac3-file from a DVD. More often than not the m2v-file has letterboxing which I want to remove without changing the AR.

I use Canopus ProCoder 2.0 to convert my files to WMV-streams with width 640. Canopus has a videofilter called "crop" that I have been trying to use but either I get files with strange AR or files with a lot of the picture taken from left and right (text which appears on screen can be cut off and so on).

Could someone please guide me here? Most of my DVDs are 1.33:1, 2.35:1, 1.78:1 and 1.85:1.

Question1:
How can I make my WMV-streams (640 width) without letterboxing but with 16:9/4:3 AR (depending on source)?

Question2:
Ive been reading a whole lot about this and an expression I see a lot is "resize and crop". Where does the resizing come in the picture? How do I know what to resize to?

Question3:
Probably doesn't have anything to do with this but could someone explain offset?

Skelsgard
11th August 2006, 10:57
Question1:
How can I make my WMV-streams (640 width) without letterboxing but with 16:9/4:3 AR (depending on source)?


If what u mean is to make the video display with the "proper" DAR, then u only need to set the DAR specified by the movie without the letterboxing. I.e. if a have a 2.35:1 movie in NTSC, it means that after Iīve cropped the letterboxed portion, letīs say 58 pixels from top and bottom ([480 - 364]/2), the remaining video must be set to 2.35:1.

Question2:
Ive been reading a whole lot about this and an expression I see a lot is "resize and crop". Where does the resizing come in the picture? How do I know what to resize to?

Resizing is simply changing the size of the video to a desired one. Cropping is to cut out from the frame a specific number of columns or rows (or both) of pixels.
In the example above, if my source (2.35:1) is 480 pixels height, and of those, 58 pixels on the top and 58 pixels on the bottom are black, then I need to crop those pixels to get rid of them since they represent no info (no actual video).
Generally, the croping comes first and the resizing after (not mandatory, is just easier to calculate what the final size should be when the frame is clean (using its full size) then to calculate the size it must be so that u can crop pixels later).

This 720 x 480 image has a 364 actual video height, the rest (116 pixels) is the letterboxing. Since it is not needed, it can be cropped.
http://img154.imageshack.us/img154/7700/235in169zv0.jpg

Then uīll get this:
http://img301.imageshack.us/img301/1565/235croppedmm4.jpg

But the file is not 2.35:1, is 720 / 364 = 1.98.
So, u resize it to a 2.35:1 DAR. Letīs say 696 x 296. And get this.

http://img301.imageshack.us/img301/8277/235resizehi0.jpg



Offset.
http://en.wikipedia.org/wiki/Offset_%28computer%29

tominator
14th August 2006, 00:08
sweet, thanks a lot.

CWR03
14th August 2006, 07:34
Nice examples and explanations, Skelsgard, however your pics have a lot of strange vertical lines in them.

Skelsgard
14th August 2006, 09:07
CWR03, those are the puppet strings :D
(for a second there, I couldnīt understand what u meant)

Tominator, the resolution used in the last picture as an example was chosen for being a fairly accurate 2.35:1 example, yet is not mod16. MPEG encoders work better with mod16 resolutions (donīt know if ALL mpeg versions (1, 2, 4 ASP, AVC) do, someone correct me on this if wrong).

Cheers

tominator
22nd August 2006, 03:02
Tominator, the resolution used in the last picture as an example was chosen for being a fairly accurate 2.35:1 example, yet is not mod16. MPEG encoders work better with mod16 resolutions (donīt know if ALL mpeg versions (1, 2, 4 ASP, AVC) do, someone correct me on this if wrong).


By mod16 you mean the following right?

1,78:1 = 640x360
1,85:1 = 640x352
2,35:1 = 640x272

Skelsgard
22nd August 2006, 03:29
Exactly, any number divisible by 16.

DarkZell666
5th September 2006, 23:16
except that 640x360 isn't divideable by 16.

360/16 = 22,5

RedHouse
11th September 2007, 03:59
I know this is an old thread but... it happens to be just the opposite of what I need to do, so to save some typing....

I have some old clips taken from my old camcorder, which I made into some video clips a long time ago (before home burnable DVD's).

And of course now I want to get them onto DVD's. I have resolutions like 320x240 which wehn resized int TMPGEnc to say 720x480 they make people look squat (short-fat)

If I resize the 320x240 clips to 640x480 is there then a way to ADD letterbox-like blackspace to make it a full 720x480 DVD size resolution?

cross_syd
11th September 2007, 04:37
i remember software like imtoo (google for "imtoo") let you do it, but its quality and codec selection sux
i suggest using virtualdub, convert it to size you want, then crop it

Skelsgard
11th September 2007, 05:41
720x480 or 720x576 are the frame sizes of DVD MPEG-2 video but the DAR (Display Aspect Ratio) is what will set how the frame will look (will be displayed).
Usual DARs are 16:9 and 4:3.
As your movie is 4:3 AR (320x240) you need to to set the DAR to 4:3 when encoding to MPEG-2 in TMPGEnc.

Cheers

RedHouse
13th September 2007, 03:48
Is there any software that will let me take my 320x240 clip, add black (or other color) border around it so it's total size is 720x480 but clip is still 320x240 inside the added border? like so....

http://users.isp.com/brad_anne/320x240_with_added_border_making_720x480.jpg

My old clips look real crappy when expanded to 720x480, I didn't save them with enough resoulution (or whatever we call it) originally and I don't have the old camcorder tapes anymore to re-do them, so I'm stuck trying to salvage what I have and make it do.

If viewed at the 320x240 res the clip doesn't look bad, but if I resize it in TMPGEnc to 720x480 (to include on a DVD burn) it looks REALLY crappy.

Skelsgard
13th September 2007, 04:09
You can do that with all video editing software.
The easiest fastest way for me is with Avisynth and HCenc.
Avisynth will allow you to resize the 320x240 to 360x240 and then add the borders.
The script should look like this:

Avisource("your_file.avi", audio=false)
BicubicResize(360,240)
AddBorders(180,120,-180,-120)
ConvertToYV12()

Then you send this script to HCenc for MPEG-2 encoding.

I've seen some really high quality upsizing with functions like those in MVTools.
You should check that out too to create full frame 720x480 video.

Later

RedHouse
13th September 2007, 04:41
Ah! when you mentioned AviSynth it rang a bell (idea) so I dug out an old USB HDD which has a bunch of utilz stored on it, I got into the 'ol VirtualDub and found that the "Resize filter" allows this very operation.

Thanks for the quick reply.

BTW, VirtualDub has these types of resize sampling:

Nearest Neighbor
BiLiner
BiCubic
Precise BiLinear
Precise BiCubic (A=.075)
Precise BiCubic (A=.060)
Precise BiCubic (A=1.0)
Lanczose3

which would yield the truest to the original clip?

Skelsgard
13th September 2007, 10:48
There's not actually a "truest" one but for example, Lanczos3 is sharper than Bicubic, and Bilinear and Nearest Neighbor are not what you're looking for.
In AviSynth you have BicubicResize(), LanczosResize() (Lanczos3), and Lanczos4Resize(), the last one is sharper than Lanczos3.
I would just use Bicubic. If you want a little sharper, use Lanczos3 (in either VirtualDub or Avisynth)

Later