+33
-2
@@ -59,6 +59,7 @@ function App() {
|
|||||||
const [inputopts, setInputopts] = createSignal("");
|
const [inputopts, setInputopts] = createSignal("");
|
||||||
const [outputopts, setOutputopts] = createSignal("");
|
const [outputopts, setOutputopts] = createSignal("");
|
||||||
const [audioCodec, setAudioCodec] = createSignal("copy");
|
const [audioCodec, setAudioCodec] = createSignal("copy");
|
||||||
|
const [audioEncoder, setAudioEncoder] = createSignal("");
|
||||||
const logs: { [id: number]: string[] } = {};
|
const logs: { [id: number]: string[] } = {};
|
||||||
let supportedCodecs: CodecList = { vcodecs: [], acodecs: [] };
|
let supportedCodecs: CodecList = { vcodecs: [], acodecs: [] };
|
||||||
let ffmpegParams: FFmpegParams = {
|
let ffmpegParams: FFmpegParams = {
|
||||||
@@ -228,6 +229,19 @@ function App() {
|
|||||||
setSelectedEncoder(encoder);
|
setSelectedEncoder(encoder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getAudioEncoders() {
|
||||||
|
const codec = audioCodec();
|
||||||
|
const encoders = audioCodecList().find(
|
||||||
|
(v) => v.shortName === codec,
|
||||||
|
)?.encoders;
|
||||||
|
|
||||||
|
if (encoders) {
|
||||||
|
setAudioEncoder(encoders[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return encoders;
|
||||||
|
}
|
||||||
|
|
||||||
function onParametersChanged(key: string, value: any) {
|
function onParametersChanged(key: string, value: any) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
ffmpegParams[key] = value;
|
ffmpegParams[key] = value;
|
||||||
@@ -564,10 +578,10 @@ function App() {
|
|||||||
<h3 class="k-form-section-title">Audio</h3>
|
<h3 class="k-form-section-title">Audio</h3>
|
||||||
</div>
|
</div>
|
||||||
<form class="k-form">
|
<form class="k-form">
|
||||||
<label for="targetCodec">Codec</label>
|
<label for="audioCodec">Codec</label>
|
||||||
<select
|
<select
|
||||||
class="k-dropdown"
|
class="k-dropdown"
|
||||||
id="targetCodec"
|
id="audioCodec"
|
||||||
value={audioCodec()}
|
value={audioCodec()}
|
||||||
oninput={(e) => setAudioCodec(e.target.value)}
|
oninput={(e) => setAudioCodec(e.target.value)}
|
||||||
>
|
>
|
||||||
@@ -580,6 +594,23 @@ function App() {
|
|||||||
)}
|
)}
|
||||||
</For>
|
</For>
|
||||||
</select>
|
</select>
|
||||||
|
<Show when={getAudioEncoders()}>
|
||||||
|
<label for="audioEncoder">Encoder</label>
|
||||||
|
<select
|
||||||
|
class="k-dropdown"
|
||||||
|
id="audioEncoder"
|
||||||
|
value={audioEncoder()}
|
||||||
|
oninput={(e) =>
|
||||||
|
setAudioEncoder(e.target.value)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<For each={getAudioEncoders()}>
|
||||||
|
{(item, _) => (
|
||||||
|
<option value={item}>{item}</option>
|
||||||
|
)}
|
||||||
|
</For>
|
||||||
|
</select>
|
||||||
|
</Show>
|
||||||
</form>
|
</form>
|
||||||
<div class="row flex-col align-items-center">
|
<div class="row flex-col align-items-center">
|
||||||
<h3 class="k-form-section-title">
|
<h3 class="k-form-section-title">
|
||||||
|
|||||||
Reference in New Issue
Block a user