https://github.com/deuteronomy-works/pyffmpeg
FFmpeg wrapper for python
https://github.com/deuteronomy-works/pyffmpeg
convert encoding ffmpeg multimedia
Last synced: 4 months ago
JSON representation
FFmpeg wrapper for python
- Host: GitHub
- URL: https://github.com/deuteronomy-works/pyffmpeg
- Owner: deuteronomy-works
- License: apache-2.0
- Created: 2020-03-25T11:02:32.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-11-06T19:05:11.000Z (7 months ago)
- Last Synced: 2025-11-06T21:04:17.081Z (7 months ago)
- Topics: convert, encoding, ffmpeg, multimedia
- Language: Python
- Homepage:
- Size: 209 MB
- Stars: 67
- Watchers: 2
- Forks: 14
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Contributing: .github/contributing.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# pyffmpeg | [](https://pepy.tech/project/pyffmpeg)
FFmpeg wrapper for python. It uses the most up-to-date FFmpeg binary to provide both FFmpeg and FFprobe functionality. So you can kill two birds with one stone.
The beautiful thing about this is that it comes with it's own FFmpeg executable. It is compressed, making it the smallest one you can find. Becuase it's cross-platform and python 3, it is the only option available for building cross-platform apps with ffmpeg in python.
## FFmpeg Version
Uses current FFmpeg version
## Installation
pip install pyffmpeg
## Usage
### FFmpeg
```python
from pyffmpeg import FFmpeg
inp = 'path/to/music_folder/f.mp4'
out = 'path/to/music_folder/f.mp3'
ff = FFmpeg()
output_file = ff.convert(inp, out)
print(output_file)
```
OR
```python
from pyffmpeg import FFmpeg
ff = FFmpeg()
ff.input('path/to/music_folder/f.mp4').output('path/to/music_folder/f.mp3').run()
```
Or for multiple input files
```
ff.input(
'path/to/music_folder/f.mp4',
'path/to/music_folder/g.mp3',
map=['0:1', '0:0']
).output('path/to/music_folder/f.mp4').run()
```
This method allows more complex file handling
### FFprobe
Provides FFprobe functions and values
```python
from pyffmpeg import FFprobe
input_file = 'path/to/music.mp3'
fp = FFprobe(input_file)
print(fp.duration)
```
will print
```shell
> 00:04:32:32
```
NB: The above digits are just for illustration purposes.
## Wiki
The wiki can be located [here](https://github.com/deuteronomy-works/pyffmpeg/wiki)
## Contributing
Contributions are welcome. Please read [Contributing](https://github.com/deuteronomy-works/pyffmpeg/wiki/How-to-Contribute)
## Legal
This library uses prebuilt binaries of FFmpeg licensed under the LGPLv2.1 and can be downloaded via the following links:
* Mac - here
* Linux - here
* Windows - here