summaryrefslogtreecommitdiffstats
path: root/cfg-mplayer.h
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-02-29 03:46:25 +0100
committerwm4 <wm4@mplayer2.org>2012-02-29 04:14:54 +0100
commit12c44610ad6963bb58c01cc4415cc7befef386e1 (patch)
treef41a1f7975d253d847e6cb5ecf1537f5f5d9a008 /cfg-mplayer.h
parent8b69d8a366df590c2160b36269dae424f93eabb7 (diff)
downloadmpv-12c44610ad6963bb58c01cc4415cc7befef386e1.tar.bz2
mpv-12c44610ad6963bb58c01cc4415cc7befef386e1.tar.xz
screenshot: make screenshot filenames configurable
This adds the --screenshot-template option, which specifies a template for the filename used for a screenshot. The '%' character is parsed as format specifier. These format specifiers insert metadata into the filename. For example, '%f' is replaced with the filename of the currently played file. The following format specifiers are available: %n Insert sequence number (padded with 4 zeros), e.g. "0002". %0Nn Like %n, but pad to N zeros (N = 0 to 9). %n behaves like %04n. %#n Like %n, but reset the sequence counter on every screenshot. (Useful if other parts in the template make the resulting filename already mostly unique.) %#0Nn Use %0Nn and %#n at the same time. %f Insert filename of the currently played video. %F Like %f, but with stripped file extension ("." and rest). %p Insert current playback time, in HH:MM:SS format. %P Like %p, but adds milliseconds: HH:MM:SS.mmmm %tX Insert the current local date/time, using the date format X. X is a single letter and is passed to strftime() as "%X". E.g. "%td" inserts the number of the current day. %{prop} Insert the value of the slave property 'prop'. E.g. %{filename} is the same as %f. If the property doesn't exist or is not available, nothing is inserted, unless a fallback is specified as in %{prop:fallback text}. %% Insert the character '%'. The strings inserted by format specifiers will be checked for characters not allowed in filenames (including '/' and '\'), and replaced with the placeholder '_'. (This doesn't happen for text that was passed with the --screenshot-template option, and allows specifying a screenshot target directory by prefixing the template with a relative or absolute path.)
Diffstat (limited to 'cfg-mplayer.h')
-rw-r--r--cfg-mplayer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cfg-mplayer.h b/cfg-mplayer.h
index 0664d004a1..a8f485c7c9 100644
--- a/cfg-mplayer.h
+++ b/cfg-mplayer.h
@@ -938,6 +938,7 @@ const m_option_t mplayer_opts[]={
OPT_INTRANGE("screenshot-jpeg-quality", screenshot_jpeg_quality, 0, 0, 100),
OPT_INTRANGE("screenshot-png-compression", screenshot_png_compression, 0, 0, 9),
OPT_STRING("screenshot-filetype", screenshot_filetype, 0),
+ OPT_STRING("screenshot-template", screenshot_template, 0),
OPT_FLAG_ON("list-properties", list_properties, CONF_GLOBAL),
{"identify", &mp_msg_levels[MSGT_IDENTIFY], CONF_TYPE_FLAG, CONF_GLOBAL, 0, MSGL_V, NULL},