替换为mjpeg格式

This commit is contained in:
mofeng 2023-12-16 17:08:27 +08:00
parent ac8d3c9c45
commit 7809ded32e
2 changed files with 9 additions and 13 deletions

View File

@ -39,8 +39,7 @@ kvmd:
- "/usr/bin/ustreamer" - "/usr/bin/ustreamer"
- "--device=/dev/kvmd-video" - "--device=/dev/kvmd-video"
- "--persistent" - "--persistent"
- "--format=yuyv" - "--format=mjpeg"
- "--encoder=cpu"
- "--resolution={resolution}" - "--resolution={resolution}"
- "--desired-fps={desired_fps}" - "--desired-fps={desired_fps}"
- "--drop-same-frames=30" - "--drop-same-frames=30"
@ -52,11 +51,9 @@ kvmd:
- "--process-name-prefix={process_name_prefix}" - "--process-name-prefix={process_name_prefix}"
- "--notify-parent" - "--notify-parent"
- "--no-log-colors" - "--no-log-colors"
- "--sink=kvmd::ustreamer::yuyv"
- "--sink-mode=0660"
vnc: vnc:
memsink: memsink:
jpeg: jpeg:
sink: "kvmd::ustreamer::yuyv" sink: "kvmd::ustreamer::jpeg"

View File

@ -10,13 +10,13 @@ FIND_STR="short_press_gpio420"
#检查架构和Python版本 #检查架构和Python版本
check-environment(){ check-environment(){
echo -e "\e[0;32m设备名称$MACHINE\nPython版本$PYVER\e[0;37m" echo -e "\e[0;32m设备名称$MACHINE\nPython版本$PYVER"
if [ARCH!="armv7l"];then if [ ! $ARCH = "armv7l" ]; then
echo -e "\e[0;31m暂不支持$MACHINE架构以外的设备\n退出脚本\e[0;37m" echo -e "\e[0;31m暂不支持$MACHINE架构以外的设备\n退出脚本"
exit exit
fi fi
if [[ "$PYVER" != *"3.10"* && $(which python3.10) != *"python"* ]]; then if [[ "$PYVER" != *"3.10"* && $(which python3.10) != *"python"* ]]; then
echo -e "\e[0;31m您似乎没有安装 Python 3.10\n退出脚本\e[0;37m" echo -e "您似乎没有安装 Python 3.10\n退出脚本\e[0;37m"
exit exit
else else
update-alternative update-alternative
@ -42,7 +42,7 @@ update-alternative(){
#删除SSL证书 #删除SSL证书
delete-ssl(){ delete-ssl(){
if [ -f "/etc/kvmd/nginx/ssl/server.crt" ] || [ -f "/etc/kvmd/nginx/ssl/server.key" ]; then if [ -f "/etc/kvmd/nginx/ssl/server.crt" ] || [ -f "/etc/kvmd/nginx/ssl/server.key" ]; then
echo -e "\e[0;30m正在删除SSL证书\e[0;37m" echo -e "正在删除SSL证书\e[0;37m"
rm /etc/kvmd/nginx/ssl/server.crt rm /etc/kvmd/nginx/ssl/server.crt
rm /etc/kvmd/nginx/ssl/server.key rm /etc/kvmd/nginx/ssl/server.key
fi fi
@ -56,7 +56,7 @@ change-device-tree(){
#覆盖引导分区 #覆盖引导分区
override-uboot(){ override-uboot(){
echo -e "\e[0;31m是否选择跳过按下重置键时的玩客云USB线刷检测\e[1;31mY/\e[1;32mN\e[0;31m\e[0;37m" echo -e "\e[0;31m是否选择跳过按下重置键时的玩客云USB线刷检测\e[1;31mY/\e[1;32mN\e[0;31m"
read USERYN read USERYN
case $USERYN in case $USERYN in
N | n) N | n)
@ -72,7 +72,7 @@ override-uboot(){
#安装依赖软件 #安装依赖软件
install-dependencies(){ install-dependencies(){
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh) --source mirrors.tuna.tsinghua.edu.cn --updata-software false --web-protocol http && echo "换源成功!" bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh) --source mirrors.tuna.tsinghua.edu.cn --updata-software false --web-protocol http && echo "换源成功!"
echo "正在安装依赖软件nginx tesseract-ocr tesseract-ocr-eng janus libevent-dev libgpiod-dev tesseract-ocr-chi-sim......" echo "\e[0;32m正在安装依赖软件nginx tesseract-ocr tesseract-ocr-eng janus libevent-dev libgpiod-dev tesseract-ocr-chi-sim......"
apt install -y nginx tesseract-ocr tesseract-ocr-eng janus libevent-dev libgpiod-dev tesseract-ocr-chi-sim >> ./log.txt apt install -y nginx tesseract-ocr tesseract-ocr-eng janus libevent-dev libgpiod-dev tesseract-ocr-chi-sim >> ./log.txt
} }
@ -87,7 +87,6 @@ install-pikvm(){
cp -f ./patch/long_press_gpio420 /usr/bin && cp -f ./patch/short_press_gpio420 /usr/bin cp -f ./patch/long_press_gpio420 /usr/bin && cp -f ./patch/short_press_gpio420 /usr/bin
chmod +x /usr/bin/long_press_gpio420 && chmod +x /usr/bin/short_press_gpio420 chmod +x /usr/bin/long_press_gpio420 && chmod +x /usr/bin/short_press_gpio420
echo "GPIO-420脚本移动成功" echo "GPIO-420脚本移动成功"
#此处还要屏蔽hw.py温度获取报错
cp -f ./patch/hw.py /usr/local/lib/python3.10/kvmd-packages/kvmd/apps/kvmd/info/ cp -f ./patch/hw.py /usr/local/lib/python3.10/kvmd-packages/kvmd/apps/kvmd/info/
chmod +x /usr/local/lib/python3.10/kvmd-packages/kvmd/apps/kvmd/info/hw.py chmod +x /usr/local/lib/python3.10/kvmd-packages/kvmd/apps/kvmd/info/hw.py
cp -f ./config/main.yaml /etc/kvmd/ && cp -f ./config/override.yaml /etc/kvmd/ cp -f ./config/main.yaml /etc/kvmd/ && cp -f ./config/override.yaml /etc/kvmd/