Skip to main content

FFmpeg Wrapper for Python

Project description

ffmpeg-studio

FFmpeg Wrapper for Python This module provides a Pythonic interface to FFmpeg, allowing users to construct and execute FFmpeg commands programmatically. It simplifies video and audio processing tasks such as format conversion, filtering, and transcoding.

Installation

Using PIP

From PyPi

pip install ffmpeg-studio

From Source

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

Usage

Documention read docs here.

ffmpeg-studio support complex Filters and can be used with apply or apply2, apply2 is for multi output filters like Split and Concat.

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

# 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)

# run command 
ffmpeg = FFmpeg().output(Map(upscaled_clip), path="out.mp4").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.

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

Verify installation:

ffmpeg -version

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

ffmpeg_studio-0.0.11.tar.gz (82.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.0.11-py3-none-any.whl (49.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ffmpeg_studio-0.0.11.tar.gz
  • Upload date:
  • Size: 82.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for ffmpeg_studio-0.0.11.tar.gz
Algorithm Hash digest
SHA256 ec745dd6a57aebdd1a506478bf5ae8057b0e4a358c4622bd6957b35ee4a36095
MD5 f8704db11265f0e4d3226e094f59ac18
BLAKE2b-256 6e8a264f0dfb3c6075398f5050687f52f74052e6ad4486e755257fc16ab692d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ffmpeg_studio-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 2c1e8c5b31465f45c59e1e19f4502006c6464756cdccf99e84046e5deb7c1caa
MD5 371092e1c17fd9febeb0d436300caf56
BLAKE2b-256 6226c83867e4771bd1829d22aede55dcae58423a7cd681bb892e0a45e3ba0fc9

See more details on using hashes here.

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