I am emulating a screen with
Xvfb
, and I want to capture it with ffmpeg. In order to prevent frame dropping or duplication, I would like to capture at the exact refresh rate of the screen, but it seems that Xvfb does not … have this?
xrandr
confirms that it's 0.0:
$ Xvfb :123 -ac -nolisten tcp -screen 0 1920x1080x24 &
$ DISPLAY=:123 xrandr
xrandr: Failed to get size of gamma for output screen
Screen 0: minimum 1 x 1, current 1920 x 1080, maximum 1920 x 1080
screen connected 1920x1080+0+0 0mm x 0mm
1920x1080 0.00*
At which rate are the images then drawn to the screen? ffmpeg shows 29.97 fps for this input when using x11grab
:
$ ffmpeg -f x11grab -i :123
ffmpeg version 4.3.5-0+deb11u1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
configuration: --prefix=/usr --extra-version=0+deb11u1 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[x11grab @ 0xaaaadaa0c2a0] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, x11grab, from ':123':
Duration: N/A, start: 1669816070.219332, bitrate: 1988667 kb/s
Stream #0:0: Video: rawvideo (BGR / 0x524742), bgr0, 1920x1080, 1988667 kb/s, 29.97 fps, 1000k tbr, 1000k tbn, 1000k tbc
But when I encode using the "native" framerate at realtime, I get more like ~17-21 fps.
$ ffmpeg -progress - -nostats -f x11grab -re -i :123 -f null /dev/null
…
frame=198
fps=17.80
stream_0_0_q=-0.0
bitrate=N/A
total_size=N/A
out_time_us=11111100
out_time_ms=11111100
out_time=00:00:11.111100
dup_frames=0
drop_frames=0
speed=0.999x
progress=end
It appears to me that the display does not even have a native frame rate, rather letting me sample as often as I want from it.
So, my question is: is that correct? If so, does it go up to "infinite" fps as long as the processing power is large enough?
Asked by slhck
(504 rep)
Nov 30, 2022, 02:19 PM
Last activity: Jan 27, 2023, 01:53 AM
Last activity: Jan 27, 2023, 01:53 AM