FIX: Past duration too large error in FFmpeg

Reading time icon 2 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more

Key notes

  • 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

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.



[wl_navigator]

More about the topics: audio editors, Video Editors, windows 10