Log in

View Full Version : Variable crop, is it possible?


cerncern
6th August 2008, 13:23
Well, what I intend is apply diferents crops in some parts of a source resulting a single video.

Example: dvdvideo source

frames 1 to 300 need crop(16,16,16,16) and resize 640x480

frames 301 to 500 need crop(8,16,8,16) and resize 640x480

frames 501 to 800 need crop(32,4,32,8) and resize 640x480

If I apply the bigest crop in each border I would lost too much area of video depending the zone, that's why I was wondering if the previously mentioned is possible.

Thanks in advance

martino
6th August 2008, 13:26
Trim(0,1) + Trim(1,300).Crop(16,16,16,16).Lanczos4Resize(640,480) + \
Trim(301,500).Crop(8,16,8,16).Lanczos4Resize(640,480) + \
Trim(501,800).Crop(32,4,32,8).Lanczos4Resize(640,480)


P.S. Frame 0 is a frame too, if you've missed that part.

Gavino
6th August 2008, 14:07
Note that you can combine the crop with the resize as a single operation.
I expect that cerncern also meant the crop values to be right and bottom rather than width and height. So Trim(1,300).Lanczos4Resize(640,480,16,16,-16,-16) + etc

Alex_ander
6th August 2008, 15:19
...and also use odd numbers for cropping (where necessary) in resize filter.

cerncern
7th August 2008, 10:41
Thanks a lot to everyone. question solved.

pavan_a
7th August 2008, 11:08
Trim(0,1) + Trim(1,300).Crop(16,16,16,16).Lanczos4Resize(640,480) + \
Trim(301,500).Crop(8,16,8,16).Lanczos4Resize(640,480) + \
Trim(501,800).Crop(32,4,32,8).Lanczos4Resize(640,480)


P.S. Frame 0 is a frame too, if you've missed that part.

will it affect in A/V synch???

Mystery Keeper
7th August 2008, 11:26
No. But it WILL affect the look. Objects will have different proportions in different frames.

themostestultimategenius
7th August 2008, 15:12
Just looks neater in my opinion.
Source = DirectShowSource("Video")
a = Source.Trim(0,1)
b = Source.Trim(1,300).Spline36Resize(640,480,16,16,-16,-16)
c = Source.Trim(301,500).Spline36Resize(640,480,8,16,-8,-16)
d = Source.Trim(501,800).Spline36Resize(640,480,32,4,-32,-8)
e = Source.Trim(801,0)
f = a++b++c++d++e
Return f