mirror of
https://github.com/linuxserver/docker-ffmpeg.git
synced 2026-02-20 04:56:23 +08:00
stashing work to get logs working
This commit is contained in:
parent
de371a8cf4
commit
8da1faf0c0
18
commands.yml
Normal file
18
commands.yml
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
|
||||
- category: "H.264 Downsampling"
|
||||
- name: "720p 4mpbs"
|
||||
description: "This can be used as a catch all for most H.264 720p encodes, if you want a higher bitrate then modify the 4000k to your suit your needs"
|
||||
command: |
|
||||
ffmpeg -i "${INPUTFILE}" \
|
||||
-vf scale=-1:720 \
|
||||
-c:v h264 \
|
||||
-c:a copy \
|
||||
-b:v 4000k \
|
||||
"${OUTPUTFILE}"
|
||||
- category: "H.265 Downsampling"
|
||||
- category: "H.264 Downsampling Vaapi"
|
||||
- category: "H.265 Downsampling Vaapi"
|
||||
- category: "H.264 Downsampling Nvidia"
|
||||
- category: "H.265 Downsampling Nvidia"
|
||||
- category: "Audio Processing"
|
||||
23
config.yml
Normal file
23
config.yml
Normal file
@ -0,0 +1,23 @@
|
||||
---
|
||||
|
||||
interval: 60
|
||||
|
||||
commands:
|
||||
- name: "test1"
|
||||
extension: ".mkv"
|
||||
command: |
|
||||
ffmpeg -i "${INPUTFILE}" \
|
||||
-vf scale=-1:720 \
|
||||
-c:v h264 \
|
||||
-c:a copy \
|
||||
-b:v 4000k \
|
||||
"${OUTPUTFILE}"
|
||||
- name: "test2"
|
||||
extension: ".mkv"
|
||||
command: |
|
||||
ffmpeg -i "${INPUTFILE}" \
|
||||
-vf scale=-1:720 \
|
||||
-c:v h264 \
|
||||
-c:a copy \
|
||||
-b:v 4000k \
|
||||
"${OUTPUTFILE}"
|
||||
@ -9,24 +9,25 @@ $(document).ready(function(){rendermain()})
|
||||
|
||||
//// Main Page rendering ////
|
||||
function rendermain(){
|
||||
$('#pagecontent').empty();
|
||||
$('#pagecontent').append('<center><div class="spinner-border" style="width: 6rem; height: 6rem;"></div></center>');
|
||||
socket.emit('getmain');
|
||||
}
|
||||
socket.on('sendmain', function(rules){
|
||||
$('#pagecontent').empty();
|
||||
var editor = [];
|
||||
$(JSON.parse(rules)).each(function(i,data){
|
||||
$(rules.commands).each(function(i,data){
|
||||
var name = data.name;
|
||||
var extension = data.extension;
|
||||
var command = data.command;
|
||||
$('#pagecontent').append('\
|
||||
<div class="card">\
|
||||
<div class="card-header">\
|
||||
Process Rule ' + name + '\
|
||||
</div>\
|
||||
<div class="card" id="' + name + '">\
|
||||
<div class="card-body">\
|
||||
<form>\
|
||||
<div class="form-row align-items-center">\
|
||||
<div class="col-auto">\
|
||||
<input type="text" class="form-control" value="' + name + '" placeholder="File Extension">\
|
||||
</div>\
|
||||
<div class="col-auto">\
|
||||
<input type="text" class="form-control" value="' + extension + '" placeholder="File Extension">\
|
||||
</div>\
|
||||
@ -38,11 +39,8 @@ socket.on('sendmain', function(rules){
|
||||
</label>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="col-auto">\
|
||||
<button class="btn btn-primary mb-2">Save</button>\
|
||||
</div>\
|
||||
<div class="col float-right">\
|
||||
<button class="btn btn-success mb-2 float-right">Run Now</button>\
|
||||
<button class="btn btn-success mb-2 float-right">Run Single</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
</form>\
|
||||
@ -59,12 +57,25 @@ socket.on('sendmain', function(rules){
|
||||
editor[i].setOptions({
|
||||
readOnly: false,
|
||||
});
|
||||
editor[i].setValue(data.command, -1);
|
||||
editor[i].setValue(command, -1);
|
||||
});
|
||||
}).promise().done(function(){
|
||||
$('#pagecontent').append('<center><button type="button" class="btn btn-secondary btn-lg">+</button></center>');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
//// Command Page rendering ////
|
||||
function rendercommands(){
|
||||
$('#pagecontent').empty();
|
||||
$('#pagecontent').append('<center><div class="spinner-border" style="width: 6rem; height: 6rem;"></div></center>');
|
||||
socket.emit('getcommands');
|
||||
}
|
||||
socket.on('sendcommands', function(categories){
|
||||
console.log(categories);
|
||||
$('#pagecontent').empty();
|
||||
var editor = [];
|
||||
$('#pagecontent').append('<div id="cats"></div>')
|
||||
$(categories).each(function(i,data){
|
||||
var cat = data.category;
|
||||
});
|
||||
});
|
||||
|
||||
@ -41,6 +41,15 @@
|
||||
<div class="nav-link" style="cursor:pointer;" onclick="rendercommands()" >Example Commands</div>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="form-inline my-2 my-md-0" onsubmit="return false;">
|
||||
<select class="custom-select form-control mr-sm-2" id="interval">
|
||||
<option selected>Never</option>
|
||||
<option value="30">30 seconds</option>
|
||||
<option value="60">60 seconds</option>
|
||||
<option value="300">5 minutes</option>
|
||||
</select>
|
||||
<button style="cursor:pointer;" onclick="saveall()" class="btn btn-primary my-2 my-sm-0" type="submit">Save Config</button>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
<br>
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
aiohttp
|
||||
python-socketio
|
||||
pyyaml
|
||||
@ -4,4 +4,4 @@
|
||||
cd /app/ffmpeg-web
|
||||
exec \
|
||||
s6-setuidgid abc nodemon \
|
||||
--exec python3 server.py > /applogs/app.log
|
||||
--exec python3 server.py > /applogs/app.log 2>&1
|
||||
|
||||
23
server.py
23
server.py
@ -1,6 +1,7 @@
|
||||
from aiohttp import web
|
||||
import socketio
|
||||
import json
|
||||
import yaml
|
||||
import os
|
||||
|
||||
sio = socketio.AsyncServer()
|
||||
app = web.Application()
|
||||
@ -13,11 +14,25 @@ async def index(request):
|
||||
app.router.add_get('/', index)
|
||||
app.router.add_static('/public/', path=str('./public/'))
|
||||
|
||||
json = '[{"name":"test1","extension":".mkv","command":"ffmpeg -y -vaapi_device /dev/dri/renderD1339"},{"name":"test2","extension":".mkv","command":"ffmpeg -y -vaapi_device /dev/dri/renderD129"}]'
|
||||
|
||||
# Send the current config to the user to render
|
||||
@sio.on('getmain')
|
||||
async def message(sid):
|
||||
await sio.emit('sendmain', json, room=sid)
|
||||
with open("./config.yml", 'r') as stream:
|
||||
try:
|
||||
config = yaml.safe_load(stream)
|
||||
await sio.emit('sendmain', config, room=sid)
|
||||
except yaml.YAMLError as e:
|
||||
print(e)
|
||||
|
||||
# Send the current command examples from github to the user to render
|
||||
@sio.on('getcommands')
|
||||
async def message(sid):
|
||||
with open("./commands.yml", 'r') as stream:
|
||||
try:
|
||||
commands = yaml.safe_load(stream)
|
||||
await sio.emit('sendcommands', commands, room=sid)
|
||||
except yaml.YAMLError as e:
|
||||
print(e)
|
||||
|
||||
if __name__ == '__main__':
|
||||
web.run_app(app, port=8787)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user