FIX: Past duration too large error in FFmpeg

Milan Stanojevic
by Milan Stanojevic
Deputy Editor
Affiliate Disclosure
Share this article:

  • FFmpeg is an open-source audio and video editing tool.
  • The guide below will cover a more frequent issue reported by users to appear when using FFmpeg.
  • For more articles on this type of product, check out our Video Editors Hub.
  • More fixes and guides regarding software issues can be found on our Software Fix page.
Fix Past duration too large error in FFmpeg
To fix various PC problems, we recommend DriverFix: This software will keep your drivers up and running, thus keeping you safe from common computer errors and hardware failure. Check all your drivers now in 3 easy steps:
  1. Download DriverFix (verified download file).
  2. Click Start Scan to find all problematic drivers.
  3. Click Update Drivers to get new versions and avoid system malfunctionings.
  • DriverFix has been downloaded by 0 readers this month.

FFmpeg is an open-source tool that is used by billions of people around the world for processing audio, video, and other multimedia content.

This command-line program often generates Past Duration Too Large error during the downscaling or encoding video content. One of the users who experienced a similar problem reported the issue on StackOverflow.

When encoding H.264 using ffmpeg I get the following type of warnings:  Past duration 0.603386 too large

What do they mean? I have not found anything clear online or in the ffmpeg documentation.

It seems like it is a warning message rather than an error that appears when you try to encode a high frame rate file to a low frame rate output.

The framerates are dropped in that case. Today, we will show how you can get rid of this warning message.

How do I fix the Past duration too large error in FFmpeg?

1. Set the input frame rate

set input frame rate FFmpeg Past Duration Too Large error

  1. The problem might appear if the input frames are missing from the video and it can cause some frames to drop.
    • You need to add the input frames to fix the issue.
  2. Look at the call that you are using for video conversion.
    • It should be similar to this one:
      • ffmpeg -framerate 24 -i %05d.png -c:v libx264 -crf 5 out.mkv
  3. You need to separately mention the input and output framerate in the following manner:
    • ffmpeg -framerate 25 -i %05d.png -r 10 -c:v libx264 -crf 5 out.mkv

The issue should disappear because the encoding is now done for 161/400 images. The system will delete the rest of the images.

However, if the problem still persists head towards the second solution.

2. Add Sync Flags

add sync flags FFmpeg Past Duration Too Large error

  1. Right now, you might be using the call mentioned below: ffmpeg -framerate 24 -i %05d.png -c:v libx264 -crf 5 out.mkv
  2. If yes, you might be missing sync commands and it might trigger the error.
  3. Add the -async 1 -vsync1 synchronization commands in order to synchronize the video input and video output:
    • ffmpeg -framerate 24 -i %05d.png -c:v libx264 -crf 5 out.mkv -async 1 -vsync 1

The situation can be frustrating if you are unable to encoding or downscaling a video. It is important to find a quick solution in that case.

Make sure that you are correctly following each and every step to fix this problem. Let us know in the comments section below if our solutions helped you to fix this issue.

FAQ: Learn more about FFmpeg

  • What is FFmpeg?

FFmpeg is an open-source tool that is used by billions of people around the world for processing audio, video, and other multimedia content.

  • Where can I download FFmpeg?

FFmpeg can be downloaded from the official website and installed like any other product. Check out this article for more details on getting FFmpeg.

  • Are there any alternatives to FFmpeg?

As far as audio extraction goes, there are plenty of tools that you can use as FFmpeg alternatives.

Editor's Note: This article was originally published in September 2019 and was revamped and updated in July 2020 for freshness, accuracy, and comprehensiveness.
Was this page helpful?
Thanks for letting us know! You can also help us by leaving a review on MyWOT or Trustpillot.
Get the most from your tech with our daily tips
Tell us why!