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.15.tar.gz (82.5 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.15-py3-none-any.whl (51.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ffmpeg_studio-0.0.15.tar.gz
Algorithm Hash digest
SHA256 05196cc74818e7dfba53aa98e8927b12ed7ad29e3fa2b6ba7b8a6abefed5facd
MD5 c3b8d905f6420ba55efd8c4a75aaea06
BLAKE2b-256 f9363f9e27cf7b47e66e8c6cb2abc260e1c0a87d6b05115b3517ca9758f6a331

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ffmpeg_studio-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 043a6b258b864ef0c33ec5645e361fda2daea367f6ce3d868322497d6cc55255
MD5 07b7798dbaba73ca3d3da8fcf22098c7
BLAKE2b-256 3df1282803fcc090af83d389381e68df527fb32c8ff66cf8a68587250487433e

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