This commit is contained in:
HaveAGitGat 2019-09-26 07:56:25 +01:00 committed by GitHub
parent 0b3e23f116
commit 5da3c88a1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,127 +84,14 @@ 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', // {
// _id: 'C:/Users/H/Desktop/Test Input1/Sample.mp4',
// DB: 'ZRPDmnmpyuAEQi7nG', // DB: 'ZRPDmnmpyuAEQi7nG',
// HealthCheck: 'Not attempted', // HealthCheck: 'Not attempted',
// TranscodeDecisionMaker: 'Not attempted', // TranscodeDecisionMaker: 'Not attempted',
// bit_rate: 1689273.6, // bit_rate: 1690430.4,
// container: 'mp4', // container: 'mp4',
// createdAt: 2019-09-25T21:28:36.411Z, // createdAt: 2019-09-26T06:46:31.929Z,
// ffProbeData: { streams: [ [Object], [Object] ] },
// ffProbeRead: 'success',
// file: 'C:/Users/H/Desktop/Test Input1/SampleVideo.mp4',
// fileMedium: 'video',
// file_size: 1.055796,
// meta:
// { SourceFile: 'C:/Users/H/Desktop/Test Input1/SampleVideo.mp4',
// errors: [],
// Duration: 5.312,
// PreviewDuration: 0,
// SelectionDuration: 0,
// TrackDuration: 5.28,
// MediaDuration: 5.312,
// ExifToolVersion: 11.65,
// FileName: 'SampleVideo.mp4',
// Directory: 'C:/Users/H/Desktop/Test Input1',
// FileSize: '1031 kB',
// FileModifyDate:
// { year: 2019,
// month: 9,
// day: 25,
// hour: 22,
// minute: 24,
// second: 13,
// millisecond: 0,
// tzoffsetMinutes: 60,
// rawValue: '2019:09:25 22:24:13+01:00' },
// FileAccessDate:
// { year: 2019,
// month: 9,
// day: 25,
// hour: 22,
// minute: 24,
// second: 13,
// millisecond: 0,
// tzoffsetMinutes: 60,
// rawValue: '2019:09:25 22:24:13+01:00' },
// 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' }
// { _id: 'C:/Users/H/Desktop/Test Input1/SampleVideo.mp4',
// DB: 'ZRPDmnmpyuAEQi7nG',
// HealthCheck: 'Not attempted',
// TranscodeDecisionMaker: 'Not attempted',
// bit_rate: 1689273.6,
// container: 'mp4',
// createdAt: 2019-09-25T21:28:36.411Z,
// ffProbeData: // ffProbeData:
// { streams: // { streams:
// [ { index: 0, // [ { index: 0,
@ -251,7 +138,10 @@ module.exports.plugin = plugin;
// clean_effects: 0, // clean_effects: 0,
// attached_pic: 0, // attached_pic: 0,
// timed_thumbnails: 0 }, // timed_thumbnails: 0 },
// tags: { language: 'und', handler_name: 'VideoHandler' } }, // tags:
// { creation_time: '1970-01-01T00:00:00.000000Z',
// language: 'und',
// handler_name: 'VideoHandler' } },
// { index: 1, // { index: 1,
// codec_name: 'aac', // codec_name: 'aac',
// codec_long_name: 'AAC (Advanced Audio Coding)', // codec_long_name: 'AAC (Advanced Audio Coding)',
@ -273,7 +163,7 @@ module.exports.plugin = plugin;
// duration_ts: 254976, // duration_ts: 254976,
// duration: '5.312000', // duration: '5.312000',
// bit_rate: '384828', // bit_rate: '384828',
// max_bit_rate: '384828', // max_bit_rate: '400392',
// nb_frames: '249', // nb_frames: '249',
// disposition: // disposition:
// { default: 1, // { default: 1,
@ -288,13 +178,16 @@ module.exports.plugin = plugin;
// clean_effects: 0, // clean_effects: 0,
// attached_pic: 0, // attached_pic: 0,
// timed_thumbnails: 0 }, // timed_thumbnails: 0 },
// tags: { language: 'und', handler_name: 'SoundHandler' } } ] }, // tags:
// { creation_time: '1970-01-01T00:00:00.000000Z',
// language: 'und',
// handler_name: 'SoundHandler' } } ] },
// ffProbeRead: 'success', // ffProbeRead: 'success',
// file: 'C:/Users/H/Desktop/Test Input1/SampleVideo.mp4', // file: 'C:/Users/H/Desktop/Test Input1/Sample.mp4',
// fileMedium: 'video', // fileMedium: 'video',
// file_size: 1.055796, // file_size: 1.056519,
// meta: // meta:
// { SourceFile: 'C:/Users/H/Desktop/Test Input1/SampleVideo.mp4', // { SourceFile: 'C:/Users/H/Desktop/Test Input1/Sample.mp4',
// errors: [], // errors: [],
// Duration: 5.312, // Duration: 5.312,
// PreviewDuration: 0, // PreviewDuration: 0,
@ -302,39 +195,39 @@ module.exports.plugin = plugin;
// TrackDuration: 5.28, // TrackDuration: 5.28,
// MediaDuration: 5.312, // MediaDuration: 5.312,
// ExifToolVersion: 11.65, // ExifToolVersion: 11.65,
// FileName: 'SampleVideo.mp4', // FileName: 'Sample.mp4',
// Directory: 'C:/Users/H/Desktop/Test Input1', // Directory: 'C:/Users/H/Desktop/Test Input1',
// FileSize: '1031 kB', // FileSize: '1032 kB',
// FileModifyDate: // FileModifyDate:
// { year: 2019, // { year: 2019,
// month: 9, // month: 9,
// day: 25, // day: 24,
// hour: 22, // hour: 7,
// minute: 24, // minute: 24,
// second: 13, // second: 22,
// millisecond: 0, // millisecond: 0,
// tzoffsetMinutes: 60, // tzoffsetMinutes: 60,
// rawValue: '2019:09:25 22:24:13+01:00' }, // rawValue: '2019:09:24 07:24:22+01:00' },
// FileAccessDate: // FileAccessDate:
// { year: 2019, // { year: 2019,
// month: 9, // month: 9,
// day: 25, // day: 26,
// hour: 22, // hour: 7,
// minute: 24, // minute: 44,
// second: 13, // second: 30,
// millisecond: 0, // millisecond: 0,
// tzoffsetMinutes: 60, // tzoffsetMinutes: 60,
// rawValue: '2019:09:25 22:24:13+01:00' }, // rawValue: '2019:09:26 07:44:30+01:00' },
// FileCreateDate: // FileCreateDate:
// { year: 2019, // { year: 2019,
// month: 9, // month: 9,
// day: 25, // day: 26,
// hour: 22, // hour: 7,
// minute: 23, // minute: 44,
// second: 18, // second: 30,
// millisecond: 0, // millisecond: 0,
// tzoffsetMinutes: 60, // tzoffsetMinutes: 60,
// rawValue: '2019:09:25 22:23:18+01:00' }, // rawValue: '2019:09:26 07:44:30+01:00' },
// FilePermissions: 'rw-rw-rw-', // FilePermissions: 'rw-rw-rw-',
// FileType: 'MP4', // FileType: 'MP4',
// FileTypeExtension: 'mp4', // FileTypeExtension: 'mp4',
@ -342,11 +235,27 @@ module.exports.plugin = plugin;
// MajorBrand: 'MP4 Base Media v1 [IS0 14496-12:2003]', // MajorBrand: 'MP4 Base Media v1 [IS0 14496-12:2003]',
// MinorVersion: '0.2.0', // MinorVersion: '0.2.0',
// CompatibleBrands: [ 'isom', 'iso2', 'avc1', 'mp41' ], // CompatibleBrands: [ 'isom', 'iso2', 'avc1', 'mp41' ],
// MovieDataSize: 1051459, // MovieDataSize: 0,
// MovieDataOffset: 48, // MovieDataOffset: 1051515,
// MovieHeaderVersion: 0, // MovieHeaderVersion: 0,
// CreateDate: '0000:00:00 00:00:00', // CreateDate:
// ModifyDate: '0000:00:00 00:00:00', // { year: 1970,
// month: 1,
// day: 8,
// hour: 0,
// minute: 0,
// second: 0,
// millisecond: 0,
// rawValue: '1970:01:08 00:00:00' },
// ModifyDate:
// { year: 2014,
// month: 7,
// day: 19,
// hour: 17,
// minute: 15,
// second: 29,
// millisecond: 0,
// rawValue: '2014:07:19 17:15:29' },
// TimeScale: 1000, // TimeScale: 1000,
// PreferredRate: 1, // PreferredRate: 1,
// PreferredVolume: '100.00%', // PreferredVolume: '100.00%',
@ -371,7 +280,6 @@ module.exports.plugin = plugin;
// XResolution: 72, // XResolution: 72,
// YResolution: 72, // YResolution: 72,
// BitDepth: 24, // BitDepth: 24,
// PixelAspectRatio: '1:1',
// VideoFrameRate: 25, // VideoFrameRate: 25,
// MatrixStructure: '1 0 0 0 1 0 0 0 1', // MatrixStructure: '1 0 0 0 1 0 0 0 1',
// MediaHeaderVersion: 0, // MediaHeaderVersion: 0,
@ -387,7 +295,29 @@ module.exports.plugin = plugin;
// AudioSampleRate: 48000, // AudioSampleRate: 48000,
// HandlerType: 'Metadata', // HandlerType: 'Metadata',
// HandlerVendorID: 'Apple', // HandlerVendorID: 'Apple',
// Encoder: 'Lavf58.24.101', // Encoder: 'Lavf53.24.2',
// Title: 'Sample title test',
// Composer: 'th',
// BeatsPerMinute: '',
// ContentCreateDate: 2018,
// Genre: 'this',
// Artist: 'hhj',
// Comment: 'hhk',
// Subtitle: 'jj',
// Mood: 'lik',
// ContentDistributor: 'cont',
// Conductor: 'jo',
// Writer: 'writ',
// InitialKey: 'ho',
// Producer: 'prod',
// ParentalRating: 'par',
// Director: 'dir',
// Period: 'pol',
// Publisher: 'pub',
// PromotionURL: 'prom',
// AuthorURL: 'auth',
// EncodedBy: 'enc',
// Category: 'h',
// ImageSize: '1280x720', // ImageSize: '1280x720',
// Megapixels: 0.922, // Megapixels: 0.922,
// AvgBitrate: '1.58 Mbps', // AvgBitrate: '1.58 Mbps',