Differences
This shows you the differences between two versions of the page.
mencoder [2013/06/28 15:35] beandog created |
mencoder [2013/06/28 15:37] (current) beandog |
||
---|---|---|---|
Line 13: | Line 13: | ||
Some ideas though: | Some ideas though: | ||
- | - force the incoming fps and/or outcoming fps | + | * force the incoming fps and/or outcoming fps |
- | - try -mc 0 and/or -noskip with mencoder (the opposite being -vf | + | * try -mc 0 and/or -noskip with mencoder (the opposite being -vf harddup=1) |
- | harddup=1) | + | |
Positive results: | Positive results: | ||
(movie starts at 29.97, but switches immediately to 23.97) | (movie starts at 29.97, but switches immediately to 23.97) | ||
- | mencoder movie.vob -aid 128 -ovc lavc -oac copy -o movie.avi -mc 0 | + | |
- | -noskip -fps 24000/1001 | + | <code>mencoder movie.vob -aid 128 -ovc lavc -oac copy -o movie.avi -mc 0 -noskip -fps 24000/1001</code> |
comes close, same scenario: | comes close, same scenario: | ||
- | transcode -i movie.vob -o transcode.avi -a 0 -b 128,0,0 -w 2200,250,100 | + | |
- | -A -N 0x2000 -M 2 -Y 4,4,4,4 -B 1,11,8 -R 0 -x vob,vob -y xvid4 -f 0,1 | + | <code>transcode -i movie.vob -o transcode.avi -a 0 -b 128,0,0 -w 2200,250,100 -A -N 0x2000 -M 2 -Y 4,4,4,4 -B 1,11,8 -R 0 -x vob,vob -y xvid4 -f 0,1</code> |
Something to try: | Something to try: | ||
- | audio delay (-audio-delay on mencoder, test float value with mplayer | + | |
- | -delay 0.2 movie.avi) | + | audio delay (-audio-delay on mencoder, test float value with mplayer -delay 0.2 movie.avi) |
mencoder basics: | mencoder basics: | ||
Line 37: | Line 36: | ||
worth it). | worth it). | ||
- | example: mencoder video.wmv -o video.avi -ovc lavc -oac mp3lame -fps 29.97 | + | example: |
+ | <code>mencoder video.wmv -o video.avi -ovc lavc -oac mp3lame -fps 29.97</code> | ||
- | example notes: -oac lavc uses mp2 by default as audio. I've found my | + | example notes: -oac lavc uses mp2 by default as audio. I've found my files are smaller using -oac mp3lame each time. -ovc lavc uses divx4. |
- | files are smaller using -oac mp3lame each time. -ovc lavc uses divx4. | + | |
- | Use -fps 29.97 since that's the NTSC standard framerate. Encoding at | + | |
- | another framerate sometimes makes the video fuzzy (wmv -> avi). | + | |
- | "-of" sets the format type, default is "avi". Other type you would use | + | Use -fps 29.97 since that's the NTSC standard framerate. Encoding at another framerate sometimes makes the video fuzzy (wmv -> avi). |
- | is "mpeg". | + | |
- | "-oac" is the audio codec to use. No default is set. Options are | + | "-of" sets the format type, default is "avi". Other type you would use is "mpeg". |
- | "copy" (use the old codec), "pcm" (uncompressed), "mp3lame" and "lavc" | + | |
- | (another audio codec). | + | |
- | "-ovc" is the video codec to use. No default is set. Options I | + | "-oac" is the audio codec to use. No default is set. Options are "copy" (use the old codec), "pcm" (uncompressed), "mp3lame" and "lavc" (another audio codec). |
- | would use are "copy" (use old codec, don't re-encode), "divx4" (div4/5), | + | |
- | "lavc" (supposedly best quality) and "xvid" (open source mpeg4 codec). | + | "-ovc" is the video codec to use. No default is set. Options I would use are "copy" (use old codec, don't re-encode), "divx4" (div4/5), "lavc" (supposedly best quality) and "xvid" (open source mpeg4 codec). |
using "-lavcopts": | using "-lavcopts": | ||
- | I see a lot of examples that needlessy add "-lavcopts vcodec=mpeg4", | + | I see a lot of examples that needlessy add "-lavcopts vcodec=mpeg4", when the default video codec already is mpeg4 (and the best one too use). There's no reason to change the default. |
- | when the default video codec already is mpeg4 (and the best one too | + | |
- | use). There's no reason to change the default. | + | |
You can use lavcopts to do a three pass encoding to improve the quailty. | You can use lavcopts to do a three pass encoding to improve the quailty. | ||
+ | <code> | ||
rm frameno.avi | rm frameno.avi | ||
- | mencoder input.avi -ovc frameno -o frameno.avi -oac mp3lame -lameopts | + | mencoder input.avi -ovc frameno -o frameno.avi -oac mp3lame -lameopts vbr=3 |
- | vbr=3 | + | mencoder input.avi -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o output.avi |
- | mencoder input.avi -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o | + | mencoder input.avi -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o output.avi |
- | output.avi | + | </code> |
- | mencoder input.avi -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o | + | |
- | output.avi | + | |
# encode from wmv -> avi | # encode from wmv -> avi | ||
+ | <code> | ||
mencoder video.wmv -o video.avi -ovc lavc -oac mp3lame -fps 29.97 | mencoder video.wmv -o video.avi -ovc lavc -oac mp3lame -fps 29.97 | ||
+ | </code> | ||
# rip DVD | # rip DVD | ||
- | 2-pass encode of a DVD to an MPEG4 ("DivX") AVI while encoding the audio | + | 2-pass encode of a DVD to an MPEG4 ("DivX") AVI while encoding the audio track to MP3. |
- | track to MP3. | + | |
- | mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac mp3lame | + | <code> |
- | -lameopts vbr=3 -o movie.avi | + | mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac mp3lame -lameopts vbr=3 -o movie.avi |
- | mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac mp3lame | + | mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac mp3lame -lameopts vbr=3 -o movie.avi |
- | -lameopts vbr=3 -o movie.avi | + | </code> |
# XviD 2-pass | # XviD 2-pass | ||
+ | <code> | ||
mencoder dvd:// -ovc xvid -oac copy -xvidencopts pass=1:vhq=1 | mencoder dvd:// -ovc xvid -oac copy -xvidencopts pass=1:vhq=1 | ||
+ | </code> | ||
# encode only so much | # encode only so much | ||
+ | |||
use "-endpos <secs>" to test if the encoding is going to work. :) | use "-endpos <secs>" to test if the encoding is going to work. :) | ||
# detect aspect ratio for DVDs | # detect aspect ratio for DVDs | ||
+ | |||
+ | <code> | ||
mplayer dvd://1 -vf cropdetect | mplayer dvd://1 -vf cropdetect | ||
+ | </code> | ||
* Mencoder + XviD | * Mencoder + XviD | ||
- | Does mencoder ignore my xvidencopts flags?? Anytime I pass a | + | Does mencoder ignore my xvidencopts flags?? Anytime I pass a bitrate=foo value, it ignores it completely and seems to want to set it to it's own value. Kind of odd. |
- | bitrate=foo value, it ignores it completely and seems to want to set it | + | |
- | to it's own value. Kind of odd. | + | |
* images | * images | ||
- | mencoder mf://image.jpg -ofps 25 -mf fps=.002:type=jpg -ovc lavc -vf | + | <code> |
- | harddup -oac copy -of avi -o output.avi -audiofile audio.mp3 | + | mencoder mf://image.jpg -ofps 25 -mf fps=.002:type=jpg -ovc lavc -vf harddup -oac copy -of avi -o output.avi -audiofile audio.mp3 |
+ | </code> | ||
# Expanding | # Expanding | ||
- | Some videos (PAL DVDs, often) will come in 4:3 aspect with squished | + | Some videos (PAL DVDs, often) will come in 4:3 aspect with squished displays. You need to expand it so it has black bars at top/bottom. |
- | displays. You need to expand it so it has black bars at top/bottom. | + | |
Pretty simple, but you have to reencode the video with mencoder. | Pretty simple, but you have to reencode the video with mencoder. | ||
+ | <code> | ||
mencoder foo.mpg -vf expand=320:::::4/3 | mencoder foo.mpg -vf expand=320:::::4/3 | ||
+ | </code> | ||
- | Using a width smaller than the input will just make it fill to that | + | Using a width smaller than the input will just make it fill to that aspect ratio. |
- | aspect ratio. | + | |