Mercurial > mplayer.hg
comparison DOCS/encoding.html @ 6106:f107ccf43d26
-lavcopts ... inserted since lavc is default encoder now
author | gabucino |
---|---|
date | Fri, 17 May 2002 04:09:37 +0000 |
parents | 796510223658 |
children | a463bb3a6135 |
comparison
equal
deleted
inserted
replaced
6105:b77b984120f9 | 6106:f107ccf43d26 |
---|---|
102 | 102 |
103 <P>This example shows how to encode a DVD to a 2-pass DivX4 AVI. Just two | 103 <P>This example shows how to encode a DVD to a 2-pass DivX4 AVI. Just two |
104 commands are needed :<BR> | 104 commands are needed :<BR> |
105 <CODE> rm frameno.avi</CODE> - remove this file, which | 105 <CODE> rm frameno.avi</CODE> - remove this file, which |
106 can come from a previous 3-pass encoding (it interferes with current one)<BR> | 106 can come from a previous 3-pass encoding (it interferes with current one)<BR> |
107 <CODE> mencoder -dvd 2 -divx4opts br=1100 | 107 <CODE> mencoder -dvd 2 -lavcopts vcodec=mpeg4:more_options |
108 -o movie.avi -pass 1<BR> | 108 -o movie.avi -pass 1<BR> |
109 mencoder -dvd 2 -divx4opts br=1100 -o movie.avi -pass 2</CODE></P> | 109 mencoder -dvd 2 -lavcopts vcodec=mpeg4:more_options -o movie.avi -pass 2</CODE></P> |
110 | 110 |
111 <P><U><B>3-pass encoding :</B></U> this is an extension of 2-pass encoding, | 111 <P><U><B>3-pass encoding :</B></U> this is an extension of 2-pass encoding, |
112 where the audio encoding takes place in a separate pass. This method enables | 112 where the audio encoding takes place in a separate pass. This method enables |
113 estimation of recommended video bitrate in order to fit on a CD. Also, the | 113 estimation of recommended video bitrate in order to fit on a CD. Also, the |
114 audio is encoded only once, unlike in 2-pass mode. The schematics :</P> | 114 audio is encoded only once, unlike in 2-pass mode. The schematics :</P> |
133 sizes, after this pass finishes.</B></TD> | 133 sizes, after this pass finishes.</B></TD> |
134 </TR> | 134 </TR> |
135 <TR> | 135 <TR> |
136 <TD><FONT CLASS="text"> | 136 <TD><FONT CLASS="text"> |
137 <CODE>mencoder <file/DVD> -oac copy -pass 1 | 137 <CODE>mencoder <file/DVD> -oac copy -pass 1 |
138 -divx4opts br=<bitrate></CODE></TD> | 138 -ovc divx4 -divx4opts br=<bitrate></CODE></TD> |
139 <TD><FONT CLASS="text"> | 139 <TD><FONT CLASS="text"> |
140 <B><U>Second pass</U> : alias the first pass of DivX4 video encoding. | 140 <B><U>Second pass</U> : alias the first pass of DivX4 video encoding. |
141 Optionally specify the video bitrate MEncoder printed at the end of the | 141 Optionally specify the video bitrate MEncoder printed at the end of the |
142 previous pass.</B></TD> | 142 previous pass.</B></TD> |
143 </TR> | 143 </TR> |
144 <TR> | 144 <TR> |
145 <TD><FONT CLASS="text"> | 145 <TD><FONT CLASS="text"> |
146 <CODE>mencoder <file/DVD> -oac copy -pass 2 | 146 <CODE>mencoder <file/DVD> -oac copy -pass 2 |
147 -divx4opts br=<bitrate></CODE></TD> | 147 -ovc divx4 -divx4opts br=<bitrate></CODE></TD> |
148 <TD><FONT CLASS="text"> | 148 <TD><FONT CLASS="text"> |
149 <B><U>Third pass</U> : alias the second pass of DivX4 video encoding. | 149 <B><U>Third pass</U> : alias the second pass of DivX4 video encoding. |
150 Optionally specify the video bitrate MEncoder printed at the end of the | 150 Optionally specify the video bitrate MEncoder printed at the end of the |
151 previous pass. In this pass, audio from <CODE>frameno.avi</CODE> will be | 151 previous pass. In this pass, audio from <CODE>frameno.avi</CODE> will be |
152 inserted into the destination file.. and it's all ready!</B></TD> | 152 inserted into the destination file.. and it's all ready!</B></TD> |
157 <P><B>Example for 3-pass encoding :</B></P> | 157 <P><B>Example for 3-pass encoding :</B></P> |
158 | 158 |
159 <P><CODE> rm frameno.avi</CODE> - remove this file, | 159 <P><CODE> rm frameno.avi</CODE> - remove this file, |
160 which can come from a previous 3-pass encoding (it interferes with current | 160 which can come from a previous 3-pass encoding (it interferes with current |
161 one)<BR> | 161 one)<BR> |
162 <CODE> mencoder -dvd 2 -ovc frameno | 162 <CODE> mencoder -dvd 2 -l-ovc frameno |
163 -o frameno.avi<BR> | 163 -o frameno.avi<BR> |
164 <CODE> mencoder -dvd 2 | 164 <CODE> mencoder -dvd 2 |
165 -divx4opts br=1100 -oac copy -o movie.avi -pass 1<BR> | 165 -lavcopts vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 1<BR> |
166 mencoder -dvd 2 | 166 mencoder -dvd 2 |
167 -divx4opts br=1100 -oac copy -o movie.avi -pass 2</CODE> | 167 -lavcopts vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 2</CODE> |
168 </P> | 168 </P> |
169 | 169 |
170 <P><U><B>2 or 3-pass encoding using internal libavcodec controler</B></U> : | 170 <P><U><B>2 or 3-pass encoding using internal libavcodec controler</B></U> : |
171 Optionally you can use libavcodec's internal 2 or 3-pass mode, it may gives you | 171 Optionally you can use libavcodec's internal 2 or 3-pass mode, it may gives you |
172 better final rate accuracy than using the external, DivX4-inspired 2-pass rate | 172 better final rate accuracy than using the external, DivX4-inspired 2-pass rate |
173 controler with libavcodec.<BR> | 173 controler with libavcodec.<BR> |
174 <UL> | 174 <UL> |
175 <B>2-pass encoding</B> :<BR> | 175 <B>2-pass encoding</B> :<BR> |
176 <CODE>rm -f lavc_stats.txt<BR> | 176 <CODE>rm -f lavc_stats.txt<BR> |
177 mencoder -dvd 2 -ovc lavc -lacvopts vpass=1 (audio-options) -o movie.avi<BR> | 177 mencoder -dvd 2 -ovc lavc -lacvopts vcodec=mpeg4:vpass=1 (audio-options) -o movie.avi<BR> |
178 mencoder -dvd 2 -ovc lavc -lacvopts vpass=2 (audio-options) -o movie.avi</CODE><BR> | 178 mencoder -dvd 2 -ovc lavc -lacvopts vcodec=mpeg4:vpass=2 (audio-options) -o movie.avi</CODE><BR> |
179 <BR> | 179 <BR> |
180 <B>3-pass encoding</B> :<BR> | 180 <B>3-pass encoding</B> :<BR> |
181 <CODE>rm -f frameno.avi lavc_stats.txt<BR> | 181 <CODE>rm -f frameno.avi lavc_stats.txt<BR> |
182 mencoder -dvd 2 -ovc frameno (audio-options) -o frameno.avi<BR> | 182 mencoder -dvd 2 -ovc frameno (audio-options) -o frameno.avi<BR> |
183 mencoder -dvd 2 -ovc lavc -lacvopts vpass=1 -oac copy -o movie.avi<BR> | 183 mencoder -dvd 2 -ovc lavc -lacvopts vcodec=mpeg4:vpass=1 -oac copy -o movie.avi<BR> |
184 mencoder -dvd 2 -ovc lavc -lacvopts vpass=2 -oac copy -o movie.avi</CODE><BR> | 184 mencoder -dvd 2 -ovc lavc -lacvopts vcodec=mpeg4:vpass=2 -oac copy -o movie.avi</CODE><BR> |
185 </UL> | 185 </UL> |
186 </P> | 186 </P> |
187 | 187 |
188 <P><B><A NAME=2.4.3.2>2.4.3.2. Rescaling movies</B></P> | 188 <P><B><A NAME=2.4.3.2>2.4.3.2. Rescaling movies</B></P> |
189 | 189 |
200 <CODE>-vop scale=X:Y</CODE>. Its quality can be set with the | 200 <CODE>-vop scale=X:Y</CODE>. Its quality can be set with the |
201 <CODE>-sws</CODE> option. If it's not specified, <B>MEncoder</B> will use 0 : | 201 <CODE>-sws</CODE> option. If it's not specified, <B>MEncoder</B> will use 0 : |
202 fast bilinear.</P> | 202 fast bilinear.</P> |
203 | 203 |
204 <P>Usage :<BR> | 204 <P>Usage :<BR> |
205 <CODE> mencoder sample-svcd.mpg -divx4opts br=1300 -vop scale=640:480 -sws 2 -o output.avi</CODE></P> | 205 <CODE> mencoder sample-svcd.mpg -lavcopts vcodec=mpeg4:more_options -vop scale=640:480 -sws 2 -o output.avi</CODE></P> |
206 | 206 |
207 | 207 |
208 <P><B><A NAME=2.4.3.3>2.4.3.3. Stream copying</B></P> | 208 <P><B><A NAME=2.4.3.3>2.4.3.3. Stream copying</B></P> |
209 | 209 |
210 <P><B>MEncoder</B> can handle input streams in two ways : <B>encode</B> or | 210 <P><B>MEncoder</B> can handle input streams in two ways : <B>encode</B> or |
284 | 284 |
285 <P>The explanation of the <CODE>-mf</CODE> option can be found below in the | 285 <P>The explanation of the <CODE>-mf</CODE> option can be found below in the |
286 global <A HREF=#2.4.5>Options</A> section and in the manpage.</P> | 286 global <A HREF=#2.4.5>Options</A> section and in the manpage.</P> |
287 | 287 |
288 <P><I>Creating a DivX4 file from all the JPEG files in the current dir :</I><BR> | 288 <P><I>Creating a DivX4 file from all the JPEG files in the current dir :</I><BR> |
289 <CODE>mencoder \*.jpg -mf on:w=800:h=600:fps=25 -ovc divx4 -o | 289 <CODE>mencoder \*.jpg -lavcopts -mf on:w=800:h=600:fps=25 -ovc divx4 -o |
290 output.avi</CODE></P> | 290 output.avi</CODE></P> |
291 | 291 |
292 <P><I>Creating a DivX4 file from some JPEG files in the current dir :</I><BR> | 292 <P><I>Creating a DivX4 file from some JPEG files in the current dir :</I><BR> |
293 <CODE>mencoder frame001.jpg,frame002.jpg -mf on:w=800:h=600:fps=25 -ovc divx4 -o | 293 <CODE>mencoder frame001.jpg,frame002.jpg -mf on:w=800:h=600:fps=25 -ovc divx4 -o |
294 output.avi</CODE></P> | 294 output.avi</CODE></P> |
438 <P><B><A NAME=2.4.6>2.4.6. Examples</B></P> | 438 <P><B><A NAME=2.4.6>2.4.6. Examples</B></P> |
439 | 439 |
440 <P>Using <B>MEncoder</B> is the easiest thing on Earth. See the following :</P> | 440 <P>Using <B>MEncoder</B> is the easiest thing on Earth. See the following :</P> |
441 | 441 |
442 <P>Encoding from DVD, title 2 :<BR> | 442 <P>Encoding from DVD, title 2 :<BR> |
443 <CODE> mencoder -dvd 2 -o title2.avi</CODE></P> | 443 <CODE> mencoder -dvd 2 -lavcopts vcodec=mpeg4:more_options -o title2.avi</CODE></P> |
444 | 444 |
445 <P>The same, but with libavcodec family, MJPEG compression :<BR> | 445 <P>The same, but with libavcodec family, MJPEG compression :<BR> |
446 <CODE> mencoder -dvd 2 -o title2.avi -ovc lavc -lavcopts vcodec=mjpeg -ffourcc mjpg</CODE></P> | 446 <CODE> mencoder -dvd 2 -lavcopts vcodec=mpeg4:more_options -o title2.avi -ovc lavc -lavcopts vcodec=mjpeg -ffourcc mjpg</CODE></P> |
447 | 447 |
448 <P>Encoding from DVD, title 2, with rescaling :<BR> | 448 <P>Encoding from DVD, title 2, with rescaling :<BR> |
449 <CODE> mencoder -dvd 2 -vop scale=640:480 -sws 2 -o title2.avi</CODE></P> | 449 <CODE> mencoder -dvd 2 -vop scale=640:480 -sws 2 -lavcopts vcodec=mpeg4:more_options -o title2.avi</CODE></P> |
450 | 450 |
451 <P>Encoding from HTTP :<BR> | 451 <P>Encoding from HTTP :<BR> |
452 <CODE> mencoder http://mplayer.hq/example.avi -o example.avi</CODE></P> | 452 <CODE> mencoder http://mplayer.hq/example.avi -lavcopts vcodec=mpeg4:more_options -o example.avi</CODE></P> |
453 | 453 |
454 <P>Encoding from a pipe :<BR> | 454 <P>Encoding from a pipe :<BR> |
455 <CODE> rar p test-SVCD.rar | mencoder -divx4opts br=800 -ofps 24 -pass 1 -- -</CODE></P> | 455 <CODE> rar p test-SVCD.rar | mencoder -lavcopts vcodec=mpeg4:more_options -ofps 24 -pass 1 -- -</CODE></P> |
456 | 456 |
457 <P>Encoding multiple *.vob files :<BR> | 457 <P>Encoding multiple *.vob files :<BR> |
458 <CODE> cat *.vob | mencoder <options> -</CODE></P> | 458 <CODE> cat *.vob | mencoder <options> -</CODE></P> |
459 | 459 |
460 <P>Encoding from tuner (for tuner options <A HREF="documentation.html#2.5">see the TV input section !</A>) :<BR> | 460 <P>Encoding from tuner (for tuner options <A HREF="documentation.html#2.5">see the TV input section !</A>) :<BR> |