Skip to content

armgit / VERT

Public Imported from GitHub
0

The next-generation file converter. Open source, fully local* and free forever.

fix: broken image sequences

Maya8850b25f8b85
diff --git a/src/lib/converters/ffmpeg.svelte.ts b/src/lib/converters/ffmpeg.svelte.ts
index d4a170c..7b6adc8 100644
--- a/src/lib/converters/ffmpeg.svelte.ts
+++ b/src/lib/converters/ffmpeg.svelte.ts
@@ -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";
diff --git a/src/lib/converters/magick.svelte.ts b/src/lib/converters/magick.svelte.ts
index 04d13f4..97b4114 100644
--- a/src/lib/converters/magick.svelte.ts
+++ b/src/lib/converters/magick.svelte.ts
@@ -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",
diff --git a/src/lib/converters/mediabunny.svelte.ts b/src/lib/converters/mediabunny.svelte.ts
index 325fc19..30bbf8b 100644
--- a/src/lib/converters/mediabunny.svelte.ts
+++ b/src/lib/converters/mediabunny.svelte.ts
@@ -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);
diff --git a/src/lib/converters/vertd.svelte.ts b/src/lib/converters/vertd.svelte.ts
index 862526a..b0bb6d3 100644
--- a/src/lib/converters/vertd.svelte.ts
+++ b/src/lib/converters/vertd.svelte.ts
@@ -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