MpegFlowBlogBack to home
← Recipes·Progress monitoring·tooling

Monitor FFmpeg progress for production: parsing -progress output

Track FFmpeg encoding progress in production. The -progress flag emits structured key-value pairs vs the chaotic stderr output that breaks log aggregators.

ByMpegFlow Engineering Team·FFmpeg recipe
·3 variants·May 9, 2026

When to use this

You parse FFmpeg progress when you need real-time feedback during long encodes — UI progress bars, queue health monitoring, ETA calculation, OOM detection. The default approach (parsing stderr line-by-line) is fragile and ships verbose log volume to your aggregator. The -progress flag emits structured key-value output to a file or stdout, dramatically simpler to parse and far less log volume to ship.

Command variants

Progress to stdout (pipeable)
ffmpeg -progress pipe:1 -i input.mp4 \
  -c:v libx264 -preset medium -crf 22 \
  -c:a copy \
  output.mp4 2>/dev/null | grep -E "frame=|fps=|out_time=|progress="

pipe:1 sends -progress output to stdout. Suppresses stderr to silence the verbose default output.

Progress to file (parseable)
ffmpeg -progress progress.log -i input.mp4 \
  -c:v libx264 -preset medium -crf 22 \
  -c:a copy \
  output.mp4

Writes structured progress to progress.log every second. Parse the file from your monitoring service.

Progress with explicit fields
ffmpeg -progress pipe:1 -nostats -i input.mp4 \
  -c:v libx264 -preset medium -crf 22 \
  -c:a copy \
  output.mp4 2>/dev/null

-nostats suppresses the default 1-line stderr stats. Cleaner output for production.

What each parameter does

  • -progress [target]

    Send structured progress to target. pipe:1 = stdout, pipe:2 = stderr, [filename] = file. Updates every second.

  • -nostats

    Suppress the default verbose stderr stats line. Useful when -progress is doing the reporting.

  • progress=continue

    Field in the progress output indicating encoding is in progress. progress=end signals completion.

  • frame=N out_time_ms=N speed=N

    Standard progress fields. frame = frames encoded so far. out_time_ms = position in output (milliseconds). speed = encode rate vs realtime (1x = realtime).

What this outputs

A stream of structured key-value pairs (one field per line) updated every second during encoding. Format is stable and parseable; no need to handle FFmpeg's verbose stderr output.

Pitfalls

  1. Default stderr output is fragile to parse: format changes between FFmpeg versions, contains warnings mixed with progress. Use -progress for production monitoring.
  2. -progress pipe:1 to stdout requires explicit stderr suppression (2>/dev/null) or your output gets contaminated with verbose logs.
  3. Progress updates every second by default; can't increase frequency. For sub-second progress, parse frame number changes from -progress and infer rate.
  4. Progress fields differ between encoders (NVENC vs libx264 produce different field sets). Test with your specific encoder pool.
  5. Progress file accumulates indefinitely if not rotated. For long-running encodes, periodically truncate or rotate the progress file.
  6. progress=continue alternates with progress=end at the close of the encode. Race conditions in parsers checking only current value can miss completion.

At production scale

Parsing FFmpeg progress at scale matters because logging FFmpeg's default stderr output is wasteful. A typical encode emits ~5-10 KB of stderr; -progress emits ~500 bytes. At 100K encodes/day, that's 500 MB vs 50 MB of log volume. The cost difference at log-aggregation scale (Datadog charges by log volume) is meaningful — 10× reduction matters.

How MpegFlow handles this

MpegFlow workers always use -progress for structured progress reporting. The progress is parsed, summarized, and exposed via the gRPC API to the coordinator. UIs and webhooks receive concise progress events, not raw FFmpeg output.

Topics
  • FFmpeg
  • progress
  • monitoring
  • tooling
  • Operations
See also
  • Engineering blog
    Running Ffmpeg At Scale Queue Retry Audit
  • Recipe
    Multi Output Encoding
Running this at scale?

Get the orchestration layer for free.

The progress monitoring command above is the easy part. The queue, retries, audit trail, encoder-version pinning, and multi-tenant security around it are what every video team rebuilds from scratch. We did the rebuild — design partners run it free during beta.

Apply More recipes
© 2026 MpegFlow, Inc. · Trust & complianceAll systems nominal·StatusPrivacy