feat: expand GPU transcoding settings (extension, framerate, rc mode, audio)
This commit is contained in:
parent
629022ab5f
commit
066b9b17d3
1 changed files with 16 additions and 7 deletions
|
|
@ -201,14 +201,20 @@ router.get('/transcoding', async (req, res, next) => {
|
||||||
try {
|
try {
|
||||||
const result = await pool.query(
|
const result = await pool.query(
|
||||||
`SELECT key, value FROM settings
|
`SELECT key, value FROM settings
|
||||||
WHERE key IN ('gpu_transcode_enabled','gpu_codec','gpu_preset','gpu_bitrate_mbps','gpu_node')`
|
WHERE key IN ('gpu_transcode_enabled','gpu_codec','gpu_preset','gpu_bitrate_mbps','gpu_node',
|
||||||
|
'gpu_extension','gpu_framerate','gpu_rc_mode','gpu_audio_codec','gpu_audio_bitrate_kbps')`
|
||||||
);
|
);
|
||||||
const out = {
|
const out = {
|
||||||
gpu_transcode_enabled: 'false',
|
gpu_transcode_enabled: 'false',
|
||||||
gpu_codec: 'h264_nvenc',
|
gpu_codec: 'h264_nvenc',
|
||||||
gpu_preset: 'p4',
|
gpu_preset: 'p4',
|
||||||
gpu_bitrate_mbps: '8',
|
gpu_bitrate_mbps: '8',
|
||||||
gpu_node: '',
|
gpu_node: '',
|
||||||
|
gpu_extension: 'mp4',
|
||||||
|
gpu_framerate: 'passthrough',
|
||||||
|
gpu_rc_mode: 'cbr',
|
||||||
|
gpu_audio_codec: 'aac',
|
||||||
|
gpu_audio_bitrate_kbps: '192',
|
||||||
};
|
};
|
||||||
for (const { key, value } of result.rows) out[key] = value;
|
for (const { key, value } of result.rows) out[key] = value;
|
||||||
res.json(out);
|
res.json(out);
|
||||||
|
|
@ -219,7 +225,10 @@ router.get('/transcoding', async (req, res, next) => {
|
||||||
|
|
||||||
router.put('/transcoding', async (req, res, next) => {
|
router.put('/transcoding', async (req, res, next) => {
|
||||||
try {
|
try {
|
||||||
const allowed = ['gpu_transcode_enabled', 'gpu_codec', 'gpu_preset', 'gpu_bitrate_mbps', 'gpu_node'];
|
const allowed = [
|
||||||
|
'gpu_transcode_enabled', 'gpu_codec', 'gpu_preset', 'gpu_bitrate_mbps', 'gpu_node',
|
||||||
|
'gpu_extension', 'gpu_framerate', 'gpu_rc_mode', 'gpu_audio_codec', 'gpu_audio_bitrate_kbps',
|
||||||
|
];
|
||||||
for (const key of allowed) {
|
for (const key of allowed) {
|
||||||
if (req.body[key] !== undefined) {
|
if (req.body[key] !== undefined) {
|
||||||
await pool.query(
|
await pool.query(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue