mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-27 17:08:28 +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;
|
||||
}
|
||||
|
||||
const ffargs = [
|
||||
"-vn",
|
||||
const ffargs = [];
|
||||
|
||||
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.output.metadata ? ffmpegMetadataArgs(info.output.metadata) : [])
|
||||
];
|
||||
);
|
||||
|
||||
if (info.audio.format === "mp3" && info.audio.bitrate === "8") {
|
||||
ffargs.push("-ar", "12000");
|
||||
|
@ -80,6 +80,8 @@ export type CobaltLocalProcessingResponse = {
|
||||
copy: boolean,
|
||||
format: string,
|
||||
bitrate: string,
|
||||
cover?: boolean,
|
||||
cropCover?: boolean,
|
||||
},
|
||||
|
||||
isHLS?: boolean,
|
||||
|
Loading…
Reference in New Issue
Block a user