make-only-subtitle-default
HaveAGitGat 6 years ago committed by GitHub
parent 0b3e23f116
commit 5da3c88a1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -23,7 +23,7 @@ function plugin(file) {
var response = { var response = {
processFile: false, //If set to false, the file will be skipped. Set to true to have the file transcoded. processFile: false, //If set to false, the file will be skipped. Set to true to have the file transcoded.
preset: '', //HandBrake/FFmpeg CLI aguments you'd like to use. preset: '', //HandBrake/FFmpeg CLI arguments you'd like to use.
//For FFmpeg, the input arguments come first followed by a comma, followed by the output argument. //For FFmpeg, the input arguments come first followed by a comma, followed by the output argument.
// Examples // Examples
//HandBrake //HandBrake
@ -84,314 +84,244 @@ module.exports.details = details;
module.exports.plugin = plugin; module.exports.plugin = plugin;
//Example file object: //Example file object:
// { _id: 'C:/Users/H/Desktop/Test Input1/SampleVideo.mp4', // {
// DB: 'ZRPDmnmpyuAEQi7nG', // _id: 'C:/Users/H/Desktop/Test Input1/Sample.mp4',
// HealthCheck: 'Not attempted', // DB: 'ZRPDmnmpyuAEQi7nG',
// TranscodeDecisionMaker: 'Not attempted', // HealthCheck: 'Not attempted',
// bit_rate: 1689273.6, // TranscodeDecisionMaker: 'Not attempted',
// container: 'mp4', // bit_rate: 1690430.4,
// createdAt: 2019-09-25T21:28:36.411Z, // container: 'mp4',
// ffProbeData: { streams: [ [Object], [Object] ] }, // createdAt: 2019-09-26T06:46:31.929Z,
// ffProbeRead: 'success', // ffProbeData:
// file: 'C:/Users/H/Desktop/Test Input1/SampleVideo.mp4', // { streams:
// fileMedium: 'video', // [ { index: 0,
// file_size: 1.055796, // codec_name: 'h264',
// meta: // codec_long_name: 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10',
// { SourceFile: 'C:/Users/H/Desktop/Test Input1/SampleVideo.mp4', // profile: 'Main',
// errors: [], // codec_type: 'video',
// Duration: 5.312, // codec_time_base: '1/50',
// PreviewDuration: 0, // codec_tag_string: 'avc1',
// SelectionDuration: 0, // codec_tag: '0x31637661',
// TrackDuration: 5.28, // width: 1280,
// MediaDuration: 5.312, // height: 720,
// ExifToolVersion: 11.65, // coded_width: 1280,
// FileName: 'SampleVideo.mp4', // coded_height: 720,
// Directory: 'C:/Users/H/Desktop/Test Input1', // has_b_frames: 0,
// FileSize: '1031 kB', // sample_aspect_ratio: '1:1',
// FileModifyDate: // display_aspect_ratio: '16:9',
// { year: 2019, // pix_fmt: 'yuv420p',
// month: 9, // level: 31,
// day: 25, // chroma_location: 'left',
// hour: 22, // refs: 1,
// minute: 24, // is_avc: 'true',
// second: 13, // nal_length_size: '4',
// millisecond: 0, // r_frame_rate: '25/1',
// tzoffsetMinutes: 60, // avg_frame_rate: '25/1',
// rawValue: '2019:09:25 22:24:13+01:00' }, // time_base: '1/12800',
// FileAccessDate: // start_pts: 0,
// { year: 2019, // start_time: '0.000000',
// month: 9, // duration_ts: 67584,
// day: 25, // duration: '5.280000',
// hour: 22, // bit_rate: '1205959',
// minute: 24, // bits_per_raw_sample: '8',
// second: 13, // nb_frames: '132',
// millisecond: 0, // disposition:
// tzoffsetMinutes: 60, // { default: 1,
// rawValue: '2019:09:25 22:24:13+01:00' }, // dub: 0,
// FileCreateDate: // original: 0,
// { year: 2019, // comment: 0,
// month: 9, // lyrics: 0,
// day: 25, // karaoke: 0,
// hour: 22, // forced: 0,
// minute: 23, // hearing_impaired: 0,
// second: 18, // visual_impaired: 0,
// millisecond: 0, // clean_effects: 0,
// tzoffsetMinutes: 60, // attached_pic: 0,
// rawValue: '2019:09:25 22:23:18+01:00' }, // timed_thumbnails: 0 },
// FilePermissions: 'rw-rw-rw-', // tags:
// FileType: 'MP4', // { creation_time: '1970-01-01T00:00:00.000000Z',
// FileTypeExtension: 'mp4', // language: 'und',
// MIMEType: 'video/mp4', // handler_name: 'VideoHandler' } },
// MajorBrand: 'MP4 Base Media v1 [IS0 14496-12:2003]', // { index: 1,
// MinorVersion: '0.2.0', // codec_name: 'aac',
// CompatibleBrands: [ 'isom', 'iso2', 'avc1', 'mp41' ], // codec_long_name: 'AAC (Advanced Audio Coding)',
// MovieDataSize: 1051459, // profile: 'LC',
// MovieDataOffset: 48, // codec_type: 'audio',
// MovieHeaderVersion: 0, // codec_time_base: '1/48000',
// CreateDate: '0000:00:00 00:00:00', // codec_tag_string: 'mp4a',
// ModifyDate: '0000:00:00 00:00:00', // codec_tag: '0x6134706d',
// TimeScale: 1000, // sample_fmt: 'fltp',
// PreferredRate: 1, // sample_rate: '48000',
// PreferredVolume: '100.00%', // channels: 6,
// PreviewTime: '0 s', // channel_layout: '5.1',
// PosterTime: '0 s', // bits_per_sample: 0,
// SelectionTime: '0 s', // r_frame_rate: '0/0',
// CurrentTime: '0 s', // avg_frame_rate: '0/0',
// NextTrackID: 3, // time_base: '1/48000',
// TrackHeaderVersion: 0, // start_pts: 0,
// TrackCreateDate: '0000:00:00 00:00:00', // start_time: '0.000000',
// TrackModifyDate: '0000:00:00 00:00:00', // duration_ts: 254976,
// TrackID: 1, // duration: '5.312000',
// TrackLayer: 0, // bit_rate: '384828',
// TrackVolume: '0.00%', // max_bit_rate: '400392',
// ImageWidth: 1280, // nb_frames: '249',
// ImageHeight: 720, // disposition:
// GraphicsMode: 'srcCopy', // { default: 1,
// OpColor: '0 0 0', // dub: 0,
// CompressorID: 'avc1', // original: 0,
// SourceImageWidth: 1280, // comment: 0,
// SourceImageHeight: 720, // lyrics: 0,
// XResolution: 72, // karaoke: 0,
// YResolution: 72, // forced: 0,
// BitDepth: 24, // hearing_impaired: 0,
// PixelAspectRatio: '1:1', // visual_impaired: 0,
// VideoFrameRate: 25, // clean_effects: 0,
// MatrixStructure: '1 0 0 0 1 0 0 0 1', // attached_pic: 0,
// MediaHeaderVersion: 0, // timed_thumbnails: 0 },
// MediaCreateDate: '0000:00:00 00:00:00', // tags:
// MediaModifyDate: '0000:00:00 00:00:00', // { creation_time: '1970-01-01T00:00:00.000000Z',
// MediaTimeScale: 48000, // language: 'und',
// MediaLanguageCode: 'und', // handler_name: 'SoundHandler' } } ] },
// HandlerDescription: 'SoundHandler', // ffProbeRead: 'success',
// Balance: 0, // file: 'C:/Users/H/Desktop/Test Input1/Sample.mp4',
// AudioFormat: 'mp4a', // fileMedium: 'video',
// AudioChannels: 2, // file_size: 1.056519,
// AudioBitsPerSample: 16, // meta:
// AudioSampleRate: 48000, // { SourceFile: 'C:/Users/H/Desktop/Test Input1/Sample.mp4',
// HandlerType: 'Metadata', // errors: [],
// HandlerVendorID: 'Apple', // Duration: 5.312,
// Encoder: 'Lavf58.24.101', // PreviewDuration: 0,
// ImageSize: '1280x720', // SelectionDuration: 0,
// Megapixels: 0.922, // TrackDuration: 5.28,
// AvgBitrate: '1.58 Mbps', // MediaDuration: 5.312,
// Rotation: 0 }, // ExifToolVersion: 11.65,
// processingStatus: false, // FileName: 'Sample.mp4',
// video_codec_name: 'h264', // Directory: 'C:/Users/H/Desktop/Test Input1',
// video_resolution: '720p' } // FileSize: '1032 kB',
// { _id: 'C:/Users/H/Desktop/Test Input1/SampleVideo.mp4', // FileModifyDate:
// DB: 'ZRPDmnmpyuAEQi7nG', // { year: 2019,
// HealthCheck: 'Not attempted', // month: 9,
// TranscodeDecisionMaker: 'Not attempted', // day: 24,
// bit_rate: 1689273.6, // hour: 7,
// container: 'mp4', // minute: 24,
// createdAt: 2019-09-25T21:28:36.411Z, // second: 22,
// ffProbeData: // millisecond: 0,
// { streams: // tzoffsetMinutes: 60,
// [ { index: 0, // rawValue: '2019:09:24 07:24:22+01:00' },
// codec_name: 'h264', // FileAccessDate:
// codec_long_name: 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10', // { year: 2019,
// profile: 'Main', // month: 9,
// codec_type: 'video', // day: 26,
// codec_time_base: '1/50', // hour: 7,
// codec_tag_string: 'avc1', // minute: 44,
// codec_tag: '0x31637661', // second: 30,
// width: 1280, // millisecond: 0,
// height: 720, // tzoffsetMinutes: 60,
// coded_width: 1280, // rawValue: '2019:09:26 07:44:30+01:00' },
// coded_height: 720, // FileCreateDate:
// has_b_frames: 0, // { year: 2019,
// sample_aspect_ratio: '1:1', // month: 9,
// display_aspect_ratio: '16:9', // day: 26,
// pix_fmt: 'yuv420p', // hour: 7,
// level: 31, // minute: 44,
// chroma_location: 'left', // second: 30,
// refs: 1, // millisecond: 0,
// is_avc: 'true', // tzoffsetMinutes: 60,
// nal_length_size: '4', // rawValue: '2019:09:26 07:44:30+01:00' },
// r_frame_rate: '25/1', // FilePermissions: 'rw-rw-rw-',
// avg_frame_rate: '25/1', // FileType: 'MP4',
// time_base: '1/12800', // FileTypeExtension: 'mp4',
// start_pts: 0, // MIMEType: 'video/mp4',
// start_time: '0.000000', // MajorBrand: 'MP4 Base Media v1 [IS0 14496-12:2003]',
// duration_ts: 67584, // MinorVersion: '0.2.0',
// duration: '5.280000', // CompatibleBrands: [ 'isom', 'iso2', 'avc1', 'mp41' ],
// bit_rate: '1205959', // MovieDataSize: 0,
// bits_per_raw_sample: '8', // MovieDataOffset: 1051515,
// nb_frames: '132', // MovieHeaderVersion: 0,
// disposition: // CreateDate:
// { default: 1, // { year: 1970,
// dub: 0, // month: 1,
// original: 0, // day: 8,
// comment: 0, // hour: 0,
// lyrics: 0, // minute: 0,
// karaoke: 0, // second: 0,
// forced: 0, // millisecond: 0,
// hearing_impaired: 0, // rawValue: '1970:01:08 00:00:00' },
// visual_impaired: 0, // ModifyDate:
// clean_effects: 0, // { year: 2014,
// attached_pic: 0, // month: 7,
// timed_thumbnails: 0 }, // day: 19,
// tags: { language: 'und', handler_name: 'VideoHandler' } }, // hour: 17,
// { index: 1, // minute: 15,
// codec_name: 'aac', // second: 29,
// codec_long_name: 'AAC (Advanced Audio Coding)', // millisecond: 0,
// profile: 'LC', // rawValue: '2014:07:19 17:15:29' },
// codec_type: 'audio', // TimeScale: 1000,
// codec_time_base: '1/48000', // PreferredRate: 1,
// codec_tag_string: 'mp4a', // PreferredVolume: '100.00%',
// codec_tag: '0x6134706d', // PreviewTime: '0 s',
// sample_fmt: 'fltp', // PosterTime: '0 s',
// sample_rate: '48000', // SelectionTime: '0 s',
// channels: 6, // CurrentTime: '0 s',
// channel_layout: '5.1', // NextTrackID: 3,
// bits_per_sample: 0, // TrackHeaderVersion: 0,
// r_frame_rate: '0/0', // TrackCreateDate: '0000:00:00 00:00:00',
// avg_frame_rate: '0/0', // TrackModifyDate: '0000:00:00 00:00:00',
// time_base: '1/48000', // TrackID: 1,
// start_pts: 0, // TrackLayer: 0,
// start_time: '0.000000', // TrackVolume: '0.00%',
// duration_ts: 254976, // ImageWidth: 1280,
// duration: '5.312000', // ImageHeight: 720,
// bit_rate: '384828', // GraphicsMode: 'srcCopy',
// max_bit_rate: '384828', // OpColor: '0 0 0',
// nb_frames: '249', // CompressorID: 'avc1',
// disposition: // SourceImageWidth: 1280,
// { default: 1, // SourceImageHeight: 720,
// dub: 0, // XResolution: 72,
// original: 0, // YResolution: 72,
// comment: 0, // BitDepth: 24,
// lyrics: 0, // VideoFrameRate: 25,
// karaoke: 0, // MatrixStructure: '1 0 0 0 1 0 0 0 1',
// forced: 0, // MediaHeaderVersion: 0,
// hearing_impaired: 0, // MediaCreateDate: '0000:00:00 00:00:00',
// visual_impaired: 0, // MediaModifyDate: '0000:00:00 00:00:00',
// clean_effects: 0, // MediaTimeScale: 48000,
// attached_pic: 0, // MediaLanguageCode: 'und',
// timed_thumbnails: 0 }, // HandlerDescription: 'SoundHandler',
// tags: { language: 'und', handler_name: 'SoundHandler' } } ] }, // Balance: 0,
// ffProbeRead: 'success', // AudioFormat: 'mp4a',
// file: 'C:/Users/H/Desktop/Test Input1/SampleVideo.mp4', // AudioChannels: 2,
// fileMedium: 'video', // AudioBitsPerSample: 16,
// file_size: 1.055796, // AudioSampleRate: 48000,
// meta: // HandlerType: 'Metadata',
// { SourceFile: 'C:/Users/H/Desktop/Test Input1/SampleVideo.mp4', // HandlerVendorID: 'Apple',
// errors: [], // Encoder: 'Lavf53.24.2',
// Duration: 5.312, // Title: 'Sample title test',
// PreviewDuration: 0, // Composer: 'th',
// SelectionDuration: 0, // BeatsPerMinute: '',
// TrackDuration: 5.28, // ContentCreateDate: 2018,
// MediaDuration: 5.312, // Genre: 'this',
// ExifToolVersion: 11.65, // Artist: 'hhj',
// FileName: 'SampleVideo.mp4', // Comment: 'hhk',
// Directory: 'C:/Users/H/Desktop/Test Input1', // Subtitle: 'jj',
// FileSize: '1031 kB', // Mood: 'lik',
// FileModifyDate: // ContentDistributor: 'cont',
// { year: 2019, // Conductor: 'jo',
// month: 9, // Writer: 'writ',
// day: 25, // InitialKey: 'ho',
// hour: 22, // Producer: 'prod',
// minute: 24, // ParentalRating: 'par',
// second: 13, // Director: 'dir',
// millisecond: 0, // Period: 'pol',
// tzoffsetMinutes: 60, // Publisher: 'pub',
// rawValue: '2019:09:25 22:24:13+01:00' }, // PromotionURL: 'prom',
// FileAccessDate: // AuthorURL: 'auth',
// { year: 2019, // EncodedBy: 'enc',
// month: 9, // Category: 'h',
// day: 25, // ImageSize: '1280x720',
// hour: 22, // Megapixels: 0.922,
// minute: 24, // AvgBitrate: '1.58 Mbps',
// second: 13, // Rotation: 0 },
// millisecond: 0, // processingStatus: false,
// tzoffsetMinutes: 60, // video_codec_name: 'h264',
// rawValue: '2019:09:25 22:24:13+01:00' }, // video_resolution: '720p' }
// FileCreateDate:
// { year: 2019,
// month: 9,
// day: 25,
// hour: 22,
// minute: 23,
// second: 18,
// millisecond: 0,
// tzoffsetMinutes: 60,
// rawValue: '2019:09:25 22:23:18+01:00' },
// FilePermissions: 'rw-rw-rw-',
// FileType: 'MP4',
// FileTypeExtension: 'mp4',
// MIMEType: 'video/mp4',
// MajorBrand: 'MP4 Base Media v1 [IS0 14496-12:2003]',
// MinorVersion: '0.2.0',
// CompatibleBrands: [ 'isom', 'iso2', 'avc1', 'mp41' ],
// MovieDataSize: 1051459,
// MovieDataOffset: 48,
// MovieHeaderVersion: 0,
// CreateDate: '0000:00:00 00:00:00',
// ModifyDate: '0000:00:00 00:00:00',
// TimeScale: 1000,
// PreferredRate: 1,
// PreferredVolume: '100.00%',
// PreviewTime: '0 s',
// PosterTime: '0 s',
// SelectionTime: '0 s',
// CurrentTime: '0 s',
// NextTrackID: 3,
// TrackHeaderVersion: 0,
// TrackCreateDate: '0000:00:00 00:00:00',
// TrackModifyDate: '0000:00:00 00:00:00',
// TrackID: 1,
// TrackLayer: 0,
// TrackVolume: '0.00%',
// ImageWidth: 1280,
// ImageHeight: 720,
// GraphicsMode: 'srcCopy',
// OpColor: '0 0 0',
// CompressorID: 'avc1',
// SourceImageWidth: 1280,
// SourceImageHeight: 720,
// XResolution: 72,
// YResolution: 72,
// BitDepth: 24,
// PixelAspectRatio: '1:1',
// VideoFrameRate: 25,
// MatrixStructure: '1 0 0 0 1 0 0 0 1',
// MediaHeaderVersion: 0,
// MediaCreateDate: '0000:00:00 00:00:00',
// MediaModifyDate: '0000:00:00 00:00:00',
// MediaTimeScale: 48000,
// MediaLanguageCode: 'und',
// HandlerDescription: 'SoundHandler',
// Balance: 0,
// AudioFormat: 'mp4a',
// AudioChannels: 2,
// AudioBitsPerSample: 16,
// AudioSampleRate: 48000,
// HandlerType: 'Metadata',
// HandlerVendorID: 'Apple',
// Encoder: 'Lavf58.24.101',
// ImageSize: '1280x720',
// Megapixels: 0.922,
// AvgBitrate: '1.58 Mbps',
// Rotation: 0 },
// processingStatus: false,
// video_codec_name: 'h264',
// video_resolution: '720p' }

Loading…
Cancel
Save