mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
some fixes for ustreamer
This commit is contained in:
parent
8fd196bde8
commit
054f8e44db
@ -44,7 +44,7 @@ kvmd:
|
|||||||
- "--tv-standard=pal"
|
- "--tv-standard=pal"
|
||||||
- "--format=yuyv"
|
- "--format=yuyv"
|
||||||
- "--encoder=cpu"
|
- "--encoder=cpu"
|
||||||
- "--jpeg-quality={quality}"
|
- "--quality={quality}"
|
||||||
- "--width=720"
|
- "--width=720"
|
||||||
- "--height=576"
|
- "--height=576"
|
||||||
- "--fake-width=800"
|
- "--fake-width=800"
|
||||||
|
|||||||
@ -36,14 +36,14 @@ kvmd:
|
|||||||
init_restart_after: 0.0
|
init_restart_after: 0.0
|
||||||
shutdown_delay: 10.0
|
shutdown_delay: 10.0
|
||||||
|
|
||||||
quality: 80
|
quality: 20
|
||||||
|
|
||||||
cmd:
|
cmd:
|
||||||
- "/usr/bin/ustreamer"
|
- "/usr/bin/ustreamer"
|
||||||
- "--device=/dev/kvmd-streamer"
|
- "--device=/dev/kvmd-streamer"
|
||||||
- "--format=uyvy"
|
- "--format=uyvy"
|
||||||
- "--encoder=omx"
|
- "--encoder=omx"
|
||||||
- "--jpeg-quality={quality}"
|
- "--quality={quality}"
|
||||||
- "--dv-timings"
|
- "--dv-timings"
|
||||||
- "--host=localhost"
|
- "--host=localhost"
|
||||||
- "--port=8082"
|
- "--port=8082"
|
||||||
|
|||||||
@ -9,6 +9,7 @@ error_log /dev/null crit;
|
|||||||
events {
|
events {
|
||||||
worker_connections 1024;
|
worker_connections 1024;
|
||||||
use epoll;
|
use epoll;
|
||||||
|
multi_accept on;
|
||||||
}
|
}
|
||||||
|
|
||||||
http {
|
http {
|
||||||
@ -19,6 +20,8 @@ http {
|
|||||||
charset utf-8;
|
charset utf-8;
|
||||||
|
|
||||||
sendfile on;
|
sendfile on;
|
||||||
|
tcp_nodelay on;
|
||||||
|
tcp_nopush on;
|
||||||
keepalive_timeout 10;
|
keepalive_timeout 10;
|
||||||
|
|
||||||
client_body_temp_path /tmp/nginx.client_body_temp;
|
client_body_temp_path /tmp/nginx.client_body_temp;
|
||||||
@ -116,6 +119,7 @@ http {
|
|||||||
rewrite /streamer/?(.*) /$1 break;
|
rewrite /streamer/?(.*) /$1 break;
|
||||||
proxy_pass http://ustreamer;
|
proxy_pass http://ustreamer;
|
||||||
include /etc/nginx/proxy-params.conf;
|
include /etc/nginx/proxy-params.conf;
|
||||||
|
postpone_output 0;
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
proxy_ignore_headers X-Accel-Buffering;
|
proxy_ignore_headers X-Accel-Buffering;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,14 +27,19 @@ RUN useradd -r -d / packer \
|
|||||||
&& cd - \
|
&& cd - \
|
||||||
&& rm -rf /tmp/packer-color
|
&& rm -rf /tmp/packer-color
|
||||||
|
|
||||||
|
COPY testenv/customizepkg.nginx /etc/customizepkg.d/nginx-mainline-mod-ndk
|
||||||
|
COPY testenv/customizepkg.nginx /etc/customizepkg.d/nginx-mainline-mod-lua
|
||||||
|
|
||||||
RUN pacman -Syy \
|
RUN pacman -Syy \
|
||||||
|
&& user-packer -S --noconfirm \
|
||||||
|
customizepkg \
|
||||||
&& user-packer -S --noconfirm \
|
&& user-packer -S --noconfirm \
|
||||||
python \
|
python \
|
||||||
python-pip \
|
python-pip \
|
||||||
nginx-mainline \
|
nginx-mainline \
|
||||||
nginx-mainline-mod-lua \
|
|
||||||
ustreamer \
|
ustreamer \
|
||||||
socat \
|
socat \
|
||||||
|
&& env MAKEPKGOPTS="--skipchecksums --skippgpcheck" user-packer -S --noconfirm nginx-mainline-mod-lua \
|
||||||
&& pacman -Sc --noconfirm
|
&& pacman -Sc --noconfirm
|
||||||
|
|
||||||
COPY testenv/requirements.txt requirements.txt
|
COPY testenv/requirements.txt requirements.txt
|
||||||
|
|||||||
1
testenv/customizepkg.nginx
Normal file
1
testenv/customizepkg.nginx
Normal file
@ -0,0 +1 @@
|
|||||||
|
replace#global#_nginxver=.*#_nginxver=`pacman -Q nginx-mainline | grep -Po "\\d+\\.\\d+\\.\\d+"`
|
||||||
@ -41,7 +41,7 @@ kvmd:
|
|||||||
cmd:
|
cmd:
|
||||||
- "/usr/bin/ustreamer"
|
- "/usr/bin/ustreamer"
|
||||||
- "--device=/dev/kvmd-streamer"
|
- "--device=/dev/kvmd-streamer"
|
||||||
- "--jpeg-quality={quality}"
|
- "--quality={quality}"
|
||||||
- "--width=800"
|
- "--width=800"
|
||||||
- "--height=600"
|
- "--height=600"
|
||||||
- "--host=0.0.0.0"
|
- "--host=0.0.0.0"
|
||||||
|
|||||||
@ -76,9 +76,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div data-dont-hide-menu class="ctl-dropdown-content-text">
|
<div data-dont-hide-menu class="ctl-dropdown-content-text">
|
||||||
Quality:
|
Quality:
|
||||||
<select disabled id="stream-quality-select">
|
<select disabled id="stream-quality-select"></select>
|
||||||
<option>80%</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div data-dont-hide-menu class="ctl-dropdown-content-text">
|
<div data-dont-hide-menu class="ctl-dropdown-content-text">
|
||||||
|
|||||||
@ -5,7 +5,7 @@ function Stream() {
|
|||||||
|
|
||||||
var __prev_state = false;
|
var __prev_state = false;
|
||||||
|
|
||||||
var __quality = 80;
|
var __quality = 10;
|
||||||
|
|
||||||
var __normal_size = {width: 640, height: 480};
|
var __normal_size = {width: 640, height: 480};
|
||||||
var __size_factor = 1;
|
var __size_factor = 1;
|
||||||
@ -14,6 +14,7 @@ function Stream() {
|
|||||||
$("stream-led").title = "Stream inactive";
|
$("stream-led").title = "Stream inactive";
|
||||||
|
|
||||||
var quality = 10;
|
var quality = 10;
|
||||||
|
$("stream-quality-select").innerHTML = "";
|
||||||
for (; quality <= 100; quality += 10) {
|
for (; quality <= 100; quality += 10) {
|
||||||
$("stream-quality-select").innerHTML += "<option value=\"" + quality + "\">" + quality + "%</option>";
|
$("stream-quality-select").innerHTML += "<option value=\"" + quality + "\">" + quality + "%</option>";
|
||||||
}
|
}
|
||||||
@ -34,7 +35,7 @@ function Stream() {
|
|||||||
var http = tools.makeRequest("GET", "/streamer/ping", function() {
|
var http = tools.makeRequest("GET", "/streamer/ping", function() {
|
||||||
if (http.readyState === 4) {
|
if (http.readyState === 4) {
|
||||||
var response = (http.status === 200 ? JSON.parse(http.responseText) : null);
|
var response = (http.status === 200 ? JSON.parse(http.responseText) : null);
|
||||||
if (http.status !== 200 || !response.stream.online) {
|
if (http.status !== 200) {
|
||||||
tools.info("Refreshing stream ...");
|
tools.info("Refreshing stream ...");
|
||||||
__prev_state = false;
|
__prev_state = false;
|
||||||
$("stream-image").className = "stream-image-inactive";
|
$("stream-image").className = "stream-image-inactive";
|
||||||
@ -43,20 +44,27 @@ function Stream() {
|
|||||||
$("stream-led").title = "Stream inactive";
|
$("stream-led").title = "Stream inactive";
|
||||||
$("stream-reset-button").disabled = true;
|
$("stream-reset-button").disabled = true;
|
||||||
$("stream-quality-select").disabled = true;
|
$("stream-quality-select").disabled = true;
|
||||||
} else if (http.status === 200 && !__prev_state) {
|
} else if (http.status === 200) {
|
||||||
__normal_size = response.stream.resolution;
|
if (__prev_state) {
|
||||||
__refreshImage();
|
if (__normal_size != response.stream.resolution) {
|
||||||
__prev_state = true;
|
__normal_size = response.stream.resolution;
|
||||||
$("stream-image").className = "stream-image-active";
|
__applySizeFactor();
|
||||||
$("stream-box").classList.remove("stream-box-inactive");
|
}
|
||||||
$("stream-led").className = "led-on";
|
} else {
|
||||||
$("stream-led").title = "Stream is active";
|
__normal_size = response.stream.resolution;
|
||||||
$("stream-reset-button").disabled = false;
|
__refreshImage();
|
||||||
$("stream-quality-select").disabled = false;
|
__prev_state = true;
|
||||||
|
$("stream-image").className = "stream-image-active";
|
||||||
|
$("stream-box").classList.remove("stream-box-inactive");
|
||||||
|
$("stream-led").className = "led-on";
|
||||||
|
$("stream-led").title = "Stream is active";
|
||||||
|
$("stream-reset-button").disabled = false;
|
||||||
|
$("stream-quality-select").disabled = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setTimeout(__startPoller, 1500);
|
setTimeout(__startPoller, 1000);
|
||||||
};
|
};
|
||||||
|
|
||||||
var __clickResetButton = function() {
|
var __clickResetButton = function() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user