Skip to main content

FFmpeg-studio

PyPI License Docs GitHub stars

ffmpeg-studio provides a Pythonic interface to FFmpeg, allowing users to construct and execute FFmpeg commands programmatically.

It simplifies and Handles:

  • Complex filter generation
  • All popular Filters and Baseclass for custom filters
  • Automatic Safe quoting & escaping
  • Input handling & stream selection
  • Output mapping & stream selection
  • Progress tracking with callbacks
  • Allows direct flags in command.
  • Scanning metadata with ffprobe.
  • Long filter graphs.

diagram

Installation

From PyPi

pip install ffmpeg-studio

From Source

pip install git+https://github.com/electro199/ffmpeg-studio.git

Usage

ffmpeg-studio support complex Filters and can be used with apply or apply2.

from ffmpeg import FFmpeg, InputFile, FileInputOptions, Map
from ffmpeg.filters import apply, Scale, Overlay

# set options
clip = InputFile("video.mp4", FileInputOptions(duration=10))
overlay = InputFile("overlay.png")

# apply scale filter on clip
upscaled_clip = apply(Scale(1440, 1920), clip)

# apply scale filter on overlay
overlay = apply(Scale(100, 100), overlay)

# apply overlay filter with overlay on upscaled_clip
upscaled_clip = apply(Overlay(overlay, x=0, y=10), clip)


ffmpeg = FFmpeg()

# add output
ffmpeg.output(upscaled_clip, path="out.mp4")

# run command
ffmpeg.run(progress_callback=print)

For simple media conversion :

from ffmpeg.inputs import VideoFile
from ffmpeg import export

clip = VideoFile("video.mp4")

export(
   clip,
   path="out.mkv",
).run()

Install FFmpeg

This project does not install ffmpeg utility automatically.

Verify ffmpeg is installed:

ffmpeg -version

Windows

Using winget:

winget install --id=Gyan.FFmpeg  -e

or download and install FFmpeg from FFmpeg official website:

  1. Download the latest FFmpeg build from here.
  2. Extract the archive and add the bin directory to your system PATH.

macOS

Using Homebrew:

brew install ffmpeg

Linux

For Debian/Ubuntu:

sudo apt install ffmpeg

To-Do

  • All Input methods

    • Generic(Input) class
    • ImageFile class
    • VideoFile class
    • AudioFile class
    • VituralVideo class
    • VituralAudio class
  • Output options

    • Muliple output per command
    • filter_file for super long filters
    • Per map flags
    • Per output flags
  • Improve progress tracking

    • Support callbacks with frame/time info
    • Provide async interface for streaming progress
  • Documentation & Examples

    • Basic tutorials.
    • Showcase filtergraph construction with helpers
    • Detailed tutorials.
    • Detailed example/gallery.
  • Testing & CI

    • Publish to PyPI every release
    • Publish Docs every release
    • Verify cross-platform behavior (Linux/Windows/macOS)
    • GitHub Actions for automated testing
  • Packaging & Distribution

    • Publish to PyPI

Download files

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

Source Distribution

ffmpeg_studio-0.1.4.tar.gz (42.0 kB view details)

Uploaded Source

Built Distribution

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

ffmpeg_studio-0.1.4-py3-none-any.whl (56.1 kB view details)

Uploaded Python 3

File details

Details for the file ffmpeg_studio-0.1.4.tar.gz.

File metadata

  • Download URL: ffmpeg_studio-0.1.4.tar.gz
  • Upload date:
  • Size: 42.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ffmpeg_studio-0.1.4.tar.gz
Algorithm Hash digest
SHA256 976476f89aa75927d2c73748e8388da24ebc2b4055e9f27adede7e00cdae4b24
MD5 5f1986343e97b8a570b155e72a95d121
BLAKE2b-256 507d15d05590ce5fdddd72ba5970601d0f085c1dbb8d7494bb4172a4a5a8d137

See more details on using hashes here.

File details

Details for the file ffmpeg_studio-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: ffmpeg_studio-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 56.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ffmpeg_studio-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e4fafd58e2467993c22f85755b8fa80d8c0283f943a1b1915ea4a8f070251bbd
MD5 f6cbfc6d65398892b10996e08f7eeb28
BLAKE2b-256 bc0285cb329fad800ab5886d0d7938f2e5dff6d8d8f850f7ad9272a1825098f6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.15

2 files

0.0.11

2 files

0.0.10

2 files

Supported by

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