This commit is contained in:
Izuco 2021-12-09 17:54:51 +01:00
parent d262ce86bb
commit a55cf7ae8e
No known key found for this signature in database
GPG key ID: 318460063D70949F
2 changed files with 20 additions and 26 deletions

10
funi.ts
View file

@ -720,14 +720,6 @@ async function downloadStreams(epsiode: FunimationMediaDownload){
if ( argv.novids ){ if ( argv.novids ){
console.log('[INFO] Video not downloaded. Skip muxing video.'); console.log('[INFO] Video not downloaded. Skip muxing video.');
} }
// mergers
if(!argv.mp4 && !mergerBin.MKVmerge){
console.log('[WARN] MKVMerge not found...');
}
if(!mergerBin.MKVmerge && !mergerBin.FFmpeg || argv.mp4 && !mergerBin.MKVmerge){
console.log('[WARN] FFmpeg not found...');
}
const ffext = !argv.mp4 ? 'mkv' : 'mp4'; const ffext = !argv.mp4 ? 'mkv' : 'mp4';
const mergeInstance = new merger({ const mergeInstance = new merger({
@ -747,7 +739,7 @@ async function downloadStreams(epsiode: FunimationMediaDownload){
skipSubMux: argv.skipSubMux skipSubMux: argv.skipSubMux
}); });
if(!argv.mp4 && mergerBin.MKVmerge){ if(mergerBin.MKVmerge){
const command = mergeInstance.MkvMerge(); const command = mergeInstance.MkvMerge();
shlp.exec('mkvmerge', `"${mergerBin.MKVmerge}"`, command); shlp.exec('mkvmerge', `"${mergerBin.MKVmerge}"`, command);
} }

View file

@ -196,6 +196,7 @@ class Merger {
} }
if (this.options.fonts && this.options.fonts.length > 0) { if (this.options.fonts && this.options.fonts.length > 0) {
for (const f of this.options.fonts) { for (const f of this.options.fonts) {
console.log(f.path);
args.push('--attachment-name', f.name); args.push('--attachment-name', f.name);
args.push('--attachment-mime-type', f.mime); args.push('--attachment-mime-type', f.mime);
args.push('--attach-file', f.path); args.push('--attach-file', f.path);
@ -212,24 +213,25 @@ class Merger {
public static checkMerger(bin: { public static checkMerger(bin: {
mkvmerge?: string, mkvmerge?: string,
ffmpeg?: string ffmpeg?: string
}, useMP4format: boolean) { }, useMP4format: boolean) : {
const merger: { MKVmerge?: string,
MKVmerge: undefined|string|false, FFmpeg?: string
FFmpeg: undefined|string|false } {
} = { if (useMP4format && bin.ffmpeg) {
MKVmerge: bin.mkvmerge, return {
FFmpeg: bin.ffmpeg, FFmpeg: bin.ffmpeg
}; }
if( !useMP4format && !merger.MKVmerge ){ } else if (!useMP4format && (bin.mkvmerge || bin.ffmpeg)) {
console.log('[WARN] MKVMerge not found, skip using this...'); return {
merger.MKVmerge = false; MKVmerge: bin.mkvmerge,
FFmpeg: bin.ffmpeg
}
} else if (useMP4format) {
console.log('[WARN] FFmpeg not found, skip muxing...');
} else if (!bin.mkvmerge) {
console.log('[WARN] MKVMerge not found, skip muxing...');
} }
if( !merger.MKVmerge && !merger.FFmpeg || useMP4format && !merger.FFmpeg ){ return {};
console.log('[WARN] FFmpeg not found, skip using this...');
merger.FFmpeg = false;
}
return merger;
} }
public static makeFontsList (fontsDir: string, subs: { public static makeFontsList (fontsDir: string, subs: {