fix: broken image sequences

okay this is terrible why am i a developer for ts
This commit is contained in:
Maya 2026-05-12 13:00:16 +03:00
parent 2f30c454dc
commit 8850b25f8b
No known key found for this signature in database
4 changed files with 29 additions and 25 deletions

View File

@ -58,7 +58,9 @@ export class FFmpegConverter extends Converter {
new FormatInfo("m4b", true, true),
new FormatInfo("voc", true, true),
new FormatInfo("weba", true, true),
...videoFormats.map((f: string) => new FormatInfo(f, true, true, false, 0)),
...videoFormats.map(
(f: string) => new FormatInfo(f, true, true, false, 0),
),
];
public readonly reportsProgress = true;
@ -194,9 +196,9 @@ export class FFmpegConverter extends Converter {
if (!to.startsWith(".")) to = `.${to}`;
const conversionSettings =
Object.keys(settings).length > 5 // TODO: find better way to do this lmfao, rn we are just assuming all settings are present if there's at least 5 keys but ts bad
Object.keys(settings).length > 4 // TODO: find better way to do this lmfao, rn we are just assuming all settings are present if there's at least 5 keys but ts bad
? settings
: await this.getDefaultSettings(); // use defaults if not provided
: Object.assign(settings, await this.getDefaultSettings()); // use defaults if not provided
const isAlac = to === ".alac";
if (isAlac) to = ".m4a";

View File

@ -302,9 +302,12 @@ export class MagickConverter extends Converter {
// every other format handled by magick worker
const conversionSettings = JSON.stringify(
Object.keys(settings).length > 5
Object.keys(settings).length > 4
? settings // user-provided settings
: await this.getDefaultSettings(input), // use defaults if not provided
: Object.assign(
settings,
await this.getDefaultSettings(input),
), // use defaults if not provided
);
const convertMsg: WorkerMessage = {
type: "convert",

View File

@ -237,7 +237,7 @@ export class MediabunnyConverter extends Converter {
this.error("Mediabunny failed to initialize");
ToastManager.add({
type: "error",
message: m["workers.errors.mediabunny.init"](),
message: m["workers.errors.mediabunny.init"](),
durations: {
stay: 10000,
},
@ -252,7 +252,7 @@ export class MediabunnyConverter extends Converter {
this.error("WebCodecs API support incomplete");
ToastManager.add({
type: "error",
message: m["workers.errors.mediabunny.webcodecs"](),
message: m["workers.errors.mediabunny.webcodecs"](),
durations: {
stay: 10000,
},
@ -281,7 +281,7 @@ export class MediabunnyConverter extends Converter {
const fps: SettingDefinition = {
key: "fps",
label: m["convert.settings.video.fps.label"](),
label: m["convert.settings.video.fps.label"](),
type: "select",
default: "auto",
options: [
@ -299,12 +299,12 @@ export class MediabunnyConverter extends Converter {
],
hasCustomInput: true,
customInputKey: "customFps",
placeholder: m["convert.settings.video.fps.placeholder"](),
placeholder: m["convert.settings.video.fps.placeholder"](),
};
const resolution: SettingDefinition = {
key: "resolution",
label: m["convert.settings.video.resolution.label"](),
label: m["convert.settings.video.resolution.label"](),
type: "select",
default: "auto",
options: [
@ -325,13 +325,13 @@ export class MediabunnyConverter extends Converter {
],
hasCustomInput: true,
customInputKey: "customResolution",
placeholder: m["convert.settings.video.resolution.placeholder"](),
placeholder: m["convert.settings.video.resolution.placeholder"](),
};
// TODO: allow CRF for consistent quality?
const videoBitrate: SettingDefinition = {
key: "videoBitrate",
label: m["convert.settings.video.bitrate.video"](),
label: m["convert.settings.video.bitrate.video"](),
type: "select",
default: "auto",
options: [
@ -349,14 +349,14 @@ export class MediabunnyConverter extends Converter {
],
hasCustomInput: true,
customInputKey: "customVideoBitrate",
placeholder: m["convert.settings.video.bitrate.placeholder"](),
placeholder: m["convert.settings.video.bitrate.placeholder"](),
};
const toFormat = input.to;
const supportedVideoCodecs = getCompatibleCodecs("video", toFormat);
const videoCodec: SettingDefinition = {
key: "videoCodec",
label: m["convert.settings.video.codec.video"](),
label: m["convert.settings.video.codec.video"](),
type: "select",
default: "auto",
options: [
@ -371,7 +371,7 @@ export class MediabunnyConverter extends Converter {
const supportedAudioCodecs = getCompatibleCodecs("audio", toFormat);
const audioCodec: SettingDefinition = {
key: "audioCodec",
label: m["convert.settings.video.codec.audio"](),
label: m["convert.settings.video.codec.audio"](),
type: "select",
default: "auto",
options: [
@ -388,7 +388,7 @@ export class MediabunnyConverter extends Converter {
*/
const audioBitrate: SettingDefinition = {
key: "audioBitrate",
label: m["convert.settings.video.bitrate.audio"](),
label: m["convert.settings.video.bitrate.audio"](),
type: "select",
default: "auto",
options: CONVERSION_BITRATES.map((b) => ({
@ -402,12 +402,12 @@ export class MediabunnyConverter extends Converter {
})),
hasCustomInput: true,
customInputKey: "customAudioBitrate",
placeholder: m["convert.settings.audio.bitrate.placeholder"](),
placeholder: m["convert.settings.audio.bitrate.placeholder"](),
};
const sampleRate: SettingDefinition = {
key: "sampleRate",
label: m["convert.settings.audio.sample_rate.label"](),
label: m["convert.settings.audio.sample_rate.label"](),
type: "select",
default: "auto",
options: SAMPLE_RATES.map((r) => ({
@ -421,7 +421,7 @@ export class MediabunnyConverter extends Converter {
})),
hasCustomInput: true,
customInputKey: "customSampleRate",
placeholder: m["convert.settings.audio.sample_rate.placeholder"](),
placeholder: m["convert.settings.audio.sample_rate.placeholder"](),
};
/*
@ -492,9 +492,9 @@ export class MediabunnyConverter extends Converter {
});
const conversionSettings =
Object.keys(settings).length > 5
? settings // user-provided settings
: await this.getDefaultSettings(file); // use defaults if not provided
Object.keys(settings).length > 4
? settings
: Object.assign(settings, await this.getDefaultSettings(file)); // use defaults if not provided
const videoConfig = buildVideoConfig(conversionSettings);
const audioConfig = buildAudioConfig(conversionSettings);

View File

@ -745,10 +745,9 @@ export class VertdConverter extends Converter {
let fileUpload = input;
const conversionSettings = // vertd expects object not string json
Object.keys(settings).length > 5
Object.keys(settings).length > 4
? settings // user-provided settings
: await this.getDefaultSettings(input); // use defaults if not provided
: Object.assign(settings, await this.getDefaultSettings(input)); // use defaults if not provided
// if converting animated webp to video, first convert to gif
// ffmpeg (in vertd) doesn't support decoding animated webp still.. while supporting encoding animated webp for some reason
// https://trac.ffmpeg.org/ticket/4907