chore(wasm-output): authors, comments, cspell dict

This commit is contained in:
lainio24 2025-10-04 11:11:22 +08:00
parent cf3d9fd956
commit 760942ce68
No known key found for this signature in database
GPG Key ID: B333508B1D79D277
3 changed files with 17 additions and 5 deletions

View File

@ -17,6 +17,7 @@
"afterbegin",
"afterend",
"akari",
"alac",
"BALH",
"Bangumi",
"bcache",
@ -75,6 +76,7 @@
"minmax",
"mixins",
"Muuri",
"muxer",
"overscroll",
"pako",
"plusplus",

View File

@ -11,10 +11,16 @@ export const plugin: PluginMetadata = {
name: 'downloadVideo.outputs.wasm',
displayName: `下载视频 - ${title}`,
description: desc,
author: {
name: 'WakelessSloth56',
link: 'https://github.com/WakelessSloth56',
},
author: [
{
name: 'WakelessSloth56',
link: 'https://github.com/WakelessSloth56',
},
{
name: 'LainIO24',
link: 'https://github.com/LainIO24',
},
],
setup: ({ addData }) => {
addData('downloadVideo.outputs', (outputs: DownloadVideoOutput[]) => {
outputs.push({

View File

@ -10,6 +10,7 @@ const mp4Format: Format = {
args.push('-i', 'cover', '-i', 'metadata')
args.push('-map', '0', '-map', '1', '-map', '2')
args.push('-map_metadata', '3', '-disposition:2', 'attached_pic')
// mdta atom 格式元数据和封面互相干扰,不启用 +use_metadata_tags
} else if (hasCover && !hasMetadata) {
args.push('-i', 'cover')
args.push('-map', '0', '-map', '1', '-map', '2')
@ -19,7 +20,7 @@ const mp4Format: Format = {
args.push('-map_metadata', '2', '-movflags', '+use_metadata_tags')
}
args.push('-codec:v', 'copy')
args.push('-codec:a', isFlac ? 'alac' : 'copy')
args.push('-codec:a', isFlac ? 'alac' : 'copy') // MP4不支持FLAC使用ALAC重新编码FLAC
args.push('-f', 'mp4')
return args
},
@ -62,6 +63,9 @@ export async function mux(
metadata: Uint8Array,
) {
if (outputType === 'auto') {
// 自动选择格式:
// FLAC音轨 -> MKV
// 元数据+封面 -> MKV
outputType = isFlac ? 'matroska' : 'mp4'
outputType = cover && metadata ? 'matroska' : outputType
}