wkrettek / pyffmpeg

FFmpeg wrapper for python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pyffmpeg Travis (.org) Travis (.org) Travis (.org) Downloads

FFmpeg wrapper for python. It uses FFmpeg binary to provide both FFmpeg and FFprobe functionality (FFprobe functionality includes get_album_art). 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 4.4

Installation

pip install pyffmpeg

Usage

FFmpeg

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)

FFprobe

Provides FFprobe functions and values

from pyffmpeg import FFprobe

input_file = 'path/to/music.mp3'
fp = FFprobe(input_file)

print(fp.duration)

will print

> 00:04:32:32

NB: The above digits are just for illustration purposes.

Wiki

The wiki can be located here

Contributing

Please read Contributing

Legal

This library uses prebuilt binaries of FFmpeg licensed under the LGPLv2.1 and can be downloaded via the following links:

About

FFmpeg wrapper for python

License:Apache License 2.0


Languages

Language:Python 100.0%