diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-09-09 17:42:45 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-09-10 18:33:50 +0200 |
commit | 6f83529f219ab5ac546013967419c00e6ff3edfc (patch) | |
tree | 1f3dc689058654659c561fc62ec11da9eb608ece /video/decode | |
parent | be9222315753acca6c00f9f8f4c3b7794dc53c5d (diff) | |
download | mpv-6f83529f219ab5ac546013967419c00e6ff3edfc.tar.bz2 mpv-6f83529f219ab5ac546013967419c00e6ff3edfc.tar.xz |
vd_lavc: by default enable cropping by decoder
While this resolves limitations of lavc decoder crop, it also introduces
artifacts with some of the source files or hwdec.
Depending on chroma sampler it is possible to sample outside the decoder
crop area, pulling dirty pixels into the image. Some decoders left them
zeroed, not black. To fix that we would need specifc solution during
mapping of avframes.
As most of the files require the crop only in bottom/right area, the
AVCodecContext::apply_cropping works ok for those.
For all other cases that require more fancy cropping like 1440x1080+240+0
user can manually set `--vd-apply-cropping=no`.
Limitations of the lavc crop are explained here:
https://ffmpeg.org/doxygen/trunk/structAVCodecContext.html#a4745c7455c317272c4e139d6f369936c
Fixes: 826ce82cad315f7a48f9c971d3a5fa005a9eab46
Diffstat (limited to 'video/decode')
-rw-r--r-- | video/decode/vd_lavc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 54a9975915..74d0b3c94d 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -147,6 +147,7 @@ const struct m_sub_options vd_lavc_conf = { // for example, if vo_gpu increases the number of reference surfaces for // interpolation, this value has to be increased too. .hwdec_extra_frames = 6, + .apply_cropping = true, }, }; |