NavigationUser loginPopular content |
Howto: Encode video files with mencoderCan you believe how hard it is to find a quick cheat sheet for using mencoder (included with mplayer) to encode various video formats? These should work on any platform that is supported by mplayer (*nix, windows, os x). I figured almost everyone will want to encode to some avi container-based format, and encoding to other formats is outside the scope of this article (there are far too many options for the different codecs to cover here). What this will help with, is encoding FROM any of those nonsense crazy formats to the very reasonable, and open source XviD codec. Most information will work with any other input format (simply change from big_file-worthless.mkv to big_file-worthless.mpg or big_file-worthless.asf, etc.) Extracting subtitles and different audio tracks is Matroska specific, but that's what I needed to do so that's the example you're getting! Get a Sample (start at 5:00 and record until 13:00) mencoder movie.wmv -o movie.avi -ovc lavc -oac mp3lame -ss 5:00 -endpos 8:00 Matroska Video (.mkv) --> XviD (.avi) mencoder big_file-worthless.mkv -oac mp3lame -ovc xvid -xvidencopts pass=1 -alang en -slang en -sub subtitles.srt -o it's_a_good_size.avi Extract Subtitles/Audio (Track 4/3) from Matroska Video emerge mkvtoolnix (only on gentoo linux-based systems, figure it out for your own platform)
|
Wow
Do you guys still post on here?
Looks like a ghost town.
hey MKV is nice!
Hey Bob, I like MKV!
Having all sorts of problems with AVI files on the Apple TV I just got (and promptly hacked). AVI 2.0 is kind of a pain with XBMC/Boxee--silly OpenDML stuff. Anyway technically it would seem Matroska is a far superior container format and modern.
AVI 1996 by M$
OpenDML + AVI (AVI 2.0) 1996 by Matrox
MKV 2002 as an OSS project
http://en.wikipedia.org/wiki/Audio_Video_Interleave
http://en.wikipedia.org/wiki/Matroska
http://en.wikipedia.org/wiki/Comparison_of_container_formats
Anyway I'm encoding a Flying Circus episode in a much of containers to see what helps with my A/V sync issues. Hope things are going well,
=D
BTW
BTW you shouldn't re-encode video since the encoding is based on a bunch of stats taken from a nicer data source. Encoding from the recreated stuff is likely to make an inferior copy. If you can live with the codec inside of the AVI container then you shouldn't re-encode it, just slurp the data out of the container.
To make MKV's as I'm trying now use:
mencoder file.avi -ovc copy -nosound -o video_only.raw
mencoder -of rawaudio -ovc frameno -oac copy -o audio_only.raw
mkvmerge -o file.mkv video_only.raw audio_only.raw
But you can use the first part of that process with: '-oac copy -ovc copy' and get the data out without re-encoding.
You can get a list of container formats with:
mencoder -of help
And specify them like so:
mencoder file.mkv -of avi -ovc copy -oac copy -o file.avi
Just thought I'd contribute some of my research to your page here.
=D