From 766018fd588c40032c0c2fe7bdeabec99d7070cc Mon Sep 17 00:00:00 2001 From: Jan Stabenow Date: Thu, 26 Sep 2024 12:39:17 +0200 Subject: [PATCH] Mod cleanup select values --- src/misc/controls/Preview.js | 41 +++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/misc/controls/Preview.js b/src/misc/controls/Preview.js index 20496f2..80e1654 100644 --- a/src/misc/controls/Preview.js +++ b/src/misc/controls/Preview.js @@ -8,6 +8,15 @@ import Typography from '@mui/material/Typography'; import Checkbox from '../Checkbox'; import Select from '../Select'; +const encoderOptions = { + 'libx264': 'H.264 (libx264)', + 'h264_nvenc': 'H.264 (NVENC)', + 'h264_omx': 'H.264 (OpenMAX IL)', + 'h264_v4l2m2m': 'H.264 (V4L2 Memory to Memory)', + 'h264_vaapi': 'H.264 (Intel VAAPI)', + 'h264_videotoolbox': 'H.264 (VideoToolbox)', +}; + function init(settings) { const initSettings = { enable: true, @@ -46,25 +55,19 @@ export default function Control({ settings = {}, encoders = [], onChange = funct Enable browser-compatible H.264 stream} checked={settings.enable} onChange={handleChange('enable')} /> - Video Codec} + value={settings.video_encoder} + disabled={!settings.enable} + onChange={handleChange('video_encoder')} + > + {Object.entries(encoderOptions).map(([value, label]) => ( + encoders.includes(value) && ( + + {label} + + ) + ))} The H.264 encoder used.