File indexing completed on 2024-03-24 04:51:48

0001 <!--
0002 SPDX-FileCopyrightText: 2020 George Florea Bănuș <georgefb899@gmail.com>
0003 
0004 SPDX-License-Identifier: CC-BY-4.0
0005 -->
0006 
0007 <h2>Screenshot Template</h2>
0008 <div><a href="https://mpv.io/manual/stable/#screenshot">https://mpv.io/manual/stable/#screenshot</a></div>
0009 <div>
0010     <p class="first">Specify the filename template used to save screenshots. The template
0011         specifies the filename without file extension, and can contain format
0012         specifiers, which will be substituted when taking a screenshot.
0013         By default, the template is <tt class="docutils literal"><span class="pre">mpv-shot%n</span></tt>, which results in filenames like
0014         <tt class="docutils literal"><span class="pre">mpv-shot0012.png</span></tt> for example.
0015     </p>
0016     <p>The template can start with a relative or absolute path, in order to
0017         specify a directory location where screenshots should be saved.
0018     </p>
0019     <p>If the final screenshot filename points to an already existing file, the
0020         file will not be overwritten. The screenshot will either not be saved, or if
0021         the template contains <tt class="docutils literal">%n</tt>, saved using different, newly generated
0022         filename.
0023     </p>
0024     <p>Allowed format specifiers:</p>
0025     <dl class="last docutils">
0026         <dt><tt class="docutils literal" id="options-%[#][0x]n"><span class="pre">%[#][0X]n</span><a href="#options-%[#][0x]n" class="anchor fa fa-link"></a></tt></dt>
0027         <dd>A sequence number, padded with zeros to length X (default: 04). E.g.
0028             passing the format <tt class="docutils literal">%04n</tt> will yield <tt class="docutils literal">0012</tt> on the 12th screenshot.
0029             The number is incremented every time a screenshot is taken or if the
0030             file already exists. The length <tt class="docutils literal">X</tt> must be in the range 0-9. With
0031             the optional # sign, mpv will use the lowest available number. For
0032             example, if you take three screenshots--0001, 0002, 0003--and delete
0033             the first two, the next two screenshots will not be 0004 and 0005, but
0034             0001 and 0002 again.
0035         </dd>
0036         <dt><tt class="docutils literal" id="options-%f">%f<a href="#options-%f" class="anchor fa fa-link"></a></tt></dt>
0037         <dd>Filename of the currently played video.</dd>
0038         <dt><tt class="docutils literal" id="options-%f">%F<a href="#options-%f" class="anchor fa fa-link"></a></tt></dt>
0039         <dd>Same as <tt class="docutils literal">%f</tt>, but strip the file extension, including the dot.</dd>
0040         <dt><tt class="docutils literal" id="options-%x">%x<a href="#options-%x" class="anchor fa fa-link"></a></tt></dt>
0041         <dd>Directory path of the currently played video. If the video is not on
0042             the filesystem (but e.g. <tt class="docutils literal"><span class="pre">http://</span></tt>), this expand to an empty string.
0043         </dd>
0044         <dt><tt class="docutils literal" id="options-%x{fallback}">%X{fallback}<a href="#options-%x{fallback}" class="anchor fa fa-link"></a></tt></dt>
0045         <dd>Same as <tt class="docutils literal">%x</tt>, but if the video file is not on the filesystem, return
0046             the fallback string inside the <tt class="docutils literal"><span class="pre">{...}</span></tt>.
0047         </dd>
0048         <dt><tt class="docutils literal" id="options-%p">%p<a href="#options-%p" class="anchor fa fa-link"></a></tt></dt>
0049         <dd>Current playback time, in the same format as used in the OSD. The
0050             result is a string of the form "HH:MM:SS". For example, if the video is
0051             at the time position 5 minutes and 34 seconds, <tt class="docutils literal">%p</tt> will be replaced
0052             with "00:05:34".
0053         </dd>
0054         <dt><tt class="docutils literal" id="options-%p">%P<a href="#options-%p" class="anchor fa fa-link"></a></tt></dt>
0055         <dd>
0056             <p class="first">Similar to <tt class="docutils literal">%p</tt>, but extended with the playback time in milliseconds.
0057                 It is formatted as "HH:MM:SS.mmm", with "mmm" being the millisecond
0058                 part of the playback time.
0059             </p>
0060             <div class="admonition note last">
0061                 <p class="first admonition-title">Note</p>
0062                 <p class="last">This is a simple way for getting unique per-frame timestamps. (Frame
0063                     numbers would be more intuitive, but are not easily implementable
0064                     because container formats usually use time stamps for identifying
0065                     frames.)
0066                 </p>
0067             </div>
0068         </dd>
0069         <dt><tt class="docutils literal" id="options-%wx">%wX<a href="#options-%wx" class="anchor fa fa-link"></a></tt></dt>
0070         <dd>
0071             <p class="first">Specify the current playback time using the format string <tt class="docutils literal">X</tt>.
0072                 <tt class="docutils literal">%p</tt> is like <tt class="docutils literal"><span class="pre">%wH:%wM:%wS</span></tt>, and <tt class="docutils literal">%P</tt> is like <tt class="docutils literal"><span class="pre">%wH:%wM:%wS.%wT</span></tt>.
0073             </p>
0074             <dl class="last docutils">
0075                 <dt>Valid format specifiers:</dt>
0076                 <dd>
0077                     <dl class="first last docutils">
0078                         <dt><tt class="docutils literal" id="options-%wh">%wH<a href="#options-%wh" class="anchor fa fa-link"></a></tt></dt>
0079                         <dd>hour (padded with 0 to two digits)</dd>
0080                         <dt><tt class="docutils literal" id="options-%wh">%wh<a href="#options-%wh" class="anchor fa fa-link"></a></tt></dt>
0081                         <dd>hour (not padded)</dd>
0082                         <dt><tt class="docutils literal" id="options-%wm">%wM<a href="#options-%wm" class="anchor fa fa-link"></a></tt></dt>
0083                         <dd>minutes (00-59)</dd>
0084                         <dt><tt class="docutils literal" id="options-%wm">%wm<a href="#options-%wm" class="anchor fa fa-link"></a></tt></dt>
0085                         <dd>total minutes (includes hours, unlike <tt class="docutils literal">%wM</tt>)</dd>
0086                         <dt><tt class="docutils literal" id="options-%ws">%wS<a href="#options-%ws" class="anchor fa fa-link"></a></tt></dt>
0087                         <dd>seconds (00-59)</dd>
0088                         <dt><tt class="docutils literal" id="options-%ws">%ws<a href="#options-%ws" class="anchor fa fa-link"></a></tt></dt>
0089                         <dd>total seconds (includes hours and minutes)</dd>
0090                         <dt><tt class="docutils literal" id="options-%wf">%wf<a href="#options-%wf" class="anchor fa fa-link"></a></tt></dt>
0091                         <dd>like <tt class="docutils literal">%ws</tt>, but as float</dd>
0092                         <dt><tt class="docutils literal" id="options-%wt">%wT<a href="#options-%wt" class="anchor fa fa-link"></a></tt></dt>
0093                         <dd>milliseconds (000-999)</dd>
0094                     </dl>
0095                 </dd>
0096             </dl>
0097         </dd>
0098         <dt><tt class="docutils literal" id="options-%tx">%tX<a href="#options-%tx" class="anchor fa fa-link"></a></tt></dt>
0099         <dd>Specify the current local date/time using the format <tt class="docutils literal">X</tt>. This format
0100             specifier uses the UNIX <tt class="docutils literal">strftime()</tt> function internally, and inserts
0101             the result of passing "%X" to <tt class="docutils literal">strftime</tt>. For example, <tt class="docutils literal">%tm</tt> will
0102             insert the number of the current month as number. You have to use
0103             multiple <tt class="docutils literal">%tX</tt> specifiers to build a full date/time string.
0104         </dd>
0105         <dt><tt class="docutils literal" id="options-%{prop[:fallback"><span class="pre">%{prop[:fallback</span> text]}<a href="#options-%{prop[:fallback" class="anchor fa fa-link"></a></tt></dt>
0106         <dd>Insert the value of the input property 'prop'. E.g. <tt class="docutils literal">%{filename}</tt> is
0107             the same as <tt class="docutils literal">%f</tt>. If the property does not exist or is not available,
0108             an error text is inserted, unless a fallback is specified.
0109         </dd>
0110         <dt><tt class="docutils literal" id="options-%%">%%<a href="#options-%%" class="anchor fa fa-link"></a></tt></dt>
0111         <dd>Replaced with the <tt class="docutils literal">%</tt> character itself.</dd>
0112     </dl>
0113 </div>