Compare commits
No commits in common. "gpu-encode" and "main" have entirely different histories.
gpu-encode
...
main
10 changed files with 21 additions and 72 deletions
|
|
@ -27,8 +27,6 @@ class Convert:
|
|||
self.active_tasks.add(obj)
|
||||
logging.info(f"Warteschlange started Auftrag - {obj.task}")
|
||||
obj.status = 3
|
||||
await self.obj_websocket.send_websocket(self.obj_path.active_path_to_dict())
|
||||
await self.obj_websocket.send_websocket(self.obj_path.queue_path_to_dict())
|
||||
|
||||
if len(self.active_tasks) >= self.yaml["task_max"]:
|
||||
break
|
||||
|
|
@ -45,6 +43,7 @@ class Convert:
|
|||
|
||||
async def convert_video(self, obj):
|
||||
"""Startet die Videokonvertierung asynchron."""
|
||||
|
||||
obj_process = Process(self.obj_websocket)
|
||||
obj_stat = Stat()
|
||||
|
||||
|
|
@ -53,6 +52,8 @@ class Convert:
|
|||
result = None
|
||||
|
||||
logging.info(f"Starte Konvertierung: {command}")
|
||||
await self.obj_websocket.send_websocket(self.obj_path.active_path_to_dict())
|
||||
await self.obj_websocket.send_websocket(self.obj_path.queue_path_to_dict())
|
||||
|
||||
try:
|
||||
# Starte den Subprozess asynchron
|
||||
|
|
@ -68,7 +69,7 @@ class Convert:
|
|||
await obj_process.read_out(obj)
|
||||
await obj.process.wait()
|
||||
|
||||
# Prozess beendet, Status auswerten
|
||||
# Prself.obj_websocket.send_websocket(self.obj_path.active_path_to_dict())ozess beendet, Status auswerten
|
||||
if obj.process.returncode == 0:
|
||||
obj.status = 0
|
||||
result = "Finished"
|
||||
|
|
@ -92,21 +93,16 @@ class Convert:
|
|||
|
||||
def convert_cmd(self, obj):
|
||||
command_convert = [
|
||||
"ffmpeg", "-y",
|
||||
"-init_hw_device", "vaapi=intel:/dev/dri/renderD128",
|
||||
"-hwaccel", "vaapi",
|
||||
"-hwaccel_device", "intel",
|
||||
"-i", obj.source_file,
|
||||
"ffmpeg", "-y", "-i", obj.source_file,
|
||||
# "-init_hw_device", "vaapi=va:/dev/dri/renderD128",
|
||||
"-map", "0:0",
|
||||
#"-c:v", "libsvtav1",
|
||||
"-c:v", "av1_vaapi",
|
||||
#"-preset", "5",
|
||||
#"-crf", "30",
|
||||
"-qp", "30",
|
||||
"-c:v", "libsvtav1",
|
||||
#"-c:v", "av1_qsv",
|
||||
"-preset", "5",
|
||||
"-crf", "30",
|
||||
"-g", "240",
|
||||
#"-pix_fmt", "yuv420p10le",
|
||||
"-vf", "format=nv12,hwupload",
|
||||
#"-svtav1-params", "tune=0:film-grain=8",
|
||||
"-pix_fmt", "yuv420p10le",
|
||||
"-svtav1-params", "tune=0:film-grain=8",
|
||||
]
|
||||
|
||||
if len(obj.streams_audio):
|
||||
|
|
|
|||
|
|
@ -64,9 +64,10 @@ class Server:
|
|||
|
||||
if data.get("data_path"):
|
||||
self.obj_path.receive_paths(data.get("data_path"))
|
||||
await self.start_convert()
|
||||
await self.send_websocket(self.obj_path.active_path_to_dict())
|
||||
await self.send_websocket(self.obj_path.queue_path_to_dict())
|
||||
await self.start_convert()
|
||||
|
||||
elif data.get("data_command"):
|
||||
if data["data_command"]["cmd"] == "delete":
|
||||
self.obj_path.delete_path(data["data_command"]["id"])
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ function sendCommand(command, id){
|
|||
function deleteVideoElement(packet) {
|
||||
for (let key in videoActive){
|
||||
if (!(key in packet.data_convert)){
|
||||
const elem = document.getElementById(`convert_${key}`);
|
||||
const elem = document.getElementById(key);
|
||||
if(elem){
|
||||
elem.remove();
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ function createVideoElement(packet){
|
|||
if(!videoActive[key]){
|
||||
const card = document.createElement('div');
|
||||
card.className = 'video-card';
|
||||
card.id = `convert_${key}`
|
||||
card.id = key
|
||||
|
||||
card.innerHTML = `
|
||||
<h3 title="${video.source_path}" align="center">${video.source_file_name} - ${video.target_file_name}</h3>
|
||||
|
|
@ -129,7 +129,7 @@ function createWaitingSnake(packet){
|
|||
|
||||
for (let key in videoQueue) {
|
||||
if (!(key in packet.data_queue) || (videoQueue[key] && videoQueue[key].status !== packet.data_queue[key]?.status)) {
|
||||
const elem = document.getElementById(`queue_${key}`);
|
||||
const elem = document.getElementById(key);
|
||||
if (elem) {
|
||||
elem.remove();
|
||||
delete videoQueue[key];
|
||||
|
|
@ -143,7 +143,7 @@ function createWaitingSnake(packet){
|
|||
if(!videoQueue[key]){
|
||||
const card = document.createElement('div');
|
||||
card.className = 'queue_wait-card';
|
||||
card.id = `queue_${key}`
|
||||
card.id = key
|
||||
|
||||
if(video.status === 1 || video.status === 2){
|
||||
status_img = `<img src="/client/icons/fehler-96.png" class="status_icons">`
|
||||
|
|
@ -172,7 +172,7 @@ function createWaitingSnake(packet){
|
|||
|
||||
function updateVideoElement(packet){
|
||||
let video = packet.data_flow;
|
||||
let container = document.getElementById(`convert_${video.id}`);
|
||||
let container = document.getElementById(video.id);
|
||||
|
||||
container.querySelector(".frames").textContent = video.frames ?? 0;
|
||||
container.querySelector(".size").textContent = video.size[0] || 0;
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Service
|
||||
ServiceTypes=KonqPopupMenu/Plugin
|
||||
MimeType=video/*;audio/*;
|
||||
Actions=FFProbeInfo;
|
||||
|
||||
[Desktop Action FFProbeInfo]
|
||||
Name=FFprobe Info anzeigen
|
||||
Icon=dialog-information
|
||||
Exec=ffprobe -v error -show_format -show_streams "%f" | kdialog --textbox - --title "FFprobe Ausgabe" --geometry 800x600
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
SERVER="ws://localhost:8000/"
|
||||
|
||||
for FILE in "$@"; do
|
||||
JSON=$(printf '{"data_path": "%s"}' "$FILE")
|
||||
echo "$JSON" | websocat "$SERVER"
|
||||
|
||||
done
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Service
|
||||
ServiceTypes=KonqPopupMenu/Plugin
|
||||
MimeType=video/*
|
||||
Actions=sendToWebSocket
|
||||
|
||||
[Desktop Action sendToWebSocket]
|
||||
Name=Konvertiere AV1 Server 110
|
||||
Exec=/home/data/.local/share/kio/servicemenus/server110.sh %F
|
||||
Icon=video-x-generic
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Service
|
||||
ServiceTypes=KonqPopupMenu/Plugin
|
||||
MimeType=video/*
|
||||
Actions=sendToWebSocket
|
||||
|
||||
[Desktop Action sendToWebSocket]
|
||||
Name=Konvertiere AV1 Server 111
|
||||
Exec=/home/data/.local/share/kio/servicemenus/server111.sh %F
|
||||
Icon=video-x-generic
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
SERVER="ws://192.168.155.111:8000/"
|
||||
|
||||
for FILE in "$@"; do
|
||||
JSON=$(printf '{"data_path": "%s"}' "$FILE")
|
||||
echo "$JSON" | websocat "$SERVER"
|
||||
|
||||
done
|
||||
|
|
@ -5,6 +5,6 @@ MimeType=video/*
|
|||
Actions=sendToWebSocket
|
||||
|
||||
[Desktop Action sendToWebSocket]
|
||||
Name=Konvertiere AV1 Lokal
|
||||
Exec=/home/data/.local/share/kio/servicemenus/local.sh %F
|
||||
Name=Video to New Server
|
||||
Exec=/home/data/.local/share/kio/servicemenus/send.path.sh %F
|
||||
Icon=video-x-generic
|
||||
Loading…
Reference in a new issue