PDA

View Full Version : [ubuntu] lowering the quality (therefore filesize) of mkv files



pythonscript
December 6th, 2009, 05:03 AM
I have a 5 GB mkv file that I'd like to compress (as a video, not simply using a 7z archive or something to that effect) and I'm wondering if there's a straightforward way to do this. I have mkvtoolnix and mkvtoolnix-gui installed; would these be of assistance? Thanks for the help!

semitone36
December 6th, 2009, 06:54 AM
You could try handbrake (http://handbrake.fr/)

pythonscript
December 18th, 2009, 09:28 PM
Can handbrake work with mkv files? I know it can work with avi files, but I wasn't sure if it supported mkv files or not.

SuperSonic4
December 18th, 2009, 09:30 PM
Should do, I've wrote to it before

perhaps ffmpeg would work

michael37
December 18th, 2009, 09:33 PM
I'd use ffmpeg.
ffmpeg -i input.mkv -vcodec libx284 -acodec libfaac -b NEWVIDEORATE -ab NEWAUDIORATE output.mkv

Add spice (http://ffmpeg.org/ffmpeg-doc.html) for desired taste.

FakeOutdoorsman
December 19th, 2009, 04:58 AM
I'd use ffmpeg.
ffmpeg -i input.mkv -vcodec libx284 -acodec libfaac -b NEWVIDEORATE -ab NEWAUDIORATE output.mkv

Add spice (http://ffmpeg.org/ffmpeg-doc.html) for desired taste.

This command won't work. There is no libx284 and it should be libx264, and if you are using a recent FFmpeg, you need to use a libx264 encoding preset. Compile FFmpeg and x264 from source to get the best encoding quality. Step-by-step instructions and some encoding examples:

HOWTO: Install and use the latest FFmpeg and x264 (http://ubuntuforums.org/showthread.php?t=786095)

...or if you don't want to compile you can use FFmpeg from the repository but you need to enable some encoders:

HOWTO: Easily enable MP3, MPEG4, AAC, and other restricted encoding in FFmpeg (http://ubuntuforums.org/showthread.php?t=1117283)

However, the link above is just slightly out of date. If you are using Karmic I recommend installing the libavcodec-extra-52 package from Medibuntu instead of the version from the Ubuntu repository. The repository libavcodec-extra-52 does not have AAC encoding and AMR encoding/decoding support.