View Full Version : Crop and resize
simon42509
5th April 2008, 18:45
I put a post on DVDHELP to try to find out how to convert my home video into widescreen and someone suggested avisysnth but I've looked and I'm not technical so don't really know where to start. Can anyone help me please?
I've got a load of video I captured from a pseudo widescreen camcorder. I say pseudo becuase its really still 4:3 with black bars in the picture top and bottom. So when it plays on a PC I get the black bars top and bottom and also left and right because the PC thinks its 4:3.
So I need to do 2 things:
1) Make the PC think its 16:9
2) Crop the black bars of the top and bottom
Can anyone help me please?
I've posted an example of the video on humyo.com at the following link: - Sorry I've just amended this so it may work now :)
http://www.humyo.com/F/7731-131138339
Thanks
unskinnyboy
5th April 2008, 23:05
Although the picture inside is 16:9, the frame is 4:3, and there are already black bars all around the picture. What's your intended output format? Is it a DVD or an AVI or something else?
thetoof
6th April 2008, 00:07
Only for deinterlacing & cropping, use this:
mpeg2source("COMP_0405_1835.d2v")
mcbob().selecteven()
crop(10,66,-10,-80)
You need:
- DGIndex to create the d2v
- MCBob + all necessary plugins
I don't have the time atm to explain all this, so you'll have to search... hope it helped!
Oh, and you'll also need additional post-processing (at least denoising & sharpening)
simon42509
6th April 2008, 20:19
Thanks
I will be playing it on the PC mostly but I'd like to have a go at making DVD's as well.
thetoof
6th April 2008, 22:16
For DVDs, this'll help: http://www.aquilinestudios.org/mpegforcons.html
unskinnyboy
10th April 2008, 03:09
For DVDs, this'll help: http://www.aquilinestudios.org/mpegforcons.htmlWhat's the point in giving a newbie a guide which deals exclusively with NTSC, when his source is PAL?
@simon42509, Apart from what thetoof posted in post #3, for an AVI, you would need to resize the video to a MoD16 (divisible by 16) resolution. For a DVD, you'd also need to add additional borders using the AddBorders(..) function to make it 720x576.
You need to do some serious reading up.
Blue_MiSfit
10th April 2008, 03:44
You need to do some serious reading up.
QFT! But do feel free to ask questions, and don't hesitate to try everything!
~MiSfit
thetoof
10th April 2008, 04:04
My bad! I was in a rush when I posted, so I didn't check if it was PAL or NTSC.
@simon42509
After cropping, your video is 700x430, which means it has an aspect ratio of about 1.63:1
For DVDs, I suggest using this to keep the original aspect ratio when watching it on a 4:3 display
spline36resize(720,448)
Addborders(0,64,0,64)
You could also try, for 16:9 display, (the following is a BIG guess, I don't even know if it could work) using only spline36resize(720,576) with no addborders and, when encoding to DVD, use an anamorphic flag to make it appear as 944x576 (1.64 AR).
For PC, only spline36resize(720,448) is enough (or any other values where x/y= about 1.63 and both are mod16, like 704x432).
g-force
10th April 2008, 16:16
944x576 ...704x432).
No! :eek: Material that will end up back on DVD someday should always have a horizontal resolution of 720.
-G
thetoof
10th April 2008, 21:12
Err... my suggestion for the DVD encode was spline36resize(720,448) + Addborders(0,64,0,64) and I only said that with the use of an anamorphic flag during DVD encoding, you could maybe use the full 720x576 resolution (1.25 Aspect Ratio), but with a 1.64 Display Ratio during playback.
Also, my post was split in two parts "for DVD" and "for PC"
The 704x432 suggestion was in the "for PC" section, which implicitly means that the target file type will be avi, mkv, mp4 or any other container for PC. I will be playing it on the PC mostly but I'd like to have a go at making DVD's as well.
That's why I gave two options: script for DVD encoding & script for PC.
unskinnyboy
10th April 2008, 22:43
Err... my suggestion for the DVD encode was spline36resize(720,448) + Addborders(0,64,0,64) and I only said that with the use of an anamorphic flag during DVD encoding, you could maybe use the full 720x576 resolution (1.25 Aspect Ratio), but with a 1.64 Display Ratio during playback.For a DVD, what exactly is a 1.64 display ratio? If you mean it's DAR, it can only be either 16:9 or 4:3. Where did this 1.64 come from?
thetoof
10th April 2008, 22:58
(the following is a BIG guess, I don't even know if it could work) [...] you could maybe use the full 720x576 resolution
That's why I wrote that... I know that DVDs can handle anamorphic flags, but I didn't know if you could tweak it or not to another value than 16:9 and 4:3 (like you can in mkvmerge). So, in the end, my guess was wrong and the DVD encode should be done with the resize+borders combination.
Leak
11th April 2008, 10:44
For a DVD, what exactly is a 1.64 display ratio? If you mean it's DAR, it can only be either 16:9 or 4:3. Where did this 1.64 come from?
I'd hazard a guess he meant his 1.25 (4:3) with black bars (i.e. letterboxed), giving the final image sans the border an AR of 1.64...
2Bdecided
11th April 2008, 12:18
Save this as an AVS file, throw it at an MPEG encoder (e.g. GuEnc, suitably configured: 16x9 flag, TFF, interlaced) for DVD compliant output:
# "Correct" way to get input
#video=mpeg2source("COMP_0405_1835.d2v")
#audio=mpasource("COMP_0405_1835 T01 DELAY 0ms.mpa")
#audiodub(video,audio)
# "Good enough" way to get input
directshowsource("COMP_0405_1835.mpg")
# Should already be yv12, but just to make sure...
converttoyv12(interlaced=true)
assumetff() # set the field order correctly
# crop off borders:
crop(8,66,-8,-78)
# Ideal: crop(7,65,-9,-79), but requires conversion to RGB to use
# deinterlace:
mcbob()
# resize:
lanczos4resize(704,576)
# re-interlace:
assumetff().SeparateFields().SelectEvery(4,0,3).Weave()
If you want to use DGindex to do the input properly, uncomment the first three lines, and comment out the directshowsource line. BTW, on my system, directshowsource reports the incorrect field order, so the first assumetff is vital.
Replace the mcbob line with whatever you want to use. Quickest is just bob(), but it'll look poor. There are many other options.
If you use mcbob, and want to make the script even slower(!) you can put eedi2() or nnedi() (not both) before the resize, to give it double the information to work with. If you're using a lesser deinterlacer than mcbob, it's not worth it.
mcbob, eedi2, and nnedi all need downloading - they're not built in to AVIsynth. Google for them, i.e. search for "AVIsynth eedi2" (no quotes) to find them.
Having said all this: I'd just leave it as it is (4x3 letterboxed). Resizing interlaced content upwards never looks pretty - the above options will really help, but are very slow. A fast bob looks awful.
Instead, on a 16x9 TV, just hit the zoom button (many do this automatically anyway). On a 4x3 display, just watch what you have.
Hope this helps.
Cheers,
David.
simon42509
12th April 2008, 09:15
Thanks David, I'll give it a try.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.