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.1.tar.gz (34.0 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.1-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vidmux-0.2.1.tar.gz
  • Upload date:
  • Size: 34.0 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.1.tar.gz
Algorithm Hash digest
SHA256 e450621ceeecf9f859449bde386f9366e1ecc859975c70f3ea2f795efd7be81a
MD5 460b4964478c405c6b086034ce1aefbd
BLAKE2b-256 51b66d90adf7dca4b645f5d21772e3f5e9ed4c16a643607be7fc8bcbfea0e0df

See more details on using hashes here.

Provenance

The following attestation bundles were made for vidmux-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: vidmux-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 31.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 837d608aa00182f7324f99c1a28eff1bb9f7761612915bf67063b921c0924267
MD5 6cb97a80ed1142d9222b1b6ffaebc6aa
BLAKE2b-256 8167533278af63652e4403299c553f7e8dad9b34723563de93e6ff1160e77735

See more details on using hashes here.

Provenance

The following attestation bundles were made for vidmux-0.2.1-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