Skip to main content

Inspect and modify video/audio/subtitle tracks using FFmpeg.

Project description

vidmux

PyPi badge Python versions badge License badge GitHub issues badge

Inspect and modify video/audio/subtitle tracks using FFmpeg.

Developed and maintained by Philipp Meder.

Quick Start

Install this package:

pip install vidmux

You can get the newest stable version with:

pip install git+https://github.com/philippmeder/vidmux

License

Distributed under the BSD 3-Clause License.

Usage

You may directly call one of the two following lines:

vidmux [OPTIONS]
python -m vidmux [OPTIONS]

Features

For a full list of features, use:

vidmux --help
  1. Get codecs and audio/subtitle tracks
  2. Mux audio tracks
  3. Set audio/subtitle metadata
  4. Scan library structure
  5. Get video resolution
  6. Rename files
  7. Shift SRT timestamps

Scan for codecs, audio and subtitle tracks

Scan the video files of a library for video/audio codecs and the included audio and subtitle tracks.

vidmux scan [-h] [--extensions EXTENSION [EXTENSION ...]] [--print] [--json FILE] [--csv FILE] [--name FILE] [-l LANGUAGE_ID] library

Options:

  • library (positional): Path to the video library directory.
  • --extensions: Specify (multiple) file extensions to include in the scan.
  • --print: Print the results to the console/terminal.
  • --json: Specify a JSON file where the results should be saved.
  • --csv: Specify a CSV file where the results should be saved.
  • --name: Specify a JSON file where name suggestions will be stored (required for the rename feature).
  • -l, --default-language: Language identifier that will be used to interpret undefined languages of audio/subtitle tracks (currently only applied for naming suggestions).

Mux audio tracks

Mux multiple audio tracks into one video file using FFmpeg.

vidmux mux-audio-tracks [-h] [--dry-run] output inputs [inputs ...]

Options:

  • output (positional): Specify the output file.

  • inputs (positional): Pairs or triplets of inputs: input_file lang [title].

    Example: video_en.mp4 eng video_commentary_en.mp4 eng 'English Commentary' video_de.mp4 deu

  • --dry-run: Print the ffmpeg command without executing it.

Set audio and subtitle metadata

Set the metadata, i.e. language and title, for audio and subtitle tracks.

vidmux set-language [-h] --audio-lang LANGUAGE [LANGUAGE ...] [--subtitle-lang [LANGUAGE ...]]
[--audio-title [TITLE ...]]
[--subtitle-title [TITLE ...]]
[--dry-run]
input_file output_file

Options:

  • --audio-lang: List of language identifiers corresponding to the audio tracks, e.g. deu eng.
  • --subtitle-lang: List of language identifiers corresponding to the subtitle tracks, e.g. deu eng.
  • --audio-title: List of titles corresponding to the audio tracks.
  • --subtitle-title: List of titles corresponding to the audio tracks.
  • --dry-run: Print the ffmpeg command without executing it.

Scan for issues in the library structure

Scan and find issues in the structure of a movie library. Following rules are currently used:

  • Every movie should be in an appropriate subfolder with corresponding name, e.g. Seven Samurai (1954)/Seven Samurai (1954).mp4. It is okay to have multiple versions or parts in the same folder as long as the basic name does not change. Example:
    movie-library/Blade Runner (1982)
    ├── Blade Runner (1982) - [1080p].mp4
    ├── Blade Runner (1982) - [480p].mp4
    ├── Blade Runner (1982) - Director's Cut.mp4
    └── Blade Runner (1982) - Final Cut.mp4
    
  • Every movie should include a publishing year, e.g. Paris, Texas (1984).mp4.
  • The usual suspects of special characters are not allowed in the filename, i.e. <>:"/\\|?*.
vidmux lib-structure [-h] [--extensions EXTENSION [EXTENSION ...]] [--print] [--json FILE] [--csv FILE] library

Options:

  • library (positional): Path to the video library directory.
  • --extensions: Specify (multiple) file extensions to include in the scan.
  • --print: Print the results to the console/terminal.
  • --json: Specify a JSON file where the results should be saved.
  • --csv: Specify a CSV file where the results should be saved.

Get video resolution

Inspect and show the video resolution of a video file (supports URL).

vidmux resolution [-h] path_or_url

Rename files

Rename files according to a mapping given by a file (use vidmux scan --name).

vidmux rename [-h] [--no-backup] file

Options:

  • --no-backup: Prevent the creation of a file containing the original filename (so you can revoke the process).

Shift SRT timestamps

Shift all timestamps in a SRT subtitle file.

vidmux srt-tools [-h] -s SECONDS [-o FILE] [--inplace] [--show-count] input_file

Options:

  • -s, --shift: Timeshift in seconds (e.g. 1.5 or -0.8).
  • -o, --output: Output SRT file (if not provided: stdout or --inplace)
  • --inplace: Overwrite original file (a backup will be created).
  • --show-count: Show number of changed timestamps.

Requirements

  • ffmpeg with ffprobe has to be installed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vidmux-0.2.0.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vidmux-0.2.0-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file vidmux-0.2.0.tar.gz.

File metadata

  • Download URL: vidmux-0.2.0.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vidmux-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6290edc73f53da83e7e24213efdd9a3300afde5ddc09f503a07a0876799b05ef
MD5 30b3c2b357f2d9ce05dec33348b7bce7
BLAKE2b-256 280440f31b4253706cdfb6b35e01f3546127f0d5148dd3334169457674984ce1

See more details on using hashes here.

Provenance

The following attestation bundles were made for vidmux-0.2.0.tar.gz:

Publisher: publish-python-package.yml on PhilippMeder/vidmux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vidmux-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: vidmux-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vidmux-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00c85a9abc75deab7a97d66cba136ed03e9b0766f24a9cf561cfb2407522d181
MD5 3e9a9d857ad26442271d56b02c9a8856
BLAKE2b-256 5a498cde6ea401d1b6b9f43464e1c28352fdc265e6f78dc4e9d9a2a5081769df

See more details on using hashes here.

Provenance

The following attestation bundles were made for vidmux-0.2.0-py3-none-any.whl:

Publisher: publish-python-package.yml on PhilippMeder/vidmux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page