Pass Xvfb directly to ffmpeg

For the developers that use FFmpeg in their software.
Post Reply
Posts: 1
Joined: Mon Jan 08, 2018 2:52 pm

Pass Xvfb directly to ffmpeg

Post by mario90yxz »

I'm trying to pass Xvfb buffor directly to ffmpeg inside Docker. This is approach give me really big performance benefits.

This is how I'm doing it:

Xvfb write the screen output:

Code: Select all

sudo Xvfb $DISPLAY -ac -screen 0 1680x900x24 -fbdir /tmp/screen/test.xwd > /dev/null 2>&1 &
ffmpeg read command:

Code: Select all

ffmpeg -hide_banner -loglevel debug -loop 1 ' \
    '-re -i /tmp/screen/test.xwd ' \
    '-f alsa -i default -strict -2 -ac 2 -preset ultrafast -f ' \
    '-c:av copy ' \
The problem is: ffmpeg missed many frames and the video should be 3 minutes long, but is half of expected time (video accelerates at some point).
On following video you can see the problem: ... NWdp7/view

I guess there is a problem with ffmpeg command and it requires some tweaks, but no idea how to configure it properly.


Post Reply