You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 16, 2020. It is now read-only.
NOTE: Cropping does not work with hardware decoding. By default this script
is only active when hardware decoding is disabled. See Dynamic control of
hardware decoding for a workaround.
Copy matroska_crop.lua into the scripts directory in your mpv config
directory (defaults to ~/.config/mpv/ on Linux). If the directory doesn’t
exist, create it.
Adding PixelCrop metadata
If you want to add the PixelCrop metadata to already existing Matroska files
you can use the mkvpropedit tool (included in mkvtoolnix):
For further information please consult the man page of
mkvpropedit and the output
of mkvpropedit -l.
Dynamic control of hardware decoding
Since cropping is not available with hardware decoding, this script can be
configured to only be active if a crop is defined in the media file.
For this behaviour to be active, create the file matroska_crop.conf in the
script-opts directory in your mpv config directory and add the following
contents:
dynamic_hwdec=yes
Please not the absence of spaces around the equal sign.
Known issues
It cannot crop the video while using hardware decoding (limitation of mpv)
It only works for local files (limitation of mkvmerge)
This could be solved by mpv exposing the needed matroska metadata
Custom filters are not applied when the video has PixelCrop metadata
(disable this script temporarily when you need to use custom filters).
About
A script for mpv which automatically crops the video if the Matroska PixelCrop properties are set.