File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -82,11 +82,27 @@ const makeAudioArgs = (info: CobaltLocalProcessingResponse) => {
8282 return ;
8383 }
8484
85- const ffargs = [
86- "-vn" ,
85+ const ffargs = [ ] ;
86+
87+ if ( info . audio . cover ) {
88+ ffargs . push (
89+ "-map" , "0" ,
90+ "-map" , "1" ,
91+ ...( info . audio . cropCover ? [
92+ "-c:v" , "mjpeg" ,
93+ "-vf" , "scale=-1:800,crop=800:800" ,
94+ ] : [
95+ "-c:v" , "copy" ,
96+ ] ) ,
97+ ) ;
98+ } else {
99+ ffargs . push ( "-vn" ) ;
100+ }
101+
102+ ffargs . push (
87103 ...( info . audio . copy ? [ "-c:a" , "copy" ] : [ "-b:a" , `${ info . audio . bitrate } k` ] ) ,
88104 ...( info . output . metadata ? ffmpegMetadataArgs ( info . output . metadata ) : [ ] )
89- ] ;
105+ ) ;
90106
91107 if ( info . audio . format === "mp3" && info . audio . bitrate === "8" ) {
92108 ffargs . push ( "-ar" , "12000" ) ;
Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ export type CobaltLocalProcessingResponse = {
8080 copy : boolean ,
8181 format : string ,
8282 bitrate : string ,
83+ cover ?: boolean ,
84+ cropCover ?: boolean ,
8385 } ,
8486
8587 isHLS ?: boolean ,
You can’t perform that action at this time.
0 commit comments