Skip to main content

Get progress information for an ffmpeg process.

Project description


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):
    return sp.Popen(['ffmpeg',
                     '-loglevel', '0',
                     '-vstats_file', vstats_path,
                     '-i', infile,

def on_message_handler(percent: float,
                       fr_cnt: int,
                       total_frames: int,
                       elapsed: float):

start('my input',
      'some output file.mp4',
      on_done=lambda: print(''),
      wait_time=1)  # seconds

start() is the main function to use. If on_message is not passed, a default function is used. The on_done argument is optional. The initial_wait_time keyword argument can be used to specify a time to wait before processing the log.

The ffmpeg callback must return a PID (int). It is recommended to pass -nostats -loglevel 0 to your ffmpeg process. The ffmpeg callback also must pass -vstats_file given the path from the callback argument.


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.

Files for ffmpeg-progress, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size ffmpeg_progress-0.0.4-py3-none-any.whl (4.4 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page