Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # let's say, we decided to fix 3 lines on the all sides: left, top, right, bottom, then:
- FFVideoSource("E:\300 MUX\300MUX.MKV").Crop(0,140,0,-140)
- safe = Crop(4,4,-4,-6) # safe area where we won't change the colorspace
- ConvertToYV24() # now we go to YV24 to fix our lines because we can't fix odd lines with YV12
- base1 = Crop(4,0,-4,0) # here we choose the area where we'll fix lines on the left/right
- l1 = Crop(0, 0, 1 - Width(), 0).Tweak(cont=1.10) # 1st line on the left
- l2 = Crop(1, 0, 2 - Width(), 0).Tweak(cont=1.06) # 2nd line on the left
- l3 = Crop(2, 0, 3 - Width(), 0).Tweak(cont=1.02) # 3d line on the left
- l4 = Crop(3, 0, 4 - Width(), 0) # 4th line, we won't fix this line, so don't need changes here
- r4 = Crop(Width() - 4, 0, -3, 0) # 4th line, we won't fix this line, so don't need changes here too
- r3 = Crop(Width() - 3, 0, -2, 0).Tweak(cont=1.00) # 3d line on the right
- r2 = Crop(Width() - 2, 0, -1, 0).Tweak(cont=1.00) # 2nd line on the right
- r1 = Crop(Width() - 1, 0, 0, 0).Tweak(cont=1.00) # 1st line on the right
- StackHorizontal(l1, l2, l3, l4, base1, r4, r3, r2, r1) # after fixing we stack those fixed lines with the 1st area (base1)
- base2 = Crop(0,4,0,-6) # now we take the area where we'll fix lines on the top/bottom
- t1 = Crop(0, 0, 0, 1 - Height()).Tweak(cont=1.00) # 1st line on the top
- t2 = Crop(0, 1, 0, 2 - Height()).Tweak(cont=0.99) # 2nd line on the top
- t3 = Crop(0, 2, 0, 3 - Height()).Tweak(cont=1.00) # 3d line on the top
- t4 = Crop(0, 3, 0, 4 - Height()) # 4th line, for example we don't need to fix this line, so don't need changes here
- b6 = Crop(0, Height() - 6, 0, -5)
- b5 = Crop(0, Height() - 5, 0, -4).Tweak(cont=0.99)
- b4 = Crop(0, Height() - 4, 0, -3).Tweak(cont=0.98)
- b3 = Crop(0, Height() - 3, 0, -2).Tweak(cont=0.98) # 3d line on the bottom
- b2 = Crop(0, Height() - 2, 0, -1).Tweak(cont=0.99) # 2nd line on the bottom
- b1 = Crop(0, Height() - 1, 0, 0).Tweak(cont=0.99) # 1st line on the bottom
- StackVertical(t1, t2, t3, t4, base2, b6, b5, b4, b3, b2, b1) # after fixing on the top/bottom we stack those fixed lines with the 2nd area (base2)
- ConvertToYV12(matrix="Rec709") # back to normal YV12 colorspace
- # here we use balancebordersgt over all fixed lines to prevent color changes from scene to scene
- # so we don't need to do an overlay for each scene of our video (BB options may vary in different cases)
- BalanceBordersGT(3,3,3,3)
- BalanceBordersGT(3,3,3,3,thresh=4,blur=10)
- Overlay(last, safe, x=4, y=4) # now we get the final pic "inserting" our safe area into fixed area via overlay function
- Spline36Resize(1280,534)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement