Skip to main content

Get progress information for an ffmpeg process.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

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 Distribution

ffmpeg-progress-0.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ffmpeg_progress-0.0.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file ffmpeg-progress-0.0.1.tar.gz.

File metadata

  • Download URL: ffmpeg-progress-0.0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for ffmpeg-progress-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9db1e14b0e2d2044b91bcc7e8d3337ddb0452be6dcb0e861ffd600f31df0cc2d
MD5 6006ea26ec304d68f5319837e65b86dd
BLAKE2b-256 cfb99bf80b469f9d3ba09c8530cf800b048d9e0332bca7ddd3f5a3346f710d25

See more details on using hashes here.

File details

Details for the file ffmpeg_progress-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ffmpeg_progress-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for ffmpeg_progress-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bfeb2c84970b701144b9fbe35a0081fe3bff01c2dc620f1179f30b396b7d8e6a
MD5 e938d258cc5747469682c0e76aec0cb6
BLAKE2b-256 6106c1c62754aed6b53b39c64cfe09a6fe81ad33a99ce5ea3147aaec80604575

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page