World Conquest Chronicles

World Conquest Chronicles

FPS Fixer, v1.2.0

The utility for fixing FPS in videos. It also supports speeding up or slowing down videos and removing audio tracks.

Add video speed adjustment and audio removal, improve FPS detection and processing controls, support a single video file as input, and introduce an automated test suite.

Change Log

  • search of videos:
    • support a single video file as input;
    • skipping videos with near target FPS:
      • use ffprobe to detect video FPS, including fractional frame rates;
      • treat FPS values at the epsilon boundary as matching the target;
      • validate and normalize the FPS and epsilon options, including comma decimal notation;
  • video correction:
    • add optional acceleration or deceleration of output videos;
    • add the option to remove audio from output videos;
    • map video and optional audio streams explicitly;
    • produce constant-frame-rate output;
  • the additional modes:
    • add the force mode to process videos regardless of their current FPS;
    • avoid creating the output directory in the mode without real video processing;
  • add a Bats test suite, with coverage of:
    • basic CLI behavior;
    • numeric option validation and normalization;
    • file discovery for directory and single-file inputs;
    • FPS detection, comparison, and processing;
    • video acceleration and audio handling;
    • processing, probing, and metadata error handling;
    • additional modes and output path construction.

Features

  • search of videos:
    • filtering by a video file extension;
    • skipping videos with near target FPS;
    • support a single video file as input;
  • video correction:
    • fixing FPS in videos that have FPS less than or greater than the specified FPS;
    • optional acceleration/deceleration of output videos with a custom speed factor;
    • optional removal of audio from output videos;
  • automatic directory creation for fixed videos;
  • the additional modes:
    • the mode without real processing of videos, only with search of them and check of their FPS;
    • the mode with processing every video regardless of FPS check;
  • logging:
    • logging of a video name and FPS at the beginning of processing;
    • logging of a fixed video path at the end of processing.

Requirements

  • FFmpeg >=4.4.2, <5.0 (with ffprobe).
  • bc.
  • GNU tools:
    • getopt;
    • date (with --rfc-3339=ns);
    • realpath (with --relative-to).

Usage

$ fps_fixer.bash -v | --version
$ fps_fixer.bash -h | --help
$ fps_fixer.bash [options] [<path>]

Options:

  • -v, --version — show the version;
  • -h, --help — show the help;
  • -e EXTENSION, --extension EXTENSION — video file extension (default: mp4);
  • -b PATH, --base-path PATH — base path for fixed videos (relative to the input directory or single file's parent directory; default: ./fixed-videos);
  • -f FPS, --fps FPS — target FPS (default: 60);
  • -E EPSILON, --epsilon EPSILON — allowable error when comparing FPS (default: 2);
  • -F, --force — process every video regardless of FPS check;
  • -s SPEED, --speed-factor SPEED — optional acceleration speed factor between 0.5 and 2.0 (inclusive);
  • --no-audio — remove audio from output videos;
  • --no-process — don't process videos, only search for them and check their FPS.

Arguments:

  • <path> — directory containing original videos or a single original video file (default: .).

Repository

Link: https://github.com/thewizardplusplus/fps-fixer/tree/v1.2.0.

Content: code.

License: MIT.

Screenshots

Running the script with the default options

Running the script in video acceleration mode

Processing a single specified video file

Demonstrating error handling when the script cannot access some video files

Running the script in no-process mode to check video FPS