mirror of
https://github.com/C4illin/ConvertX.git
synced 2026-10-27 23:30:55 +01:00
fix(ffmpeg): preserve cover art when converting to m4b (#679)
This commit is contained in:
@@ -721,7 +721,7 @@ export async function convert(
|
||||
let extraArgs: string[] = [];
|
||||
let message = "Done";
|
||||
|
||||
const audioFormatsWithCover = ["m4a", "mp3", "flac", "ogg"];
|
||||
const audioFormatsWithCover = ["m4a", "m4b", "mp3", "flac", "ogg"];
|
||||
const audioFormatsNoCover = ["wav", "aac"];
|
||||
|
||||
if (audioFormatsWithCover.includes(convertTo)) {
|
||||
|
||||
@@ -89,23 +89,26 @@ test.each([
|
||||
expect(calls[0]).toEqual(["-i", "in.mkv", "-c:v", codec, "out.video"]);
|
||||
});
|
||||
|
||||
test.each(["m4a", "mp3", "flac", "ogg"])("keeps embedded cover art for %s output", async (ext) => {
|
||||
await convert("in.wav", "wav", ext, `out.${ext}`, undefined, mockExecFile);
|
||||
test.each(["m4a", "m4b", "mp3", "flac", "ogg"])(
|
||||
"keeps embedded cover art for %s output",
|
||||
async (ext) => {
|
||||
await convert("in.mp3", "mp3", ext, `out.${ext}`, undefined, mockExecFile);
|
||||
|
||||
expect(calls[0]).toEqual([
|
||||
"-i",
|
||||
"in.wav",
|
||||
"-map",
|
||||
"0:a",
|
||||
"-map",
|
||||
"0:v:disp:attached_pic?",
|
||||
"-c:v",
|
||||
"copy",
|
||||
"-disposition:v",
|
||||
"attached_pic",
|
||||
`out.${ext}`,
|
||||
]);
|
||||
});
|
||||
expect(calls[0]).toEqual([
|
||||
"-i",
|
||||
"in.mp3",
|
||||
"-map",
|
||||
"0:a",
|
||||
"-map",
|
||||
"0:v:disp:attached_pic?",
|
||||
"-c:v",
|
||||
"copy",
|
||||
"-disposition:v",
|
||||
"attached_pic",
|
||||
`out.${ext}`,
|
||||
]);
|
||||
},
|
||||
);
|
||||
|
||||
test.each(["wav", "aac"])("drops video streams for %s output", async (ext) => {
|
||||
await convert("in.mp3", "mp3", ext, `out.${ext}`, undefined, mockExecFile);
|
||||
|
||||
Reference in New Issue
Block a user