Hi. I was looking for encoding software that supported video filters and just happened to run across MeGUI. I know very little about AviSynth scripts but I'm learning. I found several tutorials and guides on writing scripts. Getting to the point. This pic below was taken from an encoded Dragon Ball GT episode with the following specs:
20 min. 44 sec.
MPEG-4 AVC Video
3 Audio Streams (AAC, 2 CH, 48 KHz)
640x480, 23.976 fps
File Size....... 96.4 MB
Basically.. I want to encode like this guy lol. I used to encode anime a while back using Handbrake. Handbrake simply cannot touch this level of quality (with such a small file size) and it does not support real video filters. I have no idea who did this nor what program they used but I am certain MeGUI can pull it off as well. What settings and filters do I need to use to achieve this level of quality for a 22-24 minute video? The file size can be anywhere from 90-200 MB. Or at the very least, tell me what kind of filter(s) makes your video look like this...
+ Reply to Thread
Results 1 to 30 of 57
-
-
You have to use specific filters and tweak the filters and encoding settings. You wouldn't be able to use exactly the same settings for every source. For example, some might need denoising than others, some may need more saturation etc...
Without a point of reference or where you are starting from , nobody can give you any specific help.
If you upload a video sample of the source, people can give you more specific suggestions -
there isn't a good all-inclusive list, they are spread all over the place and constantly being developed;
here are a few to get you started
http://avisynth.org/warpenterprises/
http://avisynth.org/mediawiki/Internal_filters
http://avisynth.org/mediawiki/External_filters
http://www.aquilinestudios.org/avsfilters/
a good place to check for more advanced filtering and expert feedback is doom9 forums -
Hmm... Does anybody know where I can find LimitedSharpenfaster?
-
whenever you're looking for specific filters, search google for "<filtername> avisynth mediawiki" or "<filtername> doom9"
http://avisynth.org/mediawiki/LimitedSharpen
Most people use LSFMod these days, it has been modified slightly and more tweakable
http://avisynth.org/mediawiki/LSFmod -
nope, that's the job of the encoder
filesize = bitrate x running time
Using denoisers and degrainers through avisynth will help compressibility. Noise & grain "eat" up bitrate and are very costly to encode. Ideally you want to target noise reduction, aiming to keep as much detail, but reducing the noise instead of making it a blurry mess -
I know I said I wasn't going to ask any more questions but I need to know, in your opinion, what's a good denoiser, degrainer and video smoother? Please just name one of each. I found everything else I was looking for and these three things is all I need. There are so many plugins to go through and read up on.. Ugh... I think I need to lie down for a bit.
-
It depends on the type of noise, the type of grain. You have to customize the function and settings for best results, otherwise you erode too many details. For anime, it's usually more forgiving than live action - you can go overboard more
MCTemporalDenoise is one of the best generic filters , but there are many settings to play with. It's like a mega filter composed of a dozen sub filters
If you click on that last link, it provides before/after screenshots of some of the older filters (unfortunately hasn't been updated with newer filters)
If you want specific suggestions, post a sample of your source video and someone will provide suggestions -
Ok. Here's a sample I've been experimenting with. It's the intro to DBZ Remastered in .vob format. But it is about 43 MB. I also noticed that MeGUI doesn't encode each scene in order as it should. Some parts will play more than once in the encode... I sometimes have this problem while encoding VOBs. I stripped out the other angle but it didn't help. I guess it doesn't really matter because I'm just experimenting with it.
http://www.megaupload.com/?d=CW0S7Z0N
More questions for you guys. From what I've been reading, MDegrain and LSPMod are scripts. I'm still trying to wrap my head around this. Since they are scripts, am I only supposed to insert the text into this .avs file? I have all of the needed .dll files for both of them in my Avisynth plugins folder but I'm not sure if I'm supposed to use LoadPlugin for any or all of them.
The way this script is now, I really don't think MDegrain and LSPMod are even working lol. I saw no difference in the encode or encoding time when I added them both. I had the same issue with MCTemporalDenoise. It's just a script that requires a ton of plugins but how do I make it work? Also, is there a simpler / cleaner way to add scripts? Like for MCTemporalDenoise for example, can I simply place that .avs into Avisynth's plugin folder and then have the script I'm using load it somehow? @.@
Lastly, does Avisynth support video enhancement filters such as 2xSai, etc?
Here is the script I am currently using. Feel free to bash / criticize it in any manner.
Code:LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll") DirectShowSource("c:\Documents and Settings\Administrator\Desktop\Project X\Dragon Ball GT Project\Waiting For Encode\01.vob") ChangeFPS(29.970) BicubicResize(720,480) Tweak (sat=1.3) ################################################################################################ ### ### ### Simple MDegrain - SMDegrain() ### ### ### ### By Caroliano ### ### ### ### Special Thanks: Sagekilla, Didée and MVtools people ### ### ### ### v0.2 - 24 Jan 2010 ### ### ### ################################################################################################ ### ### +-----------+ ### | CHANGELOG | ### +-----------+ ### ### v0.2 : - Added this introductory section ### - Added more parameters ### ### v0.1 : - Basic working version ### - Not released ### ### ### +--------------+ ### | DEPENDENCIES | ### +--------------+ ### ### -> MVtools2 (v2.5.8.1 or higher) ### -> MVtools depends on anything?? If yes, those things. ### ### ### ### +------------------+ ### | BASIC PARAMETERS | ### +------------------+ ### ### ### tr [int: 1, 2, 3] ### -------------- ### Temporal radius. Select between MDegrain 1, 2 or 3. Higher is better, but also much slower. ### Default is 2. ### ### ### thSAD [int] ### -------------- ### Strenght of denoising. Low values can result in staggered denoising, ### large values can result in ghosting and artefactes. Default is 400. ### ### ### plane [int: 1, 2, 3, 4] ### -------------- ### Select the color planes you wish to process: ### 0 - luma only, 1 - chroma U, 2 - chroma V, 3 - both chromas, 4 - all. ### Default is 4 - all. ### ### ### ### +---------------------+ ### | ADVANCED PARAMETERS | ### +---------------------+ ### ### ### limit [int: 1 - 255] ### -------------- ### Maximal change of pixel luma (post-process like DeGrainMedian plugin ### and LimitChange function of SSETools plugin, to prevent some artefactes). ### Default is 255 (no limit). ### ### ### limitc [int: 1 - 255] ### -------------- ### Maximal change of pixel chroma. Default value = limit. ### ### ### pel [int: 1, 2, 4] ### -------------- ### Accuracy of the motion estimation. 1 means a precision to the pixel. ### 2 means a precision to half a pixel. 4 means a precision to quarter a pixel, produced by ### spatial interpolation (more accurate but slower and not always better due to big level scale step). ### Default is 2. ### ### ### sharp [int: 0, 1, 2] ### -------------- ### Subpixel interpolation method for pel=2,4. ### Use 0 for soft interpolation (bilinear), 1 for bicubic interpolation (4 tap Catmull-Rom), ### 2 for sharper Wiener interpolation (6 tap, similar to Lanczos. Default is 2. ### ### ### blksize [int: 4, 8, 16] ### -------------- ### Size of a block (horizontal). Default is 8. ### Larger blocks are less sensitive to noise, are faster, but also less accurate. ### ### ### overlap [int] ### -------------- ### Must be *even* and *less* than block size. Try use overlap value from blksize/4 to blksize/2. ### The greater overlap, the more blocks number, and the lesser the processing speed. ### Default is 2 ### ### ### Search [int= 0, 1, 2, 3, 4, 5] ### -------------- ### 0= 'OneTimeSearch', 1 = 'NStepSearch', 2= Logarithmic, 3= Exhaustive, 4= Hexagon, 5= Uneven Multi Hexagon ### Default is 4. See details at MVtools documentation. ### http://avisynth.org.ru/mvtools/mvtools2.html ### ### ### ### ### +-------------+ ### | FINAL NOTES | ### +-------------+ ### ### If there is an important parameter not implemented, please ask. ### Or better yet, implement it yourself and post in the Doom9 thread. ### ### Many paremeters will likely never be implemented, ### and you are better off using the original MVtools way. ### ################################################################################################ function SMDegrain ( clip input, int "tr", int "thSAD", int "plane", int "limit", int "limitc", \ int "pel", int "sharp", int "blksize", int "overlap", int "search") { o = input tr = default( tr, 2 ) thSAD = default( thSAD, 400 ) plane = default( plane, 4 ) limit = default( limit, 255 ) limitc = default( limitc,limit) pel = default( pel, 2 ) sharp = default( sharp, 2 ) blksize = default( blksize, 8 ) overlap = default( overlap, 2 ) search = default( search, 4 ) # Motion vector search super = o.MSuper(pel=pel, sharp=sharp) bv3 = (tr > 2) ? \ super.MAnalyse(isb = true, delta = 3, overlap=overlap, blksize=blksize, search=search) : BlankClip bv2 = (tr > 1) ? \ super.MAnalyse(isb = true, delta = 2, overlap=overlap, blksize=blksize, search=search) : BlankClip bv1 = super.MAnalyse(isb = true, delta = 1, overlap=overlap, blksize=blksize, search=search) fv1 = super.MAnalyse(isb = false, delta = 1, overlap=overlap, blksize=blksize, search=search) fv2 = (tr > 1) ? \ super.MAnalyse(isb = false, delta = 2, overlap=overlap, blksize=blksize, search=search) : BlankClip fv3 = (tr > 2) ? \ super.MAnalyse(isb = false, delta = 3, overlap=overlap, blksize=blksize, search=search) : BlankClip # Finally, MDegrain output = (tr == 3) ? o.MDegrain3(super, bv1, fv1, bv2, fv2, bv3, fv3, thSAD=thSAD, limit=limit, limitc=limitc) : \ (tr == 2) ? o.MDegrain2(super, bv1, fv1, bv2, fv2, thSAD=thSAD, limit=limit, limitc=limitc) : \ o.MDegrain1(super, bv1, fv1, thSAD=thSAD, limit=limit, limitc=limitc) return(output) } # LimitedSharpen() ( a modded version, 29 Oct 2005 ) # # A multi-purpose sharpener by Didée # # # Changes in this mod: # # - RemoveGrain >= v0.9 IS REQUIRED!! # ================================== # # - Smode=4 / sometimes does the magic ;-) # - a separate "undershoot" parameter, to allow for some line darkening in comic or Anime # - Lmode=3 / on edges, limited sharpening with zero OS & US. On not-edges, limited sharpening with specified OS + LS # - "soft" acts different now: no more boolean true/false, but instead integer 0 - 100 (or -1 -> automatic) # instead of blurring before finding minima/maxima, it now softens the "effect-of-sharpening" # - edgemode=-1 now shows the edgemask. (scaling still not implemented :p ) # ## - MODIFIED version using MaskTools 2.0 function LimitedSharpenFaster( clip clp, float "ss_x", float "ss_y", \ int "dest_x", int "dest_y", int "Smode" , int "strength", int "radius", \ int "Lmode", bool "wide", int "overshoot", int "undershoot", \ int "soft", int "edgemode", bool "special", int "exborder" ) { ox = clp.width oy = clp.height Smode = default( Smode, 3 ) ss_x = (Smode==4) \ ? default( ss_x, 1.25) \ : default( ss_x, 1.5 ) ss_y = default( ss_y, ss_x) Assert(ss_x >= 1.0 && ss_y >= 1.0,"ss_x and ss_y must be at least 1.0!") dest_x = default( dest_x, ox ) dest_y = default( dest_y, oy ) strength = (Smode==1) \ ? default( strength, 160 ) \ : default( strength, 100 ) strength = (Smode==2&&strength>100) ? 100 : strength radius = default( radius, 2 ) Lmode = default( Lmode, 1 ) wide = default( wide, false ) overshoot = default( overshoot, 1) undershoot= default( undershoot, overshoot) softdec = default( soft, 0 ) soft = softdec!=-1 ? softdec : sqrt( (((ss_x+ss_y)/2.0-1.0)*100.0) ) * 10 soft = soft>100 ? 100 : soft edgemode = default( edgemode, 0 ) special = default( special, false ) exborder = default( exborder, 0) #radius = round( radius*(ss_x+ss_y)/2) # If it's you, Mug Funky - feel free to activate it again xxs=round(ox*ss_x/8)*8 yys=round(oy*ss_y/8)*8 smx=exborder==0?dest_x:round(dest_x/Exborder/4)*4 smy=exborder==0?dest_y:round(dest_y/Exborder/4)*4 clp.isYV12() ? clp : clp.converttoyv12() ss_x != 1.0 || ss_y != 1.0 ? last.spline36resize(xxs,yys) : last tmp = last edge = mt_logic( tmp.mt_edge(thY1=0,thY2=255,"8 16 8 0 0 0 -8 -16 -8 4") \ ,tmp.mt_edge(thY1=0,thY2=255,"8 0 -8 16 0 -16 8 0 -8 4") \ ,"max") .mt_lut("x 128 / 0.86 ^ 255 *") #.levels(0,0.86,128,0,255,false) tmpsoft = tmp.removegrain(11,-1) dark_limit1 = tmp.mt_inpand() bright_limit1 = tmp.mt_expand() dark_limit = (wide==false) ? dark_limit1 : dark_limit1 .removegrain(20,-1).mt_inpand() bright_limit = (wide==false) ? bright_limit1 : bright_limit1.removegrain(20,-1).mt_expand() minmaxavg = special==false \ ? mt_average(dark_limit1, bright_limit1) \ : mt_merge(dark_limit,bright_limit,tmp.removegrain(11,-1),Y=3,U=-128,V=-128) Str=string(float(strength)/100.0) normsharp = Smode==1 ? unsharpmask(strength,radius,0) \ : Smode==2 ? sharpen(float(strength)/100.0) \ : Smode==3 ? mt_lutxy(tmp,minmaxavg,yexpr="x x y - "+Str+" * +") \ : mt_lutxy(tmp,tmpsoft,"x y == x x x y - abs 16 / 1 2 / ^ 16 * "+Str+ \ " * x y - 2 ^ x y - 2 ^ "+Str+" 100 * 25 / + / * x y - x y - abs / * + ?") OS = string(overshoot) US = string(undershoot) mt_lutxy( bright_limit, normsharp, yexpr="y x "+OS+" + < y x y x - "+OS+" - 1 2 / ^ + "+OS+" + ?") mt_lutxy( dark_limit, last, yexpr="y x "+US+" - > y x x y - "+US+" - 1 2 / ^ - "+US+" - ?") Lmode==1 ? mt_clamp(normsharp, bright_limit, dark_limit, overshoot, undershoot) : last normal = last zero = mt_clamp(normsharp, bright_limit, dark_limit, 0,0) Lmode==3 ? mt_merge(normal,zero,edge.mt_inflate()) : normal edgemode==0 ? last \ : edgemode==1 ? mt_merge(tmp,last,edge.mt_inflate().mt_inflate().removegrain(11,-1),Y=3,U=1,V=1) \ : mt_merge(last,tmp,edge.mt_inflate().mt_inflate().removegrain(11,-1),Y=3,U=1,V=1) AMNT = string(soft) AMNT2 = string(100-soft) sharpdiff=mt_makediff(tmp,last) sharpdiff2=mt_lutxy(sharpdiff,sharpdiff.removegrain(19,-1), \ "x 128 - abs y 128 - abs > y "+AMNT+" * x "+AMNT2+" * + 100 / x ?") soft==0 ? last : mt_makediff(tmp,sharpdiff2) (ss_x != 1.0 || ss_y != 1.0) \ || (dest_x != ox || dest_y != oy) ? spline36resize(dest_x,dest_y) : last ex=blankclip(last,width=smx,height=smy,color=$FFFFFF).addborders(2,2,2,2).coloryuv(levels="TV->PC") \.removegrain(mode=19).mt_inpand().removegrain(mode=19).bicubicresize(dest_x,dest_y,1.0,.0) tmp = clp.spline36resize(dest_x,dest_y) clp.isYV12() ? ( exborder==0 ? tmp.mergeluma(last) \ : mt_merge(tmp,last,ex,Y=3,U=1,V=1) ) \ : ( exborder==0 ? tmp.mergeluma(last.converttoyuy2()) \ : tmp.mergeluma( mt_merge(tmp.converttoyv12(),last,ex,Y=3,U=1,V=1) \ .converttoyuy2()) ) (edgemode!= -1) ? last : edge.spline36resize(dest_x,dest_y).greyscale return last }
Last edited by Nagashi; 21st Jun 2010 at 10:25.
-
You're right. What you are doing is just declaring the functions (making them available) - you still have to call them, using code like:
SMDegrain()
or
LimitedSharpenFaster()
Also, is there a simpler / cleaner way to add scripts? Like for MCTemporalDenoise for example, can I simply place that .avs into Avisynth's plugin folder and then have the script I'm using load it somehow?
Similarly, dll's in the plugins folder are loaded automatically without the need for LoadPlugin(). -
More questions for you guys. From what I've been reading, MDegrain and LSPMod are scripts. I'm still trying to wrap my head around this. Since they are scripts,am I only supposed to insert the text into this .avs file? I have all of the needed .dll files for both of them in my Avisynth plugins folder but I'm not sure if I'm supposed to use LoadPlugin for any or all of them.
.avsi are autoloading scripts if put into the plugins directory
.avs are manually loaded - use Import("path\script.avs") . You can rename extension to .avsi to autoload
BUT - you still have to make the calls in the script with the proper settings. Just because you have an autoloading script or dll, doesn't mean it works until you call it in the script. To call it in the script, you have to use the name. If you specify no arguments, it will use default values.
e.g.
AVISource("video.avi")
LSFMod()
the more stuff you accumulate in the plugins directory over the years for autoloading, the more slow everything will be. For this reason many people choose to manually load stuff
Don't use directshowsource() for your source filter. It's not consistent or necessarily frame accurate. I highly recommend using DGIndex for MPEG2 (DVD) sources.
There are instructions included with every avisynth filter. Sometimes in an .html file, sometimes in a text file
This is a telecined source. In order to recover the progressive frames, you have to inverse telecine. You can use TIVTC in avisynth to do this.
https://www.videohelp.com/glossary?T#Telecine
https://www.videohelp.com/glossary?I#Inverse%20Telecine,%20IVTC
http://en.wikipedia.org/wiki/Telecine
This sample isn't very noisy compared to other anime, also it's the remastered version. The original had nasty field blends and was alot messier.
So an example script is below. This is just to get you started, you can add more filters or tweak it to your preferences. So I would index with DGIndex (make sure video=>field operation honor pulldown flags is set). You need TIVTC.dll in the plugins directory.
Code:MPEG2Source("DBZ Remastered Intro VOB.d2v") TFM().TDecimate() MCTemporalDenoise(settings="high",strength=250,edgeclean=true) LanczosResize(624,352)
A good tool to use is avsp. You can compare different scripts in different tabs and switch back & forth to preview. It's a good way to learn the effects of the various filters. -
-
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
MPEG2Source("c:\Documents and Settings\Administrator\Desktop\Project X\Dragon Ball GT Project\Waiting For Encode\01.d2v")
TFM().TDecimate()
MCTemporalDenoise(settings="high",strength=250,edg eclean=true)
Tweak (sat=1.3)
LanczosResize(624,352)
can you open .avs file in vdub ?
Did you do full install of avisynth?
Yar. Ver. 1.5.8.0.
otherwise you have to LoadPlugin("PATH\dgdecode.dll")
I get that error no matter what I do. It doesn't matter what's in the script. Now it's saying "Problem in Avisynth Script. Attempted to read or write to protected memory. This is often an indication that other memory is corrupt."Last edited by Nagashi; 21st Jun 2010 at 13:33.
-
I've never seen that error message before
maybe you have a bad memory stick?
try running memtest86+ or other memory integrity programs
Try rebooting
Did you create the script in notepad? Try copy & paste into notepad, save, then rename .txt extension to .avs
Also, be careful about adding that high of a saturation (i noticed you added tweak(sat=1.3) - it will override gradients and obscure lines. This source is already very saturated IMO. I added a screenshot in a zip file comparing to illustrate (comparing original script and if you added tweak(sat=1.3). - you can notice the shading is destroyed
I highly recommend you use avsp to monitor your previews and see what the script and filters are actually doing - this is how you learnLast edited by poisondeathray; 21st Jun 2010 at 13:44.
-
If you are getting errors from any script, it's probably something incompatible in your autoload plugins folder. Did this problem start around the time you added a bunch of new plugins?
Try emptying out the folder (apart from the standard DirectShowSource.dll) and copy them in one at a time until you find the culprit.
If you post a list of the folder contents here, perhaps we can identify something wrong.
BTW What OS are you running? -
Hold on, how can you preview it in megui if you get that error message?
Try emptying out the folder (apart from the standard DirectShowSource.dll) and copy them in one at a time until you find the culprit.
Question: Is it possible to encode parts of a video file? And can I select which parts by using a time code? -
Question: Is it possible to encode parts of a video file? And can I select which parts by using a time code?
Trim(1000,2000) would encode frames 1000-2000 -
Arg... Ok. I am trying to get Avisynth to load a mkv video and mp3 audio file, but it refuses to load the mp3 audio file. I have tried nicaudio.dll and mpasource.dll w/ no luck.
Here's what it's looking like so far:
Video=DirectShowSource("C:\Users\Nagashi\Desktop\Project X\DVD Author Lab\no audio.mkv")
Audio=NicMPASource("C:\Users\Nagashi\Desktop\Project X\DVD Author Lab\01.mp3")
AudioDub(Video,Audio) -
other source filters you could try for audio (you need the plugins for the first 2, they are not internal avisynth source filters)
FFAudioSource() - from FFMpegSource2 project
BassAudioSource()
DirectShowSource()
DirectShowSource() is not recommended, and used only as the last resort, especially if you are doing temporal filtering in the video (it's not frame accurate). For the video, I wouldn't use it either, I would use FFVideoSource() which indexes your file, and is frame accurate
eg.
vid=FFVideoSource("no audio.mkv")
aud=FFAudioSource("01.mp3")
AudioDub(vid,aud) -
Thank you very much. Your limitless well of knowledge never ceases to amaze me.
-
As well as poisondeathray's suggestions, you could try a more recent version of nicaudio, where the function is called NicMPG123Source.
http://nicaudio.codeplex.com/
Similar Threads
-
Convert a DVD to an avi,mkv using Avisynth Scripts and VDubMod or MeGUI
By ppeterr in forum DVD RippingReplies: 6Last Post: 25th Apr 2010, 05:04 -
AVS scripts for MeGUI - why do they resize the video
By Bully9 in forum Video ConversionReplies: 0Last Post: 17th Mar 2010, 16:16 -
I need some help on writing H.264 AVISynth scripts
By rocky12 in forum Newbie / General discussionsReplies: 46Last Post: 6th Dec 2008, 13:40 -
H.264 deinterlacing AVISynth scripts for 29.97fps
By PuzZLeR in forum Video ConversionReplies: 12Last Post: 7th May 2008, 22:36 -
Avisynth scripts and VDubMOD filters
By GangstaRap in forum Newbie / General discussionsReplies: 2Last Post: 13th May 2007, 11:39