schema_version: 7.0
type: filter
identifier: dynamictext
title: Dynamic text
version: 1
copyright: Meltytech, LLC
license: LGPLv2.1
language: en
tags:
  - Video
description: Overlay dynamic text onto the video
notes: >
  The dynamic text filter will search for keywords in the text to be overlaid
  and will replace those keywords on a frame-by-frame basis.
  
parameters:
  - identifier: argument
    argument: yes
    title: Dynamic text
    type: string
    description: |
      The text to overlay. May include keywords enclosed in "#". 
      Keywords include:
        * #createdate#    - Best guess of file creation date
        * #smpte_df#      - SMPTE drop-frame timecode of the frame
        * #smpte_ndf#     - SMPTE non-drop-frame timecode of the frame
        * #timecode#      - same as #smpte_df#
        * #frame#         - frame number of the frame
        * #filedate#      - modification date of the file (GMT)
        * #localfiledate# - modification date of the file (local)
        * #localtime#     - current system date and time
        * #resource#      - resource of the producer that produced the frame
      Timecode keywords are based on the framerate and position of the frame.
      Time-based keywords can include a strftime format string to customize the
      output as long as you put some delimiter except "#" between the keyword
      and the format string and the keyword comes first. For example,
      "#localtime %I:%M:%S %p#" shows only the time in 12-hour format.
      Keywords may also be any frame property (e.g. #meta.media.0.codec.frame_rate#)
      The # may be escaped with "\".
    required: yes
    readonly: no
    default: > #trick to escape "#" character
      #timecode#
    widget: text

  - identifier: geometry
    title: Geometry
    type: rect
    description: A set of X/Y coordinates by which to adjust the text.
    default: 0%/0%:100%x100%:100

  - identifier: family
    title: Font family
    type: string
    description: >
      The typeface of the font.
    default: Sans
    readonly: no
    mutable: yes
    widget: combo

  - identifier: size
    title: Font size
    type: integer
    description: >
      The size in pixels of the font. 
    default: 48
    readonly: no
    mutable: yes
    widget: spinner

  - identifier: style
    title: Font style
    type: string
    description: >
      The style of the font.
    values:
      - normal
      - italic
    default: normal
    readonly: no
    mutable: yes
    widget: combo

  - identifier: weight
    title: Font weight
    type: integer
    description: The weight of the font.
    minimum: 100
    maximum: 1000
    default: 400
    readonly: no
    mutable: yes
    widget: spinner

  - identifier: fgcolour
    title: Foreground color
    type: string
    description: >
      A color value is a hexadecimal representation of RGB plus alpha channel 
      as 0xrrggbbaa. Colors can also be the words: white, black, red, green,
      or blue. You can also use a HTML-style color values #rrggbb or #aarrggbb.
    default: 0x000000ff
    readonly: no
    mutable: yes
    widget: color

  - identifier: bgcolour
    title: Background color
    type: string
    description: >
      A color value is a hexadecimal representation of RGB plus alpha channel 
      as 0xrrggbbaa. Colors can also be the words: white, black, red, green,
      or blue. You can also use a HTML-style color values #rrggbb or #aarrggbb.
    default: 0x00000020
    readonly: no
    mutable: yes
    widget: color

  - identifier: olcolour
    title: Outline color
    type: string
    description: >
      A color value is a hexadecimal representation of RGB plus alpha channel 
      as 0xrrggbbaa. Colors can also be the words: white, black, red, green,
      or blue. You can also use a HTML-style color values #rrggbb or #aarrggbb.
    readonly: no
    mutable: yes
    widget: color

  - identifier: outline
    title: Outline Width
    type: string
    description: >
      The width of the outline in pixels.
    readonly: no
    default: 0
    minimum: 0
    maximum: 3
    mutable: yes
    widget: spinner

  - identifier: pad
    title: Padding
    type: integer
    description: >
      The number of pixels to pad the background rectangle beyond edges of text.
    readonly: no
    default: 0
    mutable: yes
    widget: spinner

  - identifier: halign
    title: Horizontal alignment
    description: >
      Set the horizontal alignment within the geometry rectangle.
    type: string
    default: left
    values:
      - left
      - centre
      - right
    mutable: yes
    widget: combo

  - identifier: valign
    title: Vertical alignment
    description: >
      Set the vertical alignment within the geometry rectangle.
    type: string
    default: top
    values:
      - top
      - middle
      - bottom
    mutable: yes
    widget: combo
