Why getting and how to fix the warning/error on ffmpeg : not enough frames to estimate rate; consider increasing probesize

ffmpeg

The command I'm using :

ffmpeg -f gdigrab -framerate 24 -i desktop -preset ultrafast -pix_fmt yuv420p camera1.mp4

Stream #0: not enough frames to estimate rate; consider increasing probesize

And also :

Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.

And then all the time :

Past duration 0.810524 too large

Some info :

ffmpeg -f gdigrab -framerate 24 -i desktop -preset ultrafast -pix_fmt yuv420p camera1.mp4
ffmpeg version N-81045-g450cf40 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: –enable-gpl –enable-version3 –disable-w32threads –enable-dxva2 –enable-libmfx –enable-nvenc –enable-avisynth –enable-bzlib –enable-libebur128 –enable-fontconfig –enable-frei0r –enable-gnutls –enable-iconv –enable-libass –enable-libbluray –enable-libbs2b –enable-libcaca –enable-libfreetype –enable-libgme –enable-libgsm –enable-libilbc –enable-libmodplug –enable-libmp3lame –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libopenjpeg –enable-libopus –enable-librtmp –enable-libschroedinger –enable-libsnappy –enable-libsoxr –enable-libspeex –enable-libtheora –enable-libtwolame –enable-libvidstab –enable-libvo-amrwbenc –enable-libvorbis –enable-libvpx –enable-libwavpack –enable-libwebp –enable-libx264 –enable-libx265 –enable-libxavs –enable-libxvid –enable-libzimg –enable-lzma –enable-decklink –enable-zlib
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 50.100 / 57. 50.100
libavformat 57. 42.100 / 57. 42.100
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 47.100 / 6. 47.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
[gdigrab @ 00000000026a24a0] Capturing whole desktop as 1920x1080x32 at (0,0)

Best Answer

ffmpeg tries to guess the effective framerate of the input. It does this by examining input frames to fetch their timestamps. At a minimum, ffmpeg wants 2 frames to make some guess. But there is a limit set to how much of the data ffmpeg will read for this and other information-gathering purposes. The default value is 5 megabytes. Windows GDI supplies uncompressed frames so they can take a lot of space. For a 1920x1080x32 input, you need to read at least 16.6 MB for 2 frames, but ideally 4 to 5 frames for an accurate assessment. So,

ffmpeg -f gdigrab -framerate 24 -probesize 42M -i desktop -preset ultrafast -pix_fmt yuv420p camera1.mp4

gdigrab's framerate option is private to it and only tells the grabber how long to wait between captures.

For the other two messages, you should upgrade ffmpeg. Your build is at least a few years old.

Related Topic