我正在尝试录制我的ubuntu 14.04机器......这就是我所做的...... echo"安装Window Manager& VNC ..." apt-get install -qq -y xvfb>> install.log的 apt-get install -qq -y x11vnc>> install.log的 apt-get install -qq -y fluxbox>> install.log的 chmod + x x11vnc&& mv x11vnc / usr / bin / #安装avconv + libx264编解码器将flv转换为可在Web浏览器上播放的mp4 echo"安装VNC屏幕录制实用程序" easy_install vnc2flv 2>& 1>> install.log的 apt-get install -qq -y c>> install.log的 apt-get install -qq -y libavcodec-extra-53>> install.log的 [[$? -ne 0]]&& apt-get install -qq -y libavcodec-extra-54>> install.log#ubuntu 14
NUM_EXECUTORS="1"
SCREEN_RES="1440x1080x16"
xvfb_vncstart() {
# dropping the vnc password into a text file for the vnc recording tool
local PASSWORD_FILE=/tmp/vnc-password.txt
if [ -f $PASSWORD_FILE ]; then
rm $PASSWORD_FILE
fi
echo "$VNC_PASSWORD" > $PASSWORD_FILE
export VNC_PASSWORD
echo "Starting $NUM_EXECUTORS X servers..."
export NUM_EXECUTORS
for i in $(seq 1 $NUM_EXECUTORS); do
echo "Launching X server $i..."
# Start the X frame buffer implementation
sudo -i -u ubuntu Xvfb :$i +extension GLX -screen 0 $SCREEN_RES -ac &> xvfb-$i.log &
# Sleep a little to give programs a chance to start
sleep 2
# Start the fluxbox window manager.
# We need a light window manager that allows maximizing windows
sudo -i -u ubuntu DISPLAY=:$i fluxbox &> fluxbox-$i.log &
# Sleep a little to give programs a chance to start
sleep 2
# Share the xsession over VNC
sudo -i -u ubuntu x11vnc -forever -display :$i -N -passwdfile /tmp/vnc-password.txt &> vnc-$i.log &
# Sleep a little to give programs a chance to start
sleep 2
done
}
But video recording doesn't work even when I try to run startx.
X.Org X Server 1.15.1
Release Date: 2014-04-13
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-76-generic x86_64 Ubuntu
Current Operating System: Linux ip-10-0-0-79 3.13.0-123-generic #172-Ubuntu SMP Mon Jun 26 18:04:35 UTC 2017 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.13.0-123-generic root=UUID=d4f2aafc-946a-4514-930d-4c45e676f198 ro nomodeset console=tty1 console=ttyS0 nomdmonddf nomdmonisw
Build Date: 12 February 2015 02:49:29PM
xorg-server 2:1.15.1-0ubuntu2.7 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.30.2
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.2.log", Time: Fri Jul 14 06:47:49 2017
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension SECURITY
Initializing built-in extension XINERAMA
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension Present
Initializing built-in extension DRI3
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension SELinux
Initializing built-in extension XFree86-VidModeExtension
Initializing built-in extension XFree86-DGA
Initializing built-in extension XFree86-DRI
Initializing built-in extension DRI2
Loading extension GLX
error setting MTRR (base = 0xf0000000, size = 0x00100000, type = 1) Invalid argument (22)
I have googled up and I was not able to find a concrete answer to why video was not working.. Any help or hints would help me a world of good.. Thanks in Advance for your reply!!!!!!
答案 0 :(得分:0)
现在问题解决了。录制是在java进程中完成的。
pb = new ProcessBuilder(screenRecorderProcessLocation,
“-一个”,
“-s”,System.getenv(“SCREEN_RES”),
“-f”,“x11grab”,
“-i”,“localhost:”+显示,
“-vcodec”,“libx264”,
“-r”,“24”,
screenVideoFile.getAbsolutePath());
在环境变量中找不到SCREEN_RES值导致avconv停止录制..使用分辨率录制视频录制后的硬编码...检查的最佳方法是手动运行录制片段进行检查如果它的工作与否..然后实施..我20天后很幸运,不知道出了什么问题!大家欢呼!快乐学习!!!