From 11ed093182f29c796ba6fd08f6c5c80e8fdb9349 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 20 Oct 2012 23:32:45 +0200 Subject: 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. --- input/input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'input/input.c') 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, -- cgit v1.2.3 From 48ce4ab7f9259977f426d52b51601a54dbe15465 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 20 Oct 2012 23:58:02 +0200 Subject: screenshot: change "screenshot" input command "screenshot" now maps to "screenshot subtitles" by default, instead of "screenshot video". Swap the argument order: the more useful argument should come first. Remove the compatibility aliases for numeric choices (e.g. "screenshot 1 0" won't work anymore). --- input/input.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'input/input.c') diff --git a/input/input.c b/input/input.c index ea9d2376b2..8b59501da0 100644 --- a/input/input.c +++ b/input/input.c @@ -159,11 +159,11 @@ static const mp_cmd_t mp_cmds[] = { { MP_CMD_DVB_SET_CHANNEL, "dvb_set_channel", { ARG_INT, ARG_INT } }, { MP_CMD_SCREENSHOT, "screenshot", { - OARG_CHOICE(0, ({"single", 0}, {"0", 0}, - {"each-frame", 1}, {"1", 1})), - OARG_CHOICE(0, ({"video", 0}, {"0", 0}, - {"window", 1}, {"1", 1}, + OARG_CHOICE(2, ({"video", 0}, + {"window", 1}, {"subtitles", 2})), + OARG_CHOICE(0, ({"single", 0}, + {"each-frame", 1})), }}, { MP_CMD_LOADFILE, "loadfile", { ARG_STRING, -- cgit v1.2.3