Skip to main content

FFmpeg Wrapper for Python

Project description

FFmpeg.py

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 Package Manager

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

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

Documention

Documention read docs here.

Usage

Usage

For simple media conversion :

from ffmpeg.inputs import VideoFile
from ffmpeg import export

clip = VideoFile("video.mp4")

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

Filters

FFmpeg.py 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)

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.10.tar.gz (77.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.10-py3-none-any.whl (46.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ffmpeg_studio-0.0.10.tar.gz
Algorithm Hash digest
SHA256 6a6dbf980f99f4de83bd5b75037f8481a9aed79669643785e2ed744ab8683574
MD5 480e3ba491dcf76904c9134a7bb38f39
BLAKE2b-256 0f421672fc950c0c20dd9df26b15b0268bc929a7e8638bb6e8ae696bccf76d01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ffmpeg_studio-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 19e5597079cdaf7a95984c8b69bcb76f9baa34998e1865d1ef2cbf34840da287
MD5 31089d8aea63a55958a4d61bfcd2cf4f
BLAKE2b-256 54b449ed3d1f08756fb2bbb3bb9cdb80dbc3182dd5e7372af8b961a42228d51a

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