I'm wondering if this can be done at all using a trim on AviSynth. I'm trying but the whole clip gets cropped, rather then the 10 seconds that I want.
Code:Trim(29455,31313)+Trim(32339,33019)+Trim(35042,35196)+Trim(36132,36530).Crop(0,-24,0,24)fadeout(50)
So I want the last trim to be cropped but instead all them are. Is there a way to prevent that?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 7 of 7
Thread
-
-
It can be done if you create two clips from the same video source,
then crop the second source and resize it to the same width and height as the clip 1.
Something like this should work
Code:v1=avisource("vid1.avi") v2=avisource("vid1.avi") v1 = Trim(29455,31313)+Trim(32339,33019)+Trim(35042,35196) v2 = Trim(36132,36530).Crop(0,-24,0,24).resize(<remaining width>+48,<keep height>) v3 = v1+v2 v3.fadeout(50) return v3
-
Your script isn't going to work at all. And if he wanted to resize the cropped segment he could have just added it to his existing script:
Code:Trim(29455,31313)+Trim(32339,33019)+Trim(35042,35196)+Trim(36132,36530).Crop(0,-24,0,24).Spline36Resize(width, height) fadeout(50)
-
Here is a function that crops, then resizes to match the size of a 'master' clip so the clips can be spliced together.
Note, this function does additional cropping - beyond what you ask for - to preserve aspect ratio (see example below).
Example: need to crop out 16 lines top and bottom, then resize to original size.
Code:CropMatch(Last, Last, 0, 16, 0, -16)
[Attachment 43170 - Click to enlarge]
[Attachment 43171 - Click to enlarge]
Code:################################## ### crop, then resize to match template clip T; ### crop as needed to maintain aspect ratio ## ## @ C - Source clip. RGB or YUV444 recommended to avoid size modulus restrictions. ## @ T - Template clip. Output wil match dimensions of clip <T>. ## @ left, top, width, height - cf. [[Crop]] ## function CropMatch(clip C, clip T, \ int left, int top, int width, int height) { tmpWid = (width>0) ? (width) : (C.Width-left+width) tmpHgt = (height>0) ? (height) : (C.Height-top+height) Assert(tmpWid<=C.Width, \ "CropMatch: output width larger than input") Assert(tmpHgt<=C.Height, \ "CropMatch: output height larger than input") scaleX = Float(T.Width) / tmpWid scaleY = Float(T.Height) / tmpHgt tmpWid2 = (scaleX>=scaleY) ? Float(tmpWid) : (scaleX / scaleY * tmpWid) tmpHgt2 = (scaleY>=scaleX) ? Float(tmpHgt) : (scaleY / scaleX * tmpHgt) x = (scaleX>=scaleY) ? Float(left) : (left + 0.5 * (tmpWid - tmpWid2)) y = (scaleY>=scaleX) ? Float(top) : (top + 0.5 * (tmpHgt - tmpHgt2)) wid = (scaleX>=scaleY) ? Float(tmpWid) : (tmpWid2) hgt = (scaleY>=scaleX) ? Float(tmpHgt) : (tmpHgt2) return C.Spline64Resize(T.Width, T.Height, x, y, wid, hgt) }
Last edited by raffriff42; 21st Sep 2017 at 21:05. Reason: note
Similar Threads
-
Trim problem with AVISynth
By smike in forum EditingReplies: 5Last Post: 9th Aug 2016, 09:20 -
AviSynth Audio Trim Question
By Akai-Shuichi in forum RestorationReplies: 2Last Post: 31st Mar 2016, 18:27 -
Problem with multiple using of 'Trim' filter in Avisynth
By Balbes in forum Video ConversionReplies: 6Last Post: 19th Dec 2015, 07:15 -
avisynth: how trim using for example 0:00:31.040000 ?
By marcorocchini in forum Newbie / General discussionsReplies: 9Last Post: 31st Oct 2014, 15:07 -
Avisynth, need image duration help (trim?)
By Genex9 in forum EditingReplies: 10Last Post: 23rd Jan 2014, 18:53