Mercurial > mplayer.hg
comparison DOCS/encoding.html @ 5968:5bb339c33131
small update
| author | gabucino |
|---|---|
| date | Sat, 04 May 2002 16:29:11 +0000 |
| parents | e96469da680c |
| children | 796510223658 |
comparison
equal
deleted
inserted
replaced
| 5967:ad187ccb8c01 | 5968:5bb339c33131 |
|---|---|
| 16 | 16 |
| 17 <P><B><A NAME=2.4.1>2.4.1. Overview</B></P> | 17 <P><B><A NAME=2.4.1>2.4.1. Overview</B></P> |
| 18 | 18 |
| 19 <P><B>MEncoder</B> (<B>MPlayer</B>'s Movie Encoder) is a simple movie encoder, | 19 <P><B>MEncoder</B> (<B>MPlayer</B>'s Movie Encoder) is a simple movie encoder, |
| 20 designed to encode MPlayer-playable movies | 20 designed to encode MPlayer-playable movies |
| 21 (<B>AVI/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET</B>) to other MPlayer-playable | 21 (<B>AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET</B>) to other MPlayer-playable |
| 22 formats (see below). It can encode with various codecs, like <B>DivX4</B> (1 or | 22 formats (see below). It can encode with various codecs, like <B>DivX4</B> (1 or |
| 23 2 passes), libavcodec, <B>PCM</B>/<B>MP3</B>/<B>VBRMP3</B> audio. Also has | 23 2 passes), libavcodec, <B>PCM</B>/<B>MP3</B>/<B>VBRMP3</B> audio. Also has |
| 24 stream copying and video resizing abilities.</P> | 24 stream copying and video resizing abilities.</P> |
| 25 | 25 |
| 26 <P><B><A NAME=2.4.2>2.4.2. Compiling</B></P> | 26 <P><B><A NAME=2.4.2>2.4.2. Compiling</B></P> |
| 194 SVCDs have 480x480 size, and their header contains the aspect ratio the | 194 SVCDs have 480x480 size, and their header contains the aspect ratio the |
| 195 player should use (Ex.: 480x480 + 4:3 = 640x480). However when encoding to | 195 player should use (Ex.: 480x480 + 4:3 = 640x480). However when encoding to |
| 196 AVI (DivX) files, you have be aware that AVI headers don't store this | 196 AVI (DivX) files, you have be aware that AVI headers don't store this |
| 197 value. Thus, the only solution is rescaling.</P> | 197 value. Thus, the only solution is rescaling.</P> |
| 198 | 198 |
| 199 <P><B>MEncoder</B> can scale input images if they come in YV12 format (for example: | 199 <P>The scaling process is handled by the <I>'scale'</I> video filter: |
| 200 ffdivx, odivx drivers, or mpeg1/2). The output size is specified with the | 200 <CODE>-vop scale=X:Y</CODE>. Its quality can be set with the |
| 201 <CODE>-x</CODE>, and <CODE>-y</CODE> options. Furthermore, there are some | 201 <CODE>-sws</CODE> option. If it's not specified, <B>MEncoder</B> will use 0 : |
| 202 rescaling filters in <B>MEncoder</B>, see the manpage for them ! | 202 fast bilinear.</P> |
| 203 They can be specified with the <CODE>-sws</CODE> option. If not specified, | 203 |
| 204 <B>MEncoder</B> will use 0 : fast bilinear.</P> | 204 <P>Usage :<BR> |
| 205 | 205 <CODE> mencoder sample-svcd.mpg -divx4opts br=1300 -vop scale=640:480 -sws 2 -o output.avi</CODE></P> |
| 206 <P>Rescaling is very simple :<BR> | |
| 207 <CODE> mencoder sample-svcd.mpg -divx4opts br=1300 -x 640 -y 480 -sws 2 -o output.avi</CODE></P> | |
| 208 | 206 |
| 209 | 207 |
| 210 <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> |
| 211 | 209 |
| 212 <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 |
| 234 <P>Easiest thing. We simply copy the video and audio streams, and | 232 <P>Easiest thing. We simply copy the video and audio streams, and |
| 235 <B>MEncoder</B> generates the index. Of course this cannot fix possible bugs in | 233 <B>MEncoder</B> generates the index. Of course this cannot fix possible bugs in |
| 236 the video and/or audio streams. It also fixes files with broken interleaving, | 234 the video and/or audio streams. It also fixes files with broken interleaving, |
| 237 thus the <CODE>-ni</CODE> option won't be needed for them anymore.</P> | 235 thus the <CODE>-ni</CODE> option won't be needed for them anymore.</P> |
| 238 | 236 |
| 239 <P>Command : <CODE>mencoder input.avi -ovc copy -oac copy -o output.avi</CODE></P> | 237 <P>Command : <CODE>mencoder -idx input.avi -ovc copy -oac copy -o output.avi</CODE></P> |
| 240 | 238 |
| 241 | 239 |
| 242 <P><B><A NAME=2.4.3.5>2.4.3.5. Encoding with the <I>libavcodec</I> codec family</B></P> | 240 <P><B><A NAME=2.4.3.5>2.4.3.5. Encoding with the <I>libavcodec</I> codec family</B></P> |
| 243 | 241 |
| 244 <P><A HREF="codecs.html#2.2.1.2">libavcodec</A> provides simple encoding to a | 242 <P><A HREF="codecs.html#2.2.1.2">libavcodec</A> provides simple encoding to a |
| 345 specify output filename | 343 specify output filename |
| 346 </TD> | 344 </TD> |
| 347 </TR> | 345 </TR> |
| 348 <TR> | 346 <TR> |
| 349 <TD><FONT CLASS="text"> | 347 <TD><FONT CLASS="text"> |
| 350 <I>-x</I> width in pixels</TD> | |
| 351 <TD><FONT CLASS="text"> | |
| 352 rescale output video to given pixels width | |
| 353 </TD> | |
| 354 </TR> | |
| 355 <TR> | |
| 356 <TD><FONT CLASS="text"> | |
| 357 <I>-y</I> height in pixels</TD> | |
| 358 <TD><FONT CLASS="text"> | |
| 359 rescale output video to given pixels height | |
| 360 </TD> | |
| 361 </TR> | |
| 362 <TR> | |
| 363 <TD><FONT CLASS="text"> | |
| 364 <I>-sws</I> 0-2</TD> | 348 <I>-sws</I> 0-2</TD> |
| 365 <TD><FONT CLASS="text"> | 349 <TD><FONT CLASS="text"> |
| 366 type of scaling method<BR> | 350 type of scaling method<BR> |
| 367 0 - fast bilinear<BR> | 351 0 - fast bilinear<BR> |
| 368 1 - bilinear<BR> | 352 1 - bilinear<BR> |
| 373 <TD><FONT CLASS="text"> | 357 <TD><FONT CLASS="text"> |
| 374 <I>-ovc</I> codecname</TD> | 358 <I>-ovc</I> codecname</TD> |
| 375 <TD><FONT CLASS="text"> | 359 <TD><FONT CLASS="text"> |
| 376 Encode with the given codec (codec names are from codecs.conf). Examples:<BR> | 360 Encode with the given codec (codec names are from codecs.conf). Examples:<BR> |
| 377 <B>help</B> - get list of available codecs<BR> | 361 <B>help</B> - get list of available codecs<BR> |
| 378 <B>null</B> - do not create a video stream in the output AVI<BR> | |
| 379 <B>raw</B> - create uncompressed video<BR> | |
| 380 <B>rawrgb</B> - ?<BR> | 362 <B>rawrgb</B> - ?<BR> |
| 381 <B>copy</B> - no encoding, just copy the stream (only from AVI/ASF now)<BR> | 363 <B>copy</B> - no encoding, just copy the stream (only from AVI/ASF now)<BR> |
| 382 <B>divx4</B> - encode to DivX4<BR> | 364 <B>divx4</B> - encode to DivX4<BR> |
| 383 <B>lavc</B> - encode with a codec from libavcodec<BR> | 365 <B>lavc</B> - encode with a codec from libavcodec<BR> |
| 384 <B>vfw</B> - encode with a Windows DLL<BR> | 366 <B>vfw</B> - encode with a Windows DLL<BR> |
| 461 | 443 |
| 462 <P>The same, but with libavcodec family, MJPEG compression :<BR> | 444 <P>The same, but with libavcodec family, MJPEG compression :<BR> |
| 463 <CODE> mencoder -dvd 2 -o title2.avi -ovc lavc -lavcopts vcodec=mjpeg -ffourcc mjpg</CODE></P> | 445 <CODE> mencoder -dvd 2 -o title2.avi -ovc lavc -lavcopts vcodec=mjpeg -ffourcc mjpg</CODE></P> |
| 464 | 446 |
| 465 <P>Encoding from DVD, title 2, with rescaling :<BR> | 447 <P>Encoding from DVD, title 2, with rescaling :<BR> |
| 466 <CODE> mencoder -dvd 2 -x 640 -y 480 -sws 2 -o title2.avi</CODE></P> | 448 <CODE> mencoder -dvd 2 -vop scale=640:480 -sws 2 -o title2.avi</CODE></P> |
| 467 | 449 |
| 468 <P>Encoding from HTTP :<BR> | 450 <P>Encoding from HTTP :<BR> |
| 469 <CODE> mencoder http://mplayer.hq/example.avi -o example.avi</CODE></P> | 451 <CODE> mencoder http://mplayer.hq/example.avi -o example.avi</CODE></P> |
| 470 | 452 |
| 471 <P>Encoding from a pipe :<BR> | 453 <P>Encoding from a pipe :<BR> |
