mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 09:28:29 +00:00
web/queue: add audio covers & crop them when needed
This commit is contained in:
parent
164ea8aeb9
commit
e4ce873b56
@ -82,11 +82,27 @@ const makeAudioArgs = (info: CobaltLocalProcessingResponse) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ffargs = [
|
const ffargs = [];
|
||||||
"-vn",
|
|
||||||
|
if (info.audio.cover) {
|
||||||
|
ffargs.push(
|
||||||
|
"-map", "0",
|
||||||
|
"-map", "1",
|
||||||
|
...(info.audio.cropCover ? [
|
||||||
|
"-c:v", "mjpeg",
|
||||||
|
"-vf", "scale=-1:800,crop=800:800",
|
||||||
|
] : [
|
||||||
|
"-c:v", "copy",
|
||||||
|
]),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
ffargs.push("-vn");
|
||||||
|
}
|
||||||
|
|
||||||
|
ffargs.push(
|
||||||
...(info.audio.copy ? ["-c:a", "copy"] : ["-b:a", `${info.audio.bitrate}k`]),
|
...(info.audio.copy ? ["-c:a", "copy"] : ["-b:a", `${info.audio.bitrate}k`]),
|
||||||
...(info.output.metadata ? ffmpegMetadataArgs(info.output.metadata) : [])
|
...(info.output.metadata ? ffmpegMetadataArgs(info.output.metadata) : [])
|
||||||
];
|
);
|
||||||
|
|
||||||
if (info.audio.format === "mp3" && info.audio.bitrate === "8") {
|
if (info.audio.format === "mp3" && info.audio.bitrate === "8") {
|
||||||
ffargs.push("-ar", "12000");
|
ffargs.push("-ar", "12000");
|
||||||
|
@ -80,6 +80,8 @@ export type CobaltLocalProcessingResponse = {
|
|||||||
copy: boolean,
|
copy: boolean,
|
||||||
format: string,
|
format: string,
|
||||||
bitrate: string,
|
bitrate: string,
|
||||||
|
cover?: boolean,
|
||||||
|
cropCover?: boolean,
|
||||||
},
|
},
|
||||||
|
|
||||||
isHLS?: boolean,
|
isHLS?: boolean,
|
||||||
|
Loading…
Reference in New Issue
Block a user