summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-20 23:32:45 +0200
committerwm4 <wm4@nowhere>2012-10-24 21:56:34 +0200
commit11ed093182f29c796ba6fd08f6c5c80e8fdb9349 (patch)
tree69f920eab72378a8c4b659d7dfd8b1bb81968029 /input
parent821c01a5f50284a839ab879724a5c67b3f855a84 (diff)
downloadmpv-11ed093182f29c796ba6fd08f6c5c80e8fdb9349.tar.bz2
mpv-11ed093182f29c796ba6fd08f6c5c80e8fdb9349.tar.xz
screenshot: allow taking screenshots with subtitles
This adds a new screenshot mode "subtitles", which basically takes the video frame as decoded, and renders subtitles into it. This may fail for some pixel formats, because libswscale sucks. If this becomes ever a real problem, the code could be changed to convert the image to RGBA first (or whatever the image writer wants), and then render the subtitles into it. This would avoid the additional image copy needed with vo_xv too. But for now, it seems better to go with the current method in the common case: vo_opengl creates an image copy anyway, and drawing bitmaps to yv12 is better, as no color space conversion is involved in draw_bmp.c's up/downsampling conversion.
Diffstat (limited to 'input')
-rw-r--r--input/input.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/input/input.c b/input/input.c
index f2b601fdbe..ea9d2376b2 100644
--- a/input/input.c
+++ b/input/input.c
@@ -162,7 +162,8 @@ static const mp_cmd_t mp_cmds[] = {
OARG_CHOICE(0, ({"single", 0}, {"0", 0},
{"each-frame", 1}, {"1", 1})),
OARG_CHOICE(0, ({"video", 0}, {"0", 0},
- {"window", 1}, {"1", 1})),
+ {"window", 1}, {"1", 1},
+ {"subtitles", 2})),
}},
{ MP_CMD_LOADFILE, "loadfile", {
ARG_STRING,