Giter Club home page Giter Club logo

timergen's Introduction

timergen

A command-line tool to generate a simple timer.

This also uses a simple DSL for time formatting that includes display widths. For example, formatting 69420 ms with the format spec %M:%S.%-2m outputs 01:09.42.

Prerequisites

  • ffmpeg is required to compose the video. For now, it must be on PATH.

Command line arguments

usage: timergen [-h] [-V] [-v] [-o OUTFILE] [-R] [--keep-session]
                [-f FONT_FAMILY] [-S FONT_SIZE] [-W WIDTH] [-H HEIGHT]
                [-t TEXT_COLOR] [-b BACKGROUND_COLOR] [-F FORMAT_SPEC]
                [-r FRAME_RATE] [-a OUTPUT_FRAME_RATE]
                duration

Generate a simple timer video for a given duration

positional arguments:
  duration              Duration of the timer (in seconds)

options:
  -h, --help, -?        Show this message and exit
  -V, --version         Show this program's version number and exit
  -v, --verbose         Verbose program output (use multiple times to increase verbosity level).
                        The higher the level, the more messages get printed to STDERR.
  -o OUTFILE, --outfile OUTFILE, --output OUTFILE
                        Specify the file name for the output.
                        If not specified, will output to file <session>.mp4, where <session> is a UUIDv4.
  -R, --reversed        Produce reversed output (for countdowns)
  --keep-session        Keep temporary files created during the session

Rendering options:
  Options that handle the output's rendering

  -f FONT_FAMILY, --font-family FONT_FAMILY
                        The font family name. If not specified, a fallback font will be used.
                        Note: It must refer to a TrueType or an OpenType font.
  -S FONT_SIZE, --font-size FONT_SIZE
                        The font size in pixels (default: 40)
  -W WIDTH, --width WIDTH
                        The video width (default: 250)
  -H HEIGHT, --height HEIGHT
                        The video height (default: 50)
  -t TEXT_COLOR, --text TEXT_COLOR, --txcolor TEXT_COLOR
                        The text color  (default: #FFFFFF).
                        Note: If you wish to use a hex code, it may be required to escape the # character.
  -b BACKGROUND_COLOR, --background BACKGROUND_COLOR, --bgcolor BACKGROUND_COLOR
                        The background color (default: #000000)
  -F FORMAT_SPEC, --format FORMAT_SPEC
                        The format specification.
                        
                        One can use the following format codes:
                        - %H: hours (default size: 2)
                        - %M: minutes (default size: 2)
                        - %S: seconds (default size: 2)
                        - %m: milliseconds (default size: -3)
                        - %%: literal %
                        
                        You may also use a digit after the % sign to specify how many last digits should be used
                        (except for %), potentially with a - character to specify how many first digits should be used.
                        
                        Default value: '%M:%S.%-2m' (two minute digits, two second digits, two first millisecond digits)
  -r FRAME_RATE, --frame-rate FRAME_RATE
                        The output frame rate (default: 25)
  -a OUTPUT_FRAME_RATE, --video-frame-rate OUTPUT_FRAME_RATE
                        The video frame rate (if not provided, same as FRAME_RATE)

timergen's People

Contributors

c-ezra-m avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.