https://github.com/gautam8404/ffmpeg-py
Simple FFmpeg bindings for python
https://github.com/gautam8404/ffmpeg-py
ffmpeg ffmpeg-wrapper python-ffmpeg
Last synced: about 1 month ago
JSON representation
Simple FFmpeg bindings for python
- Host: GitHub
- URL: https://github.com/gautam8404/ffmpeg-py
- Owner: gautam8404
- License: mit
- Created: 2023-07-26T10:53:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-15T23:27:59.000Z (over 2 years ago)
- Last Synced: 2025-09-27T23:12:55.323Z (5 months ago)
- Topics: ffmpeg, ffmpeg-wrapper, python-ffmpeg
- Language: Python
- Homepage: https://pypi.org/project/ffmpeg-py/
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Simple FFmpeg binding for python, mainly created for personal use. But i do plant to modify it for professional use.
## Installation using pip
```bash
pip install ffmpeg-py
```
Example:
```python
from FFmpeg.ffmpeg import FFmpeg
import subprocess
ffmpeg = FFmpeg()
ff = (
ffmpeg
.OverwriteOutput()
.addInput("video1.webm")
.addInput("./logo.png")
.addInput("video2.webm")
.videoCodec("libx264")
.audioCodec("aac")
.videoFramerate(30)
.videoResolution(resString="1920x1080")
.scale2refFilter(2, 0, "oh*mdar:ih*0.2", "camera", "video") # resize camera to 20% of screen height
.overlayFilter("video", "1", "W-w-10", "H-h-10", "v") # overlay logo on bottom right
.overlayFilter("v", "camera", "10", "10") # overlay camera on top left
.output("output.mp4") # output file
)
code, stdout, stderr = ff.execute(stderr=subprocess.STDOUT, shell=False)
print(code, stdout, stderr)
```
## INFO
- FFmpeg.ffmpeg.FFmpeg() - Main class, contains logic for executing command using subprocess
- FFmpeg.ffmpegCommandBuilder.FFmpegCommandBuilder() - Class for building ffmpeg command, contains all methods for ffmpeg filters, codecs and other options