|
|
@@ -267,15 +267,27 @@ export async function changeMusicCover(
|
|
|
}
|
|
|
console.log(`onecold 获取新的图片地址 tempCoverPath = [${tempCoverPath}]`);
|
|
|
// 构建FFmpeg命令
|
|
|
+ // const commands: string[] = [
|
|
|
+ // "ffmpeg",
|
|
|
+ // "-i", inputPath,
|
|
|
+ // "-i", tempCoverPath,
|
|
|
+ // "-map", "0:0", // 映射音频流
|
|
|
+ // "-map", "1:0", // 映射封面图片流
|
|
|
+ // "-c", "copy", // 复制音频流
|
|
|
+ // "-id3v2_version", "3", // ID3v2版本
|
|
|
+ // "-y", // 覆盖输出文件
|
|
|
+ // finalOutputPath
|
|
|
+ // ];
|
|
|
const commands: string[] = [
|
|
|
"ffmpeg",
|
|
|
"-i", inputPath,
|
|
|
"-i", tempCoverPath,
|
|
|
- "-map", "0:0", // 映射音频流
|
|
|
- "-map", "1:0", // 映射封面图片流
|
|
|
- "-c", "copy", // 复制音频流
|
|
|
- "-id3v2_version", "3", // ID3v2版本
|
|
|
- "-y", // 覆盖输出文件
|
|
|
+ "-map", "0:0",
|
|
|
+ "-map", "1:0",
|
|
|
+ "-c", "copy",
|
|
|
+ "-id3v2_version", "3", // 设置ID3v2.3标签
|
|
|
+ "-disposition:v:0", "attached_pic",// 强制设置图片为封面
|
|
|
+ "-y",
|
|
|
finalOutputPath
|
|
|
];
|
|
|
|