@@ -59,19 +59,16 @@ encoders supported by your FFmpeg install will show up.
|
||||
- [x] libx264rgb (Untested, but _should_ work)
|
||||
- [ ] h264_amf
|
||||
- [ ] h264_nvenc
|
||||
- [ ] h264_qsv
|
||||
- [x] h264_qsv
|
||||
- [ ] h264_vaapi
|
||||
- [ ] h264_vulkan
|
||||
- [ ] H.265
|
||||
- [x] libx265
|
||||
- [ ] h264_amf
|
||||
- [ ] h264_nvenc
|
||||
- [ ] h264_qsv
|
||||
- [ ] h264_vaapi
|
||||
- [ ] h264_vulkan
|
||||
- [ ] VP8
|
||||
- [ ] libvpx
|
||||
- [ ] vp8_vaapi
|
||||
- [ ] h265_amf
|
||||
- [ ] h265_nvenc
|
||||
- [x] h265_qsv
|
||||
- [ ] h265_vaapi
|
||||
- [ ] h265_vulkan
|
||||
- [ ] VP9
|
||||
- [ ] libvpx-vp9
|
||||
- [ ] vp9_vaapi
|
||||
|
||||
+22
-14
@@ -31,7 +31,7 @@ import BreezeIcon from "./components/BreezeIcon";
|
||||
import AV1Options from "./components/AV1Options";
|
||||
import DNxHDOptions from "./components/DNxHDOptions";
|
||||
|
||||
const commonCodecs = new Set(["h264", "hevc", "vp8", "vp9", "av1", "dnxhd"]);
|
||||
const commonCodecs = new Set(["h264", "hevc", "vp9", "av1", "dnxhd"]);
|
||||
|
||||
interface RunningProcessInfo {
|
||||
process: Neutralino.SpawnedProcess;
|
||||
@@ -212,27 +212,25 @@ function App() {
|
||||
(v) => v.shortName === newValue,
|
||||
);
|
||||
|
||||
if (newValue !== "h264" && newValue !== "hevc") {
|
||||
ffmpegParams.twopass = false;
|
||||
let encoder = newValue;
|
||||
if (codecObj?.encoders.length !== 0) {
|
||||
encoder = codecObj?.encoders[0] ?? "";
|
||||
}
|
||||
setSelectedCodec(codecObj);
|
||||
setSelectedEncoder(encoder);
|
||||
}
|
||||
|
||||
createEffect(() => {
|
||||
ffmpegParams = {
|
||||
vcodec: codecObj?.shortName ?? "",
|
||||
vcodec: selectedCodec()?.shortName ?? "",
|
||||
encoder: selectedEncoder(),
|
||||
useropts: {
|
||||
global: "",
|
||||
input: "",
|
||||
output: "",
|
||||
},
|
||||
};
|
||||
|
||||
let encoder = newValue;
|
||||
if (codecObj?.encoders.length !== 0) {
|
||||
encoder = codecObj?.encoders[0] ?? "";
|
||||
}
|
||||
ffmpegParams.encoder = encoder;
|
||||
setSelectedCodec(codecObj);
|
||||
setSelectedEncoder(encoder);
|
||||
}
|
||||
});
|
||||
|
||||
function getAudioEncoders() {
|
||||
const codec = audioCodec();
|
||||
@@ -581,7 +579,16 @@ function App() {
|
||||
</For>
|
||||
</select>
|
||||
</form>
|
||||
<Switch fallback={<div></div>}>
|
||||
<div class="row flex-col align-items-center">
|
||||
<h3 class="k-form-section-title">
|
||||
Encoder Options
|
||||
</h3>
|
||||
</div>
|
||||
<Switch
|
||||
fallback={
|
||||
<div class="text-center mt-4">No options.</div>
|
||||
}
|
||||
>
|
||||
<Match
|
||||
when={
|
||||
selectedCodec()?.shortName === "h264" ||
|
||||
@@ -590,6 +597,7 @@ function App() {
|
||||
>
|
||||
<H264Options
|
||||
codec={selectedCodec()}
|
||||
encoder={selectedEncoder()}
|
||||
params={ffmpegParams}
|
||||
onParamChanged={onParametersChanged}
|
||||
/>
|
||||
|
||||
@@ -15,18 +15,12 @@ function DNxHDOptions(props: {
|
||||
onParamChanged: FFmpegParamChangedFunc;
|
||||
}) {
|
||||
return (
|
||||
<section id="commonLossyOptions">
|
||||
<div class="row flex-col align-items-center">
|
||||
<h3 class="k-form-section-title">Encoder Options</h3>
|
||||
</div>
|
||||
<div class="k-form">
|
||||
<section id="commonLossyOptions" class="k-form">
|
||||
<label>Help</label>
|
||||
<div>
|
||||
<button
|
||||
class="icon-button"
|
||||
onclick={() =>
|
||||
os.open("https://askubuntu.com/a/907515")
|
||||
}
|
||||
onclick={() => os.open("https://askubuntu.com/a/907515")}
|
||||
title="DNxHD is a picky encoder."
|
||||
>
|
||||
<BreezeIcon icon="help-about" alt="Help" />
|
||||
@@ -51,7 +45,6 @@ function DNxHDOptions(props: {
|
||||
<option value="dnxhr_sq">DNxHR SQ</option>
|
||||
<option value="dnxhr_lb">DNxHR LB</option>
|
||||
</select>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,170 +1,40 @@
|
||||
import { createSignal, Show } from "solid-js";
|
||||
import { Match, Switch } from "solid-js";
|
||||
import {
|
||||
DEFAULT_BITRATE,
|
||||
type CodecInfo,
|
||||
type FFmpegParamChangedFunc,
|
||||
type FFmpegParams,
|
||||
} from "../util/ffmpeg";
|
||||
import { os } from "@neutralinojs/lib";
|
||||
import BreezeIcon from "./BreezeIcon";
|
||||
|
||||
const information = {
|
||||
h264: {
|
||||
defaultCrf: 23,
|
||||
},
|
||||
hevc: {
|
||||
defaultCrf: 28,
|
||||
},
|
||||
};
|
||||
import LibH26xOptions from "./encoders/libx264";
|
||||
import H264QsvOptions from "./encoders/h264qsv";
|
||||
|
||||
/**
|
||||
* Options for H.264/H.265 codecs
|
||||
*/
|
||||
function H264Options(props: {
|
||||
codec: CodecInfo | undefined;
|
||||
encoder: string;
|
||||
params: FFmpegParams;
|
||||
onParamChanged: FFmpegParamChangedFunc;
|
||||
}) {
|
||||
const [twopass, setTwopass] = createSignal(false);
|
||||
const defaultCrf =
|
||||
props.codec?.shortName === "h264"
|
||||
? information.h264.defaultCrf
|
||||
: information.hevc.defaultCrf;
|
||||
|
||||
return (
|
||||
<section id="commonLossyOptions">
|
||||
<div class="row flex-col align-items-center">
|
||||
<h3 class="k-form-section-title">Encoder Options</h3>
|
||||
</div>
|
||||
<div class="k-form">
|
||||
<div></div>
|
||||
<div class="checkbox-container">
|
||||
<input
|
||||
type="checkbox"
|
||||
value={props.params.twopass?.toString()}
|
||||
onInput={(e) => {
|
||||
props.params.twopass = e.target.checked;
|
||||
props.onParamChanged("twopass", e.target.checked);
|
||||
setTwopass(e.target.checked);
|
||||
}}
|
||||
id="twopassCheck"
|
||||
/>
|
||||
<label for="twopassCheck">
|
||||
Use target bitrate instead of CRF
|
||||
</label>
|
||||
<button
|
||||
class="icon-button"
|
||||
onclick={() =>
|
||||
os.open(
|
||||
"https://trac.ffmpeg.org/wiki/Encode/H.264#twopass",
|
||||
)
|
||||
}
|
||||
title="This will use the two-pass rate control mode instead of relying on a Constant Rate Factor (CRF) value."
|
||||
>
|
||||
<BreezeIcon icon="help-about" alt="Help" />
|
||||
</button>
|
||||
</div>
|
||||
<label for="encodingPreset">Preset</label>
|
||||
<select
|
||||
class="k-dropdown"
|
||||
name="encodingPreset"
|
||||
id="encodingPreset"
|
||||
value={props.params.preset ?? "medium"}
|
||||
oninput={(e) => {
|
||||
props.params.preset = e.target.value;
|
||||
props.onParamChanged("preset", e.target.value);
|
||||
}}
|
||||
>
|
||||
<option value="ultrafast">ultrafast</option>
|
||||
<option value="superfast">superfast</option>
|
||||
<option value="veryfast">veryfast</option>
|
||||
<option value="faster">faster</option>
|
||||
<option value="fast">fast</option>
|
||||
<option value="medium">medium (Default)</option>
|
||||
<option value="slow">slow</option>
|
||||
<option value="slower">slower</option>
|
||||
<option value="veryslow">veryslow</option>
|
||||
<option
|
||||
value="placebo"
|
||||
title="Don't use this option, it rarely helps."
|
||||
>
|
||||
placebo
|
||||
</option>
|
||||
</select>
|
||||
<Show
|
||||
when={twopass()}
|
||||
fallback={
|
||||
<>
|
||||
<label for="crf">CRF</label>
|
||||
<input
|
||||
type="number"
|
||||
name="crf"
|
||||
id="crf"
|
||||
min="0"
|
||||
max="51"
|
||||
value={props.params.crf ?? defaultCrf}
|
||||
oninput={(e) => {
|
||||
props.params.crf = parseInt(e.target.value);
|
||||
props.onParamChanged(
|
||||
"crf",
|
||||
parseInt(e.target.value),
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
<Switch fallback={<div class="text-center mt-4">No options.</div>}>
|
||||
<Match
|
||||
when={
|
||||
props.encoder === "libx264" ||
|
||||
props.encoder === "libx264rgb" ||
|
||||
props.encoder === "libx265"
|
||||
}
|
||||
>
|
||||
<label for="bitrate">Bitrate</label>
|
||||
<div>
|
||||
<input
|
||||
type="number"
|
||||
name="bitrate"
|
||||
id="bitrate"
|
||||
value={props.params.vbitrate ?? DEFAULT_BITRATE}
|
||||
oninput={(e) => {
|
||||
props.params.vbitrate = parseInt(
|
||||
e.target.value,
|
||||
);
|
||||
props.onParamChanged(
|
||||
"vbitrate",
|
||||
parseInt(e.target.value),
|
||||
);
|
||||
}}
|
||||
/>
|
||||
<span> Kbps</span>
|
||||
</div>
|
||||
</Show>
|
||||
<Show when={props.codec?.shortName === "h264"}>
|
||||
<div></div>
|
||||
<div class="checkbox-container">
|
||||
<input
|
||||
type="checkbox"
|
||||
value={props.params.faststart?.toString()}
|
||||
onInput={(e) => {
|
||||
props.params.faststart = e.target.checked;
|
||||
props.onParamChanged(
|
||||
"faststart",
|
||||
e.target.checked,
|
||||
);
|
||||
}}
|
||||
id="fastStartCheck"
|
||||
/>
|
||||
<label for="fastStartCheck">Enable Fast Start</label>
|
||||
<button
|
||||
class="icon-button"
|
||||
onclick={() =>
|
||||
os.open(
|
||||
"https://trac.ffmpeg.org/wiki/Encode/H.264#faststartforwebvideo",
|
||||
)
|
||||
<LibH26xOptions {...props} />
|
||||
</Match>
|
||||
<Match
|
||||
when={
|
||||
props.encoder === "h264_qsv" || props.encoder === "hevc_qsv"
|
||||
}
|
||||
title="This will move some information to the beginning of your file and allow the video to begin playing before it is completely downloaded by the viewer, recommended for web videos. Click for more information."
|
||||
>
|
||||
<BreezeIcon icon="help-about" alt="Help" />
|
||||
</button>
|
||||
</div>
|
||||
</Show>
|
||||
</div>
|
||||
</section>
|
||||
<H264QsvOptions {...props} />
|
||||
</Match>
|
||||
</Switch>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,11 +16,7 @@ function VP9Options(props: {
|
||||
const defaultCrf = 30;
|
||||
|
||||
return (
|
||||
<section id="commonLossyOptions">
|
||||
<div class="row flex-col align-items-center">
|
||||
<h3 class="k-form-section-title">Encoder Options</h3>
|
||||
</div>
|
||||
<div class="k-form">
|
||||
<section id="commonLossyOptions" class="k-form">
|
||||
<div></div>
|
||||
<div class="checkbox-container">
|
||||
<input
|
||||
@@ -106,9 +102,7 @@ function VP9Options(props: {
|
||||
id="bitrate"
|
||||
value={props.params.vbitrate ?? DEFAULT_BITRATE}
|
||||
oninput={(e) => {
|
||||
props.params.vbitrate = parseInt(
|
||||
e.target.value,
|
||||
);
|
||||
props.params.vbitrate = parseInt(e.target.value);
|
||||
props.onParamChanged(
|
||||
"vbitrate",
|
||||
parseInt(e.target.value),
|
||||
@@ -126,10 +120,7 @@ function VP9Options(props: {
|
||||
value={props.params.faststart?.toString()}
|
||||
onInput={(e) => {
|
||||
props.params.faststart = e.target.checked;
|
||||
props.onParamChanged(
|
||||
"faststart",
|
||||
e.target.checked,
|
||||
);
|
||||
props.onParamChanged("faststart", e.target.checked);
|
||||
}}
|
||||
id="fastStartCheck"
|
||||
/>
|
||||
@@ -147,7 +138,6 @@ function VP9Options(props: {
|
||||
</button>
|
||||
</div>
|
||||
</Show>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
import {
|
||||
DEFAULT_BITRATE,
|
||||
type CodecInfo,
|
||||
type FFmpegParamChangedFunc,
|
||||
type FFmpegParams,
|
||||
} from "@/util/ffmpeg";
|
||||
import { createEffect, createSignal, onMount, Show } from "solid-js";
|
||||
|
||||
function H264QsvOptions({
|
||||
onParamChanged,
|
||||
}: {
|
||||
codec: CodecInfo | undefined;
|
||||
params: FFmpegParams;
|
||||
onParamChanged: FFmpegParamChangedFunc;
|
||||
}) {
|
||||
const [rateControl, setRateControl] = createSignal("icq");
|
||||
const [globalQuality, setGlobalQuality] = createSignal(18);
|
||||
const [bitrate, setBitrate] = createSignal(DEFAULT_BITRATE);
|
||||
const [cqp, setCqp] = createSignal(18);
|
||||
|
||||
createEffect(() => {
|
||||
const opts: Record<string, string> = {};
|
||||
|
||||
switch (rateControl()) {
|
||||
case "icq":
|
||||
onParamChanged("vbitrate", undefined);
|
||||
const quality = globalQuality();
|
||||
opts["global_quality"] = quality.toString();
|
||||
break;
|
||||
case "cbr":
|
||||
onParamChanged("vbitrate", bitrate());
|
||||
opts["maxrate"] = `${bitrate() ?? DEFAULT_BITRATE}k`;
|
||||
break;
|
||||
case "vbr":
|
||||
onParamChanged("vbitrate", bitrate());
|
||||
break;
|
||||
case "cqp":
|
||||
onParamChanged("vbitrate", undefined);
|
||||
opts["q"] = cqp().toString();
|
||||
break;
|
||||
}
|
||||
|
||||
onParamChanged("outputopts", opts);
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
onParamChanged("hwaccel", "qsv");
|
||||
});
|
||||
|
||||
return (
|
||||
<section id="encoderOptions" class="k-form">
|
||||
<label for="rateControl">Rate Control Mode</label>
|
||||
<select
|
||||
name="rateControl"
|
||||
id="rateControl"
|
||||
class="k-dropdown"
|
||||
value={rateControl()}
|
||||
oninput={(e) => setRateControl(e.target.value)}
|
||||
>
|
||||
<option value="cbr">CBR: Constant Bitrate</option>
|
||||
<option value="cqp">
|
||||
CQP: Constant Quantization Parameter
|
||||
</option>
|
||||
<option value="vbr">VBR: Variable Bitrate</option>
|
||||
<option value="icq">ICQ: Intelligent Constant Quality</option>
|
||||
</select>
|
||||
<Show when={rateControl() === "icq"}>
|
||||
<label for="globalQuality">Global Quality</label>
|
||||
<input
|
||||
type="number"
|
||||
name="globalQuality"
|
||||
id="globalQuality"
|
||||
min="1"
|
||||
max="51"
|
||||
value={globalQuality()}
|
||||
oninput={(e) => setGlobalQuality(parseInt(e.target.value))}
|
||||
/>
|
||||
</Show>
|
||||
<Show when={rateControl() === "cqp"}>
|
||||
<label for="cqp">CQP</label>
|
||||
<input
|
||||
type="number"
|
||||
name="cqp"
|
||||
id="cqp"
|
||||
min="1"
|
||||
max="51"
|
||||
value={cqp()}
|
||||
oninput={(e) => setCqp(parseInt(e.target.value))}
|
||||
/>
|
||||
</Show>
|
||||
<Show when={rateControl() === "cbr" || rateControl() === "vbr"}>
|
||||
<label for="bitrate">Bitrate</label>
|
||||
<div>
|
||||
<input
|
||||
type="number"
|
||||
name="bitrate"
|
||||
id="bitrate"
|
||||
value={bitrate()}
|
||||
oninput={(e) => setBitrate(parseInt(e.target.value))}
|
||||
/>
|
||||
<span> Kbps</span>
|
||||
</div>
|
||||
</Show>
|
||||
<Show when={rateControl() === "vbr" || rateControl() === "icq"}>
|
||||
<div></div>
|
||||
<div
|
||||
class="checkbox-container"
|
||||
title="May not be available on some platforms."
|
||||
>
|
||||
<input type="checkbox" name="lookAhead" id="lookAhead" />
|
||||
<label for="lookAhead">Look-ahead mode</label>
|
||||
</div>
|
||||
</Show>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
export default H264QsvOptions;
|
||||
@@ -46,11 +46,7 @@ function LibaomOptions(props: {
|
||||
});
|
||||
|
||||
return (
|
||||
<section id="encoderOptions">
|
||||
<div class="row flex-col align-items-center">
|
||||
<h3 class="k-form-section-title">Encoder Options</h3>
|
||||
</div>
|
||||
<div class="k-form">
|
||||
<section id="encoderOptions" class="k-form">
|
||||
<label>Help</label>
|
||||
<div>
|
||||
<button
|
||||
@@ -92,10 +88,7 @@ function LibaomOptions(props: {
|
||||
max="63"
|
||||
value={props.params.crf ?? DEFAULT_CRF}
|
||||
oninput={(e) => {
|
||||
props.onParamChanged(
|
||||
"crf",
|
||||
parseInt(e.target.value),
|
||||
);
|
||||
props.onParamChanged("crf", parseInt(e.target.value));
|
||||
}}
|
||||
/>
|
||||
</Show>
|
||||
@@ -118,7 +111,6 @@ function LibaomOptions(props: {
|
||||
<span>Kbps</span>
|
||||
</div>
|
||||
</Show>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ function Librav1eOptions(props: {
|
||||
onParamChanged: FFmpegParamChangedFunc;
|
||||
}) {
|
||||
onMount(() => {
|
||||
props.onParamChanged("crf", undefined);
|
||||
props.onParamChanged(
|
||||
"vbitrate",
|
||||
props.params.vbitrate ?? DEFAULT_BITRATE,
|
||||
@@ -23,11 +22,7 @@ function Librav1eOptions(props: {
|
||||
});
|
||||
|
||||
return (
|
||||
<section id="encoderOptions">
|
||||
<div class="row flex-col align-items-center">
|
||||
<h3 class="k-form-section-title">Encoder Options</h3>
|
||||
</div>
|
||||
<div class="k-form">
|
||||
<section id="encoderOptions" class="k-form">
|
||||
<label>Help</label>
|
||||
<div>
|
||||
<button
|
||||
@@ -70,7 +65,6 @@ function Librav1eOptions(props: {
|
||||
/>
|
||||
<span>Kbps</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -33,20 +33,8 @@ function LibSvtAv1Options({
|
||||
});
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
onParamChanged("vbitrate", undefined);
|
||||
|
||||
if (isNaN(parseInt(params.preset ?? ""))) {
|
||||
onParamChanged("preset", "5");
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<section id="encoderOptions">
|
||||
<div class="row flex-col align-items-center">
|
||||
<h3 class="k-form-section-title">Encoder Options</h3>
|
||||
</div>
|
||||
<div class="k-form">
|
||||
<section id="encoderOptions" class="k-form">
|
||||
<label>Help</label>
|
||||
<div>
|
||||
<button
|
||||
@@ -79,9 +67,7 @@ function LibSvtAv1Options({
|
||||
id="crf"
|
||||
title="A range from 1 to 63. A good starting point for a 1080p video is 30"
|
||||
value={params.crf ?? 30}
|
||||
oninput={(e) =>
|
||||
onParamChanged("crf", parseInt(e.target.value))
|
||||
}
|
||||
oninput={(e) => onParamChanged("crf", parseInt(e.target.value))}
|
||||
min="1"
|
||||
max="63"
|
||||
/>
|
||||
@@ -116,7 +102,6 @@ function LibSvtAv1Options({
|
||||
<option value="0">Subjective Quality</option>
|
||||
<option value="1">Objective Quality (PSNR)</option>
|
||||
</select>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
import { createSignal, Show } from "solid-js";
|
||||
import {
|
||||
DEFAULT_BITRATE,
|
||||
type CodecInfo,
|
||||
type FFmpegParamChangedFunc,
|
||||
type FFmpegParams,
|
||||
} from "@/util/ffmpeg";
|
||||
import { os } from "@neutralinojs/lib";
|
||||
import BreezeIcon from "@/components/BreezeIcon";
|
||||
|
||||
const information = {
|
||||
h264: {
|
||||
defaultCrf: 23,
|
||||
},
|
||||
hevc: {
|
||||
defaultCrf: 28,
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Options for H.264/H.265 codecs
|
||||
*/
|
||||
function LibH26xOptions(props: {
|
||||
codec: CodecInfo | undefined;
|
||||
params: FFmpegParams;
|
||||
onParamChanged: FFmpegParamChangedFunc;
|
||||
}) {
|
||||
const [twopass, setTwopass] = createSignal(false);
|
||||
const defaultCrf =
|
||||
props.codec?.shortName === "h264"
|
||||
? information.h264.defaultCrf
|
||||
: information.hevc.defaultCrf;
|
||||
|
||||
return (
|
||||
<section id="commonLossyOptions" class="k-form">
|
||||
<div></div>
|
||||
<div class="checkbox-container">
|
||||
<input
|
||||
type="checkbox"
|
||||
value={props.params.twopass?.toString()}
|
||||
onInput={(e) => {
|
||||
props.params.twopass = e.target.checked;
|
||||
props.onParamChanged("twopass", e.target.checked);
|
||||
setTwopass(e.target.checked);
|
||||
}}
|
||||
id="twopassCheck"
|
||||
/>
|
||||
<label for="twopassCheck">
|
||||
Use target bitrate instead of CRF
|
||||
</label>
|
||||
<button
|
||||
class="icon-button"
|
||||
onclick={() =>
|
||||
os.open(
|
||||
"https://trac.ffmpeg.org/wiki/Encode/H.264#twopass",
|
||||
)
|
||||
}
|
||||
title="This will use the two-pass rate control mode instead of relying on a Constant Rate Factor (CRF) value."
|
||||
>
|
||||
<BreezeIcon icon="help-about" alt="Help" />
|
||||
</button>
|
||||
</div>
|
||||
<label for="encodingPreset">Preset</label>
|
||||
<select
|
||||
class="k-dropdown"
|
||||
name="encodingPreset"
|
||||
id="encodingPreset"
|
||||
value={props.params.preset ?? "medium"}
|
||||
oninput={(e) => {
|
||||
props.params.preset = e.target.value;
|
||||
props.onParamChanged("preset", e.target.value);
|
||||
}}
|
||||
>
|
||||
<option value="ultrafast">ultrafast</option>
|
||||
<option value="superfast">superfast</option>
|
||||
<option value="veryfast">veryfast</option>
|
||||
<option value="faster">faster</option>
|
||||
<option value="fast">fast</option>
|
||||
<option value="medium">medium (Default)</option>
|
||||
<option value="slow">slow</option>
|
||||
<option value="slower">slower</option>
|
||||
<option value="veryslow">veryslow</option>
|
||||
<option
|
||||
value="placebo"
|
||||
title="Don't use this option, it rarely helps."
|
||||
>
|
||||
placebo
|
||||
</option>
|
||||
</select>
|
||||
<Show
|
||||
when={twopass()}
|
||||
fallback={
|
||||
<>
|
||||
<label for="crf">CRF</label>
|
||||
<input
|
||||
type="number"
|
||||
name="crf"
|
||||
id="crf"
|
||||
min="0"
|
||||
max="51"
|
||||
value={props.params.crf ?? defaultCrf}
|
||||
oninput={(e) => {
|
||||
props.params.crf = parseInt(e.target.value);
|
||||
props.onParamChanged(
|
||||
"crf",
|
||||
parseInt(e.target.value),
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
>
|
||||
<label for="bitrate">Bitrate</label>
|
||||
<div>
|
||||
<input
|
||||
type="number"
|
||||
name="bitrate"
|
||||
id="bitrate"
|
||||
value={props.params.vbitrate ?? DEFAULT_BITRATE}
|
||||
oninput={(e) =>
|
||||
props.onParamChanged(
|
||||
"vbitrate",
|
||||
parseInt(e.target.value),
|
||||
)
|
||||
}
|
||||
/>
|
||||
<span> Kbps</span>
|
||||
</div>
|
||||
</Show>
|
||||
<Show when={props.codec?.shortName === "h264"}>
|
||||
<div></div>
|
||||
<div class="checkbox-container">
|
||||
<input
|
||||
type="checkbox"
|
||||
value={props.params.faststart?.toString()}
|
||||
onInput={(e) => {
|
||||
props.params.faststart = e.target.checked;
|
||||
props.onParamChanged("faststart", e.target.checked);
|
||||
}}
|
||||
id="fastStartCheck"
|
||||
/>
|
||||
<label for="fastStartCheck">Enable Fast Start</label>
|
||||
<button
|
||||
class="icon-button"
|
||||
onclick={() =>
|
||||
os.open(
|
||||
"https://trac.ffmpeg.org/wiki/Encode/H.264#faststartforwebvideo",
|
||||
)
|
||||
}
|
||||
title="This will move some information to the beginning of your file and allow the video to begin playing before it is completely downloaded by the viewer, recommended for web videos. Click for more information."
|
||||
>
|
||||
<BreezeIcon icon="help-about" alt="Help" />
|
||||
</button>
|
||||
</div>
|
||||
</Show>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
export default LibH26xOptions;
|
||||
@@ -171,7 +171,7 @@ export function generateOutputCommand(params: FFmpegParams) {
|
||||
? " -movflags +faststart"
|
||||
: "";
|
||||
|
||||
let globalopts = "-hwaccel auto -y";
|
||||
let globalopts = `-hwaccel ${params.hwaccel ?? "auto"} -y`;
|
||||
let inputopts =
|
||||
params.useropts.input !== "" ? " " + params.useropts.input : "";
|
||||
let outputopts =
|
||||
@@ -220,7 +220,7 @@ ffmpeg ${commonOpts} ${params.vcodec === "hevc" ? "-x265-params pass=2" : "-pass
|
||||
}
|
||||
|
||||
return `ffmpeg ${globalopts}${inputopts} -i "${params.inputFile ?? "{fileName}"}" -c:v ${params.encoder ?? params.vcodec}${params.crf === undefined ? "" : ` -crf ${params.crf}`
|
||||
}${params.vbitrate === undefined ? "" : ` -b:v ${params.vbitrate}`
|
||||
}${params.vbitrate === undefined ? "" : ` -b:v ${params.vbitrate}k`
|
||||
}${faststart}${params.preset === undefined ? "" : ` -preset ${params.preset}`
|
||||
} -c:a ${params.acodec ?? "copy"}${params.abitrate === undefined ? "" : ` -b:a ${params.abitrate}k`
|
||||
}${params.speed === undefined ? "" : ` -speed ${params.speed}`
|
||||
|
||||
Reference in New Issue
Block a user