This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
software:mencoder [2022/01/13 11:35] – [encoding files with multiple audio-streams] chris | software:mencoder [2022/11/13 12:06] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ==== setup mplayer on debian the right way for encoding ==== | ||
+ | * first: apt-get install gcc make libxv-dev libsdl1.2-dev vorbis-tools mkvtoolnix | ||
+ | * you have to download and compile at least (see mplayer-docs for where to get the software) | ||
+ | * the x264 codec | ||
+ | * lame (if you want mp3 sound encoding) | ||
+ | * vorbis-tools (contains ' | ||
+ | * mplayer itself | ||
+ | |||
+ | * procedure to find out what dev-files are needed: | ||
+ | * get mplayer-sources, | ||
+ | * less configure.log, | ||
+ | * then use https:// | ||
+ | |||
+ | * for cutting videos i like ProjectX: https:// | ||
+ | |||
+ | ==== reading dvd-tracks out ==== | ||
+ | * %%mplayer dvd://1 -dvd-device / | ||
+ | < | ||
+ | # find out what tracks you want to encode | ||
+ | for i in 1 2 3 4 5 6 7 8; do | ||
+ | | ||
+ | done | ||
+ | |||
+ | media=disc3 | ||
+ | for i in 3 4 5 6; do | ||
+ | | ||
+ | done | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ==== preprocessing ==== | ||
+ | * Started cropping black stripes off bevore encoding. ' | ||
+ | * Noticed when fast moves in the video happen that video is interlaced. ' | ||
+ | ==== encoding files with multiple audio-streams ==== | ||
+ | < | ||
+ | preparations: | ||
+ | mplayer strean.m2t -v # find out numbers of audio-streams. for example 512 and 513. | ||
+ | mplayer stream.m2d -aid 512 # verify first audio-stream | ||
+ | |||
+ | </ | ||
+ | |||
+ | The command for 2pass-encoding all files ending in .ts is: | ||
+ | < | ||
+ | for i in file*.ts ; do | ||
+ | # | ||
+ | VFOPTS=' | ||
+ | TITLE=' | ||
+ | BITRATE=' | ||
+ | |||
+ | OPTSLOW=" | ||
+ | OPTSHIGH=" | ||
+ | OPTSHIGH=" | ||
+ | OPTSHIGH=" | ||
+ | OPTSHIGH=" | ||
+ | OPTSHIGH=" | ||
+ | |||
+ | # get audiostreams out | ||
+ | mplayer $i -ao pcm: | ||
+ | #mplayer $i -ao pcm: | ||
+ | |||
+ | mencoder $i -o /dev/null -nosound $VFOPTS -ovc x264 -x264encopts \ | ||
+ | $BITRATE: | ||
+ | mencoder $i -o $i.2pass_x264.avi -nosound $VFOPTS -ovc x264 -x264encopts \ | ||
+ | $BITRATE: | ||
+ | |||
+ | oggenc -q5 ${i}_ger.wav | ||
+ | #oggenc -q5 ${i}_eng.wav | ||
+ | |||
+ | mkvmerge -o $i.mkv --title " | ||
+ | $i.2pass_x264.avi ${i}_ger.ogg | ||
+ | |||
+ | # mkvmerge -o $i.2.mkv --title ' | ||
+ | mkvmerge -o $i.2.mkv --title " | ||
+ | |||
+ | done | ||
+ | </ | ||
+ | |||
+ | ==== demultiplexing sound ==== | ||
+ | For example to get mp3-file out of .flv files, ignoring the video-part. | ||
+ | < | ||
+ | # first try dumping the audio-stream, | ||
+ | mplayer infile.flv -ao pcm: | ||
+ | mencoder -ovc frameno -oac pcm infile.flv -o outfile.wav -of rawaudio | ||
+ | |||
+ | # if you get a useful outfile.wav just encode it to ogg or mp3: | ||
+ | lame outfile.wav | ||
+ | |||
+ | # this encodes directly just the audio. br=128 is the mp3-average bitrate. You could just | ||
+ | # use the bitrate from the inputfile. The audio gets reencoded thou, so quality gets worse anyway. | ||
+ | mencoder -ovc frameno -oac mp3lame -lameopts abr:br=128 -of rawaudio inputfile.flv -o outputfile.mp3 | ||
+ | </ | ||
+ | |||