我正试图用xdotools记录一个自动化的过程。它看起来工作正常,但我看到的都是红色的矩形。矩形看起来像他们是正确的大小位置的窗口,我希望xdotools导航通过,但我没有得到一个真正的图片。
以下是我对xvfb和ffmpeg的调用。
export DISPLAY=:99.0
Xvfb $DISPLAY -screen 0 1920x1080x16 &
ffmpeg -y -f x11grab -video_size 1920x1080 -i $DISPLAY intellij.mpg &
这是ffmpeg制作的screen.webm的媒体信息。
General
Complete name : C:\vm-shared-folders\screen.webm
Format : WebM
Format version : Version 2
File size : 208 KiB
Writing application : Lavf58.20.100
Writing library : Lavf58.20.100
IsTruncated : Yes
Video
ID : 1
Format : VP8
Codec ID : V_VP8
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 30.000 FPS
Compression mode : Lossy
Writing library : Lavc58.35.100 libvpx
Default : Yes
Forced : No
这两个命令给了我很好的输出。我不知道为什么它们比我上面输入的命令更有效。我只是不断地修修补补,直到它工作。
Xvfb $DISPLAY -screen 0 1920x1080x24 &
ffmpeg -y -probesize 200M -f x11grab -video_size 1920x1080 -i "$DISPLAY" out.webm &