Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/CommonFormats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ const CommonFormats = {
"video/mp4",
Category.VIDEO
),
WMV: new FormatDefinition(
"Windows Media Video",
"wmv",
"wmv",
"video/x-ms-asf",
Category.VIDEO
),
// archive
ZIP: new FormatDefinition(
"ZIP Archive",
Expand Down
17 changes: 16 additions & 1 deletion src/handlers/FFmpeg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class FFmpegHandler implements FormatHandler {
["matroska", "Matroska / WebM"],
["mov", "QuickTime / MOV"],
["3gp", "3GPP Multimedia Container"],
["3g2", "3GPP2 Multimedia Container"]
["3g2", "3GPP2 Multimedia Container"],
["asf", "Windows Media Video (WMV)"]
]);

public name: string = "FFmpeg";
Expand Down Expand Up @@ -221,6 +222,18 @@ class FFmpegHandler implements FormatHandler {
internal: "mov"
});

// Add .wmv (Windows Media Video) support - uses ASF container
this.supportedFormats.push({
name: "Windows Media Video",
format: "wmv",
extension: "wmv",
mime: "video/x-ms-asf",
from: true,
to: true,
internal: "asf",
category: "video"
});

Copy link
Contributor

@ConnorTippets ConnorTippets Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You added CommonFormats.WMV, why not use it?

Ah, I see what's happening here. Admittedly figuring this out myself was a bit difficult too, but FormatDefinition.builder takes a string that is the internal. So CommonFormats.WMV.builder("asf").allowFrom().allowTo() would produce the same thing.

// Normalize Bink metadata to ensure ".bik" files are detected by extension.
const binkFormats = this.supportedFormats.filter(f =>
f.internal === "bink"
Expand Down Expand Up @@ -284,6 +297,8 @@ class FFmpegHandler implements FormatHandler {
command.push("-vf", "setsar=1", "-target", "ntsc-dvd", "-pix_fmt", "rgb24");
} else if (outputFormat.internal === "vcd") {
command.push("-vf", "scale=352:288,setsar=1", "-target", "pal-vcd", "-pix_fmt", "rgb24");
} else if (outputFormat.internal === "asf") {
command.push("-b:v", "15M", "-b:a", "192k");
}
if (args) command.push(...args);
command.push("output");
Expand Down
1 change: 1 addition & 0 deletions src/normalizeMimeType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function normalizeMimeType (mime: string) {
case "application/musicxml": return "application/vnd.recordare.musicxml+xml";
case "application/musicxml+xml": return "application/vnd.recordare.musicxml+xml";
case "text/mathml": return "application/mathml+xml";
case "video/x-ms-wmv": return "video/x-ms-asf";
}
return mime;
}
Expand Down