Set coustom ffmpeg track title
This commit is contained in:
parent
56b595f05c
commit
a3c324aef5
7 changed files with 25 additions and 9 deletions
6
@types/crunchyTypes.d.ts
vendored
6
@types/crunchyTypes.d.ts
vendored
|
|
@ -18,7 +18,8 @@ export type CrunchyDownloadOptions = {
|
|||
dlsubs: string[],
|
||||
skipsubs: boolean,
|
||||
mp4: boolean,
|
||||
override: string[]
|
||||
override: string[],
|
||||
videoTitle: string
|
||||
}
|
||||
|
||||
export type CurnchyMultiDownload = {
|
||||
|
|
@ -34,7 +35,8 @@ export type CrunchyMuxOptions = {
|
|||
novids?: boolean,
|
||||
mp4: boolean,
|
||||
forceMuxer?: 'ffmpeg'|'mkvmerge',
|
||||
nocleanup?: boolean
|
||||
nocleanup?: boolean,
|
||||
videoTitle: string
|
||||
}
|
||||
|
||||
export type CrunchyEpMeta = {
|
||||
|
|
|
|||
2
@types/messageHandler.d.ts
vendored
2
@types/messageHandler.d.ts
vendored
|
|
@ -83,7 +83,7 @@ export type FuniGetShowData = { id: number, e?: string, but: boolean, all: boole
|
|||
export type FuniGetEpisodeData = { subs: FuniSubsData, fnSlug: FuniEpisodeData, simul?: boolean; dubLang: string[], s: string }
|
||||
export type FuniStreamData = { callbackMaker?: (data: DownloadInfo) => HLSCallback, q: number, x: number, fileName: string, numbers: number, novids?: boolean,
|
||||
timeout: number, partsize: number, fsRetryTime: number, noaudio?: boolean, mp4: boolean, ass: boolean, fontSize: number, fontName?: string, skipmux?: boolean,
|
||||
forceMuxer: AvailableMuxer | undefined, simul: boolean, skipSubMux: boolean, nocleanup: boolean, override: string[] }
|
||||
forceMuxer: AvailableMuxer | undefined, simul: boolean, skipSubMux: boolean, nocleanup: boolean, override: string[], videoTitle: string }
|
||||
export type FuniSubsData = { nosubs?: boolean, sub: boolean, dlsubs: string[] }
|
||||
export type DownloadData = { id: string, e: string, dubLang: string[], fileName: string, q: number }
|
||||
|
||||
|
|
|
|||
|
|
@ -1266,7 +1266,8 @@ export default class Crunchy implements ServiceClass {
|
|||
lang: a.lang,
|
||||
path: a.path,
|
||||
};
|
||||
})
|
||||
}),
|
||||
videoTitle: options.videoTitle
|
||||
});
|
||||
const bin = Merger.checkMerger(this.cfg.bin, options.mp4, options.forceMuxer);
|
||||
// collect fonts info
|
||||
|
|
|
|||
3
funi.ts
3
funi.ts
|
|
@ -812,7 +812,8 @@ export default class Funi implements ServiceClass {
|
|||
}),
|
||||
videoAndAudio: audioAndVideo,
|
||||
simul: data.simul,
|
||||
skipSubMux: data.skipSubMux
|
||||
skipSubMux: data.skipSubMux,
|
||||
videoTitle: data.videoTitle
|
||||
});
|
||||
|
||||
if(mergerBin.MKVmerge){
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import yargs, { Choices } from 'yargs';
|
||||
import { args, AvailableMuxer, groups } from './module.args';
|
||||
|
||||
let argvC: { [x: string]: unknown; override: string[], fsRetryTime: number, forceMuxer: AvailableMuxer|undefined; username: string|undefined, password: string|undefined, silentAuth: boolean, skipSubMux: boolean, downloadArchive: boolean, addArchive: boolean, but: boolean, auth: boolean | undefined; dlFonts: boolean | undefined; search: string | undefined; 'search-type': string; page: number | undefined; 'search-locale': string; new: boolean | undefined; 'movie-listing': string | undefined; series: string | undefined; s: string | undefined; e: string | undefined; q: number; x: number; kstream: number; partsize: number; hslang: string; dlsubs: string[]; novids: boolean | undefined; noaudio: boolean | undefined; nosubs: boolean | undefined; dubLang: string[]; all: boolean; fontSize: number; allDubs: boolean; timeout: number; simul: boolean; mp4: boolean; skipmux: boolean | undefined; fileName: string; numbers: number; nosess: string; debug: boolean | undefined; nocleanup: boolean; help: boolean | undefined; service: 'funi' | 'crunchy'; update: boolean; fontName: string | undefined; _: (string | number)[]; $0: string; };
|
||||
let argvC: { [x: string]: unknown; videoTitle: string, override: string[], fsRetryTime: number, forceMuxer: AvailableMuxer|undefined; username: string|undefined, password: string|undefined, silentAuth: boolean, skipSubMux: boolean, downloadArchive: boolean, addArchive: boolean, but: boolean, auth: boolean | undefined; dlFonts: boolean | undefined; search: string | undefined; 'search-type': string; page: number | undefined; 'search-locale': string; new: boolean | undefined; 'movie-listing': string | undefined; series: string | undefined; s: string | undefined; e: string | undefined; q: number; x: number; kstream: number; partsize: number; hslang: string; dlsubs: string[]; novids: boolean | undefined; noaudio: boolean | undefined; nosubs: boolean | undefined; dubLang: string[]; all: boolean; fontSize: number; allDubs: boolean; timeout: number; simul: boolean; mp4: boolean; skipmux: boolean | undefined; fileName: string; numbers: number; nosess: string; debug: boolean | undefined; nocleanup: boolean; help: boolean | undefined; service: 'funi' | 'crunchy'; update: boolean; fontName: string | undefined; _: (string | number)[]; $0: string; };
|
||||
|
||||
export type ArgvType = typeof argvC;
|
||||
|
||||
|
|
|
|||
|
|
@ -574,10 +574,20 @@ const args: TAppArg<boolean|number|string|unknown[]>[] = [
|
|||
group: 'fileName',
|
||||
service: 'both',
|
||||
type: 'array',
|
||||
usage: '--override "toOverride=\'VALUE\'"',
|
||||
usage: '"${toOverride}=\'${value}\'"',
|
||||
default: {
|
||||
default: [ ]
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'videoTitle',
|
||||
describe: 'Set the video track name of the merged file\nFFmpeg only',
|
||||
docDescribe: true,
|
||||
group: 'mux',
|
||||
service: 'both',
|
||||
type: 'string',
|
||||
usage: '${title}',
|
||||
default: 'Video Track',
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ export type MergerOptions = {
|
|||
onlyAudio: MergerInput[],
|
||||
subtitles: SubtitleInput[],
|
||||
output: string,
|
||||
videoTitle: string,
|
||||
simul?: boolean,
|
||||
fonts?: ParsedFont[],
|
||||
skipSubMux?: boolean,
|
||||
|
|
@ -43,6 +44,7 @@ class Merger {
|
|||
constructor(private options: MergerOptions) {
|
||||
if (this.options.skipSubMux)
|
||||
this.options.subtitles = [];
|
||||
this.options.videoTitle = this.options.videoTitle.replace(/\"/g, '\'');
|
||||
}
|
||||
|
||||
public FFmpeg() : string {
|
||||
|
|
@ -58,7 +60,7 @@ class Merger {
|
|||
if (!hasVideo) {
|
||||
metaData.push(`-map ${index}:a -map ${index}:v`);
|
||||
metaData.push(`-metadata:s:a:${audioIndex} language=${vid.lang.code}`);
|
||||
metaData.push(`-metadata:s:v:${index} title="[Video Stream]"`);
|
||||
metaData.push(`-metadata:s:v:${index} title="${this.options.videoTitle}"`);
|
||||
hasVideo = true;
|
||||
} else {
|
||||
metaData.push(`-map ${index}:a`);
|
||||
|
|
@ -72,7 +74,7 @@ class Merger {
|
|||
if (!hasVideo) {
|
||||
args.push(`-i "${vid.path}"`);
|
||||
metaData.push(`-map ${index} -map -${index}:a`);
|
||||
metaData.push(`-metadata:s:v:${index} title="[Video Stream]"`);
|
||||
metaData.push(`-metadata:s:v:${index} title="${this.options.videoTitle}"`);
|
||||
hasVideo = true;
|
||||
index++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue