view DOCS/zh/encoding.html @ 9461:17cf28e5846a

Update sub-picture layer to work with recent DirectFB cvs and add support for selecting field parity. Patch by Ville Syrjl <syrjala@sci.fi>
author alex
date Wed, 19 Feb 2003 16:01:46 +0000 (2003-02-19)
parents a604236b0dd6
children 883f38591d47
line wrap: on
line source
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>

<HEAD>
  <TITLE>園鷹 -- MEncoder -- Linux和議窮唹園鷹匂</TITLE>
  <LINK REL="stylesheet" TYPE="text/css" HREF="default.css">
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gbk">
</HEAD>

<BODY>


<H1><A NAME="encoding">7. 喘MEncoder園鷹</A></H1>

<P>MEncoder議畠何辛喘僉�才幣箭萩心man page。匯乂糞喘議箭徨才斤匯乂園鷹歌方議�勝議盾瞥萩心貫<A 
HREF="http://mplayerhq.hu/mailman/listinfo/mplayer-users">mplayer-users</A>喨周双燕嶄朴鹿栖議<A
HREF="tech/encoding-tips.txt">園鷹室派</A>。朴沫<A HREF="http://mplayerhq.hu/pipermail/mplayer-users/">喨周
猟亀</A>辛參孀欺喘MEncoder園鷹議光圭中參式侭囑欺諒籾議戟源議網胎。</P>


<H4><A NAME="2pass">7.1 2賜宀3-pass議MPEG-4("DivX")園鷹</A></H4>

<P><U><B>2-pass園鷹�</B></U>兆各栖徭宸嶽圭隈糞縞委猟周園鷹<I>曾肝</I>議並糞。及匯肝園鷹(嗽各葎<I>pass</I>)幹秀匯乂匝扮來議叱孥議猟周(*.log)�
枠音勣評茅麿断(低辛參委AVI評阻)。壓及屈肝園鷹嶄�繍聞喘匝扮猟周議曳蒙楕方象幹秀補竃猟周�恷朔恢伏議猟周繍嗤挫誼謹議夕�嵎楚。泌惚宸頁低及匯肝油欺宸倖�
低哘乎壓利貧臥堋匯乂辛喘議峺掴。</P>

<P>宸倖箭徨處幣泌採委DVD園鷹撹葎2-pass議MPEG-4("DIVX")議AVI。峪俶勣曾倖凋綜�<BR>
  <CODE>&nbsp;&nbsp;&nbsp;&nbsp;rm frameno.avi</CODE> -- 評渠宸倖猟周�万辛嬬栖徭參念議3-pass園鷹(万氏孤氾輝念園鷹)<BR>
  <CODE>&nbsp;&nbsp;&nbsp;&nbsp;mencoder -dvd 2 -ovc lavc -lavcopts
    vcodec=mpeg4:vpass=1 -oac copy -o movie.avi<BR>
  &nbsp;&nbsp;&nbsp;&nbsp;mencoder -dvd 2 -ovc lavc -lavcopts
    vcodec=mpeg4:vpass=2 -oac copy -o movie.avi</CODE></P>

<P><U><B>3-pass園鷹�</B></U>宸頁2-pass園鷹議制婢�斤咄撞議園鷹聞喘匯倖汽鏡議園鷹。宸嶽圭隈戻工容呪篇撞曳蒙楕議浩柴參聞岻嬬校癖栽CD議否楚。揖扮�
音揖噐2-pass圭塀�咄撞叙叙瓜園鷹匯肝。荷恬双燕�</P>

<OL>
  <LI>評茅喝融議匝扮來議猟周�
    <P><CODE>rm frameno.avi</CODE></P></LI>
  <LI>及匯肝園鷹�
    <P><CODE>mencoder &lt;file/DVD&gt; -ovc frameno -oac mp3lame -lameopts vbr=3 -o frameno.avi</CODE></P> <P>繍幹秀匯倖峪嗤咄撞議avi猟周�<B>峪</B>淫根勣箔議咄撞送。音勣梨芝<CODE>-lameopts</CODE>�泌惚俶勣議三譜崔万。泌惚低斤匯何海議窮唹序佩園鷹�
MEncoder壓宸倖pass潤崩岻朔�繍斤噐650Mb�700Mb�才800Mb議朕炎寄弌嬉咫容呪議曳蒙楕峙。</P></LI>
  <LI>及屈肝園鷹�
    <P><CODE>mencoder &lt;file/DVD&gt; -oac copy
      -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=&lt;bitrate&gt;</CODE></P>
    <P>宸頁及匯肝篇撞園鷹。辛參僉夲峺協壓貧匯化潤崩扮MEncoder嬉咫議篇撞曳蒙楕。</P></LI>
  <LI>及眉肝pass�
    <P><CODE>mencoder &lt;file/DVD&gt; -oac copy
      -ovc lavc -lavcopts vcodec=mpeg4:vpass=2:vbitrate=&lt;bitrate&gt;</CODE></P>
    <P>宸頁及屈肝篇撞園鷹。峺協効貧匯肝園鷹匯劔議曳蒙楕茅掲低寔議岑祇徭失壓孤焚担。壓宸肝園鷹嶄�喘<CODE>frameno.avi</CODE>
嶄議咄撞繍瓜峨秘欺朕議猟周嶄..宸祥畠何吾協阻�</P></LI>
</OL>

<H4>3-pass園鷹議箭徨�</H4>

<P><CODE>&nbsp;&nbsp;&nbsp;&nbsp;rm frameno.avi</CODE> -- 卞肇宸倖猟周�万辛嬬栖徭參念議3-pass園鷹(万氏孤氾輝念園鷹)<BR>
  <CODE>&nbsp;&nbsp;&nbsp;&nbsp;mencoder -dvd 2 -ovc frameno
    -o frameno.avi -oac mp3lame -lameopts vbr=3<BR>
  &nbsp;&nbsp;&nbsp;&nbsp;mencoder -dvd 2 -ovc lavc
    -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o movie.avi<BR>
  &nbsp;&nbsp;&nbsp;&nbsp;mencoder -dvd 2 -ovc lavc
    -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o movie.avi</CODE></P>

<H2><A NAME="mpeg">7.2 園鷹葎MPEG鯉塀</A></H2>

<P>MEncoder辛參伏撹MPEG(MPEG-PS)鯉塀議補竃猟周。万断辛嬬峪嬬喘噐libavcodec議<I>mpeg1video</I>園盾鷹匂�咀葎匯違殴慧匂 -
- 茅阻MPlayer -- 範葎MPEG猟周嶄淫根議頁MPEG1篇撞送才MPEG1 layer 2(MP2)咄撞送。</P>
  
<P>宸倖蒙來朕念栖傍短嗤焚担喘侃�遇拝辛嬬珊嗤載謹bug�凪嶷勣來壓噐朕念MEncoder涙隈園鷹MPEG1 layer 2 (MP2)議咄撞�遇万屎頁艶議殴慧
匂範葎MPEG猟周嶄哘乎嗤議。</P>
  
<P>勣個延MEncoder議補竃猟周鯉塀�辛參聞喘<CODE>-of mpeg</CODE>僉�。</P>

<P>幣箭�<BR>
  &nbsp;&nbsp;<CODE>mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video
  -oac copy &lt;other options&gt; media.avi -o output.mpg</CODE></P>


<H2><A NAME="rescaling">7.3 窮唹壅抹慧</A></H2>

<P>委窮唹夕�議樫雁嶷仟譜崔議俶勣将械竃�。圻咀辛嬬載謹�箭泌受弌補竃猟周議寄弌�利大揮錐吉吉�載謹繁封崛壅委DVD賜SVCD園鷹葎欺DivX
議AVI議扮昨匆嶷仟抹慧�<B>宸頁危列議</B>。壓宸担恂岻念�萩枠堋響<A HREF="#aspect">隠隔徳鳥互錐曳</A>何蛍。</P>

<P>抹慧狛殻喇<I>'scale'</I>篇撞陀承侃尖�<CODE>-vop scale=widht:height</CODE>。凪嵎楚喇<CODE>-sws</CODE>僉�陣崙。泌惚万短嗤峺協�
MEncoder繍聞喘0�酔堀屈肝�來抹慧。</P>

<H5>喘隈:</H5>
  <CODE>&nbsp;&nbsp;&nbsp;&nbsp;mencoder sample-svcd.mpg -lavcopts
    vcodec=mpeg4:more_options -vop scale=640:480 -sws 2 -o
    output.avi</CODE></P>


<H2><A NAME="copying">7.4 送鹸崙</A></H2>

<P>MEncoder嬬喘曾嶽圭塀侃尖補秘送�<B>園鷹</B>賜宀<B>鹸崙</B>麿断。宸何蛍頁購噐<B>鹸崙</B>議。</P>

<UL>
  <LI><B>篇撞送</B>(<CODE>-ovc copy</CODE>僉�)� 辛參孤議載挫:)<BR>
    曳泌�委FLI賜宀VIVO賜宀MPEG1議篇撞慧(音頁廬晒)欺AVI猟周嶄。輝隼峪嗤MPlayer嬬殴慧宸劔議猟周�)。遇拝辛嬬壓�糞伏試嶄短嗤販採勺峙。
栽尖聞喘�曳泌篇撞送鹸崙辛參喘噐峪嗤咄撞送俶勣瓜園鷹議秤趨(曳泌�貫掲儿抹議PCM園鷹葎MP3)。</LI>

  <LI><B>咄撞送</B>(<CODE>-oac copy</CODE>僉�)� 岷俊阻輝。辛參委匯倖翌何咄撞猟周(MP3�Vorbis)栽襖欺補竃送嶄。
聞喘<CODE>-audiofile &lt;filename&gt;</CODE>僉夲栖糞�宸倖孔嬬。</LI>
</UL>


<H2><A NAME="fixing">7.5 俐鹸沫哈賜宀住危鱒撒議AVI </A></H2>

<P>恷否叟議並秤。厘断酒汽仇鹸崙篇撞才咄撞送�旺喘MEncoder恢伏沫哈。輝隼宸音嬬俐鹸篇撞才/賜宀咄撞送嶄辛嬬議危列。
宸揖劔匆辛參俐鹸住危鱒撒議猟周�
聞万断音壅俶勣<CODE>-ni</CODE>僉�。</P>

<P>凋綜�<CODE>mencoder -idx input.avi -ovc copy -oac copy -o output.avi</CODE></P>

<H3><A NAME="appending">7.5.1 栽旺謹倖AVI猟周</A></H3>

<P>恬葎俐鹸鱒撒議AVI猟周議険恢麗�MEncoder辛參喘栖俐鹸曾倖賜謹倖AVI猟周栽旺伏撹議猟周�</P>

<P>凋綜�<CODE>cat 1.avi 2.avi | mencoder -noidx -ovc copy -oac copy -o output.avi -</CODE></P>

<P><B>廣吭�</B>宸勣箔1.avi才2.avi聞喘揖劔議園盾鷹匂�蛍掩楕�送堀楕吉吉�旺拝崛富1.avi音頁鱒撒議。低辛嬬俶勣枠俐鹸低議
AVI補秘猟周�梓孚<A HREF="#fixing">貧中</A>侭傍議圭隈。</P>


<H2><A NAME="libavcodec">7.6 喘libavcodec園盾鷹匂怛園鷹</A></H2>

<P><A HREF="codecs.html#libavcodec">libavcodec</A>戻工酒汽園鷹俯謹嗤箸議篇撞才咄撞鯉塀(朕念凪咄撞園鷹匂珊音屶隔)議圭隈。
低嬬園鷹和双議園鷹鯉塀�</P>

<UL>
  <LI>mjpeg -- Motion JPEG</LI>
  <LI>h263 -- H263</LI>
  <LI>h263p -- H263 Plus</LI>
  <LI>mpeg4 -- DivX4</LI>
  <LI>msmpeg4 -- 析議DivX</LI>
  <LI>msmpeg4v2 -- Micro$oft MPEG4 V2 (DivX議嗽各葎MP43議念渦)</LI>
  <LI>rv10 -- 析議RealVideo園鷹鯉塀</LI>
  <LI>mpeg1video -- MPEG1篇撞�)</LI>
</UL>

<P>及匯生頁哘乎壓<CODE>vcodec</CODE>僉�戦譜崔議園鷹鯉塀議兆各�曳泌�<CODE>-lavcopts vcodec=msmpeg4</CODE></P>

<P>箭泌�斤噐聞喘MJPEG儿抹�<BR>
  <CODE>&nbsp;&nbsp;&nbsp;&nbsp;mencoder -dvd 2 -o title2.avi -ovc lavc
    -lavcopts vcodec=mjpeg -oac copy</CODE></P>


<H2><A NAME="image_files">7.7 喘補秘議謹嫌夕�猟周(JPEG�PNG賜TGA)序佩園鷹</A></H2>

<P>MEncoder醤嗤貫匯倖賜謹倖JPEG�PNG賜TGA猟周幹秀窮唹議嬬薦。宥狛酒汽議framecopy万嬬幹秀MJPEG(Motion JPEG)�
MPNG(Motion PNG )賜MTGA(Motion TGA)猟周。</P>

侃尖狛殻議盾瞥�

<OL>
  <LI>MEncoder聞喘<CODE>libjpeg</CODE><I>盾鷹</I>補秘夕�(輝盾鷹PNG扮繍聞喘<B>libpng</B>)。</LI>

  <LI>MEncoder俊彭委盾鷹朔議夕�旅公侭僉議議篇撞儿抹匂(DivX4�Xvid�ffmpeg msmpeg4吉吉)。</LI>
</OL>

<H4>箭徨</H4>

<P><CODE>-mf</CODE>僉�議盾瞥嬬壓man page嶄孀欺。</P>

<P><I>喘輝念朕村嶄議侭嗤JPEG猟周幹秀DivX4猟周�</I><BR>
  &nbsp;&nbsp;<CODE>mencoder \*.jpg -mf on:w=800:h=600:fps=25 -ovc divx4 -o
  output.avi</CODE></P></P>

<P><I>喘輝念朕村嶄議匯乂JPEG猟周幹秀DivX4猟周�</I><BR>
  &nbsp;&nbsp;<CODE>mencoder -mf on:w=800:h=600:fps=25 -ovc divx4 -o output.avi \*.jpg</CODE></P>

<P><I>喘輝念朕村嶄議侭嗤JPEG猟周幹秀Motion JPEG(MJPEG)猟周�</I><BR>
  &nbsp;&nbsp;<CODE>mencoder -mf on:w=800:h=600:fps=25 -ovc copy -o output.avi \*.jpg</CODE></P>

<P><I>喘輝念朕村嶄議侭嗤PNG猟周幹秀匯倖掲儿抹議猟周�</I><BR>
  &nbsp;&nbsp;<CODE>mencoder -mf on:w=800:h=600:fps=25:type=png -ovc rawrgb -o output.avi \*.png</CODE></P>

<P><B>廣吭�</B>錐業駅倬頁4議屁方蔚�宸頁RAW RGB AVI鯉塀議匯倖�崙。</P>

<P><I>喘輝念朕村嶄議侭嗤PNG猟周幹秀Motion PNG(MPNG)猟周�</I><BR>
  &nbsp;&nbsp;<CODE>mencoder -mf on:w=800:h=600:fps=25:type=png -ovc copy -o output.avi \*.png</CODE></P>

<P><I>喘輝念朕村嶄議侭嗤TGA猟周幹秀Motion TGA(MTGA)猟周�</I><BR>
&nbsp;&nbsp;<CODE>mencoder -mf on:w=800:h=600:fps=25:type=tga -ovc copy -o output.avi \*.tga</CODE></P>


<H2><A NAME="vobsub">7.8 繍DVD忖鳥戻函葎Vobsub猟周</A></H4>

<P>MEncoder嗤委DVD忖鳥戻函欺Vobsub鯉塀議猟周議嬬薦。淫凄參<CODE>.idx</CODE>才<CODE>.sub</CODE>潤硫議匯斤
猟周遇拝宥械嬉淫壓匯倖汽匯議<CODE>.rar</CODE>猟亀嶄。MPlayer嬬聞喘<CODE>-vobsub</CODE>才<CODE>-vobsubid</CODE>
僉�殴慧万断。</P>

<P>低聞喘<CODE>-vobsubout</CODE>僉�号協補竃猟周議児兆各(祥頁音淫凄<CODE>.idx</CODE>賜宀<CODE>.sub</CODE>議朔弸)才
<CODE>-vobsuboutindex</CODE>峺協忖鳥壓補竃猟周嶄議沫哈催。</P>

<P>泌惚補秘音頁栖徭DVD低駅倬聞喘<CODE>-ifo</CODE>栖峺苧更夛<CODE>.idx</CODE>猟周俶勣議<CODE>.ifo</CODE>猟周。</P>

<P>泌惚補秘音頁栖徭DVD遇拝低匆短嗤<CODE>.ifo</CODE>猟周低繍俶勣聞喘<CODE>-vobsubid</CODE>僉�斑万阻盾壓<CODE>.idx</CODE>
猟周嶄慧崔焚担劔議language id。</P>

<P>泌惚<CODE>.idx</CODE>才<CODE>.sub</CODE>猟周厮将贋壓�耽肝塰佩繍弖紗塰佩資誼議忖鳥。咀緩�低哘乎壓蝕兵岻念評渠侭嗤叫廉。</P>

<H4>箭徨</H4>

<P><I>壓序佩3-pass園鷹議揖扮貫DVD鹸崙曾芸忖鳥</I><BR>
  &nbsp;&nbsp;<CODE>rm subtitles.idx subtitles.sub</CODE><BR>
  &nbsp;&nbsp;<CODE>mencoder -dvd 1 -vobsubout subtitles -vobsuboutindex 0
    -sid 2 -o frameno.avi -ovc frameno</CODE><BR>
  &nbsp;&nbsp;<CODE>mencoder -dvd 1 -oac copy -ovc divx4 -pass 1</CODE><BR>
  &nbsp;&nbsp;<CODE>mencoder -dvd 1 -oac copy -ovc divx4 -pass 2 -vobsubout
    subtitles -vobsuboutindex 1 -sid 5</CODE></P>

<P><I>貫匯倖MPEG猟周嶄鹸崙隈囂忖鳥</I><BR>
  &nbsp;&nbsp;<CODE>rm subtitles.idx subtitles.sub</CODE><BR>
  &nbsp;&nbsp;<CODE>mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles
    -vobsuboutindex 0 -vobsuboutid fr -sid 1</CODE></P>

<H2><A NAME="aspect">7.9 隠隔徳鳥互錐曳</A></H2>

<P>DVD才SVCD(匆祥頁MPEG1/2)猟周宥械淫根徳鳥互錐曳議峙�万宙峰殴慧匂泌採屎鳩抹慧篇撞送�隠屬繁音氏海痔軌辻期
(ex.: 480x480 + 4:3 = 640x480)。徽輝園鷹撹AVI(DivX)猟周扮�低駅倬賠佰議範紛欺AVI議猟周遊嶄短嗤刈贋宸倖方象。嶷仟抹慧窮唹
頁綜繁凵具議遇拝�債扮寂。駅倬嗤匯倖厚挫議蒙來�</P>

<P>和中祥頁。</P>

<P>MPEG4嗤匯倖蒙來�篇撞送辛參淫根万侭俶勣議徳鳥互錐曳�短危�祥効MPEG1/2猟周(DVD, SVCD)匯劔。凖唆議頁�茅阻MPlayer
岻翌<U>短嗤</U>篇撞殴慧匂屶隔宸倖蒙來。</P>

<P>宸倖蒙來峪嬬喘噐<B>libavcodec</B>議<CODE>mpeg4</CODE>園盾鷹匂。昔昔芝廖宸匯泣�勝砿MPlayer嬬屎鳩殴慧侭幹秀議猟周。
艶議殴慧匂珊氏聞喘危列議徳鳥互錐曳。</P>

<P>低哘乎範寔議委窮唹貧和議菜円俳渠。心man page阻盾<CODE>cropdetect</CODE>才<CODE>crop</CODE>陀承議聞喘。</P>

<H5>喘隈�</H5>

<P><CODE>$ mencoder sample-svcd.mpg -ovc lavc -lavcopts
  vcodec=mpeg4:aspect=16.0/9.0 -vop crop=714:548:0:14 -oac copy -o output.avi</CODE></P>

</BODY>
</HTML>