I have a fairly long DVD with many scenes from different tape transfers. So the black boarders on the left and right shift by a few pixels between the different scenes. So using a single crop setting for the entire video would be perfect for some scenes, but would also leave a black bar on the left or right of many scenes. Even though video picture is being cut off the opposite side.
My knowledge of avisynth is modest but I'm not really sure how to do a custom crop for a group of frames, and then another custom crop for a different scene. I'll be using the same amount of cropping and resolution for the entire video, it's just a matter of cutting off more from the left or the right.
Currently my only option is to just crop the video in segments with trim(), and just encode each scene separately. Appending it all together with MKVmerge. It works this way, just wondering how to do it in one go with avisynth.
Any guidance would be nice.
+ Reply to Thread
Results 1 to 5 of 5
-
Last edited by KarMa; 26th Nov 2015 at 02:09. Reason: grammar
-
Perhaps something like this:
A=Last
B=A.Crop(8,0,-8,0).AddBorders(8,0,8,0)
ReplaceFramesSimple(A,B,Mappings="[0 16666] ")
A=Last
B=A.Crop(12,0,-4,0).AddBorders(8,0,8,0)
ReplaceFramesSimple(A,B,Mappings="[16667 183207] ")
A=Last
B=A.Crop(4,0,-12,0).AddBorders(8,0,8,0)
ReplaceFramesSimple(A,B,Mappings="[183208 251009] ")
RemapFramesSimple is part of stickboy's RemapFrames. If you prefer you can also string together a bunch of Trims:
X=Last
A=X.Trim(0,16666).Crop(8,0,-8,0).AddBorders(8,0,8,0)
B=X.Trim(16667 183207).Crop(12,0,-4,0).AddBorders(8,0,8,0)
C=X.Trim(183208,251009.Crop(4,0,-12,0).AddBorders(8,0,8,0)
A+B+C
I prefer ReplaceFramesSimple because if you have to do a whole bunch of different crops throughout the movie, you can add the repeated ones (same crop values) to where you first used those same crop values:
B=A.Crop(12,0,-4,0).AddBorders(8,0,8,0)
ReplaceFramesSimple(A,B,Mappings="[16667 183207] [195000 197000] [199000 201000] ")
whereas adding together a whole bunch of Trim statements can get kind of unwieldy. Whichever way you prefer.Last edited by manono; 26th Nov 2015 at 02:15.
-
Thank you LigH for pointing out AutoCrop, I tried it for awhile but I think I would rather set the cropping. Will probably use it when/if I have lots and lots of clips to deal with.
Thank you manono as that was exactly what I wanted. This works perfectly.
What I've done so far.
X=Last
A=X.Trim(0, 327).crop(12, 0, -6, 0).Spline64Resize(640,480)
B=X.Trim(328, 10893).crop(12, 0, -6, 0).Spline64Resize(640,480)
C=X.Trim(10894, 41294).crop(12, 0, -6, 0).Spline64Resize(640,480)
D=X.Trim (41295, 49970).crop(16, 0, -2, 0).Spline64Resize(640,480)
E=X.Trim(49971, 176264).crop(8, 0, -10, 0).Spline64Resize(640,480)
F=X.Trim(176265, 202307).crop(6, 0, -12, 0).Spline64Resize(640,480)
G=X.Trim(202308, 206628).crop(8, 0, -10, 0).Spline64Resize(640,480)
H=X.Trim(206629, 211035).crop(6, 0, -12, 0).Spline64Resize(640,480)
A+C+D+E+F+G+H #I cut out BLast edited by KarMa; 26th Nov 2015 at 04:01.
-
I too find that can simetimes get out of control when you use a lot of trims, especially if you tend to change your mind and alter, add or remove them. I tend to do it like this:
Trim(0, 327).crop(12, 0, -6, 0).Spline64Resize(640,480) \
++Trim(328, 10893).crop(12, 0, -6, 0).Spline64Resize(640,480) \
++Trim(10894, 41294).crop(12, 0, -6, 0).Spline64Resize(640,480) \
++Trim (41295, 49970).crop(16, 0, -2, 0).Spline64Resize(640,480) \
++Trim(49971, 176264).crop(8, 0, -10, 0).Spline64Resize(640,480)
Then you can modify the trim ranges and add, delete or insert new ones without needing to also do the same for the sequence telling Avisynth what to encode as it's not needed. Whatever works though....
And you only need to add resizing to each line to keep the resolution the same if the cropping doesn't result in the same resolution. If it does:
Trim(0, 327).crop(12, 0, -6, 0) \
++Trim(328, 10893).crop(12, 0, -6, 0) \
++Trim(10894, 41294).crop(12, 0, -6, 0) \
++Trim (41295, 49970).crop(16, 0, -2, 0) \
++Trim(49971, 176264).crop(8, 0, -10, 0)
Spline64Resize(640,480)Last edited by hello_hello; 26th Nov 2015 at 09:11.
Similar Threads
-
Could you help me write an AVIsynth script to improve this LD scene?
By jrodefeld in forum RestorationReplies: 6Last Post: 13th Oct 2014, 14:26 -
Freeware that allows scene removal?
By gastrof in forum Newbie / General discussionsReplies: 4Last Post: 9th Mar 2013, 04:12 -
Loop video scene
By Kand in forum EditingReplies: 0Last Post: 7th Aug 2012, 08:37 -
3d text in scene
By ZoNE97 in forum EditingReplies: 1Last Post: 14th Jun 2011, 16:35 -
New to the video burning scene
By Jamie218 in forum Newbie / General discussionsReplies: 4Last Post: 27th Nov 2010, 15:20