『漫游』酷论坛>『影音数码技术学习交流』>影音精华区>XviD制作教程(10.22update)

XviD制作教程(10.22update)

vincent@2003-04-11 19:49

制作所需软件:
DVD2AVIdg/MPEG2DEC3dg Version 1.0.0
AviSynth 2.5.2
XviD MPEG4 codec
VirtualDubMod 1.5.4.1
AviSynth_250 plugins:
Decomb5.0.0
Gordian Knot 0.28

1.用DVD2AVI分离mpeg2文件的音频流,确定视频流的规格信息.
首先选择Video - Field Operation,设置为None。按F5开始预览。让它运行一会儿,观察status窗口。这里有两个你需要记住的东西:第一个是Aspect Ratio,要么是16:9要么是4:3,另一个是frame type。

最后根据情况保存DVD2AVI工程文件
①视源全部为Progressive的或者Video Type是FILM并打开了Forced Film
File->Save Project [F4]
②视源是Interlaced的或者部分Interlaced部分Progressive
File->Save Project (1.76)

2.编写Avisynth script生成avs档
下是一个Avisynth script模板,带"#"内容以不起作用,根据使用情况去掉或者加上
根据上述①②分两种情况:
①的情况(YV12制程)
mpeg2_P.avs:
复制代码
  1. LoadPlugin("MPEG2Dec3dg.dll")
  2. mpeg2source("xxx.d2v")
  3. crop(6,4,-6,-4)
  4. LanczosResize(640,480)
  5. # DENOISING: choose one combination (or none)
  6. #LoadPlugin("UnDot.dll")
  7. #UnDot()
  8. #UnDot is a simple median filter for removing dots, that is stray orphan pixels and
  9. #mosquito noise. It basicly just clips each pixel value to stay within min and max
  10. #of its eight surrounding neigbors.
  11. #LoadPlugin("Convolution3d.dll")
  12. #Convolution3d("movielq")
  13. #Convolution3d (preset="movieHQ") // Movie Hi Quality (good DVD source)
  14. #Convolution3d (preset="movieLQ") // Movie Low Quality (noisy DVD source)
  15. #Convolution3d (preset="animeHQ") // Anime Hi Quality (good DVD source)
  16. #Convolution3d (preset="animeLQ") // Anime Low Quality (noisy DVD source)
  17. #Convolution3d (preset="animeBQ") // Anime Bad Quality (???)
  18. #Convolution3d (preset="vhsBQ") // VHS capture Bad Quality (???)


②的情况(YUY2制程)
mpeg2_I.avs:
复制代码
  1. LoadPlugin("LoadPluginEx.dll")
  2. LoadPlugin("MPEG2DEC2.dll")
  3. mpeg2source("xxx.d2v")
  4. #首先确定你DVD2AVI时是把Field Operation设为None,否则不要使用以下内容
  5. LoadPlugin("Decomb500.dll")
  6. #FieldDeinterlace()
  7. #影片做Deinterlace (Frame Rate:25.000 fps, Video Type:PAL,Frame Type:Interlaced)
  8. #预览画面,仔细观察。如果你没有看到水平黑线那么实际上图像是progressive的,则影片不用做Deinterlace
  9. #Telecide(order=1,guide=1)
  10. #Decimate(cycle=5)
  11. #影片做IVTC (Frame Rate:29.970 fps, Frame Type:Interlace, Field Order:Top Field First, NTSC 3:2 pulldown)
  12. #若影片的Field Order是Bottom Field First,则设置order=0;不是3:2 pulldown的去掉",guide=1"
  13. #判断Field Order和3:2 pulldown的方法请看order_guide.avs
  14. crop(8,66,-6,-60)
  15. #切边:最后兩个数字一定要为负数,所以請手動加上"-"
  16. #按照GK的Resolution里面的数值填上Crop(left,top,-width,-height)
  17. LanczosResize(640,352)
  18. #放大縮小,按照GK的Resolution里面的Width x Height数值填上LanczosResize(width,height)
  19. #LumaFilter(+10,1.1)
  20. #亮度滤镜
  21. #变暗:LumaFilter(-10,0.9)
  22. #变亮:LumaFilter(+10,1.1)
  23. #LumaFilter(clip, integer "lumoff", float "lumgain")
  24. #the transfomation is : yy = (y*lumgain)+lumoff
  25. #lumoff : Luminosity offset. default = -2 (for iago ^^)
  26. #lumgain : Luminosity gain. default = 1
  27. # DENOISING: choose one combination (or none)
  28. #LoadPlugin("UnDot.dll")
  29. #UnDot()
  30. #LoadPlugin("FluxSmooth-2.5.dll")
  31. # little noise
  32. #FluxSmooth(5,7)
  33. # medium noise
  34. #FluxSmooth(7,7)
  35. # heavy noise
  36. #FluxSmooth(10,15)
  37. #调用字幕
  38. #LoadPlugin("VSFilter.dll")
  39. #TextSub("xxx.ssa")


order_guide.avs:
复制代码
  1. LoadPlugin("LoadPluginEx.dll")
  2. LoadPlugin("MPEG2DEC2.dll")
  3. LoadPlugin("Decomb500.dll")
  4. mpeg2source("xxx.d2v")
  5. AssumeTFF().SeparateFields()
  6. #Telecide(order=1,guide=1,post=0,show=true)
  7. # 1.Set the Field Order:
  8. #Add a script line to separate the fields using top field first, as follows:
  9. #AssumeTFF().SeparateFields()
  10. #Now serve the script into VirtualDub and find an area with motion. Single step forward
  11. #through the motion. Note whether the motion progresses always forward as it should, or
  12. #whether it jumps back and forth as it proceeds. For example, if the field order is wrong,
  13. #an object moving steadily from left to right would move right, then jump back left a
  14. #little, then move right again, etc. If the field order is correct, it moves steadily to
  15. #the right.
  16. #If the motion is correct with AssumeTFF().SeparateFields(), then your field order is top
  17. #field first and you must set order=1. If the motion is incorrect, then your field order
  18. #is bottom field first and you must set order=0
  19. # 2.Set up Pattern Guidance:
  20. #Second, you can serve the following script into VirtualDub and see what Telecide() reports
  21. #about it (remember to use the correct field order as you determined it above).
  22. #AviSource("your_clip.avi")
  23. #Telecide(order=1,guide=1,post=0,show=true)
  24. #Serve this into VirtualDub and step through several typical sections of your clip. If
  25. #Telecide() reports "in-pattern", or "in-pattern*", then it is locking onto 3:2 pulldown.
  26. #If it reports "out-of-pattern" or continuously jumps in and out of pattern lock, then it
  27. #is not locking onto a consistent 3:2 pattern.
  28. #If you determine that your clip has a lot of 3:2 content, then you should go ahead and set
  29. #guide=1. If there is not a lot of 3:2 content, or you have any doubts about the nature of
  30. #the clip, then you should set guide=0.


以上avs需要用VirtualDubMoD打开预览并根据情况修改相关内容,直到预览的画面没有问题再进行下一步的真正编码.

3.用VirtualDubMoD打开最终的avs档,进行MPEG-4编码,生成Avi档
Video-->Fast recompress
xvid 1psss setting:
Global选项里
Quantization type-->H.263
VHQ mode--> 0-Off
Maximum / Minimum I-frame interval-->240 / 1
将最大关键帧设为每秒帧数的10倍(例如:240、250、300)
Use Chroma motion
Maximum B-frames-->2
B-frames quantizer ratio(%)-->100
B-frames quantizer offset-->1
B-frames threshold-->0
DX50 B-VOP compatibility

Two Pass里:
在1st pass stats指定一个目录来保存video.stats
File->save as...(F7)开始做1pass

完成后在Gordian Knot中的NanDUB Files中,OPEN打开XVID 1st pass建立的video.stats文件。
回到GK的Bitrate界面上,进行码流计算和決定要做成多少CD版本.通过调整Total File Size使Video Size/1st Pass Size的比值在30%-40%左右就可以达到质量和大小之间的平衡了.
拷贝在Video Size 這一栏里的那个xxxxxx KB的值,这个在VirtualDubMoD做2pass-int时会用到

2 Pass - 2nd pass int setting:
在Desired size(Kbtyes)填入之前在GK拷贝的那个值,即刚才在GK计算记下Video Size的大小(KB那个数值)
Advanced option...
B-frames quantizer offset-->200
Two Pass:
确定1st pass stats为之前做1pass时生成的video.stats文件
Bitrate payback delay (frames)->240
应设为每秒帧数的10倍(例如:240、250、300)

在Debug里:
把Chroma Optimizer和Use trellis R-D quantisation(该选择只对H.263有效)都选上

File->save as...(F7)开始做2pass

4.最后用VDM或NanDub合成音频流.

附上xvid-dev-api-4-2003-10-05的推荐设置
2-pass,chroma motion,h263,vhq4,BVOPs=2,ratio=1,offset=2,Trellis quantisation
引用

seth@2003-04-11 20:27

感謝指教哩 ^_________^

收下哩

很棒的教學說
引用

jacula@2003-04-12 08:09

请问怎么吧200M一集的DIVX4,5转成100M左右一集的XVID
两者画质几乎没区别呀
引用

vincent@2003-04-12 13:38

引用
最初由 jacula 发布
请问怎么吧200M一集的DIVX4,5转成100M左右一集的XVID
两者画质几乎没区别呀

不损失画质是不可能的.
而且二次压缩,画质损失更加严重..
最好还是找片源自己重新压制.
引用

dis510@2003-04-13 14:35

直接從VOB壓縮嗎?
還有,先用LAME把聲音轉成VBR能減小文件的容量嗎?
引用

JJob@2003-04-13 15:44

不错不错!回去试试!收下了!谢谢!
引用

vincent@2003-04-27 22:14

更新一下!
引用

seth@2003-04-27 22:34

用YV12,MPEGDecoder.dll,2-pass 2nd pass Ext的方法制片教程:
我看不了

不過很感謝 vincent兄 的教學

大多設置一樣, B-f那邊不太一樣, 看來好好研究哩 ^________^
引用

haohao@2003-04-28 03:34

是啊!
太复杂了,要好好研究才行,谢谢楼主
引用

skywalker@2003-04-28 05:06

关于XVID的设置,建议使用
VHQ=1, 虽然速度会慢一点, 但换来更高的质量是值得的
另外BF的设置在1st-pass和2-nd pass的时候最好保持一致,这样2-pass才会更精确.
引用

fssupu@2003-04-28 23:51

MPEGDecoder YV12 Version 2.02

这个软件在哪里有上面那几个网站都找不到?
引用

WINGX@2003-04-29 01:08

引用
最初由 fssupu 发布
MPEGDecoder YV12 Version 2.02
这个软件在哪里有上面那几个网站都找不到?


MPEGDecoder 2.03a YV12
http://www.dvdguru.net/index.php?pgid=5
引用

yukicarl@2003-04-29 16:09

~~~

强烈要求置顶~~

就差这个了~

还有就是B帧的问题了,而且问题多多~
引用

fssupu@2003-04-29 23:50

LoadPlugin("D:\Program Files\GordianKnot\MPEGDecoder.dll")
LoadPlugin("D:\Program Files\GordianKnot\Decomb.dll")
LoadPlugin("D:\Program Files\GordianKnot\VSFilter.dll")
MPEGSource("E:\divx\ind.d2v")
Telecide(guide=1).Decimate(5)
Crop(8,6,-2,-0)
LanczosResize(640,464)
VirtualDubMod 1.4.13.2v2打开的时候老说我67行出错,怎么回事呢?
引用

vincent@2003-05-21 01:51

引用
最初由 fssupu 发布
LoadPlugin("D:\Program Files\GordianKnot\MPEGDecoder.dll")
LoadPlugin("D:\Program Files\GordianKnot\Decomb.dll")
LoadPlugin("D:\Program Files\GordianKnot\VSFilter.dll")
MPEGSource("E:\divx\ind.d2v")
Telecide(guide=1).Decimate(5)
Crop(8,6,-2,-0)
LanczosResize(640,464)
VirtualDubMod 1.4.13.2v2打开的时候老说我67行出错,怎么回事呢?

照看好像没有错.提示什么错?:confused:
引用

«123»共3页

| TOP