Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#1 | Link |
|
Registered User
Join Date: Jul 2006
Posts: 30
|
Avisynth gone wrong
Dunno, I want to see how much you can mess up a source with Avisynth, I mean create halos, scratches, holes, butcher the film unrecognizable, then post your scripts so the world can use them and their glory of greatness
|
|
|
|
|
|
#2 | Link |
|
x264aholic
Join Date: Jul 2007
Location: New York
Posts: 1,752
|
There a point in that? Usually we try to -improve- videos. Not muck them up. That's the studio's job (read: Cowboy Bebop on Blu-ray.)
Easy way to make it look horrendous: Code:
AddGrain(10).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).blur(1.58) Sharpen(1).Sharpen(1).Sharpen(1).Sharpen(1).Sharpen(1).Sharpen(1).Sharpen(1).Sharpen(1)
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame. |
|
|
|
|
|
#3 | Link |
|
Sleepy overworked fellow
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
|
Actually, I'd also be interested in such a script to give a *very* old look to the image by screwing it up, but in a bit more refined fashion
-Sepia -vertical lines (scratches) -dirt + cigarette burns (I guess a blurred circular mask) -shaky (inverse of depanstabilize) That'd be a bit trickier that an addgrain.blur.sharpen chain, but it'd be some nice butchering
__________________
AnimeIVTC() - v2.00 -http://boinc.berkeley.edu/- Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p) |
|
|
|
|
|
#4 | Link |
|
Registered User
Join Date: Jan 2009
Posts: 3
|
Code:
HaloMaker3000Deluxe() Edit: Here's an example of HaloMaker3000Deluxe... almost. It renders really slowly so I did some magic. WATCH THIS AT YOUR OWN RISK: http://www.youtube.com/watch?v=SeWGyH2-dQY&fmt=22 Last edited by Jumpyshoes; 13th February 2009 at 02:17. |
|
|
|
|
|
#5 | Link |
|
x264aholic
Join Date: Jul 2007
Location: New York
Posts: 1,752
|
Sepia itself would be very easy. Tweak() could get that done. Then, vertical lines could be added with AddGrain(50, 0, 1) (replace str with your choice -- It's going to make huge vertical streaks regardless.)
Cigarette burns would be pretty easy IMO. if you play around with making a mask similar to the script I posted above, you can get a fairly nice random pattern of spots you can use to mask in something: Code:
blank = BlankClip() noise = blank.AddGrain(5,0,0).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58).Blur(1.58) diff = mt_makediff(blank,noise,U=3,V=3)
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame. |
|
|
|
|
|
#8 | Link |
|
Registered User
Join Date: May 2006
Posts: 957
|
Flicker:
Code:
src = last flicker = BlankClip(src, width=64, height=64, color_yuv=$808080).AddGrain(100).PointResize(width(src), height(src), 32,32,1,1) src.mt_adddiff(flicker) Code:
ScriptClip("""
randcrop_w=rand(32)
randcrop_h=rand(32)
LanczosResize(width(src), height(src), randcrop_w, randcrop_h, -32+randcrop_w, -32+randcrop_h)
""")
__________________
x264 log explained || x264 deblocking how-to preset -> tune -> user set options -> fast first pass -> profile -> level Doom10 - Of course it's better, it's one more. |
|
|
|
|
|
#9 | Link |
|
Registered User
Join Date: Feb 2007
Posts: 65
|
Thank you J_Darnley, especially for luma flickering, I shall not have been able to find it by myself. I was closer for shaking, I just didn't find a way to generate random number for each frame.
I've made a function to give an old look to your movies. It's far from perfect but I'm open to any suggestion. Here it is : Code:
Function OldLook ( clip clp, bool "sepia", bool "vertscratch", bool "stain", bool "lumaflick", bool "shake")
{
sepia = default (sepia , true)
vertscratch = default (vertscratch , true)
stain = default (stain , true)
lumaflick = default (lumaflick , true)
shake = default (shake , true)
x = width (clp)
y = height (clp)
# sepia
(sepia == true ) ? Eval("""
sepiaclip = blankclip (clp, color = $704214)
clp = overlay (clp, sepiaclip, mode="chroma", opacity=0.5) """) : nop
# vertical scratches
(vertscratch == true ) ? Eval("""
scratch = blankclip(clp,color=$ffffff).addgrain(7,0,vcorr=1,seed=1).mt_binarize(threshold=228)
clp = clp.overlay(scratch,mode="darken",opacity=0.2) """) : nop
# stains
(stain == true) ? Eval("""
blank = blankclip(clp,color=$808080)
noise = blank.spline36resize(32,32).AddGrain(25,0,0).blur(1.58).spline36resize(x,y)
clp = mt_adddiff(clp,noise) """) : nop
# luma flickering
(lumaflick == true ) ? Eval("""
flicker = BlankClip(clp, width=64, height=64, color_yuv=$808080).AddGrainc(10).PointResize(x, y, 32,32,1,1)
clp = clp.mt_adddiff(flicker) """) : nop
# shake
last = clp
(shake == true) ? Eval("""
ScriptClip("
x = width ()
y = height ()
randcrop_w =rand(2)
randcrop_h =rand(2)
spline36Resize(x, y, randcrop_w, randcrop_h, -2+randcrop_w, -2+randcrop_h)
")""") : nop
return last }
Last edited by Reuf Toc; 13th February 2009 at 00:08. Reason: Changed color value for sepia |
|
|
|
|
|
#11 | Link | |
|
Registered User
Join Date: May 2006
Posts: 957
|
Quote:
Also, I continued to work on the shake and flicker some more last night and got these two functions. Flicker: Code:
function Flicker(clip src, float "flicker_scale")
{
# More is less, that is the bigger this scale, the less the flicker.
flicker_scale = default(flicker_scale, 100.0) * 10.0
Eval("""ScriptClip(src, "rand = 1.0 + float( rand(256)-64 ) / """+string(flicker_scale)+"""
Levels(0, rand, 255, 0, 255, coring=false)")""")
return last
}
Shake, it doesn't work as a function, but this is what I would like to to be as: Code:
function Shake(clip src, int "shift_fraction", int "target_w", int "target_h", string "temporal_variation")
{
# Sets the maximum fraction of the image that it can move. 10 is one-tenth, 20 is one-twentieth, 100 is one one-hundredth.
# Means that the relative shaking on a 500px wide image is the same as on a 2000px wide image.
# Shaking is relative in both x and y.
shift_fraction = default(shift_fraction, 50)
# I wanted the output to be scaled down so I added this.
# Default is to make the output clip the same dimensions as the input.
target_w = default(target_w, width(src))
target_h = default(target_h, height(src))
# A string to alter the shaking in some way, not necessarily with time.
# To increase the shaking with time, perhaps use: "float(current_frame+1)/framecount"
temporal_variation = default(temporal_variation, "1.0")
src_w = width(src)
src_h = height(src)
Eval("""ScriptClip( BlankClip(src, width=target_w, height=target_h), "
shift_x=float( rand( """+string(src_w/shift_fraction)+""" ) - """+string(src_w/float(shift_fraction*2))+""" ) * """+temporal_variation+"""
shift_y=float( rand( """+string(src_h/shift_fraction)+""" ) - """+string(src_h/float(shift_fraction*2))+""" ) * """+temporal_variation+"""
crop_left = """+string(src_w/float(shift_fraction*2))+""" + shift_x
crop_top = """+string(src_h/float(shift_fraction*2))+""" + shift_y
crop_right = """+string(-src_w/float(shift_fraction*2))+""" + shift_x
crop_bottom = """+string(-src_h/float(shift_fraction*2))+""" + shift_y
LanczosResize(src, """+string(target_w)+""", """+string(target_h)+""", crop_left, crop_top, crop_right, crop_bottom)
")""")
return last
}
Small demo: http://users.telenet.be/darnley/avis...nd%20shake.mkv Made with: Code:
SetMTMode(3,0)
LoadPlugin("D:\Avisynth\Plugins\AddGrainC.dll")
LoadPlugin("D:\Avisynth\Plugins\MT.dll")
ImageReader("D:\Images\4chan\w\bleach_1234314674285.jpg", use_devil=false)
ConvertToYV12()
src = last
(true)?Shake(100, 640, 400):LanczosResize(640,400)
Flicker(100.0)
AddGrain(200, 0.1, 0.9)
Trim(0,239)
AssumeFPS(24)
__________________
x264 log explained || x264 deblocking how-to preset -> tune -> user set options -> fast first pass -> profile -> level Doom10 - Of course it's better, it's one more. |
|
|
|
|
|
|
#12 | Link | ||
|
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,442
|
Quote:
Code:
ScriptClip(src, "rand = 1.0 + float( rand(256)-64 ) / "+string(flicker_scale)+"
Levels(0, rand, 255, 0, 255, coring=false)")
Code:
ScriptClip(src, "rand = 1.0 + float( rand(256)-64 ) / flicker_scale
Levels(0, rand, 255, 0, 255, coring=false)", args="flicker_scale")
Quote:
Code:
function GShake(clip src, int "shift_fraction", int "target_w", int "target_h", string "temporal_variation") {
shift_fraction = default(shift_fraction, 50)
target_w = default(target_w, width(src))
target_h = default(target_h, height(src))
temporal_variation = default(temporal_variation, "1.0")
ScriptClip( BlankClip(src, width=target_w, height=target_h), "
variation = Eval(temporal_variation)
shift_x=float(rand(src_w/shift_fraction) - src_w/float(shift_fraction*2)) * variation
shift_y=float(rand(src_h/shift_fraction) - src_h/float(shift_fraction*2)) * variation
crop_left = src_w/float(shift_fraction*2) + shift_x
crop_top = src_h/float(shift_fraction*2) + shift_y
crop_right = -src_w/float(shift_fraction*2) + shift_x
crop_bottom = -src_h/float(shift_fraction*2) + shift_y
LanczosResize(src, target_w, target_h, crop_left, crop_top, crop_right, crop_bottom)
", args="src, src_w=width(src), src_h=height(src), shift_fraction, target_w, target_h, temporal_variation")
}
|
||
|
|
|
|
|
#13 | Link | |
|
Registered User
Join Date: May 2006
Posts: 957
|
Quote:
I forget why I was using Eval() in the flicker, perhaps copy-pasta syndrome. I discovered that I had to set src in the main body of the script. What confuses me is that: src = last Shake() worked as did: src = last <lots of text> but when src was only a variable in the function it would complain. Is this some of what was mentioned in your thread? I haven't read it yet but I certainly intend to.
__________________
x264 log explained || x264 deblocking how-to preset -> tune -> user set options -> fast first pass -> profile -> level Doom10 - Of course it's better, it's one more. |
|
|
|
|
|
|
#14 | Link | |
|
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,442
|
Quote:
The conventional solution has been to use the string() function and string concatenation, but this is cumbersome and can't be used for clip variables. GRunT provides a much more natural way of binding the variables at the place ScriptClip is called to values inside the run-time script. |
|
|
|
|
|
|
#15 | Link |
|
Learning Avisynth user
Join Date: Sep 2008
Posts: 79
|
This thread has been lingering in my head and I thought I would try an idea on the Reservoir Dogs DVD. I wanted to see if I could make it look as if it were being displayed on TV as best I could.
![]() Here is my script. The only external filter I used was ImageSequence. Code:
vid1=audiodub(mpeg2source("VTS_01_1.d2v").crop(2,56,-0,-60).lanczosresize(848,352).crop(104,0,-104,-0).addborders(0,64,0,64).converttorgb32().generalconvolution(0, "
0 0 0
-1 -6 4
0 5 0 ", 1, false).converttoyv12(),directshowsource("VTS_01_1 T80 2_0ch 192Kbps DELAY 0ms.ac3"))
img1=coronasequence("C:\Documents and Settings\Bryant\Desktop\fuzz2\*.png",sort=1).assumefps(23.976).loop()
overlay(vid1,img1,mode="exclusion",opacity=.25)
trim(110276,119186)
|
|
|
|
|
|
#17 | Link |
|
Retried Guesser
Join Date: Jun 2012
Posts: 1,371
|
Bumping this old thread because it is awesome (I especially like Reuf Toc's "OldLook"), and because I've got a new (?) effect. It's kind of a "reverse TBC", because it modulates horizontal position line-by-line from any audio signal, to create that "analog breakup" effect.
![]() For the jitter source, use white noise, sine waves or whatever you like to get the look you want. I believe this code is original, but if it was copied from somewhere, I apologize! Code:
LoadPlugin("Waveform\waveform.dll")
/*
## requires MaskTools2
## requires "Software TBC"
# http://forum.doom9.org/showthread.php?t=162726
# http://www.sendspace.com/file/s78pp4
# which requires:
# findpos 0.1 (EDIT included w/ tbc061.zip)
# dejitter 0.2 (EDIT included w/ tbc061.zip)
LoadPlugin("tbc\dejitter03\dejitter.dll")
LoadPlugin("tbc\findpos02\findpos.dll")
Import("tbc\dejitter03\dejitter.avs")
## requires MaskTools
*/
Import("tbc\tbc.avs")
##################################
### modulate horizontal position line-by-line
##
## jitter signal source = clip A's audio track (if missing, use clip C's audio)
##
#@version 1.1 Jul-2016 - in addition to YV12, add support for YV24, RGB24, RGB32
##
function JitterGenerator(clip C, clip "A")
{
Assert(C.IsYV12 || C.IsYV24 || C.IsRGB24 || C.IsRGB32,
\ "JitterGenerator: source must be YV12, YV24, RGB24 or RGB32")
A = Default(A, C)
A = IsClip(A) && HasAudio(A) ? A : C
## Last==
AudioDub(C, A.ConvertToMono)
## jitter source: add vertical waveform to left 48 pixels
TurnLeft
(!C.IsYV24)
\ ? Waveform(window=0, height=48, under=true, zoom=1)
\ : StackVertical(
\ Last,
\ ConvertToYV12
\ .Waveform(window=0, height=48, under=true, zoom=1)
\ .ConvertToYV24
\ .Crop(0, Height-48, 0, 0)
\ )
TurnRight
src = Last
thresh = 85
## Mark video edges:
## search for the first bright pixel in left 48 pixels
p = tbc_findpos_h(src.ConvertToYV12, x1=0, x2=48, thresh=thresh, leftonly=0>0)
## jitter the video
(C.IsYUV)
\ ? jitter_shift_yuv(src, p)
\ : jitter_shift_rgb(src, p)
Crop(48, 0, C.Width, C.Height)
## restore original audio
return Last.AudioDub(C)
}
#######################################
## (HACK) based on tbc_Rescale;
## shifts video position roughly according to 1st offset
##
function jitter_shift_yuv(clip C, clip offsets)
{
y = C.Greyscale
u = UtoY(C)
w1 = u.Width
h1 = u.Height
u = u.BicubicResize(y.Width, y.Height)
v = VtoY(C).BicubicResize(y.Width, y.Height)
## use 1st offset only
offsets = offsets.PointResize(4, offsets.Height).Crop(0, 0, 2, -0)
## (HACK) tweak offsets for approximately even shift
offsets = StackHorizontal(
\ offsets.mt_lut("255 x - 2 / 92 - ")
\ , offsets.mt_lut("x 16 - ")
\ ).PointResize(2, offsets.Height)
y1 = dejitter(y, offsets)
u1 = dejitter(u, offsets).BicubicResize(w1, h1)
v1 = dejitter(v, offsets).BicubicResize(w1, h1)
YtoUV(u1, v1, y1)
}
#######################################
## (HACK) based on tbc_Rescale;
## shifts video position roughly according to 1st offset
##
function jitter_shift_rgb(clip C, clip offsets)
{
r = C.ShowRed ("YV12")
g = C.ShowGreen ("YV12")
b = C.ShowBlue ("YV12")
## use 1st offset only
offsets = offsets.PointResize(4, offsets.Height).Crop(0, 0, 2, -0)
## (HACK) tweak offsets for approximately even shift
offsets = StackHorizontal(
\ offsets.mt_lut("255 x - 2 / 92 - ")
\ , offsets.mt_lut("x 16 - ")
\ ).PointResize(2, offsets.Height)
r = dejitter(r, offsets)
g = dejitter(g, offsets)
b = dejitter(b, offsets)
return (C.IsRGB24)
\ ? MergeRGB(r, g, b)
\ : MergeARGB(C.ShowAlpha, r, g, b)
}
Last edited by raffriff42; 17th March 2017 at 00:16. Reason: (fixed image link) |
|
|
|
|
|
#18 | Link | |
|
47.952fps@71.928Hz
Join Date: Mar 2011
Posts: 940
|
Quote:
Have a backup somewhere of the required plugins? They're not up on the wiki anywhere (that I see in a search)
__________________
Win10 (x64) build 19041 NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4) NTSC | DVD: R1 | BD: A AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
|
|
|
|
|
|
|
#20 | Link |
|
Retried Guesser
Join Date: Jun 2012
Posts: 1,371
|
Luckily, dejitter and findpos are included with tbc061.zip.
http://www.sendspace.com/file/s78pp4 |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|