From 9f595f3a80eeaa0bfbda5702031f054f684f6123 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 7 Feb 2018 20:18:36 +0100 Subject: vo_gpu: make screenshots use the GL renderer Using the GL renderer for color conversion will make sure screenshots will use the same conversion as normal video rendering. It can do this for all types of screenshots. The logic when to write 16 bit PNGs changes. To approximate the old behavior, we decide by looking whether the source video format has more than 8 bits per component. We apply this logic even for window screenshots. Also, 16 bit PNGs now always include an unused alpha channel. The reason is that FFmpeg has RGB48 and RGBA64 formats, but no RGB064. RGB48 is 3 bytes and usually not supported by GPUs for rendering, so we have to use RGBA64, which forces an alpha channel. Will break for users who use --target-trc and similar options. I considered creating a new gl_video context, but it could double GPU memory use, so I didn't. This uses FBOs instead of glGetTexImage(), because that increases the chance it could work on GLES (e.g. ANGLE). Untested. No support for the Vulkan and D3D11 backends yet. Fixes #5498. Also fixes #5240, because the code for reading back is not used with the new code path. --- DOCS/man/options.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'DOCS') diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 44aff271d3..0ffd6c783a 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -3309,7 +3309,8 @@ Screenshot ``--screenshot-high-bit-depth=`` If possible, write screenshots with a bit depth similar to the source video (default: yes). This is interesting in particular for PNG, as this - sometimes triggers writing 16 bit PNGs with huge file sizes. + sometimes triggers writing 16 bit PNGs with huge file sizes. This will also + include an unused alpha channel in the resulting files if 16 bit is used. ``--screenshot-template=