遊客:  註冊 | 登錄 | 幫助





標題: [分享] 認識 Avisynth (updated 5/13 Post 11)
  agelessoldman     Rank: 3
青出藍
性別 男
UID 5780

精華 0
帖子 361
積分 341   詳情

閱讀權限 40
註冊 2006-8-12
來自
狀態 離線

 
 
 
 
發表於 2007-3-23 03:58 PM  資料  個人空間  短訊  加為好友 
3/23

當需要用到各種美化影片濾鏡時候﹐而覺得 Avisynth 的內設濾鏡不夠完全﹐這時可以用第三者插件來加強功能。

這個網頁收集不少濾鏡插件﹐請在這裡下載需要的 filters :
http://avisynth.org/warpenterprises/

下載插件後﹐先解壓然後把所有解壓出來的檔案放在 Avisynth 的 plugins 文件夾內。這個文件夾的途徑應該是﹕C:\Program Files\Avisynth 2.5\Plugins .(如果解壓出來是一個文件夾﹐將裡面所有的檔案都移到 Avisynth plugins 夾內)。

在用外建插件時﹐都要加一句 'LoadPlugins("C:\Program Files\Avisynth\Plugins\xxxx.dll")' 指令﹐很繁瑣。可以利用下面這個 Registry Editor 將所有存在 plugins 文件夾內的濾鏡自動‘叫' (call)上來。

QUOTE:
REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth]
"plugindir2_5"="c:\\program files\\avisynth 2.5\\plugins"

將上面文字複製到 notepad 裡﹐另存為 AutoLoadAVS.reg。雙按這個 reg 檔再按 ok 就行。這樣在 script 裡只需要寫出濾鏡名稱和指令就可以。

Leak Kernel Deinterlace  拉絲插件

這是個很普遍但效果很不錯的一個高級『拉絲』濾鏡。使用比好幾個同類的插件簡單。有時候因為某種原因在某些畫面出現 interlace 的鏡頭時﹐這個濾鏡大致上都可以幫助解決。

這個是我很多時都用的 syntax:

QUOTE:
DirectShowSource("D:\Test.rmvb")
LeakKernelDeint(Order=0,threshold=10,Sharp=true,twoway=true)

Order : (0) 是 top field first 或 odd field, (1) 是 bottom field     
             first,或 even field. 這個很重要﹐如果搞錯會使到壓出來的影片
             不停的跳動。

Threshold : 濾鏡默認是 10, 調校範圍是 0 至 255。
                   假使 interlace 太厲害時﹐可以試試調高一點。

Sharp=true : 濾鏡默認是 false。目的是因為 deinterlace 在有些時候是
                      會將上下 field 融合一起 (blend),會使到畫面有一些模糊﹐
                      所以稍為加強銳化。

Twoway=true : 濾鏡默認是 false。這個可以不用﹐我用這個原因是要影片比較流暢一點﹐
                          不過代價是沒那麼清晰和轉檔稍微慢一點。
                          其實假若片源不是太糟的話﹐是不需要用的。

詳細的 parameters 請在 Avisynth Manual 裡找。

****************************************************************************************************


3/31

Decomb   高級拉絲插件

Decomb 是一個幾種不同拉絲濾鏡的 package (包裹)。包括有 Telecide, Decimate, Iscomb 和 FieldDeinterlace 。其中 field deinterlace 濾鏡是祇針對完全 interlace 的影片﹐非常適合 PAL 制的 TVcap 影片作拉絲程序。

DirectShowSource(“D:\test.rmvb”)
FieldDeinterlace()

這個例子是全用濾鏡本身默認的度數。參考以下 parameters (參量)來做需要的調整。

Full : 默認是 full=true, 意思是濾鏡程式會處理每一幁 (frame)畫面。
        full=false 就要濾鏡祇計算出所需要拉絲的畫面作出處理。

Threshold : 默認是 20﹐調整範圍是 0-255。當 full=true 時﹐
                  這個指令就會自動設定。用來設定偵測拉絲程度的上限。

Dthreshold : 默認是 7﹐調整範圍是 0-255。因為拉絲濾鏡是不需要把所有 frame 都作拉絲處理﹐
                    ( 在動作快速的畫面﹐interlace 的 frames 會效果更好 )
                    而這個指令是將已經作了拉絲的畫面作出處理的上限。
                    這是對付一些很頑固的 combing effects 作出調整。

Blend : 默認是 blend=true。把上下 fields 融合一起。

Chroma : 默認是 Chroma=false。這是把亮度和顏色作出分開 deinterlace 處理。


***************************************************************************************************


4/1

去除 『Blocks』 的插件


Blocks 就是影片偶爾在或多或少的時候出現的『格仔』。當轉 mpeg 時常見的 blocks 有兩種﹐一種是 macro block,另一種叫 DCT block。

Macro blocks 通常都是在壓縮 VCD (mpeg1) 時﹐因為畫面中有快速度的動作而壓縮程式分配 bitrate 時不很理想﹐另一個原因是調整 contrast 太過時也會顯現出來。
在壓縮 mpeg2 時會比較好一些﹐因為通常都會用高一點的 bitrate 來壓。

DCT blocks 通常是在原檔的 bitrate 不夠下﹐壓縮軟件讀不到原來的細節從而將部份畫面『磨』掉(smooth)所形成的效果﹐它不像 macro blocks 所呈現像『格仔』的 block﹐而會有一大片不同顏色的突然呈現出來。很多時都會在人面大特寫或一片背景牆壁﹐又或是一片天空、海洋畫面中上顯出。
這種 blocks 在 mpeg4 (avi, divx, xvid) 用過低 bitrate 來壓縮時也會產生。

所有去除 blocks 的濾鏡多多少少都會增加 bitrate 到部份需要的 pixels, 轉出來的影片會比較大一點。

Blockbuster  去除 DCT blocks 的濾鏡

這個濾鏡除了上述功能之外﹐有一個效果很不錯﹐就是當轉 TV rip 時而製作者 沒有做過任何畫面過濾﹐當畫面有煙霧的場面時﹐這個濾鏡就很管用。尤其是在比較黑暗的場面﹐譬如演唱會等。

Blockbuster (method="sharpen", block_size=4, strength=25)

Method = dither,noise,blurr,sharpen
我一直祇用(銳化) sharpen, 其他沒試過。可能用 blurr 在高 bitrate 的片源效果也許會不錯。

Block Size = 默認 8。最少 3。這個參數是代表濾鏡在每一幁片(frame)用多大的 block 來計算。每個參數都是高x寬 (H*W). 8x8 可能計算面積大了一點﹐不夠集中 ﹐做成在很多時候煙霧之外的 pixels 也算進去。我覺得效果比較不甚理想。
(這是本人自己的見解﹐不一定準確)。

Strength = 默認 25。這個是調整所用 method 的強弱﹐調整範圍是 1-100。

還有其他 parameters 我都不曾用﹐有興趣研究的朋友可以自己去看看這插件的說明。


**************************************************************************************************

5/13


DeBlock , TemporalCleaner

在眾多畫面『清潔』『清理』濾鏡之中﹐這兩個也是筆者比較多用。速度快而效果明顯。我不說“常用”而說多用是因為每一個濾鏡都會產生某程度的副作用﹐像 blurring,ringing,halo 之類等等。可以不需要時就儘量不用。最好是用於在壓縮高壓度之類的檔案(RMVB)之前。(DV-AVI/DVDRIP --> RMVB)

在清潔 RMVB 檔時要小心設定每個濾鏡不同的參數﹐將副作用減至最低。每個多媒體檔都有不同程度的需要﹐不能說固定用一個設定就可以全部都通用。

DEBLOCK

Deblock 是當畫面出現格仔 (macro blocks) 時候﹐它會將 block 裡的 pixels 模糊掉﹐讓畫面不那麼難看。缺點是設定過高會令不祇是起格的部份﹐而整個畫面都會被模糊掉。添加這個濾鏡後最好再加上銳化濾鏡在 script 的最後。Sharpen(填上).

默認是﹕ Deblock(25,0,0)或 Deblock()。第一個數字是濾鏡強度﹐調整範圍為0-60﹐第二個數字是代表濾鏡的上限﹐調得越高物體的邊線就越模糊。第三個數字是測查 blocks 和應用度數的參數。

下面這個 syntax 是從網上找到﹐可用作參考﹕

Deblock(35,1,1)

TemporalCleaner

清理畫面嘈音的濾鏡有兩大類﹐Spatial 和 Temporal.
Spatial 主要是清潔個別 frame 的嘈音﹐而 Temporal 是以多個 frames 作計算出嘈音的程度﹐從而作出清潔。上面所提及的 Deblock 是屬於 Spatial 的一種。

這個 TemporalCleaner 主要的功能其實可以說是加強影像檔的壓縮度。這個濾鏡用後出來的效果很 subtle (輕微)﹐在觀看時會感覺得好像跟以前沒什麼大分別﹐但是檔的大小會相差 8~10%。這證明濾鏡是有產生效用。

當然﹐加強參數肯定會有顯著的不同﹐祇是副作用也會隨之增加。

下面這個 syntax 例子可以用於甚至正版 DVD 的片源。(所有格式的多媒體都會帶有不同程度的嘈音)

TemporalCleaner(4,6)

濾鏡作者提議第一個參數不要超過 5﹐第二個參數可以去到 10 而不會令畫面出現反效果情形。



最後編輯: agelessoldman : 2007-5-13 09:30 PM
頂部

bahamut0     Rank: 2Rank: 2
藍之初
性別 保密
UID 964

精華 0
帖子 21
積分 120   詳情

閱讀權限 30
註冊 2006-7-14
來自
狀態 離線

 
 
 
 
發表於 2007-3-28 03:37 PM  資料  個人空間  短訊  加為好友 
In Doom9 site, it should have some of the editor for AviSynth scripting, the reason for that is if you use notepad for editing (which is the default editor for AviSynth). you would have some trouble for the script (e.g. typo on the script) until you run the script on a player, to encounter this, people have develop some AviSynth editor, one of them is AvsP, available at Doom9 site or below:

Download

it use color syntax for the script, and it has the preview window for previewing the script. so that you can correct it instantly. It might have trouble for matroska video since the decoder eats up resources pretty fast...

but for the new user this would be better then notepad.

I agree with the poster, once you get used to AviSynth, you can open virtually any video format file on your computer using a small size script file, provide that your video file is somewhere of your computer...you would be crazy on the filter once you get to use it.

The main reason for the AviSynth is frameserving, so that it can be frameserve to a video converter without losing quality for the video. the only thing that AviSynth might have trouble open with is the x.264 video. which must use mkv as a container to open it.

for the question above, try this script:


this would tell you if your AviSynth install correctly or not, it shows you version of your AviSynth, which is 2.5.7

If that works, then try to rename your file to *.rm, and try to see if it plays on your media player, although I highly doubt it is that cause the trouble.

If possible, can you post a screenshot for the error message?

頂部

  agelessoldman     Rank: 3
青出藍
性別 男
UID 5780

精華 0
帖子 361
積分 341   詳情

閱讀權限 40
註冊 2006-8-12
來自
狀態 離線

 
 
 
 
發表於 2007-3-28 11:06 PM  資料  個人空間  短訊  加為好友 


QUOTE:
the only thing that AviSynth might have trouble open with is the x.264 video. which must use mkv as a container to open it

Use ffdshow to decode x264, install haali splitter to decode mkv http://haali.cs.msu.ru/mkv/
AVISynth will have no trouble opening either file types.

Reason I didn't suggest using any avs text editors yet, is because my intention was to introduce avisynth to beginners, one must know the fundamental basics of syntaxes,  scripts and the usages before jumping into more advanced features.

The official text editor for Avisynth is : AVSEdit http://sourceforge.net/project/s ... p;package_id=107927

Although there are few other text editors available, some includes preview ability, I wouldn't recommend using them as yet. Not until you're  more familiar with the functions of various filters.

I'm trying to simplify the learning curve for many that have difficulty with  English language here. If you feel comfortable and ready to adventure onto more advanced tools, by all means, do it. For seasoned avisynth users, I'm sure they already have been using their own favorite Avisynth text editor.

BTW, x264 does not have to be in mkv container.



最後編輯: agelessoldman : 2007-3-28 11:12 PM
頂部


快速美言











一群熱心會員對本主題作出以下的回覆:

agelessoldman: RMK added - PID 87737 [ view ]
agelessoldman: RMK added - PID 87737 [ view ]
agelessoldman: RMK added - PID 88291 [ view ]



最後回覆日期: 2007-3-3 09:56 AM
  編輯帖子
快速美言
           


當前時區 GMT+8, 現在時間是 2024-5-3 11:32 PM

    Powered by Discuz!  © 2001-2007 Comsenz Inc.   
Processed in 0.815856 second(s), 8 queries

清除 Cookies - 聯繫我們 - LIPS Corner 新天藍 - Archiver