Log in

View Full Version : How to crop MKV files without losing quality?


Chengbin
15th June 2008, 02:54
I have a movie with black bars, how do I crop that out without losing quality?

Ranguvar
15th June 2008, 03:12
You could make an AviSynth script:

DirectShowSource("C:\video.mkv")
Crop(40, 50, -60, -70)

That would crop 40 off the left, 50 off the top, 60 off the right, and 70 off the bottom. You can then play the script in your favorite player.

Some players may also have an option to crop.

These are some of the only lossless choices; I don't believe there is any way of adding a parameter to an MKV so that players automatically crop?

Snowknight26
15th June 2008, 06:09
There is, but its something like only from the bottom and right.

nm
15th June 2008, 09:43
So you tried to set the cropping values at container level? I seem to get the same effect with VLC, although mkvinfo shows that cropping is set correctly. That leaves two lossless options: fix the bug in the player/demuxer/splitter or set cropping values manually within the player or with AviSynth every time. Some players may also be able to crop black bars automatically.

bond
19th June 2008, 20:50
h264info can crop losslessly on h264 video stream level (not container):
http://forum.doom9.org/showthread.php?t=123392

Atak_Snajpera
19th June 2008, 23:02
Use mkvmerge GUI and this command line (Muxing -> Add command line options)
--cropping <TID:left,top,right,bottom>
Sets the cropping parameters.

elguaxo
20th June 2008, 02:19
thanks for the info Atak_Snajpera!

nm
20th June 2008, 08:32
Use mkvmerge GUI and this command line (Muxing -> Add command line options)
--cropping <TID:left,top,right,bottom>
Sets the cropping parameters.
That's what I tried and it doesn't seem to work with VLC and MPlayer. VLC only crops bottom and right parts out and MPlayer does nothing. So bond's suggestion is perhaps a more reliable way for now.

Atak_Snajpera
20th June 2008, 20:45
Did you check in MPC-HC?

nm
20th June 2008, 22:06
Nope, I don't have Windows around.