Get progress information for an ffmpeg process.
Project description
ffmpeg-progress
This script is based on the work of Rupert Plumridge.
Basic use
import subprocess as sp
import sys
from ffmpeg_progress import start
def ffmpeg_callback(infile: str, outfile: str, vstats_path: str):
p = sp.Popen(['ffmpeg',
'-y',
'-vstats_file', vstats_path,
'-i', infile,
outfile], stdout=sp.PIPE, stderr=sp.PIPE)
return p.pid
def on_message_handler(percent: float,
fr_cnt: int,
total_frames: int,
elapsed: float):
sys.stdout.write('\r{:.2f}%'.format(percent))
sys.stdout.flush()
def on_done_handler():
print('')
start('my input file.mov',
'some output file.mp4',
ffmpeg_callback,
on_message=on_message_handler,
on_done=on_done_handler,
wait_time=1) # seconds
start()
is the main function to use. If on_message
is not passed, a default function is used.
ffprobe
An ffprobe front-end function is included. Usage:
from ffmpeg_progress import ffprobe
ffprobe('my file.mp4') # returns a dict()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for ffmpeg_progress-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f69df50ce9e4bc1f869479cef0b8ef558ce0c5904e50fafa255cce5a68c5aa01 |
|
MD5 | 3abd912c5e8a5bdf0fccdd297a76039e |
|
BLAKE2b-256 | a0a18a53ef5c8ab0b96b409ad97e614757f87869819f7bac505bd7a5b4bd074e |