mpvQC

Export Templates

mpvQC uses the Jinja template engine to customize how QC reports are exported. This allows you to control the format and structure of your exported documents.

Getting Started

  1. Create a new file with the .jinja extension (e.g., MyTemplate.jinja) in the appropriate directory:
    • Windows: appdata/export-templates
    • Linux: ~/.var/app/io.github.mpvqc.mpvQC/config/mpvQC/export-templates
  2. Edit the template file using any text editor
  3. Restart mpvQC to load the new template

Once loaded, your custom template will appear as a new export option in the File menu.

Template Reference

In addition to standard Jinja expressions, mpvQC provides the following properties and filters:

Properties

Report Metadata
write_dateboolWhether to include the export date/time
datestrCurrent date/time formatted according to user’s locale (LongFormat)
write_generatorboolWhether to include the generator information
generatorstrmpvQC version string (e.g., “mpvQC 0.9.0”)
 
Video Information
write_video_pathboolWhether to include the video file path
video_pathstrAbsolute path to the video file (empty if no video loaded)
video_namestrVideo filename with extension (empty if no video loaded)
 
User Information
write_nicknameboolWhether to include the user’s nickname
nicknamestrUser’s nickname for report attribution
 
Subtitle Information
write_subtitle_pathsboolWhether to include manually imported subtitle paths
subtitleslist[str]List of subtitle file paths
 
Comments
commentslist[dict]List of comment dictionaries containing:
time (int): Time in seconds
commentType (str): Type of comment
comment (str): The comment text

Filters

FilterPurposeUsage
as_timeConverts seconds to HH:mm:ss format{{ comment['time'] | as_time }}00:00:00
as_comment_typeTranslates comment type to user’s language{{ comment['commentType'] | as_comment_type }} → Localized type name

Default Template

mpvQC uses this template internally for saving QC documents:

[FILE]
{{ 'date      : ' + date + '\n'       if write_date       else '' -}}
{{ 'generator : ' + generator + '\n'  if write_generator  else '' -}}
{{ 'nick      : ' + nickname + '\n'   if write_nickname   else '' -}}
{{ 'path      : ' + video_path + '\n' if write_video_path else '' -}}
{% for subtitle in subtitles if write_subtitle_paths -%}
  subtitle  : {{ subtitle }}
{% endfor -%}

{{ '\n' }}[DATA]
{% for comment in comments -%}
[{{ comment['time'] | as_time }}] [{{ comment['commentType'] | as_comment_type }}] {{ comment['comment'] | trim }}
{% endfor -%}
# total lines: {{ comments | count }}