From 4d8aa2dc0df4a4b782a9f678789156b79bc96bdd Mon Sep 17 00:00:00 2001 From: Fish2 Date: Thu, 31 Mar 2022 15:28:37 +0100 Subject: [PATCH 001/126] fix title (remove space) (#287) --- Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js b/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js index d9bbcab..f3cfd11 100644 --- a/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js +++ b/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js @@ -6,7 +6,7 @@ const details = () => ({ Type: 'Audio', Operation: 'Transcode', Description: 'This plugin can convert any 2.0 audio track/s to AAC and can create downmixed audio tracks. \n\n', - Version: '2.3', + Version: '2.4', Tags: 'pre-processing,ffmpeg,audio only,configurable', Inputs: [{ name: 'aac_stereo', @@ -114,7 +114,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { && has6Channel === false && file.ffProbeData.streams[i].channels === 8 ) { - ffmpegCommandInsert += `-map 0:${i} -c:a:${audioIdx} ac3 -ac 6 -metadata:s:a:${audioIdx} title="5.1 " `; + ffmpegCommandInsert += `-map 0:${i} -c:a:${audioIdx} ac3 -ac 6 -metadata:s:a:${audioIdx} title="5.1" `; response.infoLog += '☒Audio track is 8 channel, no 6 channel exists. Creating 6 channel from 8 channel. \n'; convert = true; } @@ -124,7 +124,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { && has2Channel === false && file.ffProbeData.streams[i].channels === 6 ) { - ffmpegCommandInsert += `-map 0:${i} -c:a:${audioIdx} aac -ac 2 -metadata:s:a:${audioIdx} title="2.0 " `; + ffmpegCommandInsert += `-map 0:${i} -c:a:${audioIdx} aac -ac 2 -metadata:s:a:${audioIdx} title="2.0" `; response.infoLog += '☒Audio track is 6 channel, no 2 channel exists. Creating 2 channel from 6 channel. \n'; convert = true; } From 75c9ae3e55ceb958068be49119ce7392e2d5721f Mon Sep 17 00:00:00 2001 From: Fish2 Date: Thu, 31 Mar 2022 15:35:10 +0100 Subject: [PATCH 002/126] Add remove a newer image attachment of "gif" (#284) * Add remove a newer image attachment of "gif" * Increment version Co-authored-by: supersnellehenk --- Community/Tdarr_Plugin_MC93_MigzImageRemoval.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js b/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js index 306309f..6768bad 100644 --- a/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js +++ b/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js @@ -5,8 +5,8 @@ const details = () => ({ Name: 'Migz-Remove image formats from file', Type: 'Video', Operation: 'Transcode', - Description: 'Identify any unwanted image formats in the file and remove those streams. MJPEG & PNG \n\n', - Version: '1.3', + Description: 'Identify any unwanted image formats in the file and remove those streams. MJPEG, PNG & GIF \n\n', + Version: '1.4', Tags: 'pre-processing,ffmpeg,video only', Inputs: [], }); @@ -42,10 +42,11 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { for (let i = 0; i < file.ffProbeData.streams.length; i++) { // Check if stream is video. if (file.ffProbeData.streams[i].codec_type.toLowerCase() === 'video') { - // Check if stream codec is mjpeg or png. Remove if so. + // Check if stream codec is mjpeg, png or gif. Remove if so. if ( file.ffProbeData.streams[i].codec_name === 'mjpeg' || file.ffProbeData.streams[i].codec_name === 'png' + || file.ffProbeData.streams[i].codec_name === 'gif' ) { convert = true; extraArguments += `-map -v:${videoIdx} `; From c4707a5ee2538d9e3286635a0371c6d7f743ab2f Mon Sep 17 00:00:00 2001 From: Zach Gelnett Date: Thu, 31 Mar 2022 10:36:14 -0400 Subject: [PATCH 003/126] Fix error with ts files and cleanup (#271) * Fixed the NaN issue with BitRates. Some files had bitrate missing in the MediaInfo data so pulling from the "extra" section for those. Also resolved an issue with the way the findMediaInfoItem function wasn't working with subtitle tracks (well it wasn't working for all files due to the general section because of a previous attempted subtitle fix but this should be much much much better and work in most all cases). * Updating to comply with eslint. Unabe to get stream matching function to work so changed eqeqeq to warning. * Re-add string * parseInt * Merge remote-tracking branch 'refs/remotes/origin/master' * Modified variable names to use the lowerCamelCase naming convetion * Fixed eslint issue * Fixed an out of memory issue that prevented .ts files from being processed by removing the framerate portion of the video filter command when processing a .ts file. Removed a bunch of variables used for building the ffmpeg command and moved the actual strings down to where the logic is used. Reducing plugin file size and variable ussage. Fixed a minor bug related to changing the video height where it would always use the 1080 value rather than using the value used in the input. * Fixed issue with template line. * Removed the commented code. Cleaned up other comments to improve readability. Co-authored-by: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> --- ...Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js | 223 ++++-------------- 1 file changed, 46 insertions(+), 177 deletions(-) diff --git a/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js b/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js index 038ab7a..afa0182 100644 --- a/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js +++ b/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js @@ -7,7 +7,7 @@ /* /// /////////////////////////////////////////////////////////////////////////////////////////////////// Author: JarBinks, Zachg99, Jeff47 -Date: 01/20/2022 +Date: 03/22/2022 This is my attempt to create an all in one routine that will maintain my library in optimal format !!!!FOR MY REQUIREMENTS!!!! Chances are very good you will need to make some changes to this routine and it's partner in order to make it work for you. @@ -61,10 +61,6 @@ Audio: (Only one audio stream is used!!) Transcode the stream to aac using 100% of the original streams bitrate It could probably be less but if the source is of low bitrate but, we don�t want to compromise too much on the transcode -Subtitles: - All are removed?? (TODO: ensure this is correct and mention the flag to keep them if desired) - All are copied (They usually take up little space so I keep them) - Any that are in mov_text will be converted to srt Chapters: If chapters are found the script keeps them unless... Any chapter start time is a negative number (Yes I have seen it) @@ -86,68 +82,7 @@ Subtitles: Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile (JB - H265, AAC, MKV, bitrate optimized) Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix (JB - MKV Stats, Chapters, Audio Language) I am running the docker image provided for Tdarr - ****To get the proper video bitrate you need to run this in the docker container: - apt install mkvtoolnix - If those tools are added that no longer needs to be run. - Here is my docker config (I am running compose so yours might be a little different) - tdarr_server: - container_name: tdarr_server - image: haveagitgat/tdarr:latest - privileged: true - restart: unless-stopped - environment: - - PUID=${PUID} # default user id, defined in .env - - PGID=${PGID} # default group id, defined in .env - - TZ=${TZ} # timezone, defined in .env - - serverIP=tdarr_server #using internal docker networking. This should at least work when the nodes are on - #the same docker compose as the server - - serverPort=8266 - - webUIPort=8265 - volumes: - - ${ROOT}/tdarr/server:/app/server/Tdarr # Tdarr server files - - ${ROOT}/tdarr/configs:/app/configs # config files - can be same as NODE (unless separate server) - - ${ROOT}/tdarr/logs:/app/logs # Tdarr log files - - ${ROOT}/tdarr/cache:/temp # Cache folder, Should be same path mapped on NODE - - ${ROOT}/tdarr/testmedia:/home/Tdarr/testmedia # Should be same path mapped on NODE if using a test folder - - ${ROOT}/tdarr/scripts:/home/Tdarr/scripts # my random way of saving script files - - /volume1/video:/media # video library Should be same path mapped on NODE - ports: - - 8265:8265 #Exposed to access webui externally - - 8266:8266 #Exposed to allow external nodes to reach the server - logging: - options: - max-size: "2m" - max-file: "3" - tdarr_node: - container_name: tdarr_node - image: haveagitgat/tdarr_node:latest - privileged: true - restart: unless-stopped - devices: - - /dev/dri:/dev/dri - environment: - - PUID=${PUID} # default user id, defined in .env - - PGID=${PGID} # default group id, defined in .env - - TZ=${TZ} # timezone, defined in .env - - serverIP=192.168.x.x #container name of the server, should be modified if server is on another machine - - serverPort=8266 - - nodeID=TDARRNODE_1 - - nodeIP=192.168.x.x #container name of the node - - nodePort=9267 #not exposed via a "ports: " setting as the server/node communication is done on the internal - #docker network and can communicate on all ports - volumes: - - ${ROOT}/tdarr/configs:/app/configs # config files - can be same as server (unless separate server) - - ${ROOT}/tdarr/logs:/app/logs # config files - can be same as server (unless separate server) - - ${ROOT}/tdarr/testmedia:/home/Tdarr/testmedia # Should be same path mapped on server if using a test folder - - ${ROOT}/tdarr/scripts:/home/Tdarr/scripts # my random way of saving script files - - ${ROOT}/tdarr/cache:/temp # Cache folder, Should be same path mapped on server - - /mnt/video:/media # video library Should be same path mapped on server - ports: - - 9267:9267 - logging: - options: - max-size: "2m" - max-file: "3" + /// /////////////////////////////////////////////////////////////////////////////////////////////////// */ @@ -159,7 +94,7 @@ const details = () => ({ Operation: 'Transcode', Description: `***You should not use this*** until you read the comments at the top of the code and understand how it works **this does a lot** and is 1 of 2 routines you should to run **Part 1** \n`, - Version: '2.2', + Version: '2.4', Tags: 'pre-processing,ffmpeg,video,audio,qsv,h265,aac', Inputs: [{ name: 'Stats_Days', @@ -348,21 +283,17 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { const targetAudioBitratePerChannel = inputs.Target_Audio_Bitrate_Per_Channel; const targetAudioChannels = inputs.Target_Audio_Channels; - // Subtitles - // const bolIncludeSubs = true; //not currently used, it's possible to remove subs but not setup now /// /////////////////////////////////////////////////////////////////////////////////////////////////// const proc = require('child_process'); let bolStatsAreCurrent = false; - // Check if file is a video. If it isn't then exit plugin. if (file.fileMedium !== 'video') { response.processFile = false; response.infoLog += 'File is not a video. Exiting \n'; return response; } - // If the file has already been processed we dont need to do more if (file.container === 'mkv' && ( file.mediaInfo.track[0].extra !== undefined && file.mediaInfo.track[0].extra.JBDONEVERSION !== undefined @@ -409,10 +340,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } catch (err) { response.infoLog += 'Error Updating Status Probably Bad file, A remux will probably fix, will continue\n'; } - response.infoLog += 'Getting Stats Objects, again!\n'; - // objMedInfo = JSON.parse(proc.execSync('mediainfo "' + currentFileName + '" --output=JSON').toString()); - // objFFProbeInfo = JSON.parse(proc.execSync('ffprobe -v error -print_format json' + - // ' -show_format -show_streams -show_chapters "' + currentFileName + '"').toString()); } } @@ -440,7 +367,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { const bolDoChapters = true; - // Set up required variables let videoIdx = -1; let videoIdxFirst = -1; let audioIdx = -1; @@ -449,14 +375,12 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { let strStreamType = ''; let MILoc = -1; - // Go through each stream in the file. for (let i = 0; i < file.ffProbeData.streams.length; i += 1) { strStreamType = file.ffProbeData.streams[i].codec_type.toLowerCase(); // Looking For Video /// /////////////////////////////////////////////////////////////////////////////////////////////////// if (strStreamType === 'video') { - // First we need to check if it is included in the MediaInfo struture, it might not be (mjpeg??, others??) MILoc = findMediaInfoItem(file, i); response.infoLog += `Index ${i} MediaInfo stream: ${MILoc} \n`; @@ -484,9 +408,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { videoIdx = i; } else { const MILocC = findMediaInfoItem(file, videoIdx); - // const curstreamheight = file.ffProbeData.streams[videoIdx].height * 1; //Not needed const curStreamWidth = file.ffProbeData.streams[videoIdx].width * 1; - // const curstreamFPS = file.mediaInfo.track[MILocC].FrameRate * 1; //Not needed let curStreamBR = file.mediaInfo.track[MILocC].BitRate * 1; if (isNaN(curStreamBR)) { @@ -505,12 +427,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { // Looking For Audio /// /////////////////////////////////////////////////////////////////////////////////////////////////// if (strStreamType === 'audio') { - // response.processFile = false; - // response.infoLog += i + ":" + objFFProbeInfo.streams[i].tags.language + " \n"; - // audioIdxFirst = i; - - // response.infoLog += JSON.stringify(objFFProbeInfo.streams[i]) + " \n"; - audioChannels = file.ffProbeData.streams[i].channels * 1; audioBitrate = file.mediaInfo.track[findMediaInfoItem(file, i)].BitRate * 1; @@ -564,7 +480,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } /// /////////////////////////////////////////////////////////////////////////////////////////////////// - // Looking For Subtitles -- These are causing problems let's just exclude for now + // Looking For Subtitles /// /////////////////////////////////////////////////////////////////////////////////////////////////// if (!bolForceNoSubs && !bolDoSubs && (strStreamType === 'text' || strStreamType === 'subtitle')) { // A sub has an S_TEXT/WEBVTT codec, ffmpeg will fail with it @@ -581,33 +497,9 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { bolForceNoSubs = true; } } - // bolDoSubs = true; /// /////////////////////////////////////////////////////////////////////////////////////////////////// } - // return response; - - // Go through chapters in the file looking for badness - /// /////////////////////////////////////////////////////////////////////////////////////////////////// - // Not processing chapters - fileobject doesn't seem to have the chapters section - /// /////////////////////////////////////////////////////////////////////////////////////////////////// - // for (var i = 0; i < objFFProbeInfo.chapters.length; i+=1) { - - // Bad start times - // if (objFFProbeInfo.chapters[i].start_time < 0) { - // bolDoChapters = false; - // break; //Dont need to continue because we know they are bad - // } - - // Duplicate start times - // for (var x = 0; i < objFFProbeInfo.chapters.length; i+=1) { - // if (i != x && objFFProbeInfo.chapters[i].start_time == objFFProbeInfo.chapters[x].start_time) { - // bolDoChapters = false; - // break; //Dont need to continue because we know they are bad - // } - // } - // } - // Video Decision section /// /////////////////////////////////////////////////////////////////////////////////////////////////// if (videoIdx === -1) { @@ -638,11 +530,11 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { // Source is Variable Frame rate but we will transcode to fixed if (file.mediaInfo.track[MILoc].FrameRate_Mode === 'VFR') videoFPS = 9999; - if (videoFPS > targetFrameRate) { + if (videoFPS > targetFrameRate && file.container !== 'ts') { bolChangeFrameRateVideo = true; // Need to fix this it does not work :-( } - // Lets see if we need to scal down the video size + // Lets see if we need to scale down the video size if (videoHeight > maxVideoHeight) { bolScaleVideo = true; videoNewWidth = Math.floor((maxVideoHeight / videoHeight) * videoWidth); @@ -723,7 +615,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } } else { // We already know the existing bitrate has enough meat for a decent transcode - // bolTranscodeVideo = true; response.infoLog += `Video existing Bitrate, ${videoBR}, is higher than target,` + ` ${optimalVideoBitrate}, transcoding \n`; } @@ -759,12 +650,12 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { audioNewChannels = file.ffProbeData.streams[audioIdx].channels; } - let optimalaudiobitrate = audioNewChannels * targetAudioBitratePerChannel; + let optimalAudioBitrate = audioNewChannels * targetAudioBitratePerChannel; // Now what are we going todo with the audio part - if (audioBR > (optimalaudiobitrate * 1.1)) { + if (audioBR > (optimalAudioBitrate * 1.1)) { bolTranscodeAudio = true; - response.infoLog += `Audio existing Bitrate, ${audioBR}, is higher than target, ${optimalaudiobitrate} \n`; + response.infoLog += `Audio existing Bitrate, ${audioBR}, is higher than target, ${optimalAudioBitrate} \n`; } // If the audio codec is not what we want then we should transcode @@ -776,10 +667,10 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } // If the source bitrate is less than out target bitrate we should not ever go up - if (audioBR < optimalaudiobitrate) { + if (audioBR < optimalAudioBitrate) { response.infoLog += `Audio existing Bitrate, ${audioBR}, is lower than target,` - + ` ${optimalaudiobitrate}, using existing `; - optimalaudiobitrate = audioBR; + + ` ${optimalAudioBitrate}, using existing `; + optimalAudioBitrate = audioBR; if (file.ffProbeData.streams[audioIdx].codec_name !== targetAudioCodec) { response.infoLog += 'rate'; } else { @@ -791,57 +682,35 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { // lets assemble our ffmpeg command /// /////////////////////////////////////////////////////////////////////////////////////////////////// - const strTranCodeBaseHW = ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi '; - const strTranCodeBaseSW = ' -vaapi_device /dev/dri/renderD128 '; - const strTranscodeVideoMapping = ' -max_muxing_queue_size 8000 -map 0:{0} '; - const strTranscodeVideoCopy = ' -c:v:0 copy '; - const strTranscodeVideoTranscoding = ' -c:v:0 hevc_vaapi '; - // Used to make the output 10bit, I think the quotes need to be this way for ffmpeg - const strTranscodeVideoOptions = ' -vf "{0}" '; - const strTranscodeVideoScaling = 'w=-1:h=1080'; // Used when video is above our target of 1080 - const strTransCodeFrameRate = 'fps={0}'; // Used to change the framerate to the target framerate - const strTranscodeVideoFormatHW = 'scale_vaapi='; // Used to make the output 10bit - const strTranscodeVideoFormat = 'format={0}'; // Used to add filters to the hardware transcode - const strTranscodeVideo10bit = 'p010'; // Used to make the output 10bit - const strTranscodeVideo8bit = 'p008'; // Used to make the output 8bit - const strTranscodeVideoSWDecode = 'hwupload'; // Used to make it use software decode if necessary - // Used to make it sure the software decode is in the proper pixel format - const strTranscodeVideoSWDecode10bit = 'nv12|vaapi'; - const strTranscodeVideoBitrate = ' -b:v {0} '; // Used when video is above our target of 1080 - const strTranscodeAudioMapping = ' -map 0:{0} '; - const strTranscodeAudioCopy = ' -c:a:0 copy '; - const strTranscodeAudioTranscoding = ' -c:a:0 ${targetAudioCodec} -b:a {0} '; - const strTranscodeAudioDownMixing = ' -ac {0} '; - const strTranscodeSubs = ' -map 0:s -scodec copy '; - const strTranscodeSubsConvert = ' -map 0:s -c:s srt '; - const strTranscodeSubsNone = ' -map -0:s '; - const strTranscodeMetadata = ' -map_metadata:g -1 -metadata JBDONEVERSION=1 -metadata JBDONEDATE={0} '; - const strTranscodeChapters = ' -map_chapters {0} '; const strTranscodeFileOptions = ' '; let strFFcmd = ''; if (bolTranscodeVideo) { if (bolTranscodeSoftwareDecode) { - strFFcmd += strTranCodeBaseSW; + strFFcmd += ' -vaapi_device /dev/dri/renderD128 '; } else { - strFFcmd += strTranCodeBaseHW; + strFFcmd += ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi '; } } - strFFcmd += strTranscodeVideoMapping.replace('{0}', videoIdx); + + strFFcmd += ` -max_muxing_queue_size 8000 -map 0:${videoIdx} `; if (bolTranscodeVideo) { - strFFcmd += strTranscodeVideoTranscoding; + // Used to make the output 10bit, I think the quotes need to be this way for ffmpeg + strFFcmd += ' -c:v:0 hevc_vaapi '; if (bolScaleVideo || bolUse10bit || bolTranscodeSoftwareDecode || bolChangeFrameRateVideo) { let strOptions = ''; let strFormat = ''; if (bolScaleVideo) { - strOptions += strTranscodeVideoScaling; + // Used when video is above our target + strOptions += `w=-1:h=${maxVideoHeight}`; } let strChangeVideoRateString = ''; if (bolChangeFrameRateVideo) { - strChangeVideoRateString = `${strTransCodeFrameRate.replace('{0}', targetFrameRate)},`; + // Used to change the framerate to the target framerate + strChangeVideoRateString = `fps=${targetFrameRate},`; } if (strFormat.length > 0) { @@ -849,11 +718,13 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (bolUse10bit && !bolSource10bit) { - strFormat += strTranscodeVideo10bit; + // Used to make the output 10bit + strFormat += 'p010'; } if (!bolUse10bit && bolSource10bit) { - strFormat += strTranscodeVideo8bit; + // Used to make the output 8bit + strFormat += 'p008'; } if (bolTranscodeSoftwareDecode) { @@ -861,66 +732,64 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { if (strFormat.length > 0) { strFormat += ','; } - strFormat += strTranscodeVideoSWDecode10bit; + // Used to make it sure the software decode is in the proper pixel format + strFormat += 'nv12|vaapi'; } if (strFormat.length > 0) { strFormat += ','; } - strFormat += strTranscodeVideoSWDecode; + // Used to make it use software decode if necessary + strFormat += 'hwupload'; } if (strFormat.length > 0) { if (strOptions.length > 0) { strOptions += ','; } - strOptions += strTranscodeVideoFormat.replace('{0}', strFormat); + strOptions += `format=${strFormat}`; } if (bolTranscodeSoftwareDecode) { - strFFcmd += strTranscodeVideoOptions.replace('{0}', strChangeVideoRateString + strOptions); + strFFcmd += ` -vf "${strChangeVideoRateString} ${strOptions}" `; } else { - strFFcmd += strTranscodeVideoOptions - .replace('{0}', strChangeVideoRateString + strTranscodeVideoFormatHW + strOptions); + strFFcmd += ` -vf "${strChangeVideoRateString} scale_vaapi=${strOptions}" `; } } - strFFcmd += strTranscodeVideoBitrate.replace('{0}', optimalVideoBitrate); + // Used when video is above our target + strFFcmd += ` -b:v ${optimalVideoBitrate} `; } else { - strFFcmd += strTranscodeVideoCopy; + strFFcmd += ' -c:v:0 copy '; } - strFFcmd += strTranscodeAudioMapping.replace('{0}', audioIdx); + strFFcmd += ` -map 0:${audioIdx} `; if (bolTranscodeAudio) { - strFFcmd += strTranscodeAudioTranscoding - .replace('{0}', optimalaudiobitrate) - .replace('${targetAudioCodec}', targetAudioCodec); + strFFcmd += ` -c:a:0 ${targetAudioCodec} -b:a ${optimalAudioBitrate} `; } else { - strFFcmd += strTranscodeAudioCopy; + strFFcmd += ' -c:a:0 copy '; } if (bolDownMixAudio) { - strFFcmd += strTranscodeAudioDownMixing.replace('{0}', audioNewChannels); + strFFcmd += ` -ac ${audioNewChannels} `; } if (bolForceNoSubs) { - strFFcmd += strTranscodeSubsNone; + strFFcmd += ' -map -0:s '; } else if (bolDoSubs) { if (bolDoSubsConvert) { - strFFcmd += strTranscodeSubsConvert; + strFFcmd += ' -map 0:s -c:s srt '; } else { - strFFcmd += strTranscodeSubs; + strFFcmd += ' -map 0:s -scodec copy '; } } - strFFcmd += strTranscodeMetadata.replace('{0}', new Date().toISOString()); + strFFcmd += ` -map_metadata:g -1 -metadata JBDONEVERSION=1 -metadata JBDONEDATE=${new Date().toISOString()} `; if (bolDoChapters) { - strFFcmd += strTranscodeChapters.replace('{0}', '0'); + strFFcmd += ' -map_chapters 0 '; } else { - strFFcmd += strTranscodeChapters.replace('{0}', '-1'); + strFFcmd += ' -map_chapters -1 '; } strFFcmd += strTranscodeFileOptions; /// /////////////////////////////////////////////////////////////////////////////////////////////////// - // response.infoLog += strFFcmd + "\n"; - response.preset += strFFcmd; response.processFile = true; response.infoLog += 'File needs work. Transcoding. \n'; From 884cadd6a0b12e1f323e7b2be9d697d5bda34c0f Mon Sep 17 00:00:00 2001 From: argonan <101281012+argonan0@users.noreply.github.com> Date: Thu, 31 Mar 2022 16:38:23 +0200 Subject: [PATCH 004/126] Add 10bit output boolean (#280) * Add 10bit output boolean Certain media benefits from being pushed into 10bit if not already. This could be improved by detecting if the source file already is 10bit and maybe assigning a special main10 profile. * edits per review comments * Fix rename issue * Cleanup Had to revert from a ternary since ESLint got mad Co-authored-by: supersnellehenk --- ..._vdka_Tiered_CPU_CRF_Based_Configurable.js | 104 +++++++++--------- 1 file changed, 54 insertions(+), 50 deletions(-) diff --git a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js index a988ad0..f041aab 100644 --- a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js +++ b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js @@ -67,8 +67,8 @@ const details = () => ({ }, { name: 'bframe', - type: 'string', - defaultValue: '8', + type: 'number', + defaultValue: 8, inputUI: { type: 'text', }, @@ -100,8 +100,8 @@ const details = () => ({ }, { name: 'sdDisabled', - type: 'string', - defaultValue: 'false', + type: 'boolean', + defaultValue: false, inputUI: { type: 'dropdown', options: [ @@ -116,16 +116,38 @@ const details = () => ({ }, { name: 'uhdDisabled', - type: 'string', - defaultValue: 'false', + type: 'boolean', + defaultValue: false, inputUI: { - type: 'text', + type: 'dropdown', + options: [ + 'false', + 'true', + ], }, tooltip: `Input "true" if you want to skip 4k (UHD) files \\nExample:\\n true`, }, + { + name: 'force10bit', + type: 'boolean', + defaultValue: false, + inputUI: { + type: 'dropdown', + options: [ + 'false', + 'true', + ], + }, + tooltip: `Specify if output file should be forced to 10bit. Default is false (bit depth is same as source). + \\nExample:\\n + true + + \\nExample:\\n + false`, + }, ], }); @@ -137,7 +159,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { let crf; // default values that will be returned const response = { - processFile: true, + processFile: false, preset: '', container: '.mkv', handBrakeMode: false, @@ -146,86 +168,68 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { infoLog: '', }; - // check if the file is a video, if not the function will be stopped immediately + // check if the file is a video, if not the plugin will exit if (file.fileMedium !== 'video') { - response.processFile = false; response.infoLog += '☒File is not a video! \n'; return response; } response.infoLog += '☑File is a video! \n'; - // check if the file is SD and sdDisable is enabled + // check if the file is SD and sdDisabled is true // skip this plugin if so - if (['480p', '576p'].includes(file.video_resolution) && inputs.sdDisabled === 'true') { - response.processFile = false; - response.infoLog += '☒File is SD, not processing\n'; + if (inputs.sdDisabled && ['480p', '576p'].includes(file.video_resolution)) { + response.infoLog += '☒File is SD and disabled, not processing\n'; return response; } - // check if the file is 4k and 4kDisable is enabled + // check if the file is 4k and uhdDisabled is true // skip this plugin if so - if (file.video_resolution === '4KUHD' && inputs.uhdDisabled) { - response.processFile = false; - response.infoLog += '☒File is 4k/UHD, not processing\n'; + if (inputs.uhdDisabled && file.video_resolution === '4KUHD') { + response.infoLog += '☒File is 4k/UHD and disabled, not processing\n'; return response; } - // check if the file is already hevc - // it will not be transcoded if true and the plugin will be stopped immediately - for (let i = 0; i < file.ffProbeData.streams.length; i += 1) { - if (file.ffProbeData.streams[i].codec_name && file.ffProbeData.streams[i].codec_name.toLowerCase() === 'hevc') { - response.processFile = false; - response.infoLog += '☑File is already in hevc! \n'; - return response; - } + // check if the file contains a hevc track + // it will not be transcoded if true and the plugin will exit + if (file.ffProbeData.streams.filter((x) => x.codec_name.toLowerCase() === 'hevc').length) { + response.infoLog += '☑File is already in hevc! \n'; + return response; } // if we made it to this point it is safe to assume there is no hevc stream response.infoLog += '☒File is not hevc!\n'; - - // set sane input defaults if not configured - const sdCRF = inputs.sdCRF ? inputs.sdCRF : 20; - const hdCRF = inputs.hdCRF ? inputs.hdCRF : 22; - const fullhdCRF = inputs.fullhdCRF ? inputs.fullhdCRF : 24; - const uhdCRF = inputs.uhdCRF ? inputs.uhdCRF : 28; - const bframe = inputs.bframe ? inputs.bframe : 8; - - // set preset to slow if not configured - let ffmpegPreset = 'slow'; - if (!inputs.ffmpegPreset) { - response.infoLog += '☑Preset not set, defaulting to slow\n'; - } else { - ffmpegPreset = `${inputs.ffmpegPreset}`; - response.infoLog += `☑Preset set as ${inputs.ffmpegPreset}\n`; - } + response.infoLog += `☑Preset set as ${inputs.ffmpegPreset}\n`; // set crf by resolution switch (file.video_resolution) { case '480p': case '576p': - crf = sdCRF; + crf = inputs.sdCRF; break; case '720p': - crf = hdCRF; + crf = inputs.hdCRF; break; case '1080p': - crf = fullhdCRF; + crf = inputs.fullhdCRF; break; case '4KUHD': - crf = uhdCRF; + crf = inputs.uhdCRF; break; default: response.infoLog += 'Could for some reason not detect resolution, plugin will not proceed. \n'; - response.processFile = false; return response; } + const pixel10Bit = inputs.force10bit ? ' -pix_fmt p010le' : ''; + // encoding settings - response.preset += `,-map 0 -dn -c:v libx265 -preset ${ffmpegPreset}` - + ` -x265-params crf=${crf}:bframes=${bframe}:rc-lookahead=32:ref=6:b-intra=1:aq-mode=3` - + ' -a53cc 0 -c:a copy -c:s copy -max_muxing_queue_size 9999'; + response.preset += ` -map 0 -dn -c:v libx265 -preset ${inputs.ffmpegPreset}` + + `-x265-params crf=${crf}:bframes=${inputs.bframe}:rc-lookahead=32:ref=6:b-intra=1:aq-mode=3` + + ` ${pixel10Bit} -a53cc 0 -c:a copy -c:s copy -max_muxing_queue_size 9999`; + response.infoLog += `☑File is ${file.video_resolution}, using CRF value of ${crf}!\n`; response.infoLog += 'File is being transcoded!\n'; + response.processFile = true; return response; }; From e3f1842b74fe01d0d06b460450789dc6fe10ad55 Mon Sep 17 00:00:00 2001 From: Rick Meijer Date: Fri, 1 Apr 2022 05:02:25 +0200 Subject: [PATCH 005/126] Update Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js (#291) Missing space. Command is invalid this way. --- .../Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js index f041aab..e1d5aee 100644 --- a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js +++ b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js @@ -224,7 +224,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { // encoding settings response.preset += ` -map 0 -dn -c:v libx265 -preset ${inputs.ffmpegPreset}` - + `-x265-params crf=${crf}:bframes=${inputs.bframe}:rc-lookahead=32:ref=6:b-intra=1:aq-mode=3` + + ` -x265-params crf=${crf}:bframes=${inputs.bframe}:rc-lookahead=32:ref=6:b-intra=1:aq-mode=3` + ` ${pixel10Bit} -a53cc 0 -c:a copy -c:s copy -max_muxing_queue_size 9999`; response.infoLog += `☑File is ${file.video_resolution}, using CRF value of ${crf}!\n`; From bba9e1240081d80dd64c8b1177d1e08efbbe0167 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Fri, 8 Apr 2022 08:10:48 +0100 Subject: [PATCH 006/126] Update wording --- Community/Tdarr_Plugin_00td_filter_by_size.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Community/Tdarr_Plugin_00td_filter_by_size.js b/Community/Tdarr_Plugin_00td_filter_by_size.js index e75c081..468344e 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_size.js +++ b/Community/Tdarr_Plugin_00td_filter_by_size.js @@ -16,7 +16,7 @@ const details = () => ({ type: 'text', }, tooltip: - 'Enter the upper bound size in MB for files which should be processed.', + 'Enter the upper bound size in MB for files which should be processed. Files above this size won\'t be processed.', }, { name: 'lowerBound', @@ -26,7 +26,7 @@ const details = () => ({ type: 'text', }, tooltip: - 'Enter the lower bound size in MB for files which should be processed.', + 'Enter the lower bound size in MB for files which should be processed. Files below this size won\'t be processed.', }, ], }); From 7a337456c68b37ea8d53de4cafee63c66e85acef Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 9 Apr 2022 13:34:39 +0100 Subject: [PATCH 007/126] Fix line length error --- Community/Tdarr_Plugin_00td_filter_by_size.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Community/Tdarr_Plugin_00td_filter_by_size.js b/Community/Tdarr_Plugin_00td_filter_by_size.js index 468344e..2e9ae67 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_size.js +++ b/Community/Tdarr_Plugin_00td_filter_by_size.js @@ -16,7 +16,8 @@ const details = () => ({ type: 'text', }, tooltip: - 'Enter the upper bound size in MB for files which should be processed. Files above this size won\'t be processed.', + 'Enter the upper bound size in MB for files which should be processed.' + + ' Files above this size won\'t be processed.', }, { name: 'lowerBound', @@ -26,7 +27,8 @@ const details = () => ({ type: 'text', }, tooltip: - 'Enter the lower bound size in MB for files which should be processed. Files below this size won\'t be processed.', + 'Enter the lower bound size in MB for files which should be processed.' + + ' Files below this size won\'t be processed.', }, ], }); From 5c605a2d209f225b3b9e6c1c34330831bc2a531f Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 9 Apr 2022 13:35:27 +0100 Subject: [PATCH 008/126] Fix re-order bug --- Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js index 4c0376c..986bd0f 100644 --- a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js +++ b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js @@ -95,7 +95,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { infoLog: '', }; - let { streams } = file.ffProbeData; + let { streams } = JSON.parse(JSON.stringify(file.ffProbeData)); streams.forEach((stream, index) => { // eslint-disable-next-line no-param-reassign From 01e85692ecafaf71a76295978c5d31c2939cf3ea Mon Sep 17 00:00:00 2001 From: Fish2 Date: Sun, 10 Apr 2022 15:51:04 +0100 Subject: [PATCH 009/126] fix unknown timestamp fix for ts and avi for migz gpu (#292) * unknown timestamp fix for ts and avi * Increment version * fix formatting * Fix comment --- Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js index 4b28665..6e6103f 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js +++ b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js @@ -10,7 +10,7 @@ const details = () => ({ Working by the logic that H265 can support the same ammount of data at half the bitrate of H264. NVDEC & NVENC compatable GPU required. This plugin will skip any files that are in the VP9 codec.`, - Version: '3.0', + Version: '3.1', Tags: 'pre-processing,ffmpeg,video only,nvenc h265,configurable', Inputs: [{ name: 'container', @@ -149,6 +149,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { let videoIdx = 0; let CPU10 = false; let extraArguments = ''; + let genpts = ''; let bitrateSettings = ''; // Work out currentBitrate using "Bitrate = file size / (number of minutes * .0075)" // Used from here https://blog.frame.io/2017/03/06/calculate-video-bitrates/ @@ -164,6 +165,11 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { // eslint-disable-next-line no-bitwise const maximumBitrate = ~~(targetBitrate * 1.3); + // If Container .ts or .avi set genpts to fix unknown timestamp + if (inputs.container.toLowerCase() === 'ts' || inputs.container.toLowerCase() === 'avi') { + genpts = '-fflags +genpts'; + } + // If targetBitrate comes out as 0 then something has gone wrong and bitrates could not be calculated. // Cancel plugin completely. if (targetBitrate === 0) { @@ -321,7 +327,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.preset = '-c:v vp8_cuvid'; } - response.preset += `,-map 0 -c:v hevc_nvenc -cq:v 19 ${bitrateSettings} ` + response.preset += `${genpts}, -map 0 -c:v hevc_nvenc -cq:v 19 ${bitrateSettings} ` + `-spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:s copy -max_muxing_queue_size 9999 ${extraArguments}`; response.processFile = true; response.infoLog += 'File is not hevc or vp9. Transcoding. \n'; From ed800662240175983a113bee27c30f0f99fce372 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 Apr 2022 16:52:22 +0200 Subject: [PATCH 010/126] Bump minimist from 1.2.5 to 1.2.6 (#288) Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fc10388..6cdd9f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1113,9 +1113,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "ms": { From 595fdf402aed78bd8757f0f7c69e74168ee8af6d Mon Sep 17 00:00:00 2001 From: Fish2 Date: Sun, 10 Apr 2022 15:53:44 +0100 Subject: [PATCH 011/126] Add mpeg4 Decode Migz GPU (#289) * Add mpeg4 decode * Increment version --- Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js index 6e6103f..11edf36 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js +++ b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js @@ -321,6 +321,8 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.preset = '-c:v mpeg1_cuvid'; } else if (file.video_codec_name === 'mpeg2') { response.preset = '-c:v mpeg2_cuvid'; + } else if (file.video_codec_name === 'mpeg4') { + response.preset = '-c:v mpeg4_cuvid'; } else if (file.video_codec_name === 'vc1') { response.preset = '-c:v vc1_cuvid'; } else if (file.video_codec_name === 'vp8') { From d593eb312db5704b4034ea87910c19b0f3e9de83 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 Apr 2022 16:54:28 +0200 Subject: [PATCH 012/126] Bump ansi-regex from 4.1.0 to 4.1.1 (#293) Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/chalk/ansi-regex/releases) - [Commits](https://github.com/chalk/ansi-regex/compare/v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: ansi-regex dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6cdd9f4..5a261a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -117,9 +117,9 @@ "dev": true }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -1472,9 +1472,9 @@ }, "dependencies": { "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true }, "strip-ansi": { From 764afced49dc0640569de07049c3632104e3ab18 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 25 Apr 2022 20:08:22 +0200 Subject: [PATCH 013/126] Check title is string (#300) * Check title is string * Fix lint and brackets --- .../Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js index d289f15..b892b64 100644 --- a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js +++ b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js @@ -98,7 +98,9 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { const { index } = subStream; if (fs.existsSync(`${subsFile}`)) { response.infoLog += `${lang}.srt already exists. Skipping!\n`; - } else if (title.toLowerCase().includes('commentary') || title.toLowerCase().includes('description')) { + } else if (typeof title === 'string' + && (title.toLowerCase().includes('commentary') + || title.toLowerCase().includes('description'))) { response.infoLog += `Stream ${i} ${lang}.srt is a ${title} track. Skipping!\n`; } else { response.infoLog += `Extracting ${lang}.srt\n`; From ba2dbf4470c06cddc50cec6ae52277e0c6dd5310 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 25 Apr 2022 20:29:13 +0200 Subject: [PATCH 014/126] Pepper fix (#301) * Check title is string * Fix lint and brackets * Add more checks --- .../Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js index b892b64..4dcd6ee 100644 --- a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js +++ b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js @@ -71,11 +71,11 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { let lang = ''; let title = 'none'; - if (subStream.tags) { + if (subStream && subStream.tags && subStream.tags.language) { lang = subStream.tags.language; } - if (subStream.tags.title) { + if (subStream && subStream.tags && subStream.tags.title) { title = subStream.tags.title; } From 99ad3b334d2c66bf51e9ca1fc5c40c06582dfa6c Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 7 May 2022 17:33:40 +0200 Subject: [PATCH 015/126] Add error warning if no streams info (#298) --- .../Tdarr_Plugin_00td_action_re_order_all_streams_v2.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js index 986bd0f..f1a35a7 100644 --- a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js +++ b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js @@ -95,6 +95,11 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { infoLog: '', }; + if (!Array.isArray(file.ffProbeData.streams)) { + throw new Error('FFprobe was unable to extract any streams info on this file.' + + 'This may be due to a corrupt file or permissions issue when scanning the file.'); + } + let { streams } = JSON.parse(JSON.stringify(file.ffProbeData)); streams.forEach((stream, index) => { From 49d6a692a85895051d5eff7e5e846f959dc1dd95 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Fri, 13 May 2022 14:35:04 +0100 Subject: [PATCH 016/126] Update Tdarr_Plugin_vdka_Remove_DataStreams.js --- Community/Tdarr_Plugin_vdka_Remove_DataStreams.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js index 330d067..84a4918 100644 --- a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js +++ b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js @@ -40,7 +40,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { return response; } else { response.FFmpegMode = true; - response.container = ".mkv"; + response.container = "." + file.container; var hasData = false; From d245122b31d61dbd6778b20c7bfdaa7543b5b6de Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Fri, 13 May 2022 15:05:59 +0100 Subject: [PATCH 017/126] Update Tdarr_Plugin_vdka_Remove_DataStreams.js --- Community/Tdarr_Plugin_vdka_Remove_DataStreams.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js index 84a4918..330d067 100644 --- a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js +++ b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js @@ -40,7 +40,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { return response; } else { response.FFmpegMode = true; - response.container = "." + file.container; + response.container = ".mkv"; var hasData = false; From a1c711fb9b4c374f161ce63c04dea711c0a0887a Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 16 May 2022 05:09:00 +0100 Subject: [PATCH 018/126] Update Tdarr_Plugin_vdka_Remove_DataStreams.js --- Community/Tdarr_Plugin_vdka_Remove_DataStreams.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js index 330d067..634c9d3 100644 --- a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js +++ b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js @@ -6,7 +6,7 @@ const details = () => { Name: "Remove Data Streams ", Type: "Video", Operation: "Transcode", - Description: `[Contains built-in filter] This plugin removes data streams if detected. The output container is the same as the original. Helps with issues like bin_data making files impossible to process. \n\n`, + Description: `[Contains built-in filter] This plugin removes data streams if detected. The output container is mkv. Helps with issues like bin_data making files impossible to process. \n\n`, Version: "1.00", Tags: "pre-processing,ffmpeg", Inputs:[], From 94710291c8de63abc10f9577134634da98a1a0da Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Tue, 17 May 2022 20:06:49 +0200 Subject: [PATCH 019/126] use ffprobedata (#307) --- ...ugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js b/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js index 4599eb4..1cbe2bf 100644 --- a/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js +++ b/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js @@ -96,8 +96,13 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { logOutFile = currentfilename.substr(0, currentfilename.lastIndexOf(".")) + ".out" console.log("Log out file: " + logOutFile) - //get an updated version of the file for checking metadata - var probeData = JSON.parse(require("child_process").execSync(`ffprobe -v quiet -print_format json -show_format -show_streams "${currentfilename}"`).toString()) + let probeData; + if (file && file.ffProbeData && file.ffProbeData.format) { + probeData = file.ffProbeData; + } else { + //get an updated version of the file for checking metadata + probeData = JSON.parse(require("child_process").execSync(`ffprobe -v quiet -print_format json -show_format -show_streams "${currentfilename}"`).toString()) + } //setup required varibles var loudNorm_i = -23.0 From 584e4cb557782f334090dbab7d441074e5758e30 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Wed, 18 May 2022 18:09:09 +0100 Subject: [PATCH 020/126] Update wording --- Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js index f1a35a7..691b173 100644 --- a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js +++ b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js @@ -21,6 +21,8 @@ const details = () => ({ tooltip: `Specify the process order. For example, if 'languages' is first, the streams will be ordered based on that first. +So put the most important properties last. +The default order is suitable for most people. \\nExample:\\n codecs,channels,languages,streamTypes From 2179a1f634f76fc9e6f56dd4da599b0e5485760b Mon Sep 17 00:00:00 2001 From: Boosh1 <45874141+Boosh1@users.noreply.github.com> Date: Fri, 20 May 2022 06:48:12 +0100 Subject: [PATCH 021/126] Update plugin - Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC - OS support, custom ffmpeg cmd input + clean-up (#306) * Create Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js * Update Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js * Update Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js * Update Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js Corrected some tooltips. Plugin should now have all the descriptions correct & should round bitrates down to avoid decimals on the ffmpeg cmd. * Initial sweep through noted issues Initial sweep through all issues. Spelling should be corrected. Unneeded returns & parenthesis removed. Force conform added for mp4>mkv etc. Encoder pre-set speed changed to slow default. 10 bit option now correctly allows encode to 10bit with separate check if file is already 10bit. Comments & layout improved * Another round of fixes Spelling cleaned up again 10bit encode logic corrected again Vars cleaned up Comments formatted a bit better * Fix checkPlugins error * Fixed input types Input types should be fixed Merged change to replace "function details" Minor correction to a comment in the wrong place * Very minor update to strings Just adding some full stops to ends of lines * Create Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js * Update Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js * Update Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js * Update Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js Corrected some tooltips. Plugin should now have all the descriptions correct & should round bitrates down to avoid decimals on the ffmpeg cmd. * Initial sweep through noted issues Initial sweep through all issues. Spelling should be corrected. Unneeded returns & parenthesis removed. Force conform added for mp4>mkv etc. Encoder pre-set speed changed to slow default. 10 bit option now correctly allows encode to 10bit with separate check if file is already 10bit. Comments & layout improved * Another round of fixes Spelling cleaned up again 10bit encode logic corrected again Vars cleaned up Comments formatted a bit better * Fix checkPlugins error * Lint * Changed strings to numbers for bitrate settings Also added "k" to some strings for the info logs so they are more consistent * Fix for possible issue where target bitrate ends up higher than current bitrate Been reported that a file ended up coming out larger and in fact the target bitrate somehow ended up being double the current bitrate instead of half. Never seen this myself but I've changed two things. Adjusted the targetBitrate calculation to ensure halving it happens last. Then added in a protection incase the target bitrate ends up equal or higher than the current bitrate. * Fix for If checks after changing strings to numbers Due to changing the strings to numbers some IF checks needed updating to check if things were "0" now instead of just blank. * Tidy up of tooltips to add more info Tidied up tooltips for hevc options to make them clearer and formatted better Also removed some lines which were unneeded * Reverting change from string to number Changed the inputs back to strings. As numbers we can't default them to a blank value which is better for users Also moved HDR check to top of video check to ensure it's caught before we start trying to remux anything. * Changed inputs back to numbers Text entries now changed back to numbers. Tooltip explains that 0 means disabled and a valid number is needed to use them. * Very minor fix Left space at end of "extraArguments" to ensure it doesn't disrupt the rest of the ffmpeg cmd line * Lint error * Updated to account for OS types Updated to account for OS types & clean up of decode & encode steps. Another clean-up of tooltips as well * Another cleanup Cleanup tooltips & comments * Another change to tooltips * Another cleanup Also corrected messy info for the OS options * Another cleanup of Tooltips Try and make them much clearer... * Remove bad comment * Revert "Merge branch 'master' of https://github.com/Boosh1/Tdarr_Plugins" This reverts commit 116fdc5df958cde059289d0caa8466e187f3f616, reversing changes made to bf4f1bfeb5e896279aca85a467e1fea7e0026309. * Revert "Revert "Merge branch 'master' of https://github.com/Boosh1/Tdarr_Plugins"" This reverts commit 5de425147a640f1328f6192e0155fdfe5da59143. Co-authored-by: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> --- ...Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js | 240 ++++++++++++------ 1 file changed, 168 insertions(+), 72 deletions(-) diff --git a/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js index 71da95b..7035c3d 100644 --- a/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js +++ b/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -1,7 +1,11 @@ // All credit for original plugin logic goes to Migz. // This Plugin is essentially just his NVENC/CPU plugin modified to work with QSV & with extra hevc logic. // Extra logic is mainly to control encoder quality/speed & to allow HEVC files to be reprocessed to reduce file size -// NOTE - This does not use VAAPI, it is QSV only. So newer intel igpus only. 8th+ gen should work. + +// NOTE - This does not use VAAPI, it is QSV only. So newer intel iGPUs only. 8th+ gen should work. +// Additionally this was designed and tested on UNRAID via docker though there is logic to support use on +// Windows, Linux & Mac + // White paper from intel regarding QSV performance on linux using FFMPEG here: // eslint-disable-next-line max-len // https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/cloud-computing-quicksync-video-ffmpeg-white-paper.pdf @@ -12,12 +16,14 @@ const details = () => ({ Name: 'Boosh-Transcode using QSV GPU & FFMPEG', Type: 'Video', Operation: 'Transcode', - Description: `This is a QSV specific plugin, VAAPI is NOT used. So an INTEL QSV enabled CPU is required. - 8th+ gen CPUs should work. Files not in H265/HEVC will be transcoded into H265/HEVC using Quick Sync Video (QSV) - via Intel GPU with ffmpeg. Settings are dependant on file bitrate working by the logic that H265 can support + Description: `This is a QSV specific plugin. 8th+ gen INTEL QSV enabled CPUs are required. VAAPI is NOT used. + Files not in H265/HEVC will be transcoded into H265/HEVC using Quick Sync Video (QSV) + via Intel GPU using FFmpeg. Settings are dependant on file bitrate working by the logic that H265 can support the same amount of data at half the bitrate of H264. This plugin will skip files already in HEVC, AV1 & VP9 unless "reconvert_hevc" is marked as true. If it is then these will be reconverted again into HEVC if they - exceed the bitrate specified in "hevc_max_bitrate". Reminder! An INTEL QSV enabled CPU is required.`, + exceed the bitrate specified in "hevc_max_bitrate". Reminder! An INTEL QSV enabled CPU is required. + NOTE - Created for use with UNRAID Docker and while it should support Windows/Mac etc, it may require + a custom version of FFmpeg to work properly.`, Version: '1.0', Tags: 'pre-processing,ffmpeg,video only,qsv,h265,hevc,configurable', Inputs: [ @@ -32,9 +38,13 @@ const details = () => ({ 'mp4', ], }, - tooltip: `Specifies the output container of the file. + tooltip: `\\n + ==DESCRIPTION== + \\n Specifies the output container of the file. \\n Ensure that all stream types you may have are supported by your chosen container. - \\n MKV is recommended. + \\n + ==INFO== + \\n Only MP4 & MKV are supported and MKV is recommended. \\nExample:\\n mkv \\nExample:\\n @@ -51,17 +61,22 @@ const details = () => ({ 'true', ], }, - tooltip: `Make the file conform to output containers requirements. - Use if you need to ensure the encode works from mp4>mkv or mkv>mp4. - This will drop data of certain type so ensure you are happy with that, - or use another plugin to convert these data types first. - \\n Drop hdmv_pgs_subtitle/eia_608/subrip/timed_id3 for MP4. - \\n Drop data streams/mov_text/eia_608/timed_id3 for MKV. - \\n Default is false. - \\nExample:\\n - true - \\nExample:\\n - false`, + tooltip: `\\n + ==DESCRIPTION== + \\n Make the file conform to output containers requirements. + Use if you need to ensure the encode works from mp4>mkv or mkv>mp4. \\n + ==WARNING== \\n + This will remove data of certain types so ensure you are happy with that, + or use another plugin to convert these data types first! + \\n + ==INFO== + \\n Drop hdmv_pgs_subtitle/eia_608/subrip/timed_id3 for MP4. + \\n Drop data streams/mov_text/eia_608/timed_id3 for MKV. + \\n Default is false. + \\nExample:\\n + true + \\nExample:\\n + false`, }, { name: 'encoder_speedpreset', @@ -79,17 +94,50 @@ const details = () => ({ 'veryslow', ], }, - tooltip: `Specify the encoder speed/preset to use. - Slower options mean slower encode but better quality and faster have quicker encodes but worse quality. - For more information see intel white paper on ffmpeg results using qsv: \\n` - // eslint-disable-next-line max-len - + `https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/cloud-computing-quicksync-video-ffmpeg-white-paper.pdf + tooltip: `\\n + ==DESCRIPTION== + \\n Specify the encoder speed/preset to use. + Slower options mean a slower encode but better quality and faster options mean faster encodes but + worse quality. + \\n For more information see intel white paper on FFmpeg results using QSV: \\n` + // eslint-disable-next-line max-len + + `https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/cloud-computing-quicksync-video-ffmpeg-white-paper.pdf + \\n + ==INFO== \\n Default is "slow". \\nExample:\\n medium \\nExample:\\n slower`, }, + { + name: 'extra_qsv_options', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: `\\n + ==DESCRIPTION== + \\n Here you can add extra options to the FFmpeg QSV ENCODE cmd. + This does not override the FFmpeg cmd, it just allows additions to it. + \\n + There are extra QSV options that can be + forced on/off as desired. See here for some possible cmds - + https://ffmpeg.org/ffmpeg-codecs.html#toc-HEVC-Options-1 + \\n + ==WARNING== \\n + Just because a cmd is mentioned doesn't mean your installed version of FFmpeg supports it... + Be certain to verify the cmds work before adding to your workflow. \\n + Check Tdarr Help Tab. Enter FFmpeg cmd - "-h encoder=hevc_qsv". This will give a list of supported commands. + \\n + ==INFO== + \\n Default is empty but a suggested value is below. If unsure just leave empty. + \\n Ensure to only use cmds valid to encoding QSV as the script handles other FFmpeg cmds relating to + bitrate etc. Anything else entered here might be supported but could cause undesired results. + \\nExample:\\n + -extbrc 1 -rdo 1 -mbbrc 1 -b_strategy 1 -adaptive_i 1 -adaptive_b 1`, + }, { name: 'enable_10bit', type: 'boolean', @@ -101,11 +149,15 @@ const details = () => ({ 'true', ], }, - tooltip: `Specify if we want to enable 10bit encoding. - If this is enabled files will be processed and converted into 10bit + tooltip: `\\n + ==DESCRIPTION== + \\n Specify if we want to enable 10bit encoding. + \\n If this is enabled files will be processed and converted into 10bit HEVC using main10 profile and with p010le pixel format. \n - If you just want to retain 10 bit already in files then this can be left as false, as - 10bit to 10bit in ffmpeg should be automatic. + If you just want to retain files that are already 10 bit then this can be left as false, as + 10bit to 10bit in FFmpeg should be automatic. + \\n + ==INFO== \\n Default is "false". \\nExample:\\n true @@ -119,9 +171,13 @@ const details = () => ({ inputUI: { type: 'text', }, - tooltip: `Specify bitrate cutoff, files with a total bitrate lower then this will not be processed. + tooltip: `\\n + ==DESCRIPTION== + \\n Specify bitrate cutoff, files with a total bitrate lower then this will not be processed. \n Since getting the bitrate of the video from files is unreliable, bitrate here refers to the total bitrate of the file and not just the video steam. + \\n + ==INFO== \\n Rate is in kbps. \\n Defaults to 0 which means this is disabled. \\n Enter a valid number to enable. @@ -137,10 +193,14 @@ const details = () => ({ inputUI: { type: 'text', }, - tooltip: `Specify a maximum average video bitrate. When encoding we take the current total bitrate and halve it + tooltip: `\\n + ==DESCRIPTION== + \\n Specify a maximum average video bitrate. When encoding we take the current total bitrate and halve it to get an average target. This option sets a upper limit to that average (i.e if you have a video bitrate of 10000, half is 5000, if your maximum desired average bitrate is 4000 then we use that as the target instead of 5000). + \\n + ==INFO== \\n Bitrate here is referring to video bitrate as we want to set the video bitrate on encode. \\n Rate is in kbps. \\n Defaults to 0 which means this is disabled. @@ -157,11 +217,15 @@ const details = () => ({ inputUI: { type: 'text', }, - tooltip: `Specify a minimum average video bitrate. When encoding we take the current total bitrate and halve - it to get an average target. This option sets a lower limit to that average (i.e if you have a video bitrate - of 3000, half is 1500, if your minimum desired average bitrate is 2000 then we use that as the target instead - of 1500). - \\nBitrate here is referring to video bitrate as we want to set the video bitrate on encode. + tooltip: `\\n + ==DESCRIPTION== + \\n Specify a minimum average video bitrate. When encoding we take the current total bitrate and halve + it to get an average target. This option sets a lower limit to that average (i.e if you have a video bitrate + of 3000, half is 1500, if your minimum desired average bitrate is 2000 then we use that as the target instead + of 1500). + \\n + ==INFO== + \\n Bitrate here is referring to video bitrate as we want to set the video bitrate on encode. \\n Rate is in kbps. \\n Defaults to 0 which means this is disabled. \\n Enter a valid number to enable. @@ -181,9 +245,12 @@ const details = () => ({ 'true', ], }, - tooltip: `Specify if we want to reprocess HEVC, VP9 or AV1 files - (i.e reduce bitrate of files already in those codecs). Since this uses the same logic as normal, halving the - current bitrate, this is NOT recommended unless you know what you are doing, so leave false if unsure. + tooltip: `\\n + ==DESCRIPTION== + \\n Specify if we want to reprocess HEVC, VP9 or AV1 files + (i.e reduce bitrate of files already in those codecs). + \\n Since this uses the same logic as normal, halving the current bitrate, this is NOT recommended + unless you know what you are doing, so leave false if unsure. NEEDS to be used in conjunction with "bitrate_cutoff" or "hevc_max_bitrate" otherwise is ignored. This is useful in certain situations, perhaps you have a file which is HEVC but has an extremely high bitrate and you'd like to reduce it. @@ -192,7 +259,9 @@ const details = () => ({ "hevc_max_bitrate" & "max_average_bitrate" to prevent the plugin looping. Also it is highly suggested that you have your "hevc_max_bitrate" higher than "max_average_bitrate". \\n Again if you are unsure, please leave this as false! - \\n\\n WARNING!! IF YOU HAVE VP9 OR AV1 FILES YOU WANT TO KEEP IN THOSE FORMATS THEN DO NOT USE THIS OPTION. + \\n + ==WARNING== \\n + IF YOU HAVE VP9 OR AV1 FILES YOU WANT TO KEEP IN THOSE FORMATS THEN DO NOT USE THIS OPTION. \\n \\nExample:\\n true @@ -206,7 +275,9 @@ const details = () => ({ inputUI: { type: 'text', }, - tooltip: `Has no effect unless "reconvert_hevc" is set to true. This allows you to specify a maximum + tooltip: `\\n + ==DESCRIPTION== + \\n Has no effect unless "reconvert_hevc" is set to true. This allows you to specify a maximum allowed average bitrate for HEVC or similar files. Much like the "bitrate_cutoff" option, but specifically for HEVC files. It should be set HIGHER then your standard cutoff for safety. \\n Also, it's highly suggested you use the min & max average bitrate options in combination with this. You @@ -216,6 +287,8 @@ const details = () => ({ this is why it is NOT recommended! \\n As with the cutoff, getting the bitrate of the video from files is unreliable, so bitrate here refers to the total bitrate of the file and not just the video steam. + \\n + ==INFO== \\n Rate is in kbps. \\n Defaults to 0 which means this is disabled. \\n Enter a valid number to enable, otherwise we use "bitrate_cutoff" and multiply x2 for a safe limit. @@ -229,7 +302,7 @@ const details = () => ({ // eslint-disable-next-line no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { - const lib = require('../methods/lib')(); + const lib = require('../methods/lib')(); const os = require('os'); // eslint-disable-next-line no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { @@ -413,7 +486,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } // Check for HDR in files. If so exit plugin. We assume HDR files have bt2020 color spaces. HDR can be complicated - // and some aspects are still unsupported in ffmpeg I believe. Likely we don't want to re-encode anything HDR. + // and some aspects are still unsupported in FFmpeg I believe. Likely we don't want to re-encode anything HDR. if (file.ffProbeData.streams[i].color_space === 'bt2020nc' && file.ffProbeData.streams[i].color_transfer === 'smpte2084' && file.ffProbeData.streams[i].color_primaries === 'bt2020') { @@ -502,57 +575,80 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { + `-maxrate ${maximumBitrate}k -bufsize ${currentBitrate}k`; // Print to infoLog information around file & bitrate settings. response.infoLog += `\nContainer for output selected as ${inputs.container}. \n`; - response.infoLog += `The current file bitrate = ${currentBitrate}k \n`; - response.infoLog += 'Bitrate settings: \n'; + response.infoLog += 'Encode variable bitrate settings: \n'; response.infoLog += `Target = ${targetBitrate}k \n`; response.infoLog += `Minimum = ${minimumBitrate}k \n`; response.infoLog += `Maximum = ${maximumBitrate}k \n`; - // Codec will be checked so it can be transcoded correctly - // (QSV doesn't support HW decode of all older codecs, h263 & mpeg1 are SW based currently) - // If source file is 10 bit then don't hardware decode at all as this can cause issues. - // Instead best just to cpu decode to ensure it works. + // START PRESET + // DECODE FLAGS + // -fflags +genpts should regenerate timestamps if they end up missing... + response.preset = '-fflags +genpts '; + + // Attempt to enable HW Decoding... + // If source file is 10 bit then bail as this can cause issues. Think it's the -c:v option that can break during 10bit if (main10 === false) { + // Currently supported HW decode types switch (file.video_codec_name) { - case 'h263': - response.preset = '-hwaccel qsv -c:v h263'; + case 'mpeg2': + response.preset += '-hwaccel qsv -c:v mpeg2_qsv'; break; case 'h264': - response.preset = '-hwaccel qsv -c:v h264_qsv'; - break; - case 'mjpeg': - response.preset = '-hwaccel qsv -c:v mjpeg_qsv'; - break; - case 'hevc': - response.preset = '-hwaccel qsv -c:v hevc_qsv'; - break; - case 'mpeg1': - response.preset = '-hwaccel qsv -c:v mpeg1'; - break; - case 'mpeg2': - response.preset = '-hwaccel qsv -c:v mpeg2_qsv'; + response.preset += '-hwaccel qsv -c:v h264_qsv'; break; case 'vc1': - response.preset = '-hwaccel qsv -c:v vc1_qsv'; + response.preset += '-hwaccel qsv -c:v vc1_qsv'; + break; + case 'mjpeg': + response.preset += '-hwaccel qsv -c:v mjpeg_qsv'; break; case 'vp8': - response.preset = '-hwaccel qsv -c:v vp8_qsv'; + response.preset += '-hwaccel qsv -c:v vp8_qsv'; break; - case 'av1': - response.preset = '-hwaccel qsv -c:v av1'; + case 'hevc': + response.preset += '-hwaccel qsv -c:v hevc_qsv'; + break; + case 'vp9': // Should be supported by 8th Gen + + response.preset += '-hwaccel qsv -c:v vp9_qsv'; break; default: - response.preset = ''; + response.preset += '-hwaccel qsv'; } + } else { + response.preset += '-hwaccel qsv'; + // Enable basic hwaccel regardless. Seems to work... } - response.preset += ` -map 0 -c:v hevc_qsv ${bitrateSettings} ` - + `-preset ${inputs.encoder_speedpreset} -look_ahead 1 + // ADD ENCODE FLAGS TO PRESET + response.preset += ' -map 0 -c:v '; + + // Account for different OS setup for QSV. + // FYI Darwin is Mac OS + switch (os.platform()) { + case 'darwin': + response.preset += 'hevc_videotoolbox'; + // hevc_videotoolbox is for Mac but that doesn't seem to be included in Tdarr current Jellyfin FFmpeg + // Likely needs custom FFmpeg installed + break; + case 'linux': + response.preset += 'hevc_qsv'; + break; + case 'win32': + response.preset += 'hevc_qsv -load_plugin hevc_hw'; + // Windows needs the additional -load_plugin plugin. Tested working on a Win 10 - i5-10505 + break; + default: + response.preset += 'hevc_qsv'; + } + + // Add the rest of the FFmpeg command + response.preset += ` ${bitrateSettings} ` + + `-preset ${inputs.encoder_speedpreset} ${inputs.extra_qsv_options} -c:a copy -c:s copy -max_muxing_queue_size 9999 ${extraArguments}`; - // Other settings to consider. - // -b_strategy 1 -adaptive_b 1 -adaptive_i 1 -async_depth 1 -look_ahead 1 -look_ahead_depth 100 + response.processFile = true; - response.infoLog += 'File Transcoding. \n'; + response.infoLog += 'File Transcoding... \n'; + return response; }; module.exports.details = details; From e194e6d35cabe35b99ee2bd5f0d2f98e6560b8a8 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Fri, 20 May 2022 08:44:42 +0200 Subject: [PATCH 022/126] Add filter_by_codec_tag_string (#310) --- ..._Plugin_00td_filter_by_codec_tag_string.js | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js diff --git a/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js b/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js new file mode 100644 index 0000000..a24a83d --- /dev/null +++ b/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js @@ -0,0 +1,86 @@ +const details = () => ({ + id: 'Tdarr_Plugin_00td_filter_by_codec_tag_string', + Stage: 'Pre-processing', + Name: 'Filter by codec tag string', + Type: 'Video', + Operation: 'Filter', + Description: 'Only allow files with specified codec tag strings to be processed \n\n', + Version: '1.00', + Tags: 'filter', + Inputs: [ + { + name: 'codecTagStringsToProcess', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: ` +Enter a comma separated list of codec tag strings to be processed. +Leave blank if using codecTagStringsToNotProcess`, + }, + { + name: 'codecTagStringsToNotProcess', + type: 'string', + defaultValue: '', + inputUI: { + type: 'text', + }, + tooltip: ` +Enter a comma separated list of codec tag strings to be not be processed. +Leave blank if using codecTagStringsToProcess`, + }, + ], +}); + +// eslint-disable-next-line no-unused-vars +const plugin = (file, librarySettings, inputs, otherArguments) => { + const lib = require('../methods/lib')(); + // eslint-disable-next-line no-unused-vars,no-param-reassign + inputs = lib.loadDefaultValues(inputs, details); + const response = { + processFile: false, + infoLog: '', + }; + + let fileCodecTagStrings = []; + if (file.ffProbeData && file.ffProbeData.streams) { + fileCodecTagStrings = file.ffProbeData.streams.map((row) => row.codec_tag_string); + } + + const checkInclude = (inputArr) => { + for (let i = 0; i < fileCodecTagStrings.length; i += 1) { + if (inputArr.includes(fileCodecTagStrings[i])) { + return true; + } + } + return false; + }; + + if (inputs.codecTagStringsToProcess !== '') { + const codecTagStrings = inputs.codecTagStringsToProcess.split(','); + if (checkInclude(codecTagStrings)) { + response.processFile = true; + response.infoLog += 'File is in codecTagStringsToProcess. Moving to next plugin.'; + } else { + response.processFile = false; + response.infoLog += 'File is not in codecTagStringsToProcess. Breaking out of plugin stack.'; + } + } + + if (inputs.codecTagStringsToNotProcess !== '') { + const codecTagStrings = inputs.codecTagStringsToNotProcess.split(','); + if (checkInclude(codecTagStrings)) { + response.processFile = false; + response.infoLog += 'File is in codecTagStringsToNotProcess. Breaking out of plugin stack.'; + } else { + response.processFile = true; + response.infoLog += 'File is not in codecTagStringsToNotProcess. Moving to next plugin.'; + } + } + + return response; +}; + +module.exports.details = details; +module.exports.plugin = plugin; From fa2b0abd924aade2d18c368198c94f2894948c5d Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Fri, 20 May 2022 08:56:03 +0100 Subject: [PATCH 023/126] Add new tests --- .github/workflows/lint.yml | 2 +- package-lock.json | 63 +++ package.json | 3 +- .../Tdarr_Plugin_00td_filter_by_codec.js | 59 +++ ..._Plugin_00td_filter_by_codec_tag_string.js | 59 +++ tests/helpers/run.js | 30 ++ tests/runTests.js | 31 ++ tests/sampleData/media/sampleH264_1.json | 432 ++++++++++++++++++ tests/sampleData/media/sampleH265_1.json | 334 ++++++++++++++ 9 files changed, 1011 insertions(+), 2 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_codec.js create mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js create mode 100644 tests/helpers/run.js create mode 100644 tests/runTests.js create mode 100644 tests/sampleData/media/sampleH264_1.json create mode 100644 tests/sampleData/media/sampleH265_1.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9c76f0f..042233b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,4 +20,4 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm i - - run: npm run checkPlugins && npm run lint + - run: npm run checkPlugins && npm run lint && npm run test diff --git a/package-lock.json b/package-lock.json index 5a261a7..de6ded3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -174,6 +174,12 @@ "es-abstract": "^1.18.0-next.1" } }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, "ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", @@ -230,6 +236,21 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, + "chai": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", + "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + } + }, "chalk": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", @@ -281,6 +302,12 @@ } } }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "dev": true + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -346,6 +373,15 @@ "ms": "2.1.2" } }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -790,6 +826,12 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, "get-intrinsic": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", @@ -1094,6 +1136,15 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "loupe": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", + "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "dev": true, + "requires": { + "get-func-name": "^2.0.0" + } + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -1296,6 +1347,12 @@ "pify": "^2.0.0" } }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -1577,6 +1634,12 @@ "prelude-ls": "^1.2.1" } }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, "type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", diff --git a/package.json b/package.json index a1436a8..4ff2e19 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,14 @@ "main": "Tdarr_Plugin_aaaa_Pre_Proc_Example.js", "dependencies": {}, "devDependencies": { + "chai": "^4.3.6", "eslint": "^7.14.0", "eslint-config-airbnb-base": "^14.2.1", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jsx-a11y": "^6.4.1" }, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "node ./tests/runTests.js", "lint": "eslint Community methods examples tests --ext js", "lint:fix": "eslint Community methods examples tests --ext js --fix", "checkPlugins": "node ./tests/checkPlugins.js" diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_codec.js b/tests/Community/Tdarr_Plugin_00td_filter_by_codec.js new file mode 100644 index 0000000..e8e6cd3 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_codec.js @@ -0,0 +1,59 @@ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { processFile: false, infoLog: '' }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecsToProcess: 'h264', + }, + otherArguments: {}, + }, + output: { processFile: true, infoLog: 'File is in codecsToProcess. Moving to next plugin.' }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecsToProcess: 'h265', + }, + otherArguments: {}, + }, + output: { processFile: false, infoLog: 'File is not in codecsToProcess. Breaking out of plugin stack.' }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecsToNotProcess: 'h264', + }, + otherArguments: {}, + }, + output: { processFile: false, infoLog: 'File is in codecsToNotProcess. Breaking out of plugin stack.' }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecsToNotProcess: 'h265', + }, + otherArguments: {}, + }, + output: { processFile: true, infoLog: 'File is not in codecsToNotProcess. Moving to next plugin.' }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js b/tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js new file mode 100644 index 0000000..4616650 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js @@ -0,0 +1,59 @@ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { processFile: false, infoLog: '' }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecTagStringsToProcess: 'avc1,rand', + }, + otherArguments: {}, + }, + output: { processFile: true, infoLog: 'File is in codecTagStringsToProcess. Moving to next plugin.' }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecTagStringsToNotProcess: 'avc1,rand', + }, + otherArguments: {}, + }, + output: { processFile: false, infoLog: 'File is in codecTagStringsToNotProcess. Breaking out of plugin stack.' }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: { + codecTagStringsToProcess: 'avc1,rand', + }, + otherArguments: {}, + }, + output: { processFile: false, infoLog: 'File is not in codecTagStringsToProcess. Breaking out of plugin stack.' }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: { + codecTagStringsToNotProcess: 'avc1,rand', + }, + otherArguments: {}, + }, + output: { processFile: true, infoLog: 'File is not in codecTagStringsToNotProcess. Moving to next plugin.' }, + }, +]; + +run(tests); diff --git a/tests/helpers/run.js b/tests/helpers/run.js new file mode 100644 index 0000000..3cb7f52 --- /dev/null +++ b/tests/helpers/run.js @@ -0,0 +1,30 @@ +const path = require('path'); +const chai = require('chai'); + +const scriptName = path.basename(process.mainModule.filename); +// eslint-disable-next-line import/no-dynamic-require +const { plugin } = require(`../../Community/${scriptName}`); + +const run = async (tests) => { + try { + for (let i = 0; i < tests.length; i += 1) { + // eslint-disable-next-line no-console + console.log(`${scriptName}: test ${i}`); + const test = tests[i]; + // eslint-disable-next-line no-await-in-loop + const testOutput = await plugin( + test.input.file, + test.input.librarySettings, + test.input.inputs, + test.input.otherArguments, + ); + chai.assert.deepEqual(testOutput, test.output); + } + } catch (err) { + // eslint-disable-next-line no-console + console.log(err); + process.exit(1); + } +}; + +module.exports = run; diff --git a/tests/runTests.js b/tests/runTests.js new file mode 100644 index 0000000..476fc3c --- /dev/null +++ b/tests/runTests.js @@ -0,0 +1,31 @@ +/* eslint no-console: 0 */ // --> OFF + +const fs = require('fs'); +const childProcess = require('child_process'); + +const filenames = fs.readdirSync(`${__dirname}/Community`); + +const run = async () => { + for (let i = 0; i < filenames.length; i += 1) { + const path = `${__dirname}/Community/${filenames[i]}`; + // eslint-disable-next-line no-await-in-loop + await new Promise((resolve) => { + childProcess.exec(`node ${path}`, (err, stdout, stderr) => { + if (err) { + console.log(err); + } + console.log(stdout); + console.log(stderr); + }).on('exit', async (code) => { + if (code !== 0) { + await new Promise((resolve2) => setTimeout(resolve2, 1000)); + process.exit(1); + } else { + resolve(); + } + }); + }); + } +}; + +run(); diff --git a/tests/sampleData/media/sampleH264_1.json b/tests/sampleData/media/sampleH264_1.json new file mode 100644 index 0000000..9833f8d --- /dev/null +++ b/tests/sampleData/media/sampleH264_1.json @@ -0,0 +1,432 @@ +{ + "_id": "C:/Transcode/Source Folder/SampleVideo_1280x720_1mb.mp4", + "file": "C:/Transcode/Source Folder/SampleVideo_1280x720_1mb.mp4", + "DB": "2MY5YD7P8", + "footprintId": "KA_y0Hm3Ld", + "hasClosedCaptions": false, + "container": "mp4", + "scannerReads": { + "ffProbeRead": "success", + "exiftoolRead": "success", + "mediaInfoRead": "success", + "closedCaptionRead": "\"Unable to run CCExtractor\"" + }, + "ffProbeData": { + "streams": [ + { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "Main", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1280, + "height": 720, + "coded_width": 1280, + "coded_height": 720, + "closed_captions": 0, + "has_b_frames": 0, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": 31, + "chroma_location": "left", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "r_frame_rate": "25/1", + "avg_frame_rate": "25/1", + "time_base": "1/12800", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 67584, + "duration": "5.280000", + "bit_rate": "1205959", + "bits_per_raw_sample": "8", + "nb_frames": "132", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "creation_time": "1970-01-01T00:00:00.000000Z", + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]" + } + }, + { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 6, + "channel_layout": "5.1", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 254976, + "duration": "5.312000", + "bit_rate": "384828", + "nb_frames": "249", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "creation_time": "1970-01-01T00:00:00.000000Z", + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + ], + "format": { + "filename": "C:/Transcode/Source Folder/SampleVideo_1280x720_1mb.mp4", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "mov,mp4,m4a,3gp,3g2,mj2", + "format_long_name": "QuickTime / MOV", + "start_time": "0.000000", + "duration": "5.312000", + "size": "1056519", + "bit_rate": "1591143", + "probe_score": 100, + "tags": { + "major_brand": "isom", + "minor_version": "512", + "compatible_brands": "isomiso2avc1mp41", + "creation_time": "1970-01-08T00:00:00.000000Z", + "encoder": "Lavf53.24.2", + "title": "Sample title test", + "composer": "th", + "date": "2018", + "genre": "this", + "artist": "hhj", + "comment": "hhk" + } + } + }, + "file_size": 1.0075750350952148, + "video_resolution": "720p", + "fileMedium": "video", + "video_codec_name": "h264", + "audio_codec_name": "", + "lastPluginDetails": "none", + "createdAt": 1653029288316, + "bit_rate": 1591143, + "duration": 5, + "statSync": { + "dev": 3832468976, + "mode": 33060, + "nlink": 1, + "uid": 0, + "gid": 0, + "rdev": 0, + "blksize": 4096, + "ino": 1688849864649366, + "size": 1056519, + "blocks": 2064, + "atimeMs": 1653029288299.0342, + "mtimeMs": 1569306262000, + "ctimeMs": 1650864287160.0793, + "birthtimeMs": 1652683715285.7583, + "atime": "2022-05-20T06:48:08.299Z", + "mtime": "2019-09-24T06:24:22.000Z", + "ctime": "2022-04-25T05:24:47.160Z", + "birthtime": "2022-05-16T06:48:35.286Z" + }, + "HealthCheck": "", + "TranscodeDecisionMaker": "", + "lastHealthCheckDate": 0, + "holdUntil": 0, + "lastTranscodeDate": 0, + "bumped": false, + "history": "", + "oldSize": 0, + "newSize": 0, + "videoStreamIndex": 0, + "lastUpdate": 1653028721083, + "meta": { + "SourceFile": "C:/Transcode/Source Folder/SampleVideo_1280x720_1mb.mp4", + "errors": [], + "Duration": 5.312, + "PreviewDuration": 0, + "SelectionDuration": 0, + "TrackDuration": 5.28, + "MediaDuration": 5.28, + "ExifToolVersion": 12.4, + "FileName": "SampleVideo_1280x720_1mb.mp4", + "Directory": "C:/Transcode/Source Folder", + "FileSize": "1032 KiB", + "FileModifyDate": { + "year": 2019, + "month": 9, + "day": 24, + "hour": 7, + "minute": 24, + "second": 22, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2019:09:24 07:24:22+01:00" + }, + "FileAccessDate": { + "year": 2022, + "month": 5, + "day": 20, + "hour": 7, + "minute": 48, + "second": 6, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:20 07:48:06+01:00" + }, + "FileCreateDate": { + "year": 2022, + "month": 5, + "day": 16, + "hour": 7, + "minute": 48, + "second": 35, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:16 07:48:35+01:00" + }, + "FilePermissions": "-r--r--r--", + "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" + ], + "MediaDataSize": 0, + "MediaDataOffset": 1051515, + "MovieHeaderVersion": 0, + "CreateDate": { + "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, + "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, + "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": "Lavf53.24.2", + "Title": "Sample title test", + "Composer": "th", + "BeatsPerMinute": 0, + "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", + "Megapixels": 0.922, + "AvgBitrate": "1.58 Mbps", + "Rotation": 0 + }, + "mediaInfo": { + "@ref": "", + "track": [ + { + "@type": "General", + "VideoCount": "1", + "AudioCount": "1", + "Format": "MPEG-4", + "Format_Profile": "Base Media", + "CodecID": "isom", + "CodecID_Compatible": "isom/iso2/avc1/mp41", + "FileSize": "1056519", + "Duration": "5.312", + "OverallBitRate_Mode": "VBR", + "OverallBitRate": "1591143", + "FrameRate": "25.000", + "FrameCount": "132", + "StreamSize": "5060", + "HeaderSize": "40", + "DataSize": "1051467", + "FooterSize": "5012", + "IsStreamable": "No", + "Title": "Sample title test", + "Movie": "Sample title test", + "Performer": "hhj", + "Composer": "th", + "Genre": "this", + "Recorded_Date": "2018", + "Encoded_Date": "UTC 1970-01-08 00:00:00", + "Tagged_Date": "UTC 2014-07-19 17:15:29", + "Encoded_Application": "Lavf53.24.2", + "Comment": "hhk" + }, + { + "@type": "Video", + "StreamOrder": "0", + "ID": "1", + "Format": "AVC", + "Format_Profile": "Main", + "Format_Level": "3.1", + "Format_Settings_CABAC": "Yes", + "Format_Settings_RefFrames": "1", + "CodecID": "avc1", + "Duration": "5.280", + "BitRate": "1205959", + "Width": "1280", + "Height": "720", + "Sampled_Width": "1280", + "Sampled_Height": "720", + "PixelAspectRatio": "1.000", + "DisplayAspectRatio": "1.778", + "Rotation": "0.000", + "FrameRate_Mode": "CFR", + "FrameRate_Mode_Original": "VFR", + "FrameRate": "25.000", + "FrameCount": "132", + "ColorSpace": "YUV", + "ChromaSubsampling": "4:2:0", + "BitDepth": "8", + "ScanType": "Progressive", + "StreamSize": "795933", + "Encoded_Date": "UTC 1970-01-01 00:00:00", + "Tagged_Date": "UTC 1970-01-01 00:00:00", + "extra": { + "CodecConfigurationBox": "avcC" + } + }, + { + "@type": "Audio", + "StreamOrder": "1", + "ID": "2", + "Format": "AAC", + "Format_AdditionalFeatures": "LC", + "CodecID": "mp4a-40-2", + "Duration": "5.312", + "BitRate_Mode": "VBR", + "BitRate": "384000", + "BitRate_Maximum": "400392", + "Channels": "6", + "ChannelPositions": "Front: L C R, Side: L R, LFE", + "ChannelLayout": "C L R Ls Rs LFE", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "254976", + "FrameRate": "46.875", + "FrameCount": "249", + "Compression_Mode": "Lossy", + "StreamSize": "255526", + "StreamSize_Proportion": "0.24186", + "Default": "Yes", + "AlternateGroup": "1", + "Encoded_Date": "UTC 1970-01-01 00:00:00", + "Tagged_Date": "UTC 1970-01-01 00:00:00" + } + ] + } + } \ No newline at end of file diff --git a/tests/sampleData/media/sampleH265_1.json b/tests/sampleData/media/sampleH265_1.json new file mode 100644 index 0000000..81d53e6 --- /dev/null +++ b/tests/sampleData/media/sampleH265_1.json @@ -0,0 +1,334 @@ +{ + "_id": "C:/Transcode/Source Folder/qsv_h265.mkv", + "file": "C:/Transcode/Source Folder/qsv_h265.mkv", + "DB": "2MY5YD7P8", + "footprintId": "xkZP3IPR6g", + "hasClosedCaptions": false, + "container": "mkv", + "scannerReads": { + "ffProbeRead": "success", + "exiftoolRead": "success", + "mediaInfoRead": "success", + "closedCaptionRead": "\"Unable to run CCExtractor\"" + }, + "ffProbeData": { + "streams": [ + { + "index": 0, + "codec_name": "hevc", + "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)", + "profile": "Main", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1920, + "height": 1080, + "coded_width": 1920, + "coded_height": 1088, + "closed_captions": 0, + "has_b_frames": 1, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": 150, + "color_range": "tv", + "color_space": "bt709", + "color_transfer": "bt709", + "color_primaries": "bt709", + "chroma_location": "left", + "refs": 1, + "r_frame_rate": "25/1", + "avg_frame_rate": "25/1", + "time_base": "1/1000", + "start_pts": 21, + "start_time": "0.021000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "DURATION": "00:00:21.341000000" + } + }, + { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "title": "Stereo", + "DURATION": "00:00:21.375000000" + } + } + ], + "format": { + "filename": "C:/Transcode/Source Folder/qsv_h265.mkv", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "0.000000", + "duration": "21.375000", + "size": "8569883", + "bit_rate": "3207441", + "probe_score": 100, + "tags": { + "creation_time": "2019-09-13T16:46:14.000000Z", + "ENCODER": "Lavf58.20.100" + } + } + }, + "file_size": 8.172877311706543, + "video_resolution": "1080p", + "fileMedium": "video", + "video_codec_name": "hevc", + "audio_codec_name": "", + "lastPluginDetails": "none", + "createdAt": 1653029410394, + "bit_rate": 3207441, + "duration": 21, + "statSync": { + "dev": 3832468976, + "mode": 33060, + "nlink": 1, + "uid": 0, + "gid": 0, + "rdev": 0, + "blksize": 4096, + "ino": 1970324841360027, + "size": 8569883, + "blocks": 16744, + "atimeMs": 1653029410381.1382, + "mtimeMs": 1568393195000, + "ctimeMs": 1650864287188.087, + "birthtimeMs": 1650864302270.2063, + "atime": "2022-05-20T06:50:10.381Z", + "mtime": "2019-09-13T16:46:35.000Z", + "ctime": "2022-04-25T05:24:47.188Z", + "birthtime": "2022-04-25T05:25:02.270Z" + }, + "HealthCheck": "", + "TranscodeDecisionMaker": "", + "lastHealthCheckDate": 0, + "holdUntil": 0, + "lastTranscodeDate": 0, + "bumped": false, + "history": "", + "oldSize": 0, + "newSize": 0, + "videoStreamIndex": 0, + "lastUpdate": 1653027918258, + "meta": { + "SourceFile": "C:/Transcode/Source Folder/qsv_h265.mkv", + "errors": [], + "Duration": 21.375, + "ExifToolVersion": 12.4, + "FileName": "qsv_h265.mkv", + "Directory": "C:/Transcode/Source Folder", + "FileSize": "8.2 MiB", + "FileModifyDate": { + "year": 2019, + "month": 9, + "day": 13, + "hour": 17, + "minute": 46, + "second": 35, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2019:09:13 17:46:35+01:00" + }, + "FileAccessDate": { + "year": 2022, + "month": 5, + "day": 20, + "hour": 7, + "minute": 50, + "second": 9, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:20 07:50:09+01:00" + }, + "FileCreateDate": { + "year": 2022, + "month": 4, + "day": 25, + "hour": 6, + "minute": 25, + "second": 2, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:04:25 06:25:02+01:00" + }, + "FilePermissions": "-r--r--r--", + "FileType": "MKV", + "FileTypeExtension": "mkv", + "MIMEType": "video/x-matroska", + "EBMLVersion": 1, + "EBMLReadVersion": 1, + "DocType": "matroska", + "DocTypeVersion": 4, + "DocTypeReadVersion": 2, + "TimecodeScale": "1 ms", + "MuxingApp": "Lavf58.20.100", + "WritingApp": "HandBrake 1.2.2 2019022300", + "DateTimeOriginal": { + "year": 2019, + "month": 9, + "day": 13, + "hour": 16, + "minute": 46, + "second": 14, + "millisecond": 0, + "tzoffsetMinutes": 0, + "rawValue": "2019:09:13 16:46:14Z" + }, + "VideoFrameRate": 25, + "ImageWidth": 1920, + "ImageHeight": 1080, + "TrackNumber": 2, + "TrackName": "Stereo", + "TrackLanguage": "und", + "CodecID": "A_AAC", + "TrackType": "Audio", + "AudioChannels": 2, + "AudioSampleRate": 48000, + "TagName": "DURATION", + "TagString": "00:00:21.375000000", + "ImageSize": "1920x1080", + "Megapixels": 2.1 + }, + "mediaInfo": { + "@ref": "", + "track": [ + { + "@type": "General", + "UniqueID": "112612991515236890937117095733641799622", + "VideoCount": "1", + "AudioCount": "1", + "Format": "Matroska", + "Format_Version": "4", + "FileSize": "8569883", + "Duration": "21.375", + "OverallBitRate": "3207442", + "FrameRate": "25.000", + "FrameCount": "533", + "IsStreamable": "Yes", + "Encoded_Date": "UTC 2019-09-13 16:46:14", + "Encoded_Application": "HandBrake 1.2.2 2019022300", + "Encoded_Library": "Lavf58.20.100", + "extra": { + "ErrorDetectionType": "Per level 1" + } + }, + { + "@type": "Video", + "StreamOrder": "0", + "ID": "1", + "UniqueID": "1", + "Format": "HEVC", + "Format_Profile": "Main", + "Format_Level": "5", + "Format_Tier": "Main", + "CodecID": "V_MPEGH/ISO/HEVC", + "Duration": "21.320000000", + "Width": "1920", + "Height": "1080", + "Stored_Height": "1088", + "Sampled_Width": "1920", + "Sampled_Height": "1080", + "PixelAspectRatio": "1.000", + "DisplayAspectRatio": "1.778", + "FrameRate_Mode": "CFR", + "FrameRate": "25.000", + "FrameCount": "533", + "ColorSpace": "YUV", + "ChromaSubsampling": "4:2:0", + "BitDepth": "8", + "Delay": "0.021", + "Default": "Yes", + "Forced": "No", + "colour_description_present": "Yes", + "colour_description_present_Source": "Stream", + "colour_range": "Limited", + "colour_range_Source": "Stream", + "colour_primaries": "BT.709", + "colour_primaries_Source": "Stream", + "transfer_characteristics": "BT.709", + "transfer_characteristics_Source": "Stream", + "matrix_coefficients": "BT.709", + "matrix_coefficients_Source": "Stream" + }, + { + "@type": "Audio", + "StreamOrder": "1", + "ID": "2", + "UniqueID": "2", + "Format": "AAC", + "Format_Settings_SBR": "No (Explicit)", + "Format_AdditionalFeatures": "LC", + "CodecID": "A_AAC-2", + "Duration": "21.375000000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "1026000", + "FrameRate": "46.875", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "Title": "Stereo", + "Default": "Yes", + "Forced": "No" + } + ] + } + } \ No newline at end of file From 275025ece888239d89538f2aefa89469b03309c4 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 13:40:08 +0100 Subject: [PATCH 024/126] Add tdarrSkipTest logic --- ...ugin_00td_action_add_audio_stream_codec.js | 1 + ...gin_00td_action_handbrake_basic_options.js | 1 + ...gin_00td_action_handbrake_ffmpeg_custom.js | 1 + ...lugin_00td_action_keep_one_audio_stream.js | 1 + ...gin_00td_action_re_order_all_streams_v2.js | 1 + ...darr_Plugin_00td_action_remux_container.js | 1 + ..._action_standardise_audio_stream_codecs.js | 1 + .../Tdarr_Plugin_00td_filter_by_bitrate.js | 1 + .../Tdarr_Plugin_00td_filter_by_resolution.js | 1 + Community/Tdarr_Plugin_00td_filter_by_size.js | 1 + .../Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js | 1 + ...darr_Plugin_075a_Transcode_Customisable.js | 1 + ...5b_FFMPEG_HEVC_Generic_Video_Audio_Only.js | 1 + ...PEG_HEVC_Generic_Video_Audio_Only_CRF20.js | 1 + ...HEVC_GPU_Generic_Video_Audio_Only_CRF20.js | 1 + ...darr_Plugin_076a_re_order_audio_streams.js | 1 + ...r_Plugin_076b_re_order_subtitle_streams.js | 1 + ...n_077b_HandBrake_NVENC_264_Configurable.js | 1 + ..._Output_embedded_subs_to_SRT_and_remove.js | 1 + Community/Tdarr_Plugin_43az_add_to_radarr.js | 1 + ...lugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js | 1 + ...r_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js | 1 + ...de audio and video with HW (PC and Mac).js | 1 + Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js | 1 + ...Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js | 1 + .../Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js | 1 + Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js | 1 + .../Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js | 1 + Community/Tdarr_Plugin_MC93_Migz1Remux.js | 1 + .../Tdarr_Plugin_MC93_Migz2CleanTitle.js | 1 + .../Tdarr_Plugin_MC93_Migz3CleanAudio.js | 1 + Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js | 1 + .../Tdarr_Plugin_MC93_Migz5ConvertAudio.js | 1 + .../Tdarr_Plugin_MC93_Migz6OrderStreams.js | 1 + .../Tdarr_Plugin_MC93_MigzImageRemoval.js | 1 + .../Tdarr_Plugin_MC93_MigzPlex_Autoscan.js | 1 + ...gin_MP01_MichPasCleanSubsAndAudioCodecs.js | 1 + .../Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js | 1 + ...CLU_2_Pass_Loudnorm_Audio_Normalisation.js | 1 + ...O0dCTlb_Set_File_Permissions_For_UnRaid.js | 1 + ...rr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js | 1 + Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js | 1 + ..._Plugin_VP92_VP9_Match_Bitrate_One_Pass.js | 1 + ...ugin_a37x_Drawmonster_MP4_No_Title_Meta.js | 1 + ...eAGitGat_HandBrake_H264_VeryFast1080p30.js | 1 + ..._HaveAGitGat_HandBrake_H264_Fast1080p30.js | 1 + ..._Transcode_Specific_Audio_Stream_Codecs.js | 1 + .../Tdarr_Plugin_a9he_New_file_size_check.js | 1 + ...arr_Plugin_a9hf_New_file_duration_check.js | 1 + ...rr_Plugin_b38x_Nosirus_h265_aac_no_meta.js | 1 + ...gin_b39x_the1poet_surround_sound_to_ac3.js | 1 + ...Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js | 1 + ...Tdarr_Plugin_c0r1_SetDefaultAudioStream.js | 1 + ..._d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js | 1 + ...in_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js | 1 + ...gin_da11_Dallas_FFmpeg_Presets_H264_MP4.js | 1 + ...darr_Plugin_drdd_standardise_all_in_one.js | 1 + ..._H.264_MKV_480p30_No_Subs_No_Title_Meta.js | 1 + ..._H.264_MKV_720p30_No_Subs_No_Title_Meta.js | 1 + ...H.264_MKV_1080p30_No_Subs_No_Title_Meta.js | 1 + .../Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js | 1 + ...rr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js | 1 + .../Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js | 1 + ...rr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js | 1 + .../Tdarr_Plugin_goof1_URL_Plex_Refresh.js | 1 + ...rr_Plugin_henk_Add_Specific_Audio_Codec.js | 1 + ...r_Plugin_henk_Keep_Native_Lang_Plus_Eng.js | 1 + ...rawmonster_MP4_AAC_No_Subs_No_metaTitle.js | 1 + ..._Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js | 1 + ...eons001_Downmix_to_stereo_and_apply_DRC.js | 1 + .../Tdarr_Plugin_lmg1_Reorder_Streams.js | 1 + ...r_Plugin_nc7x_Drawmonster_No_Title_Meta.js | 1 + ...2_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js | 1 + ...in_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js | 1 + ...rr01_drpeppershaker_extract_subs_to_SRT.js | 1 + .../Tdarr_Plugin_s710_nick_h265_nvenc_4K.js | 1 + Community/Tdarr_Plugin_s7x8_winsome_h265.js | 1 + .../Tdarr_Plugin_s7x9_winsome_h265_10bit.js | 1 + .../Tdarr_Plugin_s7x9_winsome_h265_nvenc.js | 1 + ...rr_Plugin_sdd3_Remove_Commentary_Tracks.js | 1 + ...df5_Thierrrrry_Remove_Non_English_Audio.js | 1 + .../Tdarr_Plugin_vdka_Remove_DataStreams.js | 1 + ..._vdka_Tiered_CPU_CRF_Based_Configurable.js | 1 + ...dka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js | 1 + Community/Tdarr_Plugin_x7ab_Remove_Subs.js | 1 + ...darr_Plugin_x7ac_Remove_Closed_Captions.js | 1 + ...b_TheRealShadoh_FFmpeg_Subs_H264_Medium.js | 1 + ...Plugin_z18s_rename_files_based_on_codec.js | 1 + ...ame_files_based_on_codec_and_resolution.js | 1 + ...1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js | 1 + ...2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js | 1 + ...TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js | 1 + .../Tdarr_Plugin_z80t_keep_original_date.js | 1 + tests/runTests.js | 55 +++++++++++++------ 94 files changed, 130 insertions(+), 18 deletions(-) diff --git a/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js b/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js index 79b766b..ef204c1 100644 --- a/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js +++ b/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_add_audio_stream_codec', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js b/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js index 05e6f6b..34dba85 100644 --- a/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js +++ b/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_handbrake_basic_options', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js b/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js index 3c3871d..26f3f1c 100644 --- a/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js +++ b/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js b/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js index 5925da3..789fbae 100644 --- a/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js +++ b/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_keep_one_audio_stream', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js index 691b173..779ec41 100644 --- a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js +++ b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_re_order_all_streams_v2', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_00td_action_remux_container.js b/Community/Tdarr_Plugin_00td_action_remux_container.js index d43cf84..a45b03c 100644 --- a/Community/Tdarr_Plugin_00td_action_remux_container.js +++ b/Community/Tdarr_Plugin_00td_action_remux_container.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_remux_container', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js b/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js index 4d59668..2bc1e50 100644 --- a/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js +++ b/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_standardise_audio_stream_codecs', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_00td_filter_by_bitrate.js b/Community/Tdarr_Plugin_00td_filter_by_bitrate.js index 7219b51..5914e42 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_bitrate.js +++ b/Community/Tdarr_Plugin_00td_filter_by_bitrate.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_filter_by_bitrate', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_00td_filter_by_resolution.js b/Community/Tdarr_Plugin_00td_filter_by_resolution.js index c63c435..3a62c3e 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_resolution.js +++ b/Community/Tdarr_Plugin_00td_filter_by_resolution.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_filter_by_resolution', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_00td_filter_by_size.js b/Community/Tdarr_Plugin_00td_filter_by_size.js index 2e9ae67..f2321a9 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_size.js +++ b/Community/Tdarr_Plugin_00td_filter_by_size.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_filter_by_size', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js b/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js index e699050..edc8f03 100644 --- a/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js +++ b/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_075a_FFMPEG_HEVC_Generic', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_075a_Transcode_Customisable.js b/Community/Tdarr_Plugin_075a_Transcode_Customisable.js index 7a144d1..5fad3f9 100644 --- a/Community/Tdarr_Plugin_075a_Transcode_Customisable.js +++ b/Community/Tdarr_Plugin_075a_Transcode_Customisable.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => ({ id: "Tdarr_Plugin_075a_Transcode_Customisable", Stage: "Pre-processing", diff --git a/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js b/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js index 27699a7..63ad51b 100644 --- a/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js +++ b/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only", diff --git a/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js b/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js index 565926d..4091cc4 100644 --- a/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js +++ b/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20", diff --git a/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js b/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js index c17a3a7..b4ef9f2 100644 --- a/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js +++ b/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20", diff --git a/Community/Tdarr_Plugin_076a_re_order_audio_streams.js b/Community/Tdarr_Plugin_076a_re_order_audio_streams.js index 77835ca..a5b250e 100644 --- a/Community/Tdarr_Plugin_076a_re_order_audio_streams.js +++ b/Community/Tdarr_Plugin_076a_re_order_audio_streams.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_076a_re_order_audio_streams", diff --git a/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js b/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js index 65a3b86..6b8fcf8 100644 --- a/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js +++ b/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_076b_re_order_subtitle_streams", diff --git a/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js b/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js index 086dadd..7957821 100644 --- a/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js +++ b/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable", diff --git a/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js b/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js index 5198704..5a868a5 100644 --- a/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js +++ b/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove", diff --git a/Community/Tdarr_Plugin_43az_add_to_radarr.js b/Community/Tdarr_Plugin_43az_add_to_radarr.js index eff190d..8129e09 100644 --- a/Community/Tdarr_Plugin_43az_add_to_radarr.js +++ b/Community/Tdarr_Plugin_43az_add_to_radarr.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: 'Tdarr_Plugin_43az_add_to_radarr', diff --git a/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js b/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js index a52d188..4943049 100644 --- a/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js +++ b/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js @@ -1,6 +1,7 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ /* eslint-disable no-restricted-globals */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js b/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js index e8793e6..b7817c0 100644 --- a/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js +++ b/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js @@ -1,5 +1,6 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll", diff --git a/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js b/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js index d7cd530..94d96b1 100644 --- a/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js +++ b/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js @@ -4,6 +4,7 @@ /* eslint no-bitwise: 0 */ /* eslint no-mixed-operators: 0 */ +// tdarrSkipTest const details = () => { return { id: 'Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac)', diff --git a/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js b/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js index 0c5a59f..122134b 100644 --- a/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js +++ b/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js @@ -1,4 +1,5 @@ module.exports.dependencies = ['import-fresh']; +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_Greg_MP3_FFMPEG_CPU', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js b/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js index afa0182..2b685a3 100644 --- a/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js +++ b/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js @@ -86,6 +86,7 @@ Audio: (Only one audio stream is used!!) /// /////////////////////////////////////////////////////////////////////////////////////////////////// */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js b/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js index 7459154..50277de 100644 --- a/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js +++ b/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js @@ -148,6 +148,7 @@ // ////////////////////////////////////////////////////////////////////////////////////////////////////// +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix", diff --git a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js index 11edf36..39fd212 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js +++ b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js @@ -1,4 +1,5 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz1FFMPEG', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js index a5abfcb..0f6c746 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js +++ b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js @@ -1,4 +1,5 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz1FFMPEG_CPU', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_MC93_Migz1Remux.js b/Community/Tdarr_Plugin_MC93_Migz1Remux.js index 37eed73..3c4227c 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1Remux.js +++ b/Community/Tdarr_Plugin_MC93_Migz1Remux.js @@ -1,4 +1,5 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz1Remux', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js b/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js index 127e159..ef82682 100644 --- a/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js +++ b/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz2CleanTitle', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js b/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js index 32bf0d2..6852f9d 100644 --- a/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js +++ b/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js @@ -1,4 +1,5 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz3CleanAudio', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js b/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js index fe55253..3820a78 100644 --- a/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js +++ b/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js @@ -1,4 +1,5 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz4CleanSubs', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js b/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js index f3cfd11..216942b 100644 --- a/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js +++ b/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js @@ -1,4 +1,5 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz5ConvertAudio', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js b/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js index 1da1993..6aecf75 100644 --- a/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js +++ b/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js @@ -1,4 +1,5 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz6OrderStreams', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js b/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js index 6768bad..946f943 100644 --- a/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js +++ b/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js @@ -1,4 +1,5 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_MigzImageRemoval', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js b/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js index fb77764..f29ce6f 100644 --- a/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js +++ b/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js @@ -3,6 +3,7 @@ module.exports.dependencies = [ ]; /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_MigzPlex_Autoscan', Stage: 'Post-processing', diff --git a/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js b/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js index bce6bf4..da6f646 100644 --- a/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js +++ b/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs", diff --git a/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js b/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js index 701aa70..82502fb 100644 --- a/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js +++ b/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js @@ -1,6 +1,7 @@ /* eslint-disable */ const vaapiPrefix = ` -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi `; +// tdarrSkipTest const details = () => { return { id: `Tdarr_Plugin_Mthr_VaapiHEVCTranscode`, diff --git a/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js b/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js index 1cbe2bf..dac17b6 100644 --- a/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js +++ b/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js @@ -14,6 +14,7 @@ var secondPass = false; var logOutFile = ''; +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation", diff --git a/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js b/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js index d79f302..d083a33 100644 --- a/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js +++ b/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js @@ -1,6 +1,7 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid", diff --git a/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js b/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js index eef3529..b91e1a9 100644 --- a/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js +++ b/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js @@ -3,6 +3,7 @@ // https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js // Seriously, all I did was make it work for converting things to h264 instead of hevc +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264', Stage: 'Pre-processing', // Preprocessing or Post-processing. Determines when the plugin will be executed. diff --git a/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js b/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js index 63d5ec6..86c6dea 100644 --- a/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js +++ b/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js @@ -4,6 +4,7 @@ module.exports.dependencies = [ ]; /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_TD01_TOAD_Autoscan', Stage: 'Post-processing', diff --git a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js index 1412281..e5bf1af 100644 --- a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js +++ b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js @@ -1,4 +1,5 @@ /* eslint max-classes-per-file: ["error", 2] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js b/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js index 8565365..a06f3fa 100644 --- a/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta", diff --git a/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js b/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js index d782b1b..47bb9ef 100644 --- a/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js +++ b/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30", diff --git a/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js b/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js index d95a3e4..af4053c 100644 --- a/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js +++ b/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30", diff --git a/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js b/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js index c09e788..376633a 100644 --- a/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js +++ b/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs", diff --git a/Community/Tdarr_Plugin_a9he_New_file_size_check.js b/Community/Tdarr_Plugin_a9he_New_file_size_check.js index 32e99d6..e96caec 100644 --- a/Community/Tdarr_Plugin_a9he_New_file_size_check.js +++ b/Community/Tdarr_Plugin_a9he_New_file_size_check.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_a9he_New_file_size_check', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js b/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js index 4cda5ca..6f1fcc5 100644 --- a/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js +++ b/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js @@ -1,5 +1,6 @@ // eslint-disable-next-line import/no-unresolved +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_a9hf_New_file_duration_check', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js b/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js index c790869..847b659 100644 --- a/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js +++ b/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta", diff --git a/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js b/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js index 0546d04..07222fc 100644 --- a/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js +++ b/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js index 7035c3d..205132e 100644 --- a/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js +++ b/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -10,6 +10,7 @@ // eslint-disable-next-line max-len // https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/cloud-computing-quicksync-video-ffmpeg-white-paper.pdf +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js b/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js index bdd492e..fa7b834 100644 --- a/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js +++ b/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_c0r1_SetDefaultAudioStream", diff --git a/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js b/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js index 699968b..0cab71a 100644 --- a/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js +++ b/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV", diff --git a/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js b/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js index c1b9ea4..137ae08 100644 --- a/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js +++ b/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix", diff --git a/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js b/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js index c1ebc6a..956dd08 100644 --- a/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js +++ b/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4", diff --git a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js index 9fdd9f8..00ba404 100644 --- a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js +++ b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js @@ -1,5 +1,6 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_drdd_standardise_all_in_one", diff --git a/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js b/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js index 3bb5280..1b13250 100644 --- a/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta", diff --git a/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js b/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js index 5cca05c..8d6543f 100644 --- a/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta", diff --git a/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js b/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js index 7ca1c11..6b79c8e 100644 --- a/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta", diff --git a/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js b/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js index 967339c..7b56fdf 100644 --- a/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js +++ b/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js @@ -1,5 +1,6 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e5c3_CnT_Add_Subtitles", diff --git a/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js b/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js index d36415e..c2d8fd4 100644 --- a/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js +++ b/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js @@ -1,5 +1,6 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio", diff --git a/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js b/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js index 6b0b0ea..d4b8266 100644 --- a/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js +++ b/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js @@ -1,5 +1,6 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e5c3_CnT_Remove_Letterbox", diff --git a/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js b/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js index 49203be..4e433ad 100644 --- a/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js +++ b/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs", diff --git a/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js b/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js index 7644d98..9afa86a 100644 --- a/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js +++ b/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_goof1_URL_Plex_Refresh', Stage: 'Post-processing', diff --git a/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js b/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js index cf46df8..06dd4c5 100644 --- a/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js +++ b/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_henk_Add_Specific_Audio_Codec', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js b/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js index 4aa06ae..243b675 100644 --- a/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js +++ b/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js @@ -1,5 +1,6 @@ /* eslint-disable no-await-in-loop */ module.exports.dependencies = ['axios', '@cospired/i18n-iso-languages']; +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js b/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js index 76e5104..b3ee6a0 100644 --- a/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js +++ b/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle", diff --git a/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js b/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js index 88bd347..edbc80e 100644 --- a/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js +++ b/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle", diff --git a/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js b/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js index 95d04ec..39d830e 100644 --- a/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js +++ b/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js b/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js index bf5c9a5..24de43c 100644 --- a/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js +++ b/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_lmg1_Reorder_Streams", diff --git a/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js b/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js index e380b81..3526d03 100644 --- a/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta", diff --git a/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js b/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js index fd2242d..1b8d1e8 100644 --- a/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js +++ b/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation", diff --git a/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js b/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js index 6d236a5..9453c42 100644 --- a/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js +++ b/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV", diff --git a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js index 4dcd6ee..75d5e77 100644 --- a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js +++ b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js b/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js index 689d403..6c559b0 100644 --- a/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js +++ b/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s710_nick_h265_nvenc_4K", diff --git a/Community/Tdarr_Plugin_s7x8_winsome_h265.js b/Community/Tdarr_Plugin_s7x8_winsome_h265.js index b1b293f..8bc954f 100644 --- a/Community/Tdarr_Plugin_s7x8_winsome_h265.js +++ b/Community/Tdarr_Plugin_s7x8_winsome_h265.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s7x8_winsome_h265", diff --git a/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js index d5d23f6..acf22fb 100644 --- a/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js +++ b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s7x9_winsome_h265_10bit", diff --git a/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js b/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js index f336a5e..447044d 100644 --- a/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js +++ b/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s7x9_winsome_h265_nvenc", diff --git a/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js b/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js index 00df33b..8c8b8e2 100644 --- a/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js +++ b/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_sdd3_Remove_Commentary_Tracks", diff --git a/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js b/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js index 9be9ed1..71708c3 100644 --- a/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js +++ b/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio", diff --git a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js index 634c9d3..64e71ef 100644 --- a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js +++ b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_vdka_Remove_DataStreams", diff --git a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js index e1d5aee..f5614f8 100644 --- a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js +++ b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js b/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js index 4afd5f3..e0ca948 100644 --- a/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js +++ b/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: 'Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE', diff --git a/Community/Tdarr_Plugin_x7ab_Remove_Subs.js b/Community/Tdarr_Plugin_x7ab_Remove_Subs.js index 7bd12ff..3bf03de 100644 --- a/Community/Tdarr_Plugin_x7ab_Remove_Subs.js +++ b/Community/Tdarr_Plugin_x7ab_Remove_Subs.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_x7ab_Remove_Subs", diff --git a/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js b/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js index f5fe57a..26afd05 100644 --- a/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js +++ b/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_x7ac_Remove_Closed_Captions', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js index 88fc14e..716e730 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js b/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js index db917e8..7cff564 100644 --- a/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js +++ b/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js @@ -1,5 +1,6 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_z18s_rename_files_based_on_codec", diff --git a/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js b/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js index d6adedd..1a2f75d 100644 --- a/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js +++ b/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution', Stage: 'Post-processing', diff --git a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js index fbc9de3..ad301d8 100644 --- a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js +++ b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js index 28ee579..dc863a4 100644 --- a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js +++ b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js index 597003f..be10d89 100644 --- a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js +++ b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z80t_keep_original_date.js b/Community/Tdarr_Plugin_z80t_keep_original_date.js index d7f6715..9364705 100644 --- a/Community/Tdarr_Plugin_z80t_keep_original_date.js +++ b/Community/Tdarr_Plugin_z80t_keep_original_date.js @@ -4,6 +4,7 @@ module.exports.dependencies = [ 'touch', ]; +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z80t_keep_original_date', Stage: 'Post-processing', diff --git a/tests/runTests.js b/tests/runTests.js index 476fc3c..efc459c 100644 --- a/tests/runTests.js +++ b/tests/runTests.js @@ -3,28 +3,47 @@ const fs = require('fs'); const childProcess = require('child_process'); -const filenames = fs.readdirSync(`${__dirname}/Community`); +const filenames = fs.readdirSync(`${process.cwd()}/Community`); const run = async () => { for (let i = 0; i < filenames.length; i += 1) { - const path = `${__dirname}/Community/${filenames[i]}`; - // eslint-disable-next-line no-await-in-loop - await new Promise((resolve) => { - childProcess.exec(`node ${path}`, (err, stdout, stderr) => { - if (err) { - console.log(err); - } - console.log(stdout); - console.log(stderr); - }).on('exit', async (code) => { - if (code !== 0) { - await new Promise((resolve2) => setTimeout(resolve2, 1000)); - process.exit(1); - } else { - resolve(); - } + const pluginPath = `${process.cwd()}/Community/${filenames[i]}`; + const text = fs.readFileSync(pluginPath); + const pluginTestpath = `${__dirname}/Community/${filenames[i]}`; + + let shouldRunTest = true; + if (!text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) { + console.log(`${filenames[i]} does not have a test but should do.`); + process.exit(1); + } else if (!text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) { + console.log(`${filenames[i]} running test`); + } else if (text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) { + console.log(`${filenames[i]} should have // tdarrSkipTest removed`); + process.exit(1); + } else if (text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) { + console.log(`${filenames[i]} skipping tests`); + shouldRunTest = false; + } + + if (shouldRunTest) { + // eslint-disable-next-line no-await-in-loop + await new Promise((resolve) => { + childProcess.exec(`node ${pluginTestpath}`, (err, stdout, stderr) => { + if (err) { + console.log(err); + } + console.log(stdout); + console.log(stderr); + }).on('exit', async (code) => { + if (code !== 0) { + await new Promise((resolve2) => setTimeout(resolve2, 1000)); + process.exit(1); + } else { + resolve(); + } + }); }); - }); + } } }; From 8f9a97021f7ef8778258499c37c5ac4bc09d1cd1 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 13:55:02 +0100 Subject: [PATCH 025/126] Add Tdarr_Plugin_00td_action_add_audio_stream_codec test --- ...ugin_00td_action_add_audio_stream_codec.js | 1 - ...ugin_00td_action_add_audio_stream_codec.js | 92 +++++++++++++++++++ 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js diff --git a/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js b/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js index ef204c1..79b766b 100644 --- a/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js +++ b/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_add_audio_stream_codec', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js b/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js new file mode 100644 index 0000000..3862352 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js @@ -0,0 +1,92 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -ac 2', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'The required channel count 2 is lower than the highest available channel count (6). Adding! \n', + handbrakeMode: false, + ffmpegMode: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 2', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'The required channel count 2 is lower than the highest available channel count (6). Adding! \n', + handbrakeMode: false, + ffmpegMode: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + channels: 6, + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 6', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'The required channel count 6 is lower than the highest available channel count (6). Adding! \n', + handbrakeMode: false, + ffmpegMode: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + channels: 8, + language: 'fr', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 6', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'The required channel count (8) is higher than the highest channel available in specified lang tag (6). Adding lower channel track. \n', + handbrakeMode: false, + ffmpegMode: true, + }, + }, +]; + +run(tests); From 3d7314b94cbdef6b24f2d3a72d2172456d146f5d Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 13:59:37 +0100 Subject: [PATCH 026/126] Add Tdarr_Plugin_00td_action_handbrake_basic_options test --- ...gin_00td_action_handbrake_basic_options.js | 1 - ...gin_00td_action_handbrake_basic_options.js | 74 +++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js diff --git a/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js b/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js index 34dba85..05e6f6b 100644 --- a/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js +++ b/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_handbrake_basic_options', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js b/tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js new file mode 100644 index 0000000..5777e28 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js @@ -0,0 +1,74 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Very Fast 1080p30" -e x265 --all-subtitles', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'File is being transcoded using HandBrake \n', + handbrakeMode: true, + ffmpegMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + handbrakePreset: 'Fast 576p25', + videoEncoder: 'nvenc_h265', + keepSubtitles: 'true', + container: 'mp4', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Fast 576p25" -e nvenc_h265 --all-subtitles', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'File is being transcoded using HandBrake \n', + handbrakeMode: true, + ffmpegMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + handbrakePreset: 'Fast 576p25', + videoEncoder: 'nvenc_h265', + keepSubtitles: 'false', + container: 'mov', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Fast 576p25" -e nvenc_h265 ', + container: '.mov', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'File is being transcoded using HandBrake \n', + handbrakeMode: true, + ffmpegMode: false, + }, + }, +]; + +run(tests); From b1941589c6dca4050c8f28aa5da777f992645bec Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 14:08:48 +0100 Subject: [PATCH 027/126] Add Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom test --- ...gin_00td_action_handbrake_ffmpeg_custom.js | 5 +- ...gin_00td_action_handbrake_ffmpeg_custom.js | 66 +++++++++++++++++++ 2 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js diff --git a/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js b/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js index 26f3f1c..995603e 100644 --- a/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js +++ b/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom', Stage: 'Pre-processing', @@ -85,8 +84,8 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { processFile: false, preset: '', container: '', - handBrakeMode: false, - FFmpegMode: false, + handbrakeMode: false, + ffmpegMode: false, reQueueAfter: false, infoLog: '', }; diff --git a/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js b/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js new file mode 100644 index 0000000..41a2ff4 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js @@ -0,0 +1,66 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -map 0 -c copy', + container: '.mkv', + handbrakeMode: false, + ffmpegMode: true, + reQueueAfter: true, + infoLog: 'File is being transcoded using custom arguments \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + cli: 'handbrake', + arguments: '-Z "Very Fast 1080p30" --all-subtitles --all-audio', + container: 'mp4', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Very Fast 1080p30" --all-subtitles --all-audio', + container: '.mp4', + handbrakeMode: true, + ffmpegMode: false, + reQueueAfter: true, + infoLog: 'File is being transcoded using custom arguments \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + cli: 'ffmpeg', + arguments: '-c:v libx265 -crf 23 -ac 6 -c:a aac -preset veryfast', + container: 'mov', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v libx265 -crf 23 -ac 6 -c:a aac -preset veryfast', + container: '.mov', + handbrakeMode: false, + ffmpegMode: true, + reQueueAfter: true, + infoLog: 'File is being transcoded using custom arguments \n' + }, + }, +]; + +run(tests); From d409773061f74e79c3c8e51e38f098dad6a02a14 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 14:14:43 +0100 Subject: [PATCH 028/126] Add Tdarr_Plugin_00td_action_keep_one_audio_stream test --- ...lugin_00td_action_keep_one_audio_stream.js | 1 - ...lugin_00td_action_keep_one_audio_stream.js | 89 +++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js diff --git a/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js b/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js index 789fbae..5925da3 100644 --- a/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js +++ b/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_keep_one_audio_stream', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js b/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js new file mode 100644 index 0000000..26d68f4 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js @@ -0,0 +1,89 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:s? -map 0:d? -c copy -c:a:0 aac -ac 2', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'No en streams. The required channel count 2 is lower than the highest available channel count (6).Adding it and removing others! \n', + handbrakeMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 2', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'No en streams. The required channel count 2 is lower than the highest available channel count (6).Adding it and removing others! \n', + handbrakeMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + language: 'fr', + channels: '6', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 6', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'No fr streams. The required channel count 6 is lower than the highest available channel count (6).Adding it and removing others! \n', + handbrakeMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'aac', + language: 'und', + channels: '8', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'The best und stream already exists. It is the only audio stream. \n', + handbrakeMode: false, + }, + }, +]; + +run(tests); From 3ecd9937967cd269fc6a69a7c3076fb3a659cfde Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 14:14:51 +0100 Subject: [PATCH 029/126] Fix lint --- .../Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js b/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js index 41a2ff4..6be2efd 100644 --- a/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js +++ b/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js @@ -58,7 +58,7 @@ const tests = [ handbrakeMode: false, ffmpegMode: true, reQueueAfter: true, - infoLog: 'File is being transcoded using custom arguments \n' + infoLog: 'File is being transcoded using custom arguments \n', }, }, ]; From 5e61c32889b2d0b94bafed77bc80f9ca83fb0cec Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 15:08:19 +0100 Subject: [PATCH 030/126] Fix reorder streams bug --- Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js index 779ec41..4f162b2 100644 --- a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js +++ b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_re_order_all_streams_v2', Stage: 'Pre-processing', @@ -118,7 +117,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { for (let i = 0; i < items.length; i += 1) { const matchedStreams = []; for (let j = 0; j < streams.length; j += 1) { - if (String(sortType.getValue(streams[j])).includes(String(items[i]))) { + if (String(sortType.getValue(streams[j])) === String(items[i])) { if ( streams[j].codec_long_name && ( From a5109ac92126f06ab907194c86ccc2029200c5e8 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 15:08:49 +0100 Subject: [PATCH 031/126] Add Tdarr_Plugin_00td_action_re_order_all_streams_v2 test --- ...gin_00td_action_re_order_all_streams_v2.js | 72 ++ tests/sampleData/media/sampleH264_2.json | 775 ++++++++++++++++++ 2 files changed, 847 insertions(+) create mode 100644 tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js create mode 100644 tests/sampleData/media/sampleH264_2.json diff --git a/tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js b/tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js new file mode 100644 index 0000000..2567bac --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js @@ -0,0 +1,72 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + infoLog: 'Streams are in the correct order!', + }, + }, + { + // orig + // 0 vid h264 + // 1 flac eng + // 2 ac3 eng + // 3 eac3 eng + // 4 aac fre + // 5 aac eng + // 6 sub fre + + // expect + // 4 aac fre + // 2 ac3 eng + // 1 flac eng + // 3 eac3 eng + // 5 aac eng + // 6 sub fre + // 0 vid h264 + + // console.log(streams.map(stream => { + // return { + // "index": stream.index, + // codec_name: stream.codec_name, + // codec_type: stream.codec_type, + // language: stream.tags.language, + // } + // })) + + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: { + processOrder: 'codecs,channels,languages,streamTypes', + languages: 'fre,eng', + streamTypes: 'audio,subtitle,video', + codecs: 'ac3,flac,eac3,aac', + channels: '7.1,5.1,2,1', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -c copy -map 0:4 -map 0:2 -map 0:1 -map 0:3 -map 0:5 -map 0:6 -map 0:0', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + infoLog: 'Streams are not in the correct order!', + }, + }, +]; + +run(tests); diff --git a/tests/sampleData/media/sampleH264_2.json b/tests/sampleData/media/sampleH264_2.json new file mode 100644 index 0000000..7ad301b --- /dev/null +++ b/tests/sampleData/media/sampleH264_2.json @@ -0,0 +1,775 @@ +{ + "_id": "C:/Transcode/Source Folder/h264.mkv", + "file": "C:/Transcode/Source Folder/h264.mkv", + "DB": "2MY5YD7P8", + "footprintId": "asxmr-5Iij", + "hasClosedCaptions": false, + "container": "mkv", + "scannerReads": { + "ffProbeRead": "success", + "exiftoolRead": "success", + "mediaInfoRead": "success", + "closedCaptionRead": "success" + }, + "ffProbeData": { + "streams": [ + { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1918, + "height": 1080, + "coded_width": 1918, + "coded_height": 1080, + "closed_captions": 0, + "has_b_frames": 2, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "959:540", + "pix_fmt": "yuv420p", + "level": 41, + "color_range": "tv", + "color_space": "bt709", + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "r_frame_rate": "25/1", + "avg_frame_rate": "25/1", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bits_per_raw_sample": "8", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "fre", + "title": "title video", + "BPS-eng": "6453995", + "DURATION-eng": "00:01:03.960000000", + "NUMBER_OF_FRAMES-eng": "1599", + "NUMBER_OF_BYTES-eng": "51599695", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "DURATION": "00:01:03.986000000" + } + }, + { + "index": 1, + "codec_name": "flac", + "codec_long_name": "FLAC (Free Lossless Audio Codec)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "s32", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 5, + "start_time": "0.005000", + "bits_per_raw_sample": "24", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 flac", + "DURATION": "00:01:04.005000000" + } + }, + { + "index": 2, + "codec_name": "ac3", + "codec_long_name": "ATSC A/52A (AC-3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "192000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 ac3", + "DURATION": "00:01:04.000000000" + } + }, + { + "index": 3, + "codec_name": "eac3", + "codec_long_name": "ATSC A/52B (AC-3, E-AC-3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "192000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 eac3", + "DURATION": "00:01:04.000000000" + } + }, + { + "index": 4, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 5, + "start_time": "0.005000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "fre", + "title": "Français E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 aac", + "DURATION": "00:01:04.004000000" + } + }, + { + "index": 5, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 5, + "start_time": "0.005000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 aac", + "DURATION": "00:01:04.004000000" + } + }, + { + "index": 6, + "codec_name": "subrip", + "codec_long_name": "SubRip subtitle", + "codec_type": "subtitle", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 66031, + "duration": "66.031000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "fre", + "title": "Français", + "BPS-eng": "46", + "DURATION-eng": "00:01:05.840000000", + "NUMBER_OF_FRAMES-eng": "12", + "NUMBER_OF_BYTES-eng": "381", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "DURATION": "00:01:06.031000000" + } + } + ], + "format": { + "filename": "C:/Transcode/Source Folder/h264.mkv", + "nb_streams": 7, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "0.000000", + "duration": "66.031000", + "size": "68084120", + "bit_rate": "8248746", + "probe_score": 100, + "tags": { + "ENCODER": "Lavf58.24.101" + } + } + }, + "file_size": 64.9300765991211, + "video_resolution": "1080p", + "fileMedium": "video", + "video_codec_name": "h264", + "audio_codec_name": "", + "lastPluginDetails": "none", + "createdAt": 1653139154025, + "bit_rate": 8248746, + "duration": 66, + "statSync": { + "dev": 3832468976, + "mode": 33206, + "nlink": 1, + "uid": 0, + "gid": 0, + "rdev": 0, + "blksize": 4096, + "ino": 64176294690080990, + "size": 68084120, + "blocks": 132984, + "atimeMs": 1653139154001.7666, + "mtimeMs": 1594420078270.8928, + "ctimeMs": 1653139134390.225, + "birthtimeMs": 1653139123219.1018, + "atime": "2022-05-21T13:19:14.002Z", + "mtime": "2020-07-10T22:27:58.271Z", + "ctime": "2022-05-21T13:18:54.390Z", + "birthtime": "2022-05-21T13:18:43.219Z" + }, + "HealthCheck": "", + "TranscodeDecisionMaker": "", + "lastHealthCheckDate": 0, + "holdUntil": 0, + "lastTranscodeDate": 0, + "bumped": false, + "history": "", + "oldSize": 0, + "newSize": 0, + "videoStreamIndex": 0, + "meta": { + "SourceFile": "C:/Transcode/Source Folder/h264.mkv", + "errors": [], + "Duration": 66.031, + "ExifToolVersion": 12.4, + "FileName": "h264.mkv", + "Directory": "C:/Transcode/Source Folder", + "FileSize": "65 MiB", + "FileModifyDate": { + "year": 2020, + "month": 7, + "day": 10, + "hour": 23, + "minute": 27, + "second": 58, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2020:07:10 23:27:58+01:00" + }, + "FileAccessDate": { + "year": 2022, + "month": 5, + "day": 21, + "hour": 14, + "minute": 19, + "second": 11, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:21 14:19:11+01:00" + }, + "FileCreateDate": { + "year": 2022, + "month": 5, + "day": 21, + "hour": 14, + "minute": 18, + "second": 43, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:21 14:18:43+01:00" + }, + "FilePermissions": "-rw-rw-rw-", + "FileType": "MKV", + "FileTypeExtension": "mkv", + "MIMEType": "video/x-matroska", + "EBMLVersion": 1, + "EBMLReadVersion": 1, + "DocType": "matroska", + "DocTypeVersion": 4, + "DocTypeReadVersion": 2, + "TimecodeScale": "1 ms", + "MuxingApp": "Lavf58.24.101", + "WritingApp": "Lavf58.24.101", + "VideoFrameRate": 25, + "ImageWidth": 1918, + "ImageHeight": 1080, + "VideoScanType": "Unknown (2)", + "AudioChannels": 2, + "AudioSampleRate": 48000, + "AudioBitsPerSample": 32, + "TrackNumber": 7, + "TrackName": "Français", + "TrackLanguage": "fre", + "TrackDefault": "No", + "CodecID": "S_TEXT/UTF8", + "TrackType": "Subtitle", + "TagLanguage": "eng", + "TagName": "DURATION", + "TagString": "00:01:06.031000000", + "ImageSize": "1918x1080", + "Megapixels": 2.1 + }, + "mediaInfo": { + "@ref": "", + "track": [ + { + "@type": "General", + "UniqueID": "191657682055212276795239999260924509108", + "VideoCount": "1", + "AudioCount": "5", + "TextCount": "1", + "Format": "Matroska", + "Format_Version": "4", + "FileSize": "68084120", + "Duration": "66.031", + "OverallBitRate_Mode": "VBR", + "OverallBitRate": "8248746", + "FrameRate": "25.000", + "FrameCount": "1599", + "StreamSize": "12645964", + "IsStreamable": "Yes", + "Encoded_Application": "Lavf58.24.101", + "Encoded_Library": "Lavf58.24.101", + "extra": { + "ErrorDetectionType": "Per level 1" + } + }, + { + "@type": "Video", + "StreamOrder": "0", + "ID": "1", + "UniqueID": "1", + "Format": "AVC", + "Format_Profile": "High", + "Format_Level": "4.1", + "Format_Settings_CABAC": "Yes", + "Format_Settings_RefFrames": "4", + "CodecID": "V_MPEG4/ISO/AVC", + "Duration": "63.986000000", + "BitRate": "6453995", + "Width": "1918", + "Height": "1080", + "Stored_Width": "1920", + "Stored_Height": "1088", + "Sampled_Width": "1918", + "Sampled_Height": "1080", + "PixelAspectRatio": "1.000", + "DisplayAspectRatio": "1.776", + "FrameRate_Mode": "VFR", + "FrameRate": "25.000", + "FrameCount": "1599", + "ColorSpace": "YUV", + "ChromaSubsampling": "4:2:0", + "BitDepth": "8", + "ScanType": "Progressive", + "Delay": "0.000", + "StreamSize": "51599695", + "Title": "title video", + "Language": "fr", + "Default": "Yes", + "Forced": "No", + "colour_description_present": "Yes", + "colour_description_present_Source": "Container / Stream", + "colour_range": "Limited", + "colour_range_Source": "Container / Stream", + "colour_primaries_Source": "Stream", + "transfer_characteristics_Source": "Stream", + "matrix_coefficients": "BT.709", + "matrix_coefficients_Source": "Container / Stream" + }, + { + "@type": "Audio", + "@typeorder": "1", + "StreamOrder": "1", + "ID": "2", + "UniqueID": "2", + "Format": "FLAC", + "CodecID": "A_FLAC", + "Duration": "64.005000000", + "BitRate_Mode": "VBR", + "BitRate": "96000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1537", + "SamplingRate": "48000", + "SamplingCount": "3072240", + "FrameRate": "31.232", + "FrameCount": "1999", + "BitDepth": "24", + "Compression_Mode": "Lossless", + "Delay": "0.005", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 flac", + "Language": "en", + "Default": "No", + "Forced": "No" + }, + { + "@type": "Audio", + "@typeorder": "2", + "StreamOrder": "2", + "ID": "3", + "UniqueID": "3", + "Format": "AC-3", + "Format_Commercial_IfAny": "Dolby Digital", + "Format_Settings_Endianness": "Big", + "CodecID": "A_AC3", + "Duration": "64.000000000", + "BitRate_Mode": "CBR", + "BitRate": "192000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1536", + "SamplingRate": "48000", + "SamplingCount": "3072000", + "FrameRate": "31.250", + "FrameCount": "1999", + "BitDepth": "32", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 ac3", + "Language": "en", + "ServiceKind": "CM", + "Default": "No", + "Forced": "No", + "extra": { + "bsid": "8", + "dialnorm": "-31", + "dsurmod": "0", + "acmod": "2", + "lfeon": "0", + "dialnorm_Average": "-31", + "dialnorm_Minimum": "-31" + } + }, + { + "@type": "Audio", + "@typeorder": "3", + "StreamOrder": "3", + "ID": "4", + "UniqueID": "4", + "Format": "E-AC-3", + "Format_Commercial_IfAny": "Dolby Digital Plus", + "Format_Settings_Endianness": "Big", + "CodecID": "A_EAC3", + "Duration": "64.000000000", + "BitRate_Mode": "CBR", + "BitRate": "192000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1536", + "SamplingRate": "48000", + "SamplingCount": "3072000", + "FrameRate": "31.250", + "FrameCount": "1999", + "BitDepth": "32", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 eac3", + "Language": "en", + "ServiceKind": "CM", + "Default": "No", + "Forced": "No", + "extra": { + "bsid": "16", + "dialnorm": "-31", + "dsurmod": "0", + "acmod": "2", + "lfeon": "0", + "dialnorm_Average": "-31", + "dialnorm_Minimum": "-31" + } + }, + { + "@type": "Audio", + "@typeorder": "4", + "StreamOrder": "4", + "ID": "5", + "UniqueID": "5", + "Format": "AAC", + "Format_Settings_SBR": "No (Explicit)", + "Format_AdditionalFeatures": "LC", + "CodecID": "A_AAC-2", + "Duration": "64.004000000", + "BitRate": "96000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "3072192", + "FrameRate": "46.875", + "FrameCount": "1999", + "Compression_Mode": "Lossy", + "Delay": "0.005", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Français E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 aac", + "Language": "fr", + "Default": "Yes", + "Forced": "No" + }, + { + "@type": "Audio", + "@typeorder": "5", + "StreamOrder": "5", + "ID": "6", + "UniqueID": "6", + "Format": "AAC", + "Format_Settings_SBR": "No (Explicit)", + "Format_AdditionalFeatures": "LC", + "CodecID": "A_AAC-2", + "Duration": "64.004000000", + "BitRate": "96000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "3072192", + "FrameRate": "46.875", + "FrameCount": "1999", + "Compression_Mode": "Lossy", + "Delay": "0.005", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 aac", + "Language": "en", + "Default": "No", + "Forced": "No" + }, + { + "@type": "Text", + "StreamOrder": "6", + "ID": "7", + "UniqueID": "7", + "Format": "UTF-8", + "CodecID": "S_TEXT/UTF8", + "Duration": "66.031000000", + "BitRate": "46", + "FrameRate": "0.182", + "FrameCount": "12", + "ElementCount": "12", + "StreamSize": "381", + "Title": "Français", + "Language": "fr", + "Default": "No", + "Forced": "No" + } + ] + } +} \ No newline at end of file From 8fc04f8ab016c9a0fc67db4f453ac7278b2c8a50 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 15:13:21 +0100 Subject: [PATCH 032/126] Add Tdarr_Plugin_00td_action_remux_container test --- ...darr_Plugin_00td_action_remux_container.js | 1 - ...darr_Plugin_00td_action_remux_container.js | 65 +++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_action_remux_container.js diff --git a/Community/Tdarr_Plugin_00td_action_remux_container.js b/Community/Tdarr_Plugin_00td_action_remux_container.js index a45b03c..d43cf84 100644 --- a/Community/Tdarr_Plugin_00td_action_remux_container.js +++ b/Community/Tdarr_Plugin_00td_action_remux_container.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_remux_container', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_00td_action_remux_container.js b/tests/Community/Tdarr_Plugin_00td_action_remux_container.js new file mode 100644 index 0000000..154f2da --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_remux_container.js @@ -0,0 +1,65 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is not in mkv \n', + handbrakeMode: false + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + container: 'mkv' + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is not in mkv \n', + handbrakeMode: false + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + container: 'mp4' + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ', -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is already in mp4 \n', + handbrakeMode: false + }, + }, +]; + +run(tests); From 8f442d4bbf238979c43db12541d8a1bed3da21c9 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 15:19:00 +0100 Subject: [PATCH 033/126] Add Tdarr_Plugin_00td_action_standardise_audio_stream_codecs test --- ..._action_standardise_audio_stream_codecs.js | 1 - ..._action_standardise_audio_stream_codecs.js | 66 +++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js diff --git a/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js b/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js index 2bc1e50..4d59668 100644 --- a/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js +++ b/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_action_standardise_audio_stream_codecs', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js b/tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js new file mode 100644 index 0000000..63e1505 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js @@ -0,0 +1,66 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: "File does not have any audio streams which aren't in aac \n", + handbrakeMode: false, + ffmpegMode: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -c:a:1 aac -c:a:2 aac', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: "File has audio streams which aren't in aac \n", + handbrakeMode: false, + ffmpegMode: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -c:a:1 eac3 -c:a:3 eac3 -c:a:4 eac3', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: "File has audio streams which aren't in eac3 \n", + handbrakeMode: false, + ffmpegMode: true, + }, + }, +]; + +run(tests); From 7511d748e782b342a04ec788ba70f8f801482acd Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 15:19:05 +0100 Subject: [PATCH 034/126] Lint --- .../Tdarr_Plugin_00td_action_remux_container.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Community/Tdarr_Plugin_00td_action_remux_container.js b/tests/Community/Tdarr_Plugin_00td_action_remux_container.js index 154f2da..985688b 100644 --- a/tests/Community/Tdarr_Plugin_00td_action_remux_container.js +++ b/tests/Community/Tdarr_Plugin_00td_action_remux_container.js @@ -17,7 +17,7 @@ const tests = [ FFmpegMode: true, reQueueAfter: true, infoLog: 'File is not in mkv \n', - handbrakeMode: false + handbrakeMode: false, }, }, { @@ -25,7 +25,7 @@ const tests = [ file: require('../sampleData/media/sampleH264_1.json'), librarySettings: {}, inputs: { - container: 'mkv' + container: 'mkv', }, otherArguments: {}, }, @@ -37,7 +37,7 @@ const tests = [ FFmpegMode: true, reQueueAfter: true, infoLog: 'File is not in mkv \n', - handbrakeMode: false + handbrakeMode: false, }, }, { @@ -45,7 +45,7 @@ const tests = [ file: require('../sampleData/media/sampleH264_1.json'), librarySettings: {}, inputs: { - container: 'mp4' + container: 'mp4', }, otherArguments: {}, }, @@ -57,7 +57,7 @@ const tests = [ FFmpegMode: true, reQueueAfter: true, infoLog: 'File is already in mp4 \n', - handbrakeMode: false + handbrakeMode: false, }, }, ]; From 2c8050f01ca7c781c040e6cae24bf412469ed7fd Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 15:29:03 +0100 Subject: [PATCH 035/126] Add Tdarr_Plugin_00td_filter_by_bitrate test --- .../Tdarr_Plugin_00td_filter_by_bitrate.js | 1 - .../Tdarr_Plugin_00td_filter_by_bitrate.js | 64 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js diff --git a/Community/Tdarr_Plugin_00td_filter_by_bitrate.js b/Community/Tdarr_Plugin_00td_filter_by_bitrate.js index 5914e42..7219b51 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_bitrate.js +++ b/Community/Tdarr_Plugin_00td_filter_by_bitrate.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_filter_by_bitrate', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js b/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js new file mode 100644 index 0000000..4c22116 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js @@ -0,0 +1,64 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: '☑File bitrate is within filter limits. Moving to next plugin.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 500, + lowerBound: 0, + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: '☒File bitrate is not within filter limits. Breaking out of plugin stack.\n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 10000, + lowerBound: 0, + }, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: '☑File bitrate is within filter limits. Moving to next plugin.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 10000, + lowerBound: 9000, + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: '☒File bitrate is not within filter limits. Breaking out of plugin stack.\n', + }, + }, +]; + +run(tests); From 77692935c5d58fd8ec949bf9d0b0b3d1a3f5f891 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 15:33:38 +0100 Subject: [PATCH 036/126] Add Tdarr_Plugin_00td_filter_by_resolution test --- .../Tdarr_Plugin_00td_filter_by_resolution.js | 1 - .../Tdarr_Plugin_00td_filter_by_resolution.js | 74 +++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js diff --git a/Community/Tdarr_Plugin_00td_filter_by_resolution.js b/Community/Tdarr_Plugin_00td_filter_by_resolution.js index 3a62c3e..c63c435 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_resolution.js +++ b/Community/Tdarr_Plugin_00td_filter_by_resolution.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_filter_by_resolution', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js b/tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js new file mode 100644 index 0000000..91cc03f --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js @@ -0,0 +1,74 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, infoLog: '', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + resolutionsToProcess: '480p,720p', + }, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: 'File is in resolutionsToProcess. Moving to next plugin.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + resolutionsToProcess: '480p,1080p', + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: 'File is not in resolutionsToProcess. Breaking out of plugin stack.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + resolutionsToNotProcess: '480p,720p', + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: 'File is in resolutionsToNotProcess. Breaking out of plugin stack.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + resolutionsToNotProcess: '480p,1080p', + }, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: 'File is not in resolutionsToNotProcess. Moving to next plugin.', + }, + }, +]; + +run(tests); From fc2b3f9b2732e05c3b229b7f524bc122a3224a76 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 15:37:01 +0100 Subject: [PATCH 037/126] Add Tdarr_Plugin_00td_filter_by_size test --- Community/Tdarr_Plugin_00td_filter_by_size.js | 1 - .../Tdarr_Plugin_00td_filter_by_size.js | 64 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_size.js diff --git a/Community/Tdarr_Plugin_00td_filter_by_size.js b/Community/Tdarr_Plugin_00td_filter_by_size.js index f2321a9..2e9ae67 100644 --- a/Community/Tdarr_Plugin_00td_filter_by_size.js +++ b/Community/Tdarr_Plugin_00td_filter_by_size.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_00td_filter_by_size', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_size.js b/tests/Community/Tdarr_Plugin_00td_filter_by_size.js new file mode 100644 index 0000000..a869c4c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_size.js @@ -0,0 +1,64 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: 'File is within lower and upper bound size limits. Moving to next plugin.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 0.5, + lowerBound: 0, + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: 'File is not within lower and upper bound size limits. Breaking out of plugin stack.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 2, + lowerBound: 0, + }, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: 'File is within lower and upper bound size limits. Moving to next plugin.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 4, + lowerBound: 2, + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: 'File is not within lower and upper bound size limits. Breaking out of plugin stack.', + }, + }, +]; + +run(tests); From ca8eedff76a8314d6c9a24f8d310ee1de866eafc Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 19:11:11 +0100 Subject: [PATCH 038/126] Log all errors together, use chalk --- package-lock.json | 67 ++++++++++++++++++++++----- package.json | 8 ++-- tests/checkPlugins.js | 105 +++++++++++++++++++++++------------------- 3 files changed, 119 insertions(+), 61 deletions(-) diff --git a/package-lock.json b/package-lock.json index de6ded3..0980d37 100644 --- a/package-lock.json +++ b/package-lock.json @@ -252,10 +252,9 @@ } }, "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -265,7 +264,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -274,7 +272,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "requires": { "color-name": "~1.1.4" } @@ -282,20 +279,17 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "requires": { "has-flag": "^4.0.0" } @@ -510,6 +504,57 @@ "table": "^5.2.3", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "eslint-config-airbnb-base": { diff --git a/package.json b/package.json index 4ff2e19..bde78ca 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,11 @@ { "name": "tdarr_plugins", "version": "1.0.0", - "description": "There are two types of plugin:", - "main": "Tdarr_Plugin_aaaa_Pre_Proc_Example.js", - "dependencies": {}, + "description": "Tdar Plugins Repo", + "main": "", + "dependencies": { + "chalk": "^4.1.2" + }, "devDependencies": { "chai": "^4.3.6", "eslint": "^7.14.0", diff --git a/tests/checkPlugins.js b/tests/checkPlugins.js index 725531a..13bab9d 100644 --- a/tests/checkPlugins.js +++ b/tests/checkPlugins.js @@ -1,12 +1,16 @@ /* eslint no-console: 0 */ // --> OFF +/* eslint max-len: 0 */ const fs = require('fs'); +const chalk = require('chalk'); const folders = [ './Community', './examples', ]; +let errorEncountered = false; + folders.forEach((folder) => { const files = fs.readdirSync(folder).filter((row) => row.includes('.js')); @@ -28,16 +32,16 @@ folders.forEach((folder) => { const importLib = 'const lib = require(\'../methods/lib\')();'; if (!read.includes(importLib)) { - console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${importLib}`); + console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${importLib}`)); read = `${importLib}\n${read}`; // fs.writeFileSync(`${folder}/${files[i]}`, read) - process.exit(1); + errorEncountered = true; } const detailsText = 'const details = () =>'; if (!read.includes(detailsText)) { - console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${detailsText}`); - process.exit(1); + console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${detailsText}`)); + errorEncountered = true; } const syncText = 'const plugin = (file, librarySettings, inputs, otherArguments) => {'; @@ -46,27 +50,27 @@ folders.forEach((folder) => { if (!read.includes(syncText) && !read.includes(asyncText) ) { - console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${syncText} or ${asyncText}`); - process.exit(1); + console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${syncText} or ${asyncText}`)); + errorEncountered = true; } const inputsText = 'inputs = lib.loadDefaultValues(inputs, details);'; if (!read.includes(inputsText) ) { - console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${inputsText}`); - process.exit(1); + console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${inputsText}`)); + errorEncountered = true; } const exportText = `module.exports.details = details; module.exports.plugin = plugin;`; if (!read.includes(exportText)) { - console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${exportText}`); + console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${exportText}`)); read = read.replace('module.exports.details = details;', ''); read = read.replace('module.exports.plugin = plugin;', ''); read += `\n${exportText}`; // fs.writeFileSync(`${folder}/${files[i]}`, read) - process.exit(1); + errorEncountered = true; } // check deps are within functions @@ -80,8 +84,8 @@ module.exports.plugin = plugin;`; const countOpen = allBefore.join(keyWord).split('{').length - 1; const countClose = allBefore.join(keyWord).split('}').length - 1; if (countOpen === countClose) { - console.log(`Plugin has requires outside of function '${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin has requires outside of function '${folder}/${files[i]}'`)); + errorEncountered = true; } } } @@ -91,64 +95,66 @@ module.exports.plugin = plugin;`; // eslint-disable-next-line import/no-dynamic-require,global-require pluginDetails = require(`.${folder}/${files[i]}`).details(); } catch (err) { - console.log(err.message); - process.exit(1); + console.log(chalk.red(err.message)); + errorEncountered = true; } const detailsKeys = Object.keys(pluginDetails); + // eslint-disable-next-line no-loop-func detailsOrder.forEach((detail) => { if (detailsKeys.indexOf(detail) === -1) { - console.log(`Plugin details is missing '${folder}/${files[i]}' : ${detail}`); - process.exit(1); + console.log(chalk.red(`Plugin details is missing '${folder}/${files[i]}' : ${detail}`)); + errorEncountered = true; } }); + // eslint-disable-next-line no-loop-func detailsKeys.forEach((detail, index) => { if (detailsOrder[index] !== detail) { - console.log(`Plugin details keys are not in the correct order: '${folder}/${files[i]}' ${detail}`); - process.exit(1); + console.log(chalk.red(`Plugin details keys are not in the correct order: '${folder}/${files[i]}' ${detail}`)); + errorEncountered = true; } }); if (detailsKeys.length < detailsOrder.length) { - console.log(`Plugin details are too few '${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin details are too few '${folder}/${files[i]}'`)); + errorEncountered = true; } if (!['Pre-processing', 'Post-processing'].includes(pluginDetails.Stage)) { - console.log(`Plugin does not have a valid Type'${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin does not have a valid Type'${folder}/${files[i]}'`)); + errorEncountered = true; } if (!['Video', 'Audio', 'Subtitle', 'Any'].includes(pluginDetails.Type)) { - console.log(`Plugin does not have a valid Type'${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin does not have a valid Type'${folder}/${files[i]}'`)); + errorEncountered = true; } if (files[i].split('.js').join('') !== pluginDetails.id) { - console.log(`Plugin file name does not match details id'${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin file name does not match details id'${folder}/${files[i]}'`)); + errorEncountered = true; } if (!['Transcode', 'Filter'].includes(pluginDetails.Operation)) { - console.log(`Plugin does not have a valid Operation '${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin does not have a valid Operation '${folder}/${files[i]}'`)); + errorEncountered = true; } else if (detailsKeys.length > detailsOrder.length) { - console.log(`Plugin details are too many '${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin details are too many '${folder}/${files[i]}'`)); + errorEncountered = true; } else if (pluginDetails.Inputs && !Array.isArray(pluginDetails.Inputs)) { // Check default values are set; - console.log(`Plugin Inputs is not an array: ${files[i]}`); - process.exit(1); + console.log(chalk.red(`Plugin Inputs is not an array: ${files[i]}`)); + errorEncountered = true; } else if (pluginDetails.Inputs && Array.isArray(pluginDetails.Inputs)) { const inputs = pluginDetails.Inputs; const savedInputs = {}; for (let j = 0; j < inputs.length; j += 1) { // Prevent duplicate plugin inputs if (savedInputs[inputs[j].name] === true) { - console.log(`Plugin Input already exists: '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input already exists: '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } else { savedInputs[inputs[j].name] = true; } @@ -161,31 +167,31 @@ module.exports.plugin = plugin;`; || inputKeys[3] !== 'inputUI' || inputKeys[4] !== 'tooltip' ) { - console.log(`Plugin Input keys are not in correct order: '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input keys are not in correct order: '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } else if (inputs[j].type === undefined || !pluginInputTypes.includes(inputs[j].type)) { - console.log(`Plugin Input does not have a type: '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input does not have a type: '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } else if ( (inputs[j].type === 'string' && typeof inputs[j].defaultValue !== 'string') || (inputs[j].type === 'number' && typeof inputs[j].defaultValue !== 'number') || (inputs[j].type === 'boolean' && typeof inputs[j].defaultValue !== 'boolean') ) { - console.log(`Plugin Input type does not match defaultValue type: - '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input type does not match defaultValue type: + '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } else if (!['text', 'dropdown'].includes(inputs[j].inputUI.type)) { - console.log(`Plugin Input inputUI is invalid: '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input inputUI is invalid: '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } else if (inputs[j].defaultValue === undefined) { - console.log(`Plugin Input does not have a default value: '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input does not have a default value: '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } const count = read.split(inputs[j].name).length - 1; if (count === 1) { - console.log(`Plugin Input is not used: '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input is not used: '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } } } @@ -195,3 +201,8 @@ module.exports.plugin = plugin;`; }); console.log('Done!'); + +if (errorEncountered) { + console.log('Errors encountered'); + process.exit(1); +} From ea71957b55fc946cd8491ba3c665fbc726b3487b Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 19:14:50 +0100 Subject: [PATCH 039/126] Add Tdarr_Plugin_075a_FFMPEG_HEVC_Generic test --- .../Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js | 1 - .../Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js | 41 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js diff --git a/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js b/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js index edc8f03..e699050 100644 --- a/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js +++ b/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_075a_FFMPEG_HEVC_Generic', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js b/tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js new file mode 100644 index 0000000..9365ddf --- /dev/null +++ b/tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js @@ -0,0 +1,41 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a -map 0:s? -map 0:d? -c copy -c:v:0 libx265 -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☒File is not hevc! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, +]; + +run(tests); From 333e096788a41b4f679e62ecbb2ff94e1ca28a52 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 19:18:47 +0100 Subject: [PATCH 040/126] Add Tdarr_Plugin_075a_Transcode_Customisable test --- ...darr_Plugin_075a_Transcode_Customisable.js | 1 - ...darr_Plugin_075a_Transcode_Customisable.js | 81 +++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js diff --git a/Community/Tdarr_Plugin_075a_Transcode_Customisable.js b/Community/Tdarr_Plugin_075a_Transcode_Customisable.js index 5fad3f9..7a144d1 100644 --- a/Community/Tdarr_Plugin_075a_Transcode_Customisable.js +++ b/Community/Tdarr_Plugin_075a_Transcode_Customisable.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => ({ id: "Tdarr_Plugin_075a_Transcode_Customisable", Stage: "Pre-processing", diff --git a/tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js b/tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js new file mode 100644 index 0000000..c6627a6 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js @@ -0,0 +1,81 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Very Fast 1080p30" --all-subtitles --all-audio', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not in desired codec! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in hevc! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecs_to_exclude: 'h264', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in h264! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecs_to_exclude: 'hevc', + cli: 'handbrake', + transcode_arguments: '-Z "Very Fast 480p30"', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Very Fast 480p30"', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not in desired codec! \n', + }, + }, +]; + +run(tests); From 84d0c3f34565b6e9ec411ef3d5e4965113bc6266 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 19:20:48 +0100 Subject: [PATCH 041/126] Add Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only test --- ...5b_FFMPEG_HEVC_Generic_Video_Audio_Only.js | 1 - ...5b_FFMPEG_HEVC_Generic_Video_Audio_Only.js | 41 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js diff --git a/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js b/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js index 63ad51b..27699a7 100644 --- a/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js +++ b/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only", diff --git a/tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js b/tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js new file mode 100644 index 0000000..d6dc22c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js @@ -0,0 +1,41 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a -c copy -c:v:0 libx265 -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☒File is not hevc! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, +]; + +run(tests); From 2c5c0bba2e0cfd46801f98a346f72492123ea12c Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 19:22:18 +0100 Subject: [PATCH 042/126] Add Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20 test --- ...PEG_HEVC_Generic_Video_Audio_Only_CRF20.js | 1 - ...PEG_HEVC_Generic_Video_Audio_Only_CRF20.js | 41 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js diff --git a/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js b/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js index 4091cc4..565926d 100644 --- a/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js +++ b/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20", diff --git a/tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js b/tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js new file mode 100644 index 0000000..88633af --- /dev/null +++ b/tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js @@ -0,0 +1,41 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a -c copy -c:v:0 libx265 -crf 20', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☒File is not hevc! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, +]; + +run(tests); From e2530fa92fbddd96eb44aa1a3e756cf8128c3498 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 19:24:06 +0100 Subject: [PATCH 043/126] Add Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20 test --- ...HEVC_GPU_Generic_Video_Audio_Only_CRF20.js | 1 - ...HEVC_GPU_Generic_Video_Audio_Only_CRF20.js | 41 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js diff --git a/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js b/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js index b4ef9f2..c17a3a7 100644 --- a/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js +++ b/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20", diff --git a/tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js b/tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js new file mode 100644 index 0000000..0d7ee54 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js @@ -0,0 +1,41 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a -c copy -c:v:0 hevc_nvenc -crf 20', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☒File is not hevc! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, +]; + +run(tests); From 1f9ad7c0addade109c3645ac6fe77f85d120860d Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 19:29:18 +0100 Subject: [PATCH 044/126] Add Tdarr_Plugin_076a_re_order_audio_streams test --- ...darr_Plugin_076a_re_order_audio_streams.js | 1 - ...darr_Plugin_076a_re_order_audio_streams.js | 43 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js diff --git a/Community/Tdarr_Plugin_076a_re_order_audio_streams.js b/Community/Tdarr_Plugin_076a_re_order_audio_streams.js index a5b250e..77835ca 100644 --- a/Community/Tdarr_Plugin_076a_re_order_audio_streams.js +++ b/Community/Tdarr_Plugin_076a_re_order_audio_streams.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_076a_re_order_audio_streams", diff --git a/tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js b/tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js new file mode 100644 index 0000000..95a1b47 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js @@ -0,0 +1,43 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑ Preferred language is already first audio track! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: { + preferred_language: 'fre', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -c copy -map 0:v -map 0:a:3 -disposition:a:0 default -map 0:a:0 -map 0:a:1 -disposition:a:1 0 -map 0:a:2 -disposition:a:2 0 -disposition:a:3 0 -map 0:a:4 -disposition:a:4 0 -map 0:s? -map 0:d? ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒ Desired audio lang is not first audio stream, moving! \n', + }, + }, +]; + +run(tests); From 1ea00f161609fc896733a352c932454358440d19 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 19:29:26 +0100 Subject: [PATCH 045/126] Add chalk --- tests/helpers/run.js | 2 +- tests/runTests.js | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/helpers/run.js b/tests/helpers/run.js index 3cb7f52..05c9aec 100644 --- a/tests/helpers/run.js +++ b/tests/helpers/run.js @@ -22,7 +22,7 @@ const run = async (tests) => { } } catch (err) { // eslint-disable-next-line no-console - console.log(err); + console.error(err); process.exit(1); } }; diff --git a/tests/runTests.js b/tests/runTests.js index efc459c..2802bd8 100644 --- a/tests/runTests.js +++ b/tests/runTests.js @@ -1,6 +1,7 @@ /* eslint no-console: 0 */ // --> OFF const fs = require('fs'); +const chalk = require('chalk'); const childProcess = require('child_process'); const filenames = fs.readdirSync(`${process.cwd()}/Community`); @@ -13,15 +14,15 @@ const run = async () => { let shouldRunTest = true; if (!text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) { - console.log(`${filenames[i]} does not have a test but should do.`); + console.log(chalk.red(`${filenames[i]} does not have a test but should do.`)); process.exit(1); } else if (!text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) { - console.log(`${filenames[i]} running test`); + console.log(chalk.white(`${filenames[i]} running test`)); } else if (text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) { - console.log(`${filenames[i]} should have // tdarrSkipTest removed`); + console.log(chalk.red(`${filenames[i]} should have // tdarrSkipTest removed`)); process.exit(1); } else if (text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) { - console.log(`${filenames[i]} skipping tests`); + console.log(chalk.yellow(`${filenames[i]} skipping tests`)); shouldRunTest = false; } @@ -33,7 +34,7 @@ const run = async () => { console.log(err); } console.log(stdout); - console.log(stderr); + console.log(chalk.red(stderr)); }).on('exit', async (code) => { if (code !== 0) { await new Promise((resolve2) => setTimeout(resolve2, 1000)); From c39bd22995ca51341904ef5a204c422f77c0d49b Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 19:34:10 +0100 Subject: [PATCH 046/126] Add Tdarr_Plugin_076b_re_order_subtitle_streams --- ...r_Plugin_076b_re_order_subtitle_streams.js | 1 - ...r_Plugin_076b_re_order_subtitle_streams.js | 62 ++ tests/sampleData/media/sampleH264_3.json | 821 ++++++++++++++++++ 3 files changed, 883 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js create mode 100644 tests/sampleData/media/sampleH264_3.json diff --git a/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js b/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js index 6b8fcf8..65a3b86 100644 --- a/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js +++ b/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_076b_re_order_subtitle_streams", diff --git a/tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js b/tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js new file mode 100644 index 0000000..cc9ef73 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js @@ -0,0 +1,62 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☒ No subtitle tracks in desired language! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: { + preferred_language: 'fre', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑ Preferred language is already first subtitle track! \n', + }, + + }, { + input: { + file: require('../sampleData/media/sampleH264_3.json'), + librarySettings: {}, + inputs: { + preferred_language: 'fre', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -c copy -map 0:v -map 0:a -map 0:s:1 -disposition:s:0 default -map 0:s:0 -disposition:s:1 0 -map 0:d? ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒ Desired subtitle lang is not first subtitle stream, moving! \n', + }, + }, +]; + +run(tests); diff --git a/tests/sampleData/media/sampleH264_3.json b/tests/sampleData/media/sampleH264_3.json new file mode 100644 index 0000000..13ed394 --- /dev/null +++ b/tests/sampleData/media/sampleH264_3.json @@ -0,0 +1,821 @@ +{ + "_id": "C:/Transcode/Source Folder/h264.mkv", + "file": "C:/Transcode/Source Folder/h264.mkv", + "DB": "2MY5YD7P8", + "footprintId": "asxmr-5Iij", + "hasClosedCaptions": false, + "container": "mkv", + "scannerReads": { + "ffProbeRead": "success", + "exiftoolRead": "success", + "mediaInfoRead": "success", + "closedCaptionRead": "success" + }, + "ffProbeData": { + "streams": [ + { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1918, + "height": 1080, + "coded_width": 1918, + "coded_height": 1080, + "closed_captions": 0, + "has_b_frames": 2, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "959:540", + "pix_fmt": "yuv420p", + "level": 41, + "color_range": "tv", + "color_space": "bt709", + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "r_frame_rate": "25/1", + "avg_frame_rate": "25/1", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bits_per_raw_sample": "8", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "fre", + "title": "title video", + "BPS-eng": "6453995", + "DURATION-eng": "00:01:03.960000000", + "NUMBER_OF_FRAMES-eng": "1599", + "NUMBER_OF_BYTES-eng": "51599695", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "DURATION": "00:01:03.986000000" + } + }, + { + "index": 1, + "codec_name": "flac", + "codec_long_name": "FLAC (Free Lossless Audio Codec)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "s32", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 5, + "start_time": "0.005000", + "bits_per_raw_sample": "24", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 flac", + "DURATION": "00:01:04.005000000" + } + }, + { + "index": 2, + "codec_name": "ac3", + "codec_long_name": "ATSC A/52A (AC-3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "192000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 ac3", + "DURATION": "00:01:04.000000000" + } + }, + { + "index": 3, + "codec_name": "eac3", + "codec_long_name": "ATSC A/52B (AC-3, E-AC-3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "192000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 eac3", + "DURATION": "00:01:04.000000000" + } + }, + { + "index": 4, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 5, + "start_time": "0.005000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "fre", + "title": "Français E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 aac", + "DURATION": "00:01:04.004000000" + } + }, + { + "index": 5, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 5, + "start_time": "0.005000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 aac", + "DURATION": "00:01:04.004000000" + } + }, + { + "index": 6, + "codec_name": "subrip", + "codec_long_name": "SubRip subtitle", + "codec_type": "subtitle", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 66031, + "duration": "66.031000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "en", + "title": "Français", + "BPS-eng": "46", + "DURATION-eng": "00:01:05.840000000", + "NUMBER_OF_FRAMES-eng": "12", + "NUMBER_OF_BYTES-eng": "381", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "DURATION": "00:01:06.031000000" + } + }, + { + "index": 7, + "codec_name": "subrip", + "codec_long_name": "SubRip subtitle", + "codec_type": "subtitle", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 66031, + "duration": "66.031000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "fre", + "title": "Français", + "BPS-eng": "46", + "DURATION-eng": "00:01:05.840000000", + "NUMBER_OF_FRAMES-eng": "12", + "NUMBER_OF_BYTES-eng": "381", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "DURATION": "00:01:06.031000000" + } + } + ], + "format": { + "filename": "C:/Transcode/Source Folder/h264.mkv", + "nb_streams": 7, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "0.000000", + "duration": "66.031000", + "size": "68084120", + "bit_rate": "8248746", + "probe_score": 100, + "tags": { + "ENCODER": "Lavf58.24.101" + } + } + }, + "file_size": 64.9300765991211, + "video_resolution": "1080p", + "fileMedium": "video", + "video_codec_name": "h264", + "audio_codec_name": "", + "lastPluginDetails": "none", + "createdAt": 1653139154025, + "bit_rate": 8248746, + "duration": 66, + "statSync": { + "dev": 3832468976, + "mode": 33206, + "nlink": 1, + "uid": 0, + "gid": 0, + "rdev": 0, + "blksize": 4096, + "ino": 64176294690080990, + "size": 68084120, + "blocks": 132984, + "atimeMs": 1653139154001.7666, + "mtimeMs": 1594420078270.8928, + "ctimeMs": 1653139134390.225, + "birthtimeMs": 1653139123219.1018, + "atime": "2022-05-21T13:19:14.002Z", + "mtime": "2020-07-10T22:27:58.271Z", + "ctime": "2022-05-21T13:18:54.390Z", + "birthtime": "2022-05-21T13:18:43.219Z" + }, + "HealthCheck": "", + "TranscodeDecisionMaker": "", + "lastHealthCheckDate": 0, + "holdUntil": 0, + "lastTranscodeDate": 0, + "bumped": false, + "history": "", + "oldSize": 0, + "newSize": 0, + "videoStreamIndex": 0, + "meta": { + "SourceFile": "C:/Transcode/Source Folder/h264.mkv", + "errors": [], + "Duration": 66.031, + "ExifToolVersion": 12.4, + "FileName": "h264.mkv", + "Directory": "C:/Transcode/Source Folder", + "FileSize": "65 MiB", + "FileModifyDate": { + "year": 2020, + "month": 7, + "day": 10, + "hour": 23, + "minute": 27, + "second": 58, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2020:07:10 23:27:58+01:00" + }, + "FileAccessDate": { + "year": 2022, + "month": 5, + "day": 21, + "hour": 14, + "minute": 19, + "second": 11, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:21 14:19:11+01:00" + }, + "FileCreateDate": { + "year": 2022, + "month": 5, + "day": 21, + "hour": 14, + "minute": 18, + "second": 43, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:21 14:18:43+01:00" + }, + "FilePermissions": "-rw-rw-rw-", + "FileType": "MKV", + "FileTypeExtension": "mkv", + "MIMEType": "video/x-matroska", + "EBMLVersion": 1, + "EBMLReadVersion": 1, + "DocType": "matroska", + "DocTypeVersion": 4, + "DocTypeReadVersion": 2, + "TimecodeScale": "1 ms", + "MuxingApp": "Lavf58.24.101", + "WritingApp": "Lavf58.24.101", + "VideoFrameRate": 25, + "ImageWidth": 1918, + "ImageHeight": 1080, + "VideoScanType": "Unknown (2)", + "AudioChannels": 2, + "AudioSampleRate": 48000, + "AudioBitsPerSample": 32, + "TrackNumber": 7, + "TrackName": "Français", + "TrackLanguage": "fre", + "TrackDefault": "No", + "CodecID": "S_TEXT/UTF8", + "TrackType": "Subtitle", + "TagLanguage": "eng", + "TagName": "DURATION", + "TagString": "00:01:06.031000000", + "ImageSize": "1918x1080", + "Megapixels": 2.1 + }, + "mediaInfo": { + "@ref": "", + "track": [ + { + "@type": "General", + "UniqueID": "191657682055212276795239999260924509108", + "VideoCount": "1", + "AudioCount": "5", + "TextCount": "1", + "Format": "Matroska", + "Format_Version": "4", + "FileSize": "68084120", + "Duration": "66.031", + "OverallBitRate_Mode": "VBR", + "OverallBitRate": "8248746", + "FrameRate": "25.000", + "FrameCount": "1599", + "StreamSize": "12645964", + "IsStreamable": "Yes", + "Encoded_Application": "Lavf58.24.101", + "Encoded_Library": "Lavf58.24.101", + "extra": { + "ErrorDetectionType": "Per level 1" + } + }, + { + "@type": "Video", + "StreamOrder": "0", + "ID": "1", + "UniqueID": "1", + "Format": "AVC", + "Format_Profile": "High", + "Format_Level": "4.1", + "Format_Settings_CABAC": "Yes", + "Format_Settings_RefFrames": "4", + "CodecID": "V_MPEG4/ISO/AVC", + "Duration": "63.986000000", + "BitRate": "6453995", + "Width": "1918", + "Height": "1080", + "Stored_Width": "1920", + "Stored_Height": "1088", + "Sampled_Width": "1918", + "Sampled_Height": "1080", + "PixelAspectRatio": "1.000", + "DisplayAspectRatio": "1.776", + "FrameRate_Mode": "VFR", + "FrameRate": "25.000", + "FrameCount": "1599", + "ColorSpace": "YUV", + "ChromaSubsampling": "4:2:0", + "BitDepth": "8", + "ScanType": "Progressive", + "Delay": "0.000", + "StreamSize": "51599695", + "Title": "title video", + "Language": "fr", + "Default": "Yes", + "Forced": "No", + "colour_description_present": "Yes", + "colour_description_present_Source": "Container / Stream", + "colour_range": "Limited", + "colour_range_Source": "Container / Stream", + "colour_primaries_Source": "Stream", + "transfer_characteristics_Source": "Stream", + "matrix_coefficients": "BT.709", + "matrix_coefficients_Source": "Container / Stream" + }, + { + "@type": "Audio", + "@typeorder": "1", + "StreamOrder": "1", + "ID": "2", + "UniqueID": "2", + "Format": "FLAC", + "CodecID": "A_FLAC", + "Duration": "64.005000000", + "BitRate_Mode": "VBR", + "BitRate": "96000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1537", + "SamplingRate": "48000", + "SamplingCount": "3072240", + "FrameRate": "31.232", + "FrameCount": "1999", + "BitDepth": "24", + "Compression_Mode": "Lossless", + "Delay": "0.005", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 flac", + "Language": "en", + "Default": "No", + "Forced": "No" + }, + { + "@type": "Audio", + "@typeorder": "2", + "StreamOrder": "2", + "ID": "3", + "UniqueID": "3", + "Format": "AC-3", + "Format_Commercial_IfAny": "Dolby Digital", + "Format_Settings_Endianness": "Big", + "CodecID": "A_AC3", + "Duration": "64.000000000", + "BitRate_Mode": "CBR", + "BitRate": "192000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1536", + "SamplingRate": "48000", + "SamplingCount": "3072000", + "FrameRate": "31.250", + "FrameCount": "1999", + "BitDepth": "32", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 ac3", + "Language": "en", + "ServiceKind": "CM", + "Default": "No", + "Forced": "No", + "extra": { + "bsid": "8", + "dialnorm": "-31", + "dsurmod": "0", + "acmod": "2", + "lfeon": "0", + "dialnorm_Average": "-31", + "dialnorm_Minimum": "-31" + } + }, + { + "@type": "Audio", + "@typeorder": "3", + "StreamOrder": "3", + "ID": "4", + "UniqueID": "4", + "Format": "E-AC-3", + "Format_Commercial_IfAny": "Dolby Digital Plus", + "Format_Settings_Endianness": "Big", + "CodecID": "A_EAC3", + "Duration": "64.000000000", + "BitRate_Mode": "CBR", + "BitRate": "192000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1536", + "SamplingRate": "48000", + "SamplingCount": "3072000", + "FrameRate": "31.250", + "FrameCount": "1999", + "BitDepth": "32", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 eac3", + "Language": "en", + "ServiceKind": "CM", + "Default": "No", + "Forced": "No", + "extra": { + "bsid": "16", + "dialnorm": "-31", + "dsurmod": "0", + "acmod": "2", + "lfeon": "0", + "dialnorm_Average": "-31", + "dialnorm_Minimum": "-31" + } + }, + { + "@type": "Audio", + "@typeorder": "4", + "StreamOrder": "4", + "ID": "5", + "UniqueID": "5", + "Format": "AAC", + "Format_Settings_SBR": "No (Explicit)", + "Format_AdditionalFeatures": "LC", + "CodecID": "A_AAC-2", + "Duration": "64.004000000", + "BitRate": "96000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "3072192", + "FrameRate": "46.875", + "FrameCount": "1999", + "Compression_Mode": "Lossy", + "Delay": "0.005", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Français E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 aac", + "Language": "fr", + "Default": "Yes", + "Forced": "No" + }, + { + "@type": "Audio", + "@typeorder": "5", + "StreamOrder": "5", + "ID": "6", + "UniqueID": "6", + "Format": "AAC", + "Format_Settings_SBR": "No (Explicit)", + "Format_AdditionalFeatures": "LC", + "CodecID": "A_AAC-2", + "Duration": "64.004000000", + "BitRate": "96000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "3072192", + "FrameRate": "46.875", + "FrameCount": "1999", + "Compression_Mode": "Lossy", + "Delay": "0.005", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 aac", + "Language": "en", + "Default": "No", + "Forced": "No" + }, + { + "@type": "Text", + "StreamOrder": "6", + "ID": "7", + "UniqueID": "7", + "Format": "UTF-8", + "CodecID": "S_TEXT/UTF8", + "Duration": "66.031000000", + "BitRate": "46", + "FrameRate": "0.182", + "FrameCount": "12", + "ElementCount": "12", + "StreamSize": "381", + "Title": "Français", + "Language": "fr", + "Default": "No", + "Forced": "No" + } + ] + } +} \ No newline at end of file From 4d4490584f43704af1c5d5efef2859b77bc1c007 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 19:37:42 +0100 Subject: [PATCH 047/126] Add Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable test --- ...n_077b_HandBrake_NVENC_264_Configurable.js | 1 - ...n_077b_HandBrake_NVENC_264_Configurable.js | 44 +++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js diff --git a/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js b/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js index 7957821..086dadd 100644 --- a/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js +++ b/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable", diff --git a/tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js b/tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js new file mode 100644 index 0000000..9a3053c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js @@ -0,0 +1,44 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑ File is already in h264, no need to transcode! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: { + handbrake_preset: 'Very Fast 1080p30', + output_container: '.mp4', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Very Fast 1080p30" -e nvenc_h264 --all-audio --all-subtitles', + container: '.mp4', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒ File is not in h264, transcoding! \n', + }, + }, +]; + +run(tests); From 406480df71c73b773ae94c710eff8be5bbf58a04 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 19:39:32 +0100 Subject: [PATCH 048/126] Add Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30 test --- ...eAGitGat_HandBrake_H264_VeryFast1080p30.js | 1 - ...eAGitGat_HandBrake_H264_VeryFast1080p30.js | 41 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js diff --git a/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js b/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js index 47bb9ef..d782b1b 100644 --- a/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js +++ b/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30", diff --git a/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js b/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js new file mode 100644 index 0000000..cf9b536 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js @@ -0,0 +1,41 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n☑File has no subs \n☒File has title metadata \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Very Fast 1080p30"', + container: '.mp4', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not in h264! \n', + }, + }, +]; + +run(tests); From d66b54506becdde19a4a5f5ae60af8029807b2fc Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 19:47:35 +0100 Subject: [PATCH 049/126] Add Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30 test --- ..._HaveAGitGat_HandBrake_H264_Fast1080p30.js | 1 - ...eAGitGat_HandBrake_H264_VeryFast1080p30.js | 24 +++++++ ..._HaveAGitGat_HandBrake_H264_Fast1080p30.js | 65 +++++++++++++++++++ tests/helpers/run.js | 6 +- 4 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js diff --git a/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js b/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js index af4053c..d95a3e4 100644 --- a/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js +++ b/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30", diff --git a/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js b/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js index cf9b536..4b12e24 100644 --- a/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js +++ b/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js @@ -36,6 +36,30 @@ const tests = [ infoLog: '☒File is not in h264! \n', }, }, + { + input: { + file: () => { + const file = require('../sampleData/media/sampleH264_1.json'); + file.meta.Title = undefined; + return file; + }, + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in h264! \n' + + '☑File has no subs \n' + + '☑File has no title metadata☑File has aac track \n' + + '☑File meets conditions! \n', + }, + }, ]; run(tests); diff --git a/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js b/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js new file mode 100644 index 0000000..0ec4e7f --- /dev/null +++ b/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js @@ -0,0 +1,65 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n☑File has no subs \n☒File has title metadata \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Fast 1080p30"', + container: '.mp4', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not in h264! \n', + }, + }, + { + input: { + file: () => { + const file = require('../sampleData/media/sampleH264_1.json'); + file.meta.Title = undefined; + return file; + }, + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in h264! \n' + + '☑File has no subs \n' + + '☑File has no title metadata☑File has aac track \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); diff --git a/tests/helpers/run.js b/tests/helpers/run.js index 05c9aec..de35a75 100644 --- a/tests/helpers/run.js +++ b/tests/helpers/run.js @@ -11,9 +11,13 @@ const run = async (tests) => { // eslint-disable-next-line no-console console.log(`${scriptName}: test ${i}`); const test = tests[i]; + let { file } = test.input; + if (typeof test.input.file === 'function') { + file = test.input.file(); + } // eslint-disable-next-line no-await-in-loop const testOutput = await plugin( - test.input.file, + file, test.input.librarySettings, test.input.inputs, test.input.otherArguments, From 6235de073e6b6c0c38fb8f44da9db69fa767a1b6 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 19:51:44 +0100 Subject: [PATCH 050/126] Add Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs test --- ..._Transcode_Specific_Audio_Stream_Codecs.js | 1 - ..._Transcode_Specific_Audio_Stream_Codecs.js | 45 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js diff --git a/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js b/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js index 376633a..c09e788 100644 --- a/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js +++ b/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs", diff --git a/tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js b/tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js new file mode 100644 index 0000000..4bf0913 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js @@ -0,0 +1,45 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑ File does not have any streams that need to be transcoded! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecs_to_transcode: 'aac', + codec: 'eac3', + bitrate: '640k', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -c copy -map 0:v -map 0:1 -c:1 eac3 -b:a 640k -map 0:s? -map 0:d? -max_muxing_queue_size 9999', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: "☒ File has streams which aren't in desired codec! \n", + }, + }, +]; + +run(tests); From 7dcee9b1ae35293235746b74771294b4674894a8 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 20:06:36 +0100 Subject: [PATCH 051/126] Update qsv to vaapi (will handle input at later date) --- Community/Tdarr_Plugin_drdd_standardise_all_in_one.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js index 00ba404..d3e84b3 100644 --- a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js +++ b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js @@ -5,14 +5,14 @@ const details = () => { return { id: "Tdarr_Plugin_drdd_standardise_all_in_one", Stage: "Pre-processing", - Name: "DrDD H265 MKV AC3 audio subtitles [QSV & NVENC]", + Name: "DrDD H265 MKV AC3 audio subtitles [VAAPI & NVENC]", Stage: "Pre-processing", Type: "Video", Operation: "Transcode", Description: "In a single pass ensures all files are in MKV containers and where possible encoded in h265 (settings dependant on file bitrate), converts all multi channel audio to AC3, removes audio commentary and removes subtitles that are not in the configured language or marked as commentary. This plugin is opinionated based on how I like my library to be configured and based on the work done by Migz with his plugins (Thanks!).", Version: "1.0", - Tags: "pre-processing,ffmpeg,qsv h265, nvenc h265", + Tags: "pre-processing,ffmpeg,vaapi,h265, nvenc h265", Inputs: [ { name: "nvenc", @@ -347,7 +347,7 @@ function buildVideoConfiguration(inputs, file, logger) { configuration.RemoveOutputSetting("-c:v copy"); configuration.AddOutputSetting(`-c:v hevc_vaapi ${bitrateSettings}`); - logger.AddError("Transcoding to HEVC using QSV"); + logger.AddError("Transcoding to HEVC using VAAPI"); } /** From 303299707986669b803262592e5b9f2dea7c0d1b Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sat, 21 May 2022 20:25:35 +0100 Subject: [PATCH 052/126] Add Tdarr_Plugin_a9he_New_file_size_check test --- .../Tdarr_Plugin_a9he_New_file_size_check.js | 1 - .../Tdarr_Plugin_a9he_New_file_size_check.js | 67 +++++++++++++++++++ tests/helpers/run.js | 34 +++++++--- 3 files changed, 93 insertions(+), 9 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js diff --git a/Community/Tdarr_Plugin_a9he_New_file_size_check.js b/Community/Tdarr_Plugin_a9he_New_file_size_check.js index e96caec..32e99d6 100644 --- a/Community/Tdarr_Plugin_a9he_New_file_size_check.js +++ b/Community/Tdarr_Plugin_a9he_New_file_size_check.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_a9he_New_file_size_check', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js b/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js new file mode 100644 index 0000000..e8db045 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js @@ -0,0 +1,67 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: { + originalLibraryFile: require('../sampleData/media/sampleH264_1.json'), + }, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'New file has size 1.008 MB which is 100% of original file size: 1.008 MB', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: '110', + lowerBound: '35', + }, + otherArguments: { + originalLibraryFile: (() => { + const file = JSON.parse(JSON.stringify(require('../sampleData/media/sampleH264_1.json'))); + file.file_size = 3; + return file; + })(), + }, + }, + output: 'New file size not within limits. New file has size 1.008 MB which is 33% of original file size: 3.000 MB. lowerBound is 35%', + error: { + shouldThrow: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: '120', + lowerBound: '35', + }, + otherArguments: { + originalLibraryFile: (() => { + const file = JSON.parse(JSON.stringify(require('../sampleData/media/sampleH264_1.json'))); + file.file_size = 0.1; + return file; + })(), + }, + }, + output: 'New file size not within limits. New file has size 1.008 MB which is 1007% of original file size: 0.100 MB. upperBound is 120%', + error: { + shouldThrow: true, + }, + }, +]; + +run(tests); diff --git a/tests/helpers/run.js b/tests/helpers/run.js index de35a75..e91112e 100644 --- a/tests/helpers/run.js +++ b/tests/helpers/run.js @@ -15,14 +15,32 @@ const run = async (tests) => { if (typeof test.input.file === 'function') { file = test.input.file(); } - // eslint-disable-next-line no-await-in-loop - const testOutput = await plugin( - file, - test.input.librarySettings, - test.input.inputs, - test.input.otherArguments, - ); - chai.assert.deepEqual(testOutput, test.output); + + let testOutput; + let errorEncountered = false; + try { + // eslint-disable-next-line no-await-in-loop + testOutput = await plugin( + file, + test.input.librarySettings, + test.input.inputs, + test.input.otherArguments, + ); + } catch (err1) { + // eslint-disable-next-line no-console + console.error(err1); + errorEncountered = err1; + } + + if (test.error && test.error.shouldThrow) { + if (errorEncountered !== false) { + chai.assert.deepEqual(errorEncountered.message, test.output); + } else { + throw new Error('Expected plugin error but none was thrown!'); + } + } else { + chai.assert.deepEqual(testOutput, test.output); + } } } catch (err) { // eslint-disable-next-line no-console From 2dc25ebf8c5ecc0f2afa84b8aa390a9f618fa577 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 12:09:53 +0100 Subject: [PATCH 053/126] useCloneDeep --- package-lock.json | 3 +-- package.json | 3 ++- ...hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js | 11 ++++++----- ...n_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js | 11 ++++++----- .../Tdarr_Plugin_a9he_New_file_size_check.js | 5 +++-- tests/helpers/run.js | 13 +++++-------- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0980d37..76257f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1178,8 +1178,7 @@ "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "loupe": { "version": "2.3.4", diff --git a/package.json b/package.json index bde78ca..868cd9e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "Tdar Plugins Repo", "main": "", "dependencies": { - "chalk": "^4.1.2" + "chalk": "^4.1.2", + "lodash": "^4.17.21" }, "devDependencies": { "chai": "^4.3.6", diff --git a/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js b/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js index 4b12e24..805c984 100644 --- a/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js +++ b/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js @@ -1,10 +1,11 @@ /* eslint max-len: 0 */ +const _ = require('lodash'); const run = require('../helpers/run'); const tests = [ { input: { - file: require('../sampleData/media/sampleH264_1.json'), + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), librarySettings: {}, inputs: {}, otherArguments: {}, @@ -21,7 +22,7 @@ const tests = [ }, { input: { - file: require('../sampleData/media/sampleH265_1.json'), + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), librarySettings: {}, inputs: {}, otherArguments: {}, @@ -38,11 +39,11 @@ const tests = [ }, { input: { - file: () => { - const file = require('../sampleData/media/sampleH264_1.json'); + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); file.meta.Title = undefined; return file; - }, + })(), librarySettings: {}, inputs: {}, otherArguments: {}, diff --git a/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js b/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js index 0ec4e7f..47cc98c 100644 --- a/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js +++ b/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js @@ -1,10 +1,11 @@ /* eslint max-len: 0 */ +const _ = require('lodash'); const run = require('../helpers/run'); const tests = [ { input: { - file: require('../sampleData/media/sampleH264_1.json'), + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), librarySettings: {}, inputs: {}, otherArguments: {}, @@ -21,7 +22,7 @@ const tests = [ }, { input: { - file: require('../sampleData/media/sampleH265_1.json'), + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), librarySettings: {}, inputs: {}, otherArguments: {}, @@ -38,11 +39,11 @@ const tests = [ }, { input: { - file: () => { - const file = require('../sampleData/media/sampleH264_1.json'); + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); file.meta.Title = undefined; return file; - }, + })(), librarySettings: {}, inputs: {}, otherArguments: {}, diff --git a/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js b/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js index e8db045..7e1de0d 100644 --- a/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js +++ b/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js @@ -1,4 +1,5 @@ /* eslint max-len: 0 */ +const _ = require('lodash'); const run = require('../helpers/run'); const tests = [ @@ -30,7 +31,7 @@ const tests = [ }, otherArguments: { originalLibraryFile: (() => { - const file = JSON.parse(JSON.stringify(require('../sampleData/media/sampleH264_1.json'))); + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); file.file_size = 3; return file; })(), @@ -51,7 +52,7 @@ const tests = [ }, otherArguments: { originalLibraryFile: (() => { - const file = JSON.parse(JSON.stringify(require('../sampleData/media/sampleH264_1.json'))); + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); file.file_size = 0.1; return file; })(), diff --git a/tests/helpers/run.js b/tests/helpers/run.js index e91112e..c4d0525 100644 --- a/tests/helpers/run.js +++ b/tests/helpers/run.js @@ -1,5 +1,6 @@ const path = require('path'); const chai = require('chai'); +const _ = require('lodash'); const scriptName = path.basename(process.mainModule.filename); // eslint-disable-next-line import/no-dynamic-require @@ -11,20 +12,16 @@ const run = async (tests) => { // eslint-disable-next-line no-console console.log(`${scriptName}: test ${i}`); const test = tests[i]; - let { file } = test.input; - if (typeof test.input.file === 'function') { - file = test.input.file(); - } let testOutput; let errorEncountered = false; try { // eslint-disable-next-line no-await-in-loop testOutput = await plugin( - file, - test.input.librarySettings, - test.input.inputs, - test.input.otherArguments, + _.cloneDeep(test.input.file), + _.cloneDeep(test.input.librarySettings), + _.cloneDeep(test.input.inputs), + _.cloneDeep(test.input.otherArguments), ); } catch (err1) { // eslint-disable-next-line no-console From 7f51f3e0576f2f7d7cd410e4db2307f250993e30 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 12:14:01 +0100 Subject: [PATCH 054/126] Add Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta test --- ...ugin_a37x_Drawmonster_MP4_No_Title_Meta.js | 1 - ...ugin_a37x_Drawmonster_MP4_No_Title_Meta.js | 42 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js diff --git a/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js b/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js index a06f3fa..8565365 100644 --- a/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta", diff --git a/tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js new file mode 100644 index 0000000..22d571d --- /dev/null +++ b/tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js @@ -0,0 +1,42 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File has no title metadata \n☑File meets conditions! \n', + }, + }, +]; + +run(tests); From a9408f921e348d86c8a818d0382381ecebd455a8 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 12:51:28 +0100 Subject: [PATCH 055/126] Add Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only test --- ...lugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js | 1 - ...lugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js | 112 ++++++++++++++++++ tests/helpers/run.js | 10 +- tests/runTests.js | 2 +- 4 files changed, 119 insertions(+), 6 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js diff --git a/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js b/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js index 4943049..a52d188 100644 --- a/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js +++ b/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js @@ -1,7 +1,6 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ /* eslint-disable no-restricted-globals */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js b/tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js new file mode 100644 index 0000000..780bf5d --- /dev/null +++ b/tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js @@ -0,0 +1,112 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-vsync 0 -hwaccel cuda -hwaccel_output_format cuda -c:v h264_cuvid ,-map 0:v -map 0:a -map 0:s? -map -:d? -c copy -c:v:0 hevc_nvenc -preset medium -profile:v main10 -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -max_muxing_queue_size 4096 -b:v 967680 -maxrate 1257984 -minrate 677376 -bufsize 1205959 -map_metadata:g -1', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'No valid resolution selected, defaulting to 8KUHD.\n' + + 'Video details: h264-720p \n' + + ' 1280x720x25@8 bits.\n' + + 'Video bitrate is 1206Kbps, overall is 1591Kbps. Calculated target is 1613Kbps.\n' + + '☒H264 Resolution is 720p, bitrate was 1206Kbps. HEVC target bitrate will be 968Kbps.\n' + + '☒Transcoding to HEVC.', + }, + }, { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: { + ffmpegPreset: 'veryslow', + container: 'mkv', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-vsync 0 -hwaccel cuda -hwaccel_output_format cuda -c:v hevc_cuvid ,-map 0:v -map 0:a -map 0:s? -map -:d? -c copy -c:v:0 hevc_nvenc -preset veryslow -profile:v main10 -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -max_muxing_queue_size 4096 -b:v 3207442 -maxrate 4717440 -minrate 2540160 -bufsize 3628800 -map_metadata:g -1', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'No valid resolution selected, defaulting to 8KUHD.\n' + + 'Video details: hevc-1080p \n' + + ' 1920x1080x25@8 bits.\n' + + 'Video bitrate is NaNKbps, overall is 3207Kbps. Calculated target is 3629Kbps.\n' + + '☒HEVC Bitrate for 1080p could not be determined, \n' + + ' using sensible default of 3207Kbps.\n' + + '☒Transcoding to HEVC.', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: { + maxResolution: '720p', + ffmpegPreset: 'veryslow', + container: 'mkv', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-vsync 0 -hwaccel cuda -hwaccel_output_format cuda -c:v hevc_cuvid -resize 1280x720 ,-map 0:v -map 0:a -map 0:s? -map -:d? -c copy -c:v:0 hevc_nvenc -preset veryslow -profile:v main10 -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -max_muxing_queue_size 4096 -b:v 1612800 -maxrate 2096640 -minrate 1128960 -bufsize 1612800 -map_metadata:g -1', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Resizing to 1280x720.\n' + + 'Video details: hevc-1080p \n' + + ' 1920x1080x25@8 bits.\n' + + 'Video bitrate is NaNKbps, overall is 3207Kbps. Calculated target is 1613Kbps.\n' + + '☒HEVC Bitrate for 1080p could not be determined, \n' + + ' using sensible default of 1613Kbps.\n' + + '☒Transcoding to HEVC.', + }, + }, + { + input: { + file: (() => { + // modify so no processing needed + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[0].codec_name = 'hevc'; + return file; + })(), + librarySettings: {}, + inputs: { + maxResolution: '1080p', + ffmpegPreset: 'veryslow', + container: 'mkv', + compressionFactor: '1', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '-vsync 0 -hwaccel cuda -hwaccel_output_format cuda -c:v hevc_cuvid ,-map 0:v -map 0:a -map 0:s? -map -:d? -c copy -c:v:0 hevc_nvenc -preset veryslow -profile:v main10 -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -max_muxing_queue_size 4096 ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Video details: hevc-1080p \n' + + ' 1918x1080x25@8 bits.\n' + + 'Video bitrate is 6454Kbps, overall is 8249Kbps. Calculated target is 51786Kbps.\n' + + '☑HEVC Bitrate is within limits.\n', + }, + }, +]; + +run(tests); diff --git a/tests/helpers/run.js b/tests/helpers/run.js index c4d0525..3ec85ab 100644 --- a/tests/helpers/run.js +++ b/tests/helpers/run.js @@ -1,10 +1,9 @@ const path = require('path'); const chai = require('chai'); const _ = require('lodash'); +const importFresh = require('import-fresh'); const scriptName = path.basename(process.mainModule.filename); -// eslint-disable-next-line import/no-dynamic-require -const { plugin } = require(`../../Community/${scriptName}`); const run = async (tests) => { try { @@ -15,6 +14,9 @@ const run = async (tests) => { let testOutput; let errorEncountered = false; + // eslint-disable-next-line import/no-dynamic-require + const { plugin } = importFresh(`../../Community/${scriptName}`); + try { // eslint-disable-next-line no-await-in-loop testOutput = await plugin( @@ -24,13 +26,13 @@ const run = async (tests) => { _.cloneDeep(test.input.otherArguments), ); } catch (err1) { - // eslint-disable-next-line no-console - console.error(err1); errorEncountered = err1; } if (test.error && test.error.shouldThrow) { if (errorEncountered !== false) { + // eslint-disable-next-line no-console + console.log(errorEncountered); chai.assert.deepEqual(errorEncountered.message, test.output); } else { throw new Error('Expected plugin error but none was thrown!'); diff --git a/tests/runTests.js b/tests/runTests.js index 2802bd8..fa23944 100644 --- a/tests/runTests.js +++ b/tests/runTests.js @@ -4,7 +4,7 @@ const fs = require('fs'); const chalk = require('chalk'); const childProcess = require('child_process'); -const filenames = fs.readdirSync(`${process.cwd()}/Community`); +const filenames = fs.readdirSync(`${process.cwd()}/Community`).reverse(); const run = async () => { for (let i = 0; i < filenames.length; i += 1) { From 9fa395d05e154a65184b53b7801599f8d922a7be Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 12:55:00 +0100 Subject: [PATCH 056/126] Add Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta test --- ...rr_Plugin_b38x_Nosirus_h265_aac_no_meta.js | 1 - package-lock.json | 14 +++--- package.json | 1 + ...rr_Plugin_b38x_Nosirus_h265_aac_no_meta.js | 45 +++++++++++++++++++ 4 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js diff --git a/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js b/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js index 847b659..c790869 100644 --- a/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js +++ b/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta", diff --git a/package-lock.json b/package-lock.json index 76257f9..136bce7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -233,8 +233,7 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, "chai": { "version": "4.3.6", @@ -960,10 +959,9 @@ "dev": true }, "import-fresh": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.2.tgz", - "integrity": "sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw==", - "dev": true, + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -1344,7 +1342,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, "requires": { "callsites": "^3.0.0" } @@ -1476,8 +1473,7 @@ "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" }, "rimraf": { "version": "3.0.2", diff --git a/package.json b/package.json index 868cd9e..7897352 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "", "dependencies": { "chalk": "^4.1.2", + "import-fresh": "^3.3.0", "lodash": "^4.17.21" }, "devDependencies": { diff --git a/tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js b/tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js new file mode 100644 index 0000000..9c01863 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js @@ -0,0 +1,45 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy -c:v:0 libx265 -preset:v slow -pix_fmt yuv420p10le -x265-params "crf=22:aq-mode=3"', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File is not in hevc! \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in hevc! \n' + + '☑ All audio streams are in aac! \n' + + '☑File has no title metadata \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); From e48adf33aaac959b94bf830a7e11a38a243403eb Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 12:56:44 +0100 Subject: [PATCH 057/126] Add Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3 test --- ...gin_b39x_the1poet_surround_sound_to_ac3.js | 1 - ...gin_b39x_the1poet_surround_sound_to_ac3.js | 59 +++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js diff --git a/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js b/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js index 07222fc..0546d04 100644 --- a/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js +++ b/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js b/tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js new file mode 100644 index 0000000..a3b9e80 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js @@ -0,0 +1,59 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c:v copy -c:a copy -c:a:0 ac3 -c:s copy -c:d copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒ File has surround audio which is NOT in ac3! \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑ All surround audio streams are in ac3! \n☑File meets conditions! \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑ All surround audio streams are in ac3! \n☑File meets conditions! \n', + }, + }, +]; + +run(tests); From f70bed06abadf8be278f304a1f3df22074a27085 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:01:27 +0100 Subject: [PATCH 058/126] Add Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC test --- ...Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js | 1 - ...Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js | 86 +++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js diff --git a/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js index 205132e..7035c3d 100644 --- a/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js +++ b/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -10,7 +10,6 @@ // eslint-disable-next-line max-len // https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/cloud-computing-quicksync-video-ffmpeg-white-paper.pdf -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js new file mode 100644 index 0000000..fc7f4ce --- /dev/null +++ b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -0,0 +1,86 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-fflags +genpts -hwaccel qsv -c:v h264_qsv -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset slow \n' + + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ It looks like the current bitrate is 1517k. \n' + + '\n' + + 'Container for output selected as mkv. \n' + + 'Encode variable bitrate settings: \n' + + 'Target = 759k \n' + + 'Minimum = 569k \n' + + 'Maximum = 949k \n' + + 'File Transcoding... \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + encoder_speedpreset: 'fast', + enable_10bit: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-fflags +genpts -hwaccel qsv -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset fast \n' + + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ It looks like the current bitrate is 1517k. \n' + + '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n' + + '\n' + + 'Container for output selected as mp4. \n' + + 'Encode variable bitrate settings: \n' + + 'Target = 759k \n' + + 'Minimum = 569k \n' + + 'Maximum = 949k \n' + + 'File Transcoding... \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + encoder_speedpreset: 'fast', + enable_10bit: 'true', + bitrate_cutoff: '2000', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ It looks like the current bitrate is 1517k. \n' + + '☑ Current bitrate is below set cutoff of 2000k. Cancelling plugin. \n', + container: '.mp4', + }, + }, +]; + +run(tests); From 998f4f64dfffda0fb45cb502223f05ba38a972cb Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:04:34 +0100 Subject: [PATCH 059/126] Add Tdarr_Plugin_c0r1_SetDefaultAudioStream test --- ...Tdarr_Plugin_c0r1_SetDefaultAudioStream.js | 1 - ...Tdarr_Plugin_c0r1_SetDefaultAudioStream.js | 49 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js diff --git a/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js b/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js index fa7b834..bdd492e 100644 --- a/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js +++ b/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_c0r1_SetDefaultAudioStream", diff --git a/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js b/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js new file mode 100644 index 0000000..5b475f7 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js @@ -0,0 +1,49 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + infoLog: '☑ No 2 channel audio stream exists. \n ' + }, + }, + { + input: { + file: (()=>{ + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + + file.ffProbeData.streams[1].channels = 6; + return file; + })(), + librarySettings: {}, + inputs: { + channels:'6', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c copy -disposition:1 default -disposition:2 0 -disposition:3 0 -disposition:4 0 -disposition:5 0 ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + infoLog: '☒ Matching audio stream is not set to default. \n' + + '☒ Setting 6 channel matching audio stream to default. Remove default from all other audio streams \n', + reQueueAfter: true + }, + } +]; + +run(tests); From a2c644c9aba6f7fad13fdb2b71bbe199cf3fce19 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:04:55 +0100 Subject: [PATCH 060/126] Lint --- .../Tdarr_Plugin_c0r1_SetDefaultAudioStream.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js b/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js index 5b475f7..1c012bf 100644 --- a/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js +++ b/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js @@ -16,20 +16,20 @@ const tests = [ container: '.mp4', handBrakeMode: false, FFmpegMode: true, - infoLog: '☑ No 2 channel audio stream exists. \n ' + infoLog: '☑ No 2 channel audio stream exists. \n ', }, }, { input: { - file: (()=>{ + file: (() => { const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); - file.ffProbeData.streams[1].channels = 6; + file.ffProbeData.streams[1].channels = 6; return file; })(), librarySettings: {}, inputs: { - channels:'6', + channels: '6', }, otherArguments: {}, }, @@ -39,11 +39,11 @@ const tests = [ container: '.mkv', handBrakeMode: false, FFmpegMode: true, - infoLog: '☒ Matching audio stream is not set to default. \n' + - '☒ Setting 6 channel matching audio stream to default. Remove default from all other audio streams \n', - reQueueAfter: true + infoLog: '☒ Matching audio stream is not set to default. \n' + + '☒ Setting 6 channel matching audio stream to default. Remove default from all other audio streams \n', + reQueueAfter: true, }, - } + }, ]; run(tests); From 44ea52902c232a6ab77ea8acc1b42ddfbea2a809 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:06:28 +0100 Subject: [PATCH 061/126] Add Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV test --- ..._d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js | 1 - ..._d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js | 50 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js diff --git a/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js b/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js index 0cab71a..699968b 100644 --- a/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js +++ b/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV", diff --git a/tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js b/tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js new file mode 100644 index 0000000..455b2ca --- /dev/null +++ b/tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js @@ -0,0 +1,50 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v h264_cuvid,-map 0 -dn -c:v hevc_nvenc -pix_fmt p010le -qmin 0 -cq:v 30 -b:v 964k -maxrate:v 2964k -preset slow -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -a53cc 0 -c:a copy -c:s copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☒File is 720p!\n' + + '☒File is not hevc!\n' + + '☒File bitrate is 1205kb!\n' + + 'File bitrate is LOWER than the Default Target Bitrate!\n' + + '☒Target Bitrate set to 964kb!\n' + + 'File is being transcoded!\n', + maxmux: false, + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + maxmux: false, + }, + }, +]; + +run(tests); From 1160d526319fc5d7a4fe2fab501adfa187b8d0be Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:08:38 +0100 Subject: [PATCH 062/126] Add Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix test --- ...in_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js | 1 - ...in_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js | 47 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js diff --git a/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js b/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js index 137ae08..c1b9ea4 100644 --- a/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js +++ b/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix", diff --git a/tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js b/tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js new file mode 100644 index 0000000..c80b3dc --- /dev/null +++ b/tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js @@ -0,0 +1,47 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☑File is a video Without Mjpeg! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].codec_name = 'mjpeg'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ',-map 0 -map -0:v:1 -c:v copy -c:a copy -c:s copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not a video but has Mjpeg Stream! \n' + + '☑File is a video With Mjpeg! \n', + }, + }, +]; + +run(tests); From 8a768ab63a9b3929df9f48a2d738c5c3f141be62 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:13:32 +0100 Subject: [PATCH 063/126] Add Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4 test --- ...gin_da11_Dallas_FFmpeg_Presets_H264_MP4.js | 42 +++++++------ ...gin_da11_Dallas_FFmpeg_Presets_H264_MP4.js | 62 +++++++++++++++++++ 2 files changed, 84 insertions(+), 20 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js diff --git a/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js b/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js index 956dd08..2dc1a31 100644 --- a/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js +++ b/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4", @@ -63,6 +62,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); // eslint-disable-next-line no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); + var response = { processFile: false, preset: "", @@ -71,15 +71,17 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { FFmpegMode: false, reQueueAfter: false, infoLog: "", - addInfo(status, info) { - this.infoLog += (status ? "☑" : "☒") + " " + info + "\n"; - }, + }; + const addInfo = (status, info) => { + response.infoLog += (status ? "☑" : "☒") + " " + info + "\n"; + } + // Check the file is a video if (file.fileMedium !== "video") { console.log("File is not video"); - response.addInfo(BAD, `File is not video`); + addInfo(BAD, `File is not video`); response.processFile = false; return response; } @@ -88,7 +90,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { let preset = getPreset(inputs.FFmpeg_preset); if (preset === null) { - response.addInfo( + addInfo( BAD, `Invalid Preset, \"${inputs.FFmpeg_preset}\" please select from (slow,medium,fast,veryfast)` ); @@ -126,10 +128,10 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (hasBadSubs) - response.addInfo(BAD, "File contains unsupported sub(s), dropping these!"); + addInfo(BAD, "File contains unsupported sub(s), dropping these!"); if (file.ffProbeData.streams[0].codec_name != "h264") { - response.addInfo(BAD, "File is not in h264!"); + addInfo(BAD, "File is not in h264!"); response.preset = ", -map_metadata -1 -map 0:V " + subMap + @@ -140,11 +142,11 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.FFmpegMode = true; return response; } else { - response.addInfo(GOOD, "File is already in h264!"); + addInfo(GOOD, "File is already in h264!"); } if (file.meta.Title != undefined && !jsonString.includes("aac") && hasSubs) { - response.addInfo(BAD, "File has title metadata and no aac and subs"); + addInfo(BAD, "File has title metadata and no aac and subs"); response.preset = ", -map_metadata -1 -map 0:v " + subMap + @@ -157,7 +159,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (!jsonString.includes("aac") && hasSubs) { - response.addInfo(BAD, "File has no aac track and has subs"); + addInfo(BAD, "File has no aac track and has subs"); response.preset = ", -map 0:v " + subMap + @@ -170,7 +172,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (file.meta.Title != undefined && hasSubs) { - response.addInfo(BAD, "File has title and has subs"); + addInfo(BAD, "File has title and has subs"); response.preset = ", -map_metadata -1 -map 0:v " + subMap + @@ -183,7 +185,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (file.meta.Title != undefined) { - response.addInfo(BAD, "File has title metadata"); + addInfo(BAD, "File has title metadata"); response.preset = ", -map_metadata -1 -map 0:v " + subMap + @@ -194,11 +196,11 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.FFmpegMode = true; return response; } else { - response.addInfo(GOOD, "File has no title metadata"); + addInfo(GOOD, "File has no title metadata"); } if (!jsonString.includes("aac")) { - response.addInfo(BAD, "File has no aac track"); + addInfo(BAD, "File has no aac track"); response.preset = ", -map 0:v " + subMap + @@ -209,14 +211,14 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.FFmpegMode = true; return response; } else { - response.addInfo(GOOD, "File has aac track"); + addInfo(GOOD, "File has aac track"); } if (hasSubs) { if (hasBadSubs) { - response.addInfo(BAD, "File has incompatible subs, dropping these..."); + addInfo(BAD, "File has incompatible subs, dropping these..."); } else { - response.addInfo(BAD, "File has compatible subs, copying..."); + addInfo(BAD, "File has compatible subs, copying..."); } response.preset = ", -map 0:v " + subMap + " -map 0:a -c:v copy -c:a copy " + subType; @@ -224,10 +226,10 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.FFmpegMode = true; return response; } else { - response.addInfo(GOOD, "File has no/compatible subs"); + addInfo(GOOD, "File has no/compatible subs"); } - response.addInfo(GOOD, "File meets conditions!"); + addInfo(GOOD, "File meets conditions!"); return response; } diff --git a/tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js b/tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js new file mode 100644 index 0000000..e382ca8 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js @@ -0,0 +1,62 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:v -map 0:a -c:v copy -c:a copy -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ File is already in h264!\n☒ File has title metadata\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: { + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:V -map 0:a -c:v libx264 -preset medium -c:a aac -strict -2 -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒ File is not in h264!\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: { + FFmpeg_preset: 'fast', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:V -map 0:a -c:v libx264 -preset fast -c:a aac -strict -2 -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒ File is not in h264!\n', + }, + }, +]; + +run(tests); From 96de8feba72c56ab45220572c6e044de2ea65410 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:24:52 +0100 Subject: [PATCH 064/126] Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll test --- ...r_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js | 6 +- ...r_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js | 75 +++++++++++++++++++ 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js diff --git a/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js b/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js index b7817c0..2d9345a 100644 --- a/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js +++ b/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js @@ -1,6 +1,5 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll", @@ -441,10 +440,15 @@ function buildVideoConfiguration(inputs, file, logger) { /* Determine tiered bitrate variables */ var tier = tiered[file.video_resolution]; + console.log(file.video_resolution); + console.log(tier); + bitratecheck = parseInt(tier["bitrate"]); if (bitrateprobe !== null && bitrateprobe < bitratecheck) { + console.log('here1') bitratetarget = parseInt((bitrateprobe * inputs.target_pct_reduction) / 1000); } else { + console.log('here2') bitratetarget = parseInt(tier["bitrate"] / 1000); } bitratemax = bitratetarget + tier["max_increase"]; diff --git a/tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js b/tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js new file mode 100644 index 0000000..6557f17 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js @@ -0,0 +1,75 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Removing audio track in language und\n' + + '☒ *** All audio tracks would have been removed. Defaulting to keeping all tracks for this file.\n' + + '☒ Transcoding to HEVC using NVidia NVENC\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ' -c:v h264_cuvid,-map 0 -map -0:d -c:v hevc_nvenc -qmin 0 -cq:v 30 -b:v 602k -maxrate:v 2602k -preset medium -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -c:a copy -c:s copy -max_muxing_queue_size 9999 -bf 5 -analyzeduration 2147483647 -probesize 2147483647', + reQueueAfter: true, + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☑ File is in HEVC codec and in MKV\n' + + '☑ No video processing necessary\n' + + '☑ No subtitle processing necessary\n' + + '☑ No need to process file', + processFile: false, + preset: ',-map 0 -map -0:d -c:v copy -c:a copy -c:s copy -max_muxing_queue_size 9999 -bf 5 -analyzeduration 2147483647 -probesize 2147483647', + reQueueAfter: true, + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].bit_rate = undefined; + return file; + })(), + librarySettings: {}, + inputs: { + target_bitrate_720p: '1500000', + }, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Removing audio track in language und\n' + + '☒ *** All audio tracks would have been removed. Defaulting to keeping all tracks for this file.\n' + + '☒ Transcoding to HEVC using NVidia NVENC\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ' -c:v h264_cuvid,-map 0 -map -0:d -c:v hevc_nvenc -qmin 0 -cq:v 30 -b:v 1500k -maxrate:v 3500k -preset medium -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -c:a copy -c:s copy -max_muxing_queue_size 9999 -bf 5 -analyzeduration 2147483647 -probesize 2147483647', + reQueueAfter: true, + }, + }, + +]; + +run(tests); From bad596f3e67c5eff590c74291ea72f387f672d5f Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:25:39 +0100 Subject: [PATCH 065/126] Remove logging --- Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js b/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js index 2d9345a..e8793e6 100644 --- a/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js +++ b/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js @@ -440,15 +440,10 @@ function buildVideoConfiguration(inputs, file, logger) { /* Determine tiered bitrate variables */ var tier = tiered[file.video_resolution]; - console.log(file.video_resolution); - console.log(tier); - bitratecheck = parseInt(tier["bitrate"]); if (bitrateprobe !== null && bitrateprobe < bitratecheck) { - console.log('here1') bitratetarget = parseInt((bitrateprobe * inputs.target_pct_reduction) / 1000); } else { - console.log('here2') bitratetarget = parseInt(tier["bitrate"] / 1000); } bitratemax = bitratetarget + tier["max_increase"]; From 1e7a805b6bac3a3fdd6d9b824a1887f343f4d994 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:28:53 +0100 Subject: [PATCH 066/126] Add Tdarr_Plugin_drdd_standardise_all_in_one test --- ...darr_Plugin_drdd_standardise_all_in_one.js | 1 - ...darr_Plugin_drdd_standardise_all_in_one.js | 110 ++++++++++++++++++ 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js diff --git a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js index d3e84b3..608b0f5 100644 --- a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js +++ b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js @@ -1,6 +1,5 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_drdd_standardise_all_in_one", diff --git a/tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js b/tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js new file mode 100644 index 0000000..250a2a7 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js @@ -0,0 +1,110 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Will convert multi channel audio to AC3\n' + + '☒ Transcoding to HEVC (software)\n' + + 'Encoder configuration:\n' + + '• Original Bitrate: 1517\n' + + '• Target Bitrate: 1517\n' + + '• Minimum Bitrate: 1061\n' + + '• Maximum Bitrate: 1972\n' + + '\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -c:v libx265 -b:v 1517k -minrate 1061k -maxrate 1972k -bufsize 1517k -c:a copy -c:a:0 ac3 -c:s copy -max_muxing_queue_size 4096', + reQueueAfter: false, + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + nvenc: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Will convert multi channel audio to AC3\n' + + '☒ Transcoding to HEVC using NVidia NVENC\n' + + 'Encoder configuration:\n' + + '• Original Bitrate: 1517\n' + + '• Target Bitrate: 1517\n' + + '• Minimum Bitrate: 1061\n' + + '• Maximum Bitrate: 1972\n' + + '\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: '-c:v h264_cuvid,-map 0 -map -0:d -c:v hevc_nvenc -cq:v 19 -b:v 1517k -minrate 1061k -maxrate 1972k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:a:0 ac3 -c:s copy -max_muxing_queue_size 4096', + reQueueAfter: false, + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + nvenc: 'false', + qsv: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Will convert multi channel audio to AC3\n' + + '☒ Transcoding to HEVC using VAAPI\n' + + 'Encoder configuration:\n' + + '• Original Bitrate: 1517\n' + + '• Target Bitrate: 1517\n' + + '• Minimum Bitrate: 1061\n' + + '• Maximum Bitrate: 1972\n' + + '\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: '-hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi,-map 0 -map -0:d -c:v hevc_vaapi -b:v 1517k -minrate 1061k -maxrate 1972k -bufsize 1517k -c:a copy -c:a:0 ac3 -c:s copy -max_muxing_queue_size 4096', + reQueueAfter: false, + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☑ No multi channel audio found\n' + + '☑ No audio processing necessary\n' + + '☑ File is in HEVC codec and in MKV\n' + + '☑ No video processing necessary\n' + + '☑ No subtitle processing necessary\n' + + '☑ No need to process file', + processFile: false, + preset: ',-map 0 -map -0:d -c:v copy -c:a copy -c:s copy -max_muxing_queue_size 4096', + reQueueAfter: false, + }, + }, +]; + +run(tests); From a1c0f1c2480c49c3bdd4511c27881b301de64bfd Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:33:28 +0100 Subject: [PATCH 067/126] Add Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta test --- ..._H.264_MKV_480p30_No_Subs_No_Title_Meta.js | 1 - ..._H.264_MKV_480p30_No_Subs_No_Title_Meta.js | 97 +++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js diff --git a/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js b/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js index 1b13250..3bb5280 100644 --- a/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta", diff --git a/tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js new file mode 100644 index 0000000..edbb610 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js @@ -0,0 +1,97 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "H.264 MKV 480p30"', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not h264 480p! \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "H.264 MKV 480p30"', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not h264 480p! \n', + }, + }, + + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].width = 720; + file.ffProbeData.streams[0].height = 480; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is h264 480p! \n' + + '☑File has no title and has no subs \n' + + '☒File has title metadata \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].width = 720; + file.ffProbeData.streams[0].height = 480; + + file.meta.Title = undefined; + file.container = 'mkv'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is h264 480p! \n' + + '☑File has no title and has no subs \n' + + '☑File has no title metadata \n' + + '☑File has no subs \n' + + '☑File is in mkv container! \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); From ff06afcf9ffbf667de56a16060393c4ebabafb8d Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:35:46 +0100 Subject: [PATCH 068/126] Add Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta test --- ..._H.264_MKV_720p30_No_Subs_No_Title_Meta.js | 1 - ..._H.264_MKV_720p30_No_Subs_No_Title_Meta.js | 99 +++++++++++++++++++ 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js diff --git a/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js b/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js index 8d6543f..5cca05c 100644 --- a/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta", diff --git a/tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js new file mode 100644 index 0000000..4371d6c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js @@ -0,0 +1,99 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is h264 720p! \n' + + '☑File has no title and has no subs \n' + + '☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "H.264 MKV 720p30"', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not h264 720p! \n', + }, + }, + + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].width = 1280; + file.ffProbeData.streams[0].height = 720; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is h264 720p! \n' + + '☑File has no title and has no subs \n' + + '☒File has title metadata \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].width = 1280; + file.ffProbeData.streams[0].height = 720; + + file.meta.Title = undefined; + file.container = 'mkv'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is h264 720p! \n' + + '☑File has no title and has no subs \n' + + '☑File has no title metadata \n' + + '☑File has no subs \n' + + '☑File is in mkv container! \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); From 1acae31493e7c7a40e4e1efc73ad384c98d23844 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:37:43 +0100 Subject: [PATCH 069/126] Add Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta test --- ...H.264_MKV_1080p30_No_Subs_No_Title_Meta.js | 1 - ...H.264_MKV_1080p30_No_Subs_No_Title_Meta.js | 96 +++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js diff --git a/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js b/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js index 6b79c8e..7ca1c11 100644 --- a/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta", diff --git a/tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js new file mode 100644 index 0000000..046e210 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js @@ -0,0 +1,96 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is h264 1080p!☑File has no title and has no subs \n' + + '☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "H.264 MKV 1080p30"', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not h264 1080p! \n', + }, + }, + + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].width = 1920; + file.ffProbeData.streams[0].height = 1080; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is h264 1080p!☑File has no title and has no subs \n' + + '☒File has title metadata \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].width = 1920; + file.ffProbeData.streams[0].height = 1080; + + file.meta.Title = undefined; + file.container = 'mkv'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is h264 1080p!☑File has no title and has no subs \n' + + '☑File has no title metadata \n' + + '☑File has no subs \n' + + '☑File is in mkv container! \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); From 50beae72e4c412e2e07092342357b79ff819a73c Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:44:28 +0100 Subject: [PATCH 070/126] Add Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio test --- ...rr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js | 1 - ...rr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js | 94 +++++++++++++++++++ 2 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js diff --git a/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js b/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js index c2d8fd4..d36415e 100644 --- a/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js +++ b/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js @@ -1,6 +1,5 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio", diff --git a/tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js b/tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js new file mode 100644 index 0000000..5a70598 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js @@ -0,0 +1,94 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ', -map 0:v', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: 'Removing unwanted audio...\n' + + 'Found unwanted: und: 1\n' + + 'Found unwanted: und: 1\n' + + 'No unwanted audio found!\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ', -map 0:v -map 0:1', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: 'Removing unwanted audio...\nAdded undefined: 1\nNo unwanted audio found!\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + languages: 'fre', + container: 'mp4', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:4 -map 0:s? -c copy', + container: 'mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Removing unwanted audio...\n' + + 'Found wanted fre: 4\n' + + 'Found unwanted audio\n' + + 'It will be removed\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + languages: 'eng', + container: 'mp4', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:1 -map 0:2 -map 0:3 -map 0:5 -map 0:s? -c copy', + container: 'mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Removing unwanted audio...\n' + + 'Found wanted eng: 1\n' + + 'Found wanted eng: 2\n' + + 'Found wanted eng: 3\n' + + 'Found wanted eng: 5\n' + + 'Found unwanted audio\n' + + 'It will be removed\n', + }, + }, +]; + +run(tests); From ea5b34c8492e2e0020c84fd632bfc4aea3139c90 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:52:01 +0100 Subject: [PATCH 071/126] Add Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac) test --- ...de audio and video with HW (PC and Mac).js | 2 +- ...de audio and video with HW (PC and Mac).js | 107 ++++++++++++++++++ tests/runTests.js | 2 +- 3 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js diff --git a/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js b/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js index 94d96b1..e52695c 100644 --- a/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js +++ b/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js @@ -4,7 +4,6 @@ /* eslint no-bitwise: 0 */ /* eslint no-mixed-operators: 0 */ -// tdarrSkipTest const details = () => { return { id: 'Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac)', @@ -204,6 +203,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { if (inputs.bitrate_cutoff !== '') { // Checks if currentBitrate is below inputs.bitrate_cutoff // If so then don't convert video. + console.log(currentBitrate) if (currentBitrate <= inputs.bitrate_cutoff) { convertVideo = false; } diff --git a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js new file mode 100644 index 0000000..5f17cd8 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js @@ -0,0 +1,107 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.mkv', + processFile: true, + preset: ', -sn -map 0:v -c:v hevc_qsv -load_plugin hevc_hw -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -map 0:a -c:a copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Converting video, NOT resizing. 720p, h264 --> 720p, hevc. bitrate = 1517 --> 758, multiplier 0.5. \n' + + 'Not converting audio. \n' + + '2 channels - \n' + + '6 channels - und aac \n' + + '8 channels - ', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.mkv', + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is processed already, nothing to do', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + resize: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.mkv', + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is processed already, nothing to do', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + bitrate_cutoff: '6000', + }, + otherArguments: {}, + }, + output: { + container: '.mkv', + processFile: true, + preset: ', -sn -map 0:v -c:v hevc_qsv -load_plugin hevc_hw -b:v 3933k -minrate 2753k -maxrate 5112k -bufsize 7866k -map 0:a -c:a copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Converting video, NOT resizing. 1080p, h264 --> 1080p, hevc. bitrate = 7866 --> 3933, multiplier 0.5. \n' + + 'Not converting audio. \n' + + '2 channels - eng flac \n' + + '6 channels - \n' + + '8 channels - ', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + bitrate_cutoff: '8000', + }, + otherArguments: {}, + }, + output: { + container: '.mkv', + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is processed already, nothing to do', + }, + }, +]; + +run(tests); diff --git a/tests/runTests.js b/tests/runTests.js index fa23944..d5d7285 100644 --- a/tests/runTests.js +++ b/tests/runTests.js @@ -29,7 +29,7 @@ const run = async () => { if (shouldRunTest) { // eslint-disable-next-line no-await-in-loop await new Promise((resolve) => { - childProcess.exec(`node ${pluginTestpath}`, (err, stdout, stderr) => { + childProcess.exec(`node "${pluginTestpath}"`, (err, stdout, stderr) => { if (err) { console.log(err); } From 7eaec0beb830a9ce2325881ac127a39500bdd1bf Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 13:54:58 +0100 Subject: [PATCH 072/126] Add Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs test --- ...rr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js | 1 - ...rr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js | 48 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js diff --git a/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js b/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js index 4e433ad..49203be 100644 --- a/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js +++ b/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs", diff --git a/tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js b/tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js new file mode 100644 index 0000000..86bb3c1 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js @@ -0,0 +1,48 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☒File is not a 4K video \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.video_resolution = '4KUHD'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-sn -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File does not have only AC3 track commentaries! \n' + + '☑File has AC3 track! \n' + + '☒File has subs! \n', + }, + }, +]; + +run(tests); From 9215d34bca3312749487188413c6dee0ab8f4abb Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 14:01:33 +0100 Subject: [PATCH 073/126] Add Tdarr_Plugin_Greg_MP3_FFMPEG_CPU test --- Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js | 1 - .../Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js | 59 ++++ tests/sampleData/media/sampleAAC_1.json | 334 ++++++++++++++++++ tests/sampleData/media/sampleMP3_1.json | 314 ++++++++++++++++ 4 files changed, 707 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js create mode 100644 tests/sampleData/media/sampleAAC_1.json create mode 100644 tests/sampleData/media/sampleMP3_1.json diff --git a/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js b/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js index 122134b..0c5a59f 100644 --- a/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js +++ b/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js @@ -1,5 +1,4 @@ module.exports.dependencies = ['import-fresh']; -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_Greg_MP3_FFMPEG_CPU', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js b/tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js new file mode 100644 index 0000000..ef5221c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js @@ -0,0 +1,59 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + preset: ', -map_metadata 0 -id3v2_version 3 -b:a 320k', + container: '.mp3', + handbrakeMode: false, + ffmpegMode: true, + processFile: false, + reQueueAfter: true, + infoLog: 'undefined☒Codec excluded \n ☑Codec not excluded \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleAAC_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + preset: ', -map_metadata 0 -id3v2_version 3 -b:a 320k', + container: '.mp3', + handbrakeMode: false, + ffmpegMode: true, + processFile: false, + reQueueAfter: true, + infoLog: 'undefined☒Codec excluded \n ☑Codec not excluded \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleMP3_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + preset: ', -map_metadata 0 -id3v2_version 3 -b:a 320k', + container: '.mp3', + handbrakeMode: false, + ffmpegMode: true, + processFile: false, + reQueueAfter: true, + infoLog: 'undefined☒Codec excluded \n ☒Codec excluded \n', + }, + }, +]; + +run(tests); diff --git a/tests/sampleData/media/sampleAAC_1.json b/tests/sampleData/media/sampleAAC_1.json new file mode 100644 index 0000000..81d53e6 --- /dev/null +++ b/tests/sampleData/media/sampleAAC_1.json @@ -0,0 +1,334 @@ +{ + "_id": "C:/Transcode/Source Folder/qsv_h265.mkv", + "file": "C:/Transcode/Source Folder/qsv_h265.mkv", + "DB": "2MY5YD7P8", + "footprintId": "xkZP3IPR6g", + "hasClosedCaptions": false, + "container": "mkv", + "scannerReads": { + "ffProbeRead": "success", + "exiftoolRead": "success", + "mediaInfoRead": "success", + "closedCaptionRead": "\"Unable to run CCExtractor\"" + }, + "ffProbeData": { + "streams": [ + { + "index": 0, + "codec_name": "hevc", + "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)", + "profile": "Main", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1920, + "height": 1080, + "coded_width": 1920, + "coded_height": 1088, + "closed_captions": 0, + "has_b_frames": 1, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": 150, + "color_range": "tv", + "color_space": "bt709", + "color_transfer": "bt709", + "color_primaries": "bt709", + "chroma_location": "left", + "refs": 1, + "r_frame_rate": "25/1", + "avg_frame_rate": "25/1", + "time_base": "1/1000", + "start_pts": 21, + "start_time": "0.021000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "DURATION": "00:00:21.341000000" + } + }, + { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "title": "Stereo", + "DURATION": "00:00:21.375000000" + } + } + ], + "format": { + "filename": "C:/Transcode/Source Folder/qsv_h265.mkv", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "0.000000", + "duration": "21.375000", + "size": "8569883", + "bit_rate": "3207441", + "probe_score": 100, + "tags": { + "creation_time": "2019-09-13T16:46:14.000000Z", + "ENCODER": "Lavf58.20.100" + } + } + }, + "file_size": 8.172877311706543, + "video_resolution": "1080p", + "fileMedium": "video", + "video_codec_name": "hevc", + "audio_codec_name": "", + "lastPluginDetails": "none", + "createdAt": 1653029410394, + "bit_rate": 3207441, + "duration": 21, + "statSync": { + "dev": 3832468976, + "mode": 33060, + "nlink": 1, + "uid": 0, + "gid": 0, + "rdev": 0, + "blksize": 4096, + "ino": 1970324841360027, + "size": 8569883, + "blocks": 16744, + "atimeMs": 1653029410381.1382, + "mtimeMs": 1568393195000, + "ctimeMs": 1650864287188.087, + "birthtimeMs": 1650864302270.2063, + "atime": "2022-05-20T06:50:10.381Z", + "mtime": "2019-09-13T16:46:35.000Z", + "ctime": "2022-04-25T05:24:47.188Z", + "birthtime": "2022-04-25T05:25:02.270Z" + }, + "HealthCheck": "", + "TranscodeDecisionMaker": "", + "lastHealthCheckDate": 0, + "holdUntil": 0, + "lastTranscodeDate": 0, + "bumped": false, + "history": "", + "oldSize": 0, + "newSize": 0, + "videoStreamIndex": 0, + "lastUpdate": 1653027918258, + "meta": { + "SourceFile": "C:/Transcode/Source Folder/qsv_h265.mkv", + "errors": [], + "Duration": 21.375, + "ExifToolVersion": 12.4, + "FileName": "qsv_h265.mkv", + "Directory": "C:/Transcode/Source Folder", + "FileSize": "8.2 MiB", + "FileModifyDate": { + "year": 2019, + "month": 9, + "day": 13, + "hour": 17, + "minute": 46, + "second": 35, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2019:09:13 17:46:35+01:00" + }, + "FileAccessDate": { + "year": 2022, + "month": 5, + "day": 20, + "hour": 7, + "minute": 50, + "second": 9, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:20 07:50:09+01:00" + }, + "FileCreateDate": { + "year": 2022, + "month": 4, + "day": 25, + "hour": 6, + "minute": 25, + "second": 2, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:04:25 06:25:02+01:00" + }, + "FilePermissions": "-r--r--r--", + "FileType": "MKV", + "FileTypeExtension": "mkv", + "MIMEType": "video/x-matroska", + "EBMLVersion": 1, + "EBMLReadVersion": 1, + "DocType": "matroska", + "DocTypeVersion": 4, + "DocTypeReadVersion": 2, + "TimecodeScale": "1 ms", + "MuxingApp": "Lavf58.20.100", + "WritingApp": "HandBrake 1.2.2 2019022300", + "DateTimeOriginal": { + "year": 2019, + "month": 9, + "day": 13, + "hour": 16, + "minute": 46, + "second": 14, + "millisecond": 0, + "tzoffsetMinutes": 0, + "rawValue": "2019:09:13 16:46:14Z" + }, + "VideoFrameRate": 25, + "ImageWidth": 1920, + "ImageHeight": 1080, + "TrackNumber": 2, + "TrackName": "Stereo", + "TrackLanguage": "und", + "CodecID": "A_AAC", + "TrackType": "Audio", + "AudioChannels": 2, + "AudioSampleRate": 48000, + "TagName": "DURATION", + "TagString": "00:00:21.375000000", + "ImageSize": "1920x1080", + "Megapixels": 2.1 + }, + "mediaInfo": { + "@ref": "", + "track": [ + { + "@type": "General", + "UniqueID": "112612991515236890937117095733641799622", + "VideoCount": "1", + "AudioCount": "1", + "Format": "Matroska", + "Format_Version": "4", + "FileSize": "8569883", + "Duration": "21.375", + "OverallBitRate": "3207442", + "FrameRate": "25.000", + "FrameCount": "533", + "IsStreamable": "Yes", + "Encoded_Date": "UTC 2019-09-13 16:46:14", + "Encoded_Application": "HandBrake 1.2.2 2019022300", + "Encoded_Library": "Lavf58.20.100", + "extra": { + "ErrorDetectionType": "Per level 1" + } + }, + { + "@type": "Video", + "StreamOrder": "0", + "ID": "1", + "UniqueID": "1", + "Format": "HEVC", + "Format_Profile": "Main", + "Format_Level": "5", + "Format_Tier": "Main", + "CodecID": "V_MPEGH/ISO/HEVC", + "Duration": "21.320000000", + "Width": "1920", + "Height": "1080", + "Stored_Height": "1088", + "Sampled_Width": "1920", + "Sampled_Height": "1080", + "PixelAspectRatio": "1.000", + "DisplayAspectRatio": "1.778", + "FrameRate_Mode": "CFR", + "FrameRate": "25.000", + "FrameCount": "533", + "ColorSpace": "YUV", + "ChromaSubsampling": "4:2:0", + "BitDepth": "8", + "Delay": "0.021", + "Default": "Yes", + "Forced": "No", + "colour_description_present": "Yes", + "colour_description_present_Source": "Stream", + "colour_range": "Limited", + "colour_range_Source": "Stream", + "colour_primaries": "BT.709", + "colour_primaries_Source": "Stream", + "transfer_characteristics": "BT.709", + "transfer_characteristics_Source": "Stream", + "matrix_coefficients": "BT.709", + "matrix_coefficients_Source": "Stream" + }, + { + "@type": "Audio", + "StreamOrder": "1", + "ID": "2", + "UniqueID": "2", + "Format": "AAC", + "Format_Settings_SBR": "No (Explicit)", + "Format_AdditionalFeatures": "LC", + "CodecID": "A_AAC-2", + "Duration": "21.375000000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "1026000", + "FrameRate": "46.875", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "Title": "Stereo", + "Default": "Yes", + "Forced": "No" + } + ] + } + } \ No newline at end of file diff --git a/tests/sampleData/media/sampleMP3_1.json b/tests/sampleData/media/sampleMP3_1.json new file mode 100644 index 0000000..6c7dd81 --- /dev/null +++ b/tests/sampleData/media/sampleMP3_1.json @@ -0,0 +1,314 @@ +{ + "_id": "C:/Transcode/Source Folder/sample__-__-__libmp3lame__30s__audio.mkv", + "file": "C:/Transcode/Source Folder/sample__-__-__libmp3lame__30s__audio.mkv", + "DB": "2MY5YD7P8", + "footprintId": "xpsr-dmmd", + "hasClosedCaptions": false, + "container": "mkv", + "scannerReads": { + "ffProbeRead": "success", + "exiftoolRead": "success", + "mediaInfoRead": "success", + "closedCaptionRead": "\"Unable to run CCExtractor\"" + }, + "ffProbeData": { + "streams": [ + { + "index": 0, + "codec_name": "mp3", + "codec_long_name": "MP3 (MPEG audio layer 3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "128000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "GPAC ISO Audio Handler", + "ENCODER": "Lavc57.107.100 libmp3lame", + "DURATION": "00:00:30.023000000" + } + }, + { + "index": 1, + "codec_name": "mp3", + "codec_long_name": "MP3 (MPEG audio layer 3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "128000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "GPAC ISO Audio Handler", + "ENCODER": "Lavc57.107.100 libmp3lame", + "DURATION": "00:00:30.023000000" + } + } + ], + "format": { + "filename": "C:/Transcode/Source Folder/sample__-__-__libmp3lame__30s__audio.mkv", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "0.000000", + "duration": "30.023000", + "size": "979815", + "bit_rate": "261083", + "probe_score": 100, + "tags": { + "title": "Big Buck Bunny, Sunflower version", + "GENRE": "Animation", + "MAJOR_BRAND": "isom", + "MINOR_VERSION": "1", + "COMPATIBLE_BRANDS": "isomavc1", + "COMPOSER": "Sacha Goedegebure", + "ARTIST": "Blender Foundation 2008, Janus Bager Kristensen 2013", + "COMMENT": "Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net", + "ENCODER": "Lavf57.83.100" + } + } + }, + "file_size": 0.9344244003295898, + "video_resolution": "", + "fileMedium": "audio", + "video_codec_name": "", + "audio_codec_name": "mp3", + "lastPluginDetails": "none", + "createdAt": 1653224430511, + "bit_rate": 261083, + "duration": 30, + "statSync": { + "dev": 3832468976, + "mode": 33206, + "nlink": 1, + "uid": 0, + "gid": 0, + "rdev": 0, + "blksize": 4096, + "ino": 10133099162447292, + "size": 979815, + "blocks": 1920, + "atimeMs": 1653224430487.7, + "mtimeMs": 1653224386734.2915, + "ctimeMs": 1653224395573.211, + "birthtimeMs": 1653224386247.453, + "atime": "2022-05-22T13:00:30.488Z", + "mtime": "2022-05-22T12:59:46.734Z", + "ctime": "2022-05-22T12:59:55.573Z", + "birthtime": "2022-05-22T12:59:46.247Z" + }, + "HealthCheck": "", + "TranscodeDecisionMaker": "", + "lastHealthCheckDate": 0, + "holdUntil": 0, + "lastTranscodeDate": 0, + "bumped": false, + "history": "", + "oldSize": 0, + "newSize": 0, + "videoStreamIndex": -1, + "meta": { + "SourceFile": "C:/Transcode/Source Folder/sample__-__-__libmp3lame__30s__audio.mkv", + "errors": [], + "Duration": 30.023, + "ExifToolVersion": 12.4, + "FileName": "sample__-__-__libmp3lame__30s__audio.mkv", + "Directory": "C:/Transcode/Source Folder", + "FileSize": "957 KiB", + "ZoneIdentifier": "Exists", + "FileModifyDate": { + "year": 2022, + "month": 5, + "day": 22, + "hour": 13, + "minute": 59, + "second": 46, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:22 13:59:46+01:00" + }, + "FileAccessDate": { + "year": 2022, + "month": 5, + "day": 22, + "hour": 14, + "minute": 0, + "second": 29, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:22 14:00:29+01:00" + }, + "FileCreateDate": { + "year": 2022, + "month": 5, + "day": 22, + "hour": 13, + "minute": 59, + "second": 46, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:22 13:59:46+01:00" + }, + "FilePermissions": "-rw-rw-rw-", + "FileType": "MKA", + "FileTypeExtension": "mka", + "MIMEType": "audio/x-matroska", + "EBMLVersion": 1, + "EBMLReadVersion": 1, + "DocType": "matroska", + "DocTypeVersion": 4, + "DocTypeReadVersion": 2, + "TimecodeScale": "1 ms", + "Title": "Big Buck Bunny, Sunflower version", + "MuxingApp": "Lavf57.83.100", + "WritingApp": "Lavf57.83.100", + "TrackNumber": 2, + "TrackLanguage": "und", + "CodecID": "A_MPEG/L3", + "TrackType": "Audio", + "AudioChannels": 2, + "AudioSampleRate": 48000, + "AudioBitsPerSample": 32, + "TagName": "DURATION", + "TagString": "00:00:30.023000000" + }, + "mediaInfo": { + "@ref": "", + "track": [ + { + "@type": "General", + "UniqueID": "301354878049300200919944107613778820882", + "AudioCount": "2", + "Format": "Matroska", + "Format_Version": "4", + "FileSize": "979815", + "Duration": "30.023", + "OverallBitRate_Mode": "CBR", + "OverallBitRate": "261084", + "StreamSize": "19079", + "IsStreamable": "Yes", + "Title": "Big Buck Bunny, Sunflower version", + "Track": "Big Buck Bunny, Sunflower version", + "Encoded_Application": "Lavf57.83.100", + "Encoded_Library": "Lavf57.83.100", + "Comment": "Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net", + "extra": { + "ErrorDetectionType": "Per level 1", + "ARTIST": "Blender Foundation 2008, Janus Bager Kristensen 2013", + "COMPOSER": "Sacha Goedegebure", + "GENRE": "Animation" + } + }, + { + "@type": "Audio", + "@typeorder": "1", + "StreamOrder": "0", + "ID": "1", + "UniqueID": "1", + "Format": "MPEG Audio", + "Format_Version": "1", + "Format_Profile": "Layer 3", + "Format_Settings_Mode": "Joint stereo", + "Format_Settings_ModeExtension": "MS Stereo", + "CodecID": "A_MPEG/L3", + "Duration": "30.023000000", + "BitRate_Mode": "CBR", + "BitRate": "128000", + "Channels": "2", + "SamplingRate": "48000", + "SamplingCount": "1441104", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "StreamSize": "480368", + "StreamSize_Proportion": "0.49026", + "Encoded_Library": "Lavc57.107.100 libmp3lame", + "Default": "Yes", + "Forced": "No" + }, + { + "@type": "Audio", + "@typeorder": "2", + "StreamOrder": "1", + "ID": "2", + "UniqueID": "2", + "Format": "MPEG Audio", + "Format_Version": "1", + "Format_Profile": "Layer 3", + "Format_Settings_Mode": "Joint stereo", + "Format_Settings_ModeExtension": "MS Stereo", + "CodecID": "A_MPEG/L3", + "Duration": "30.023000000", + "BitRate_Mode": "CBR", + "BitRate": "128000", + "Channels": "2", + "SamplingRate": "48000", + "SamplingCount": "1441104", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "StreamSize": "480368", + "StreamSize_Proportion": "0.49026", + "Encoded_Library": "Lavc57.107.100 libmp3lame", + "Default": "Yes", + "Forced": "No" + } + ] + } +} \ No newline at end of file From 19f8d4b67b667171905773a0b9dda8c97937ee90 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 14:06:51 +0100 Subject: [PATCH 074/126] Add Tdarr_Plugin_henk_Add_Specific_Audio_Codec test --- ...rr_Plugin_henk_Add_Specific_Audio_Codec.js | 1 - ...rr_Plugin_henk_Add_Specific_Audio_Codec.js | 85 +++++++++++++++++++ 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js diff --git a/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js b/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js index 06dd4c5..cf46df8 100644 --- a/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js +++ b/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_henk_Add_Specific_Audio_Codec', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js b/tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js new file mode 100644 index 0000000..71c8098 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js @@ -0,0 +1,85 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ', -c copy -map 0:v ', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☒File is not mkv \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ', -c copy -map 0:v -map 0:a:0? -c:a:0 copy -map 0:a:1? -c:a:1 copy -map 0:a:2? -c:a:2 copy -map 0:a:3? -c:a:3 copy -map 0:a:4? -c:a:4 copy ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: "☑File doesn't contain audio tracks with the specified codec.\n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + input_codecs: 'aac', + output_codec: 'eac3', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -c copy -map 0:v -map 0:a:0? -c:a:0 copy -map 0:a:1? -c:a:1 copy -map 0:a:2? -c:a:2 copy -map 0:a:3? -c:a:3 copy -map 0:a:3? -c:a:4 eac3 -b:a:4 128k -metadata:s:a:4 title="" -metadata:s:a:4 copyright="henk_asac" -disposition:a:4 0 -map 0:a:4? -c:a:5 copy -map 0:a:4? -c:a:6 eac3 -b:a:6 128k -metadata:s:a:6 title="" -metadata:s:a:6 copyright="henk_asac" -disposition:a:6 0 -map 0:s? ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + input_codecs: 'aac', + output_codec: 'eac3', + bitrate: '256', + auto_adjust: 'false', + position_new_audio: 'before', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -c copy -map 0:v -map 0:a:0? -c:a:0 copy -map 0:a:1? -c:a:1 copy -map 0:a:2? -c:a:2 copy -map 0:a:3? -c:a:3 eac3 -b:a:3 256k -metadata:s:a:3 title="" -metadata:s:a:3 copyright="henk_asac" -disposition:a:3 0 -map 0:a:3? -c:a:4 copy -map 0:a:4? -c:a:5 eac3 -b:a:5 256k -metadata:s:a:5 title="" -metadata:s:a:5 copyright="henk_asac" -disposition:a:5 0 -map 0:a:4? -c:a:6 copy -map 0:s? ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '', + }, + }, +]; + +run(tests); From 5a6d368a1ee52fd6e16779f4ffb890b5222af6c8 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 14:12:02 +0100 Subject: [PATCH 075/126] Add Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle test --- ...rawmonster_MP4_AAC_No_Subs_No_metaTitle.js | 1 - ...rawmonster_MP4_AAC_No_Subs_No_metaTitle.js | 68 +++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js diff --git a/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js b/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js index b3ee6a0..76e5104 100644 --- a/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js +++ b/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle", diff --git a/tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js b/tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js new file mode 100644 index 0000000..894d3a0 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js @@ -0,0 +1,68 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -c:v copy -c:a copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -c:v copy -c:a copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File has no title metadata \n' + + '☑File has no subs \n' + + '☒File is not in mp4 container! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json')); + file.container = 'mp4'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File has no title metadata \n' + + '☑File has no subs \n' + + '☑File is in mp4 container! \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); From b52aa4c93bca2900a7e638965db800e7f74d01f5 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 14:14:19 +0100 Subject: [PATCH 076/126] Add Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle test --- ..._Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js | 1 - ..._Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js | 66 +++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js diff --git a/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js b/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js index edbc80e..88bd347 100644 --- a/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js +++ b/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle", diff --git a/tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js b/tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js new file mode 100644 index 0000000..df39e53 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js @@ -0,0 +1,66 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is in mp4 container! \n☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File is not in mp4 container! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json')); + file.container = 'mp4'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is in mp4 container! \n' + + '☑File has no title metadata \n' + + '☑File has aac track \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); From c7934f2da5ab755f86fe7a9a23ef264eff0edab2 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 14:28:04 +0100 Subject: [PATCH 077/126] Add outputModify func --- tests/helpers/run.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/helpers/run.js b/tests/helpers/run.js index 3ec85ab..58b6e05 100644 --- a/tests/helpers/run.js +++ b/tests/helpers/run.js @@ -29,6 +29,10 @@ const run = async (tests) => { errorEncountered = err1; } + if (test.outputModify) { + testOutput = test.outputModify(test.output); + } + if (test.error && test.error.shouldThrow) { if (errorEncountered !== false) { // eslint-disable-next-line no-console From a9c2007e5632c06f3af30bdda7e683f7bec3a38e Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 14:36:10 +0100 Subject: [PATCH 078/126] Base tests on linux for now --- ...gin_ER01_Transcode audio and video with HW (PC and Mac).js | 4 ++-- tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js index 5f17cd8..c725079 100644 --- a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js +++ b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js @@ -13,7 +13,7 @@ const tests = [ output: { container: '.mkv', processFile: true, - preset: ', -sn -map 0:v -c:v hevc_qsv -load_plugin hevc_hw -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -map 0:a -c:a copy ', + preset: ', -sn -map 0:v -c:v copy -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -map 0:a -c:a copy ', handBrakeMode: false, FFmpegMode: true, reQueueAfter: true, @@ -72,7 +72,7 @@ const tests = [ output: { container: '.mkv', processFile: true, - preset: ', -sn -map 0:v -c:v hevc_qsv -load_plugin hevc_hw -b:v 3933k -minrate 2753k -maxrate 5112k -bufsize 7866k -map 0:a -c:a copy ', + preset: ', -sn -map 0:v -c:v copy -b:v 3933k -minrate 2753k -maxrate 5112k -bufsize 7866k -map 0:a -c:a copy ', handBrakeMode: false, FFmpegMode: true, reQueueAfter: true, diff --git a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js index fc7f4ce..336f2f0 100644 --- a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js +++ b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -12,7 +12,7 @@ const tests = [ }, output: { processFile: true, - preset: '-fflags +genpts -hwaccel qsv -c:v h264_qsv -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset slow \n' + preset: '-fflags +genpts -hwaccel qsv -c:v h264_qsv -map 0 -c:v hevc_qsv -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset slow \n' + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 ', handBrakeMode: false, FFmpegMode: true, @@ -41,7 +41,7 @@ const tests = [ }, output: { processFile: true, - preset: '-fflags +genpts -hwaccel qsv -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset fast \n' + preset: '-fflags +genpts -hwaccel qsv -map 0 -c:v hevc_qsv -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset fast \n' + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -pix_fmt p010le ', handBrakeMode: false, FFmpegMode: true, From 814e76344424bbfde43a96f76f5182b2e4302fdc Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:25:09 +0100 Subject: [PATCH 079/126] Add Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC test --- ...eons001_Downmix_to_stereo_and_apply_DRC.js | 4 -- ...eons001_Downmix_to_stereo_and_apply_DRC.js | 42 +++++++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js diff --git a/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js b/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js index 39d830e..8baf72e 100644 --- a/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js +++ b/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC', Stage: 'Pre-processing', @@ -24,9 +23,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { FFmpegMode: true, reQueueAfter: true, infoLog: '', - file, - removeFromDB: false, - updateDB: false, container: `.${file.container}`, }; diff --git a/tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js b/tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js new file mode 100644 index 0000000..229b051 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js @@ -0,0 +1,42 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-sn -vcodec copy -scodec copy -acodec aac -filter:a "dynaudnorm,pan=stereo|FL < 1.0*FL + 0.707*FC + 0.707*BL|FR < 1.0*FR + 0.707*FC + 0.707*BR"', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File matches requirements for processing. Downmixing and applying DRC!', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File has more than 1 audio track - not processing', + container: '.mkv', + }, + }, +]; + +run(tests); From 1b36e0a7ddc6b4dcd9dd45b6a156bdd704910935 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:25:20 +0100 Subject: [PATCH 080/126] Add Tdarr_Plugin_lmg1_Reorder_Streams test --- .../Tdarr_Plugin_lmg1_Reorder_Streams.js | 1 - .../Tdarr_Plugin_lmg1_Reorder_Streams.js | 50 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js diff --git a/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js b/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js index 24de43c..bf5c9a5 100644 --- a/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js +++ b/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_lmg1_Reorder_Streams", diff --git a/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js b/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js new file mode 100644 index 0000000..197cc39 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js @@ -0,0 +1,50 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: 'File has video in first stream\n File meets conditions!\n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + + const audio = file.ffProbeData.streams[1]; + // eslint-disable-next-line prefer-destructuring + file.ffProbeData.streams[1] = file.ffProbeData.streams[0]; + file.ffProbeData.streams[0] = audio; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v? -map 0:a? -map 0:s? -map 0:d? -map 0:t? -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Video is not in the first stream', + }, + }, +]; + +run(tests); From f9ff9671a0a1f6ab2270dda0869e7ce1d36cccd9 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:25:36 +0100 Subject: [PATCH 081/126] Add Tdarr_Plugin_MC93_Migz1FFMPEG test --- Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js | 1 - .../Tdarr_Plugin_MC93_Migz1FFMPEG.js | 145 ++++++++++++++++++ 2 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js diff --git a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js index 39fd212..11edf36 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js +++ b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js @@ -1,5 +1,4 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz1FFMPEG', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js new file mode 100644 index 0000000..a329f18 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js @@ -0,0 +1,145 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v h264_cuvid, -map 0 -c:v hevc_nvenc -cq:v 19 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:s copy -max_muxing_queue_size 9999 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mkv. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is already hevc or vp9 & in mkv. \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v h264_cuvid, -map 0 -c:v hevc_nvenc -cq:v 19 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mp4. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + bitrate_cutoff: '10000', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Current bitrate is below set cutoff of 10000. Cancelling plugin. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + bitrate_cutoff: '1000', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v h264_cuvid, -map 0 -c:v hevc_nvenc -cq:v 19 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mp4. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + force_conform: 'false', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is hevc or vp9 but is not in mp4 container. Remuxing. \n', + container: '.mp4', + }, + }, +]; + +run(tests); From 90a337263aa7430e5a89c55df9b0ab45d39b233c Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:25:48 +0100 Subject: [PATCH 082/126] Add Tdarr_Plugin_MC93_Migz1FFMPEG_CPU test --- .../Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js | 1 - .../Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js | 145 ++++++++++++++++++ 2 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js diff --git a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js index 0f6c746..a5abfcb 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js +++ b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js @@ -1,5 +1,4 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz1FFMPEG_CPU', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js new file mode 100644 index 0000000..6e1afa3 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js @@ -0,0 +1,145 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c:v libx265 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -c:a copy -c:s copy -max_muxing_queue_size 9999 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mkv. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is already hevc or vp9 & in mkv. \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c:v libx265 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mp4. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + bitrate_cutoff: '10000', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Current bitrate is below set bitrate cutoff of 10000. Nothing to do, cancelling plugin. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + bitrate_cutoff: '1000', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c:v libx265 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mp4. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + force_conform: 'false', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is hevc or vp9 but is not in mp4 container. Remuxing. \n', + container: '.mp4', + }, + }, +]; + +run(tests); From 6ffe10ec6aa13832a65cf26b7df06175eecb7740 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:25:58 +0100 Subject: [PATCH 083/126] Add Tdarr_Plugin_MC93_Migz1Remux test --- Community/Tdarr_Plugin_MC93_Migz1Remux.js | 1 - .../Community/Tdarr_Plugin_MC93_Migz1Remux.js | 45 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js diff --git a/Community/Tdarr_Plugin_MC93_Migz1Remux.js b/Community/Tdarr_Plugin_MC93_Migz1Remux.js index 3c4227c..37eed73 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1Remux.js +++ b/Community/Tdarr_Plugin_MC93_Migz1Remux.js @@ -1,5 +1,4 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz1Remux', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js b/tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js new file mode 100644 index 0000000..16051f0 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js @@ -0,0 +1,45 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy -max_muxing_queue_size 9999 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File is mp4 but requested to be mkv container. Remuxing. \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + force_conform: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in mp4 container. \n', + container: '.mp4', + }, + }, +]; + +run(tests); From aa4ffc5527f0f7712066877fdefa2abb648cc124 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:26:10 +0100 Subject: [PATCH 084/126] Add Tdarr_Plugin_MC93_Migz2CleanTitle test --- .../Tdarr_Plugin_MC93_Migz2CleanTitle.js | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js b/tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js new file mode 100644 index 0000000..5208106 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js @@ -0,0 +1,46 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -metadata title= -c copy -map 0 -max_muxing_queue_size 9999', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has title metadata. Removing \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File has no title metadata \n', + }, + }, +]; + +run(tests); From 690e29eaf596fe56fc8cab4069b3ba9799946177 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:26:24 +0100 Subject: [PATCH 085/126] Add Tdarr_Plugin_MC93_Migz2CleanTitle test --- Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js b/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js index ef82682..127e159 100644 --- a/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js +++ b/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz2CleanTitle', Stage: 'Pre-processing', From 44c0d0968310cf92e3dc33975077a673f4de5f80 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:26:34 +0100 Subject: [PATCH 086/126] Add Tdarr_Plugin_MC93_Migz3CleanAudio test --- .../Tdarr_Plugin_MC93_Migz3CleanAudio.js | 1 - .../Tdarr_Plugin_MC93_Migz3CleanAudio.js | 98 +++++++++++++++++++ 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js diff --git a/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js b/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js index 6852f9d..32bf0d2 100644 --- a/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js +++ b/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js @@ -1,5 +1,4 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz3CleanAudio', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js b/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js new file mode 100644 index 0000000..11bd864 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js @@ -0,0 +1,98 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: "☑File doesn't contain audio tracks which are unwanted or that require tagging.\n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + language: 'eng', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:a:3 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Audio stream 0:a:3 has unwanted language tag fre, removing. \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[3].tags.title = 'description'; + return file; + })(), + librarySettings: {}, + inputs: { + language: 'eng', + commentary: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:a:2 -map -0:a:3 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Audio stream 0:a:2 detected as being descriptive, removing. \n' + + '☒Audio stream 0:a:3 has unwanted language tag fre, removing. \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[2].tags.title = 'description'; + file.ffProbeData.streams[3].tags.language = 'und'; + return file; + })(), + librarySettings: {}, + inputs: { + language: 'eng', + commentary: 'true', + tag_language: 'eng', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:a:1 -map -0:a:2 -metadata:s:a:2 language=eng -map -0:a:3 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Audio stream 0:a:1 detected as being descriptive, removing. \n' + + '☒Audio stream 0:a:2 has unwanted language tag und, removing. \n' + + '☒Audio stream 0:a:2 detected as having no language, tagging as eng. \n' + + '☒Audio stream 0:a:3 has unwanted language tag fre, removing. \n', + }, + }, +]; + +run(tests); From bd783643ff362fb4b8c34efab99d6b429b1ac43d Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:26:45 +0100 Subject: [PATCH 087/126] Add Tdarr_Plugin_MC93_Migz4CleanSubs test --- Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js | 1 - .../Tdarr_Plugin_MC93_Migz4CleanSubs.js | 72 +++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js diff --git a/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js b/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js index 3820a78..fe55253 100644 --- a/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js +++ b/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js @@ -1,5 +1,4 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz4CleanSubs', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js b/tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js new file mode 100644 index 0000000..fa10ac5 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js @@ -0,0 +1,72 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: "☑File doesn't contain subtitle tracks which are unwanted or that require tagging.\n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:s:0 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Subtitle stream 0:s:0 has unwanted language tag fre, removing. \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + + file.ffProbeData.streams[7] = _.cloneDeep(file.ffProbeData.streams[6]); + file.ffProbeData.streams[6].tags.title = 'description'; + file.ffProbeData.streams[7].tags.language = 'und'; + return file; + })(), + librarySettings: {}, + inputs: { + language: 'eng,und', + commentary: 'true', + tag_language: 'eng', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:s:0 -map -0:s:0 -metadata:s:s:1 language=eng -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Subtitle stream 0:s:0 has unwanted language tag fre, removing. \n' + + '☒Subtitle stream 0:s:0 detected as being descriptive, removing. \n' + + '☒Subtitle stream 0:s:1 has no language, tagging as eng. \n', + }, + }, +]; + +run(tests); From 37af626ca4dc14e18c56e5fa730397d8ef700926 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:26:55 +0100 Subject: [PATCH 088/126] Add Tdarr_Plugin_MC93_Migz5ConvertAudio test --- .../Tdarr_Plugin_MC93_Migz5ConvertAudio.js | 1 - .../Tdarr_Plugin_MC93_Migz5ConvertAudio.js | 90 +++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js diff --git a/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js b/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js index 216942b..f3cfd11 100644 --- a/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js +++ b/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js @@ -1,5 +1,4 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz5ConvertAudio', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js b/tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js new file mode 100644 index 0000000..9d9497c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js @@ -0,0 +1,90 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Plugin has not been configured, please configure required options. Skipping this plugin. \n', + }, + }, + + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + aac_stereo: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: false, + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File contains all required audio formats. \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + aac_stereo: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Audio track is 2 channel but is not AAC. Converting. \n' + + '☒Audio track is 2 channel but is not AAC. Converting. \n' + + '☒Audio track is 2 channel but is not AAC. Converting. \n', + preset: ', -map 0 -c:v copy -c:a copy -c:a:0 aac -c:a:1 aac -c:a:2 aac -strict -2 -c:s copy -max_muxing_queue_size 9999 ', + }, + }, + + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[1].channels = 8; + return file; + })(), + librarySettings: {}, + inputs: { + aac_stereo: 'false', + downmix: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Audio track is 8 channel, no 6 channel exists. Creating 6 channel from 8 channel. \n', + preset: ', -map 0 -c:v copy -c:a copy -map 0:1 -c:a:0 ac3 -ac 6 -metadata:s:a:0 title="5.1" -strict -2 -c:s copy -max_muxing_queue_size 9999 ', + }, + }, + +]; + +run(tests); From 3dc0f9c55377eabb6edf0976d752b436bb527b46 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:27:06 +0100 Subject: [PATCH 089/126] Add Tdarr_Plugin_MC93_Migz6OrderStreams test --- .../Tdarr_Plugin_MC93_Migz6OrderStreams.js | 1 - .../Tdarr_Plugin_MC93_Migz6OrderStreams.js | 103 ++++++++++++++++++ 2 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js diff --git a/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js b/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js index 6aecf75..1da1993 100644 --- a/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js +++ b/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js @@ -1,5 +1,4 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz6OrderStreams', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js b/tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js new file mode 100644 index 0000000..d4a111a --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js @@ -0,0 +1,103 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + infoLog: '☑ Streams are in expected order. \n ', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + infoLog: '☑ Streams are in expected order. \n ', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[1].channels = 8; + file.ffProbeData.streams[2].channels = 6; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:0 -map 0:3 -map 0:4 -map 0:5 -map 0:2 -map 0:1 -map 0:6 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + infoLog: '☒ Audio 6ch not second. \n' + + '☒ Audio 2ch not first. \n' + + '☒ Audio 2ch not first. \n' + + '☒ Audio 2ch not first. \n' + + '☒ Streams are out of order, reorganizing streams. Video, Audio, Subtitles. \n', + reQueueAfter: true, + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[1].channels = 8; + file.ffProbeData.streams[2].channels = 6; + const video = file.ffProbeData.streams.splice(0, 1)[0]; + file.ffProbeData.streams.push(video); + const subs = file.ffProbeData.streams.splice(5, 1)[0]; + file.ffProbeData.streams.unshift(subs); + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:6 -map 0:3 -map 0:4 -map 0:5 -map 0:2 -map 0:1 -map 0:0 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + infoLog: '☒ Audio not second. \n' + + '☒ Audio not second. \n' + + '☒ Audio 6ch not second. \n' + + '☒ Audio not second. \n' + + '☒ Audio 2ch not first. \n' + + '☒ Audio not second. \n' + + '☒ Audio 2ch not first. \n' + + '☒ Audio not second. \n' + + '☒ Audio 2ch not first. \n' + + '☒ Video not first. \n' + + '☒ Streams are out of order, reorganizing streams. Video, Audio, Subtitles. \n', + reQueueAfter: true, + }, + }, + +]; + +run(tests); From c033bce4dfc270b974090f108435c9585c3e1a16 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:27:16 +0100 Subject: [PATCH 090/126] Add Tdarr_Plugin_MC93_MigzImageRemoval test --- .../Tdarr_Plugin_MC93_MigzImageRemoval.js | 1 - .../Tdarr_Plugin_MC93_MigzImageRemoval.js | 46 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js diff --git a/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js b/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js index 946f943..6768bad 100644 --- a/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js +++ b/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js @@ -1,5 +1,4 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_MigzImageRemoval', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js b/tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js new file mode 100644 index 0000000..bdb0c02 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js @@ -0,0 +1,46 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + container: '.mp4', + FFmpegMode: true, + reQueueAfter: true, + infoLog: "☑File doesn't contain any unwanted image format streams.\n", + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[0].codec_name = 'mjpeg'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c copy -max_muxing_queue_size 9999 -map -v:0 ', + handBrakeMode: false, + container: '.mkv', + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has image format stream, removing. \n', + }, + }, +]; + +run(tests); From 43c5062e306336ebb042359ef7504c0609affd89 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:27:27 +0100 Subject: [PATCH 091/126] Add Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs test --- ...gin_MP01_MichPasCleanSubsAndAudioCodecs.js | 1 - ...gin_MP01_MichPasCleanSubsAndAudioCodecs.js | 47 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js diff --git a/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js b/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js index da6f646..bce6bf4 100644 --- a/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js +++ b/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs", diff --git a/tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js b/tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js new file mode 100644 index 0000000..40adead --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js @@ -0,0 +1,47 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: "☑File doesn't contain subtitle or audio codecs which were unwanted or that require tagging.\n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + tag_subtitle_codecs: 'subrip', + tag_audio_codecs: 'aac', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:a:3 -map -0:a:4 -map -0:s:0 -c copy -max_muxing_queue_size 4096', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒audio stream detected as unwanted. removing audio stream 0:a:3 - Français E-AC3 2.0 - aac \n' + + '☒audio stream detected as unwanted. removing audio stream 0:a:4 - Anglais E-AC3 2.0 - aac \n' + + '☒Subtitle stream detected as unwanted. removing subtitle stream 0:s:0 - Français - subrip. \n', + }, + }, +]; + +run(tests); From b94cfbb1bf05cb0dbcfb0f9700faa93d4e5b20a6 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:27:39 +0100 Subject: [PATCH 092/126] Add Tdarr_Plugin_Mthr_VaapiHEVCTranscode test --- .../Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js | 1 - .../Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js | 107 ++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js diff --git a/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js b/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js index 82502fb..701aa70 100644 --- a/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js +++ b/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js @@ -1,7 +1,6 @@ /* eslint-disable */ const vaapiPrefix = ` -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi `; -// tdarrSkipTest const details = () => { return { id: `Tdarr_Plugin_Mthr_VaapiHEVCTranscode`, diff --git a/tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js b/tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js new file mode 100644 index 0000000..1c5438d --- /dev/null +++ b/tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js @@ -0,0 +1,107 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi ,-map 0:v -map 0:a -map 0:s? -map 0:d? -map 0:t? -c copy -c:v:0 hevc_vaapi -b:v 758k -minrate 530k -maxrate 985k -bufsize 1M -max_muxing_queue_size 1024 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☒ Video stream 0 is not HEVC, transcode required.\n' + + ' ☑ Stream analysis complete, processing required.\n' + + ' ', + container: 'mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑ Stream analysis complete, no processing required.\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + minBitrate: '4000', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi ,-map 0:v -map 0:a -map 0:s? -map 0:d? -map 0:t? -c copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: "☒ Input file's bitrate 1517 is lower than the minimum bitrate threshold of 4000. Skipping this plugin.\n" + + '☑ Stream analysis complete, processing required.\n' + + ' ', + container: 'mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + remuxOnly: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☒ RemuxOnly is enabled and file is not a remux. Unable to process.\n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.file = `remux ${file.file}`; + return file; + })(), + librarySettings: {}, + inputs: { + remuxOnly: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi ,-map 0:v -map 0:a -map 0:s? -map 0:d? -map 0:t? -c copy -c:v:0 hevc_vaapi -b:v 3933k -minrate 2753k -maxrate 5112k -bufsize 1M -max_muxing_queue_size 1024 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☒ Video stream 0 is not HEVC, transcode required.\n' + + ' ☑ Stream analysis complete, processing required.\n' + + ' ', + container: 'mkv', + }, + }, +]; + +run(tests); From a67c594466cff491de456a0a77eaed7be96bcc86 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:27:49 +0100 Subject: [PATCH 093/126] Add Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta test --- ...r_Plugin_nc7x_Drawmonster_No_Title_Meta.js | 1 - ...r_Plugin_nc7x_Drawmonster_No_Title_Meta.js | 42 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js diff --git a/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js b/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js index 3526d03..e380b81 100644 --- a/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js +++ b/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta", diff --git a/tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js new file mode 100644 index 0000000..9dfabae --- /dev/null +++ b/tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js @@ -0,0 +1,42 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File has no title metadata \n☑File meets conditions! \n', + }, + }, +]; + +run(tests); From 4bdd795db0fff64eb5203c3861d38f6d5fda5bbd Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:28:00 +0100 Subject: [PATCH 094/126] Add Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation test --- ...2_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js | 1 - ...2_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js | 44 +++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js diff --git a/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js b/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js index 1b8d1e8..fd2242d 100644 --- a/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js +++ b/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation", diff --git a/tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js b/tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js new file mode 100644 index 0000000..4acaaaf --- /dev/null +++ b/tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js @@ -0,0 +1,44 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c:s copy -movflags use_metadata_tags -c:a aac -b:a 512k -c:v:0 libx265 -preset medium -x265-params crf=18:tune=animation:qcomp=0.7:aq-strength=1.1 -pix_fmt yuv420p10le -f matroska', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☒File is 720p but is not hevc!\n' + + '☒File will be transcoded!\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, +]; + +run(tests); From 792b7657023e59ba96dee6a383df901eb70189a6 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:28:10 +0100 Subject: [PATCH 095/126] Add Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV test --- ...in_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js | 1 - ...in_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js | 67 +++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js diff --git a/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js b/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js index 9453c42..6d236a5 100644 --- a/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js +++ b/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV", diff --git a/tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js b/tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js new file mode 100644 index 0000000..3cdab96 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js @@ -0,0 +1,67 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:s? -c:s srt -map 0:a -c copy -c:v:0 libx265 -preset fast -crf 25', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☒File is 720p but is not hevc!\n' + + '☒File will be transcoded!\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.video_resolution = '480p'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:s? -c:s srt -map 0:a -c copy -c:v:0 libx265 -preset fast -crf 27', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☒File is 480p but is not hevc!\n' + + '☒File will be transcoded!\n', + }, + }, +]; + +run(tests); From 400be0799a61e3fe10602301a3d959d77b9a807b Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:28:20 +0100 Subject: [PATCH 096/126] Add Tdarr_Plugin_s7x8_winsome_h265 test --- Community/Tdarr_Plugin_s7x8_winsome_h265.js | 1 - .../Tdarr_Plugin_s7x8_winsome_h265.js | 63 +++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js diff --git a/Community/Tdarr_Plugin_s7x8_winsome_h265.js b/Community/Tdarr_Plugin_s7x8_winsome_h265.js index 8bc954f..b1b293f 100644 --- a/Community/Tdarr_Plugin_s7x8_winsome_h265.js +++ b/Community/Tdarr_Plugin_s7x8_winsome_h265.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s7x8_winsome_h265", diff --git a/tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js b/tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js new file mode 100644 index 0000000..36ea9c2 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js @@ -0,0 +1,63 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "H.265 MKV 2160p60" --all-audio --all-subtitles', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: "☒File isn't in hevc! \n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -b:a:0 192k -ac 2', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has no language track in ac3,eac3,dts. No eng track marked so transcoding audio track 1 into ac3! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json')); + file.ffProbeData.streams[1].codec_name = 'ac3'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is in mkv container! \n', + }, + }, +]; + +run(tests); From 2a0a7e1bfc127cc7fa0bda2269b8c369c413b40a Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 18:32:59 +0200 Subject: [PATCH 097/126] Add new tests (#311) * Add new tests * Add tdarrSkipTest logic * Add Tdarr_Plugin_00td_action_add_audio_stream_codec test * Add Tdarr_Plugin_00td_action_handbrake_basic_options test * Add Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom test * Add Tdarr_Plugin_00td_action_keep_one_audio_stream test * Fix lint * Fix reorder streams bug * Add Tdarr_Plugin_00td_action_re_order_all_streams_v2 test * Add Tdarr_Plugin_00td_action_remux_container test * Add Tdarr_Plugin_00td_action_standardise_audio_stream_codecs test * Lint * Add Tdarr_Plugin_00td_filter_by_bitrate test * Add Tdarr_Plugin_00td_filter_by_resolution test * Add Tdarr_Plugin_00td_filter_by_size test * Log all errors together, use chalk * Add Tdarr_Plugin_075a_FFMPEG_HEVC_Generic test * Add Tdarr_Plugin_075a_Transcode_Customisable test * Add Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only test * Add Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20 test * Add Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20 test * Add Tdarr_Plugin_076a_re_order_audio_streams test * Add chalk * Add Tdarr_Plugin_076b_re_order_subtitle_streams * Add Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable test * Add Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30 test * Add Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30 test * Add Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs test * Update qsv to vaapi (will handle input at later date) * Add Tdarr_Plugin_a9he_New_file_size_check test * useCloneDeep * Add Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta test * Add Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only test * Add Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta test * Add Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3 test * Add Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC test * Add Tdarr_Plugin_c0r1_SetDefaultAudioStream test * Lint * Add Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV test * Add Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix test * Add Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4 test * Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll test * Remove logging * Add Tdarr_Plugin_drdd_standardise_all_in_one test * Add Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta test * Add Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta test * Add Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta test * Add Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio test * Add Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac) test * Add Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs test * Add Tdarr_Plugin_Greg_MP3_FFMPEG_CPU test * Add Tdarr_Plugin_henk_Add_Specific_Audio_Codec test * Add Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle test * Add Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle test * Add outputModify func * Base tests on linux for now * Add Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC test * Add Tdarr_Plugin_lmg1_Reorder_Streams test * Add Tdarr_Plugin_MC93_Migz1FFMPEG test * Add Tdarr_Plugin_MC93_Migz1FFMPEG_CPU test * Add Tdarr_Plugin_MC93_Migz1Remux test * Add Tdarr_Plugin_MC93_Migz2CleanTitle test * Add Tdarr_Plugin_MC93_Migz2CleanTitle test * Add Tdarr_Plugin_MC93_Migz3CleanAudio test * Add Tdarr_Plugin_MC93_Migz4CleanSubs test * Add Tdarr_Plugin_MC93_Migz5ConvertAudio test * Add Tdarr_Plugin_MC93_Migz6OrderStreams test * Add Tdarr_Plugin_MC93_MigzImageRemoval test * Add Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs test * Add Tdarr_Plugin_Mthr_VaapiHEVCTranscode test * Add Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta test * Add Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation test * Add Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV test * Add Tdarr_Plugin_s7x8_winsome_h265 test --- .github/workflows/lint.yml | 2 +- ...gin_00td_action_handbrake_ffmpeg_custom.js | 4 +- ...gin_00td_action_re_order_all_streams_v2.js | 2 +- ..._Output_embedded_subs_to_SRT_and_remove.js | 1 + Community/Tdarr_Plugin_43az_add_to_radarr.js | 1 + ...de audio and video with HW (PC and Mac).js | 1 + ...Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js | 1 + .../Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js | 1 + .../Tdarr_Plugin_MC93_MigzPlex_Autoscan.js | 1 + ...CLU_2_Pass_Loudnorm_Audio_Normalisation.js | 1 + ...O0dCTlb_Set_File_Permissions_For_UnRaid.js | 1 + ...rr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js | 1 + Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js | 1 + ..._Plugin_VP92_VP9_Match_Bitrate_One_Pass.js | 1 + ...arr_Plugin_a9hf_New_file_duration_check.js | 1 + ...gin_da11_Dallas_FFmpeg_Presets_H264_MP4.js | 41 +- ...darr_Plugin_drdd_standardise_all_in_one.js | 6 +- .../Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js | 1 + .../Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js | 1 + .../Tdarr_Plugin_goof1_URL_Plex_Refresh.js | 1 + ...r_Plugin_henk_Keep_Native_Lang_Plus_Eng.js | 1 + ...eons001_Downmix_to_stereo_and_apply_DRC.js | 3 - ...rr01_drpeppershaker_extract_subs_to_SRT.js | 1 + .../Tdarr_Plugin_s710_nick_h265_nvenc_4K.js | 1 + .../Tdarr_Plugin_s7x9_winsome_h265_10bit.js | 1 + .../Tdarr_Plugin_s7x9_winsome_h265_nvenc.js | 1 + ...rr_Plugin_sdd3_Remove_Commentary_Tracks.js | 1 + ...df5_Thierrrrry_Remove_Non_English_Audio.js | 1 + .../Tdarr_Plugin_vdka_Remove_DataStreams.js | 1 + ..._vdka_Tiered_CPU_CRF_Based_Configurable.js | 1 + ...dka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js | 1 + Community/Tdarr_Plugin_x7ab_Remove_Subs.js | 1 + ...darr_Plugin_x7ac_Remove_Closed_Captions.js | 1 + ...b_TheRealShadoh_FFmpeg_Subs_H264_Medium.js | 1 + ...Plugin_z18s_rename_files_based_on_codec.js | 1 + ...ame_files_based_on_codec_and_resolution.js | 1 + ...1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js | 1 + ...2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js | 1 + ...TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js | 1 + .../Tdarr_Plugin_z80t_keep_original_date.js | 1 + package-lock.json | 147 +++- package.json | 13 +- ...ugin_00td_action_add_audio_stream_codec.js | 92 ++ ...gin_00td_action_handbrake_basic_options.js | 74 ++ ...gin_00td_action_handbrake_ffmpeg_custom.js | 66 ++ ...lugin_00td_action_keep_one_audio_stream.js | 89 ++ ...gin_00td_action_re_order_all_streams_v2.js | 72 ++ ...darr_Plugin_00td_action_remux_container.js | 65 ++ ..._action_standardise_audio_stream_codecs.js | 66 ++ .../Tdarr_Plugin_00td_filter_by_bitrate.js | 64 ++ .../Tdarr_Plugin_00td_filter_by_codec.js | 59 ++ ..._Plugin_00td_filter_by_codec_tag_string.js | 59 ++ .../Tdarr_Plugin_00td_filter_by_resolution.js | 74 ++ .../Tdarr_Plugin_00td_filter_by_size.js | 64 ++ .../Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js | 41 + ...darr_Plugin_075a_Transcode_Customisable.js | 81 ++ ...5b_FFMPEG_HEVC_Generic_Video_Audio_Only.js | 41 + ...PEG_HEVC_Generic_Video_Audio_Only_CRF20.js | 41 + ...HEVC_GPU_Generic_Video_Audio_Only_CRF20.js | 41 + ...darr_Plugin_076a_re_order_audio_streams.js | 43 + ...r_Plugin_076b_re_order_subtitle_streams.js | 62 ++ ...n_077b_HandBrake_NVENC_264_Configurable.js | 44 + ...lugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js | 112 +++ ...r_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js | 75 ++ ...de audio and video with HW (PC and Mac).js | 107 +++ .../Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js | 59 ++ .../Tdarr_Plugin_MC93_Migz1FFMPEG.js | 145 ++++ .../Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js | 145 ++++ .../Community/Tdarr_Plugin_MC93_Migz1Remux.js | 45 + .../Tdarr_Plugin_MC93_Migz2CleanTitle.js | 46 + .../Tdarr_Plugin_MC93_Migz3CleanAudio.js | 98 +++ .../Tdarr_Plugin_MC93_Migz4CleanSubs.js | 72 ++ .../Tdarr_Plugin_MC93_Migz5ConvertAudio.js | 90 ++ .../Tdarr_Plugin_MC93_Migz6OrderStreams.js | 103 +++ .../Tdarr_Plugin_MC93_MigzImageRemoval.js | 46 + ...gin_MP01_MichPasCleanSubsAndAudioCodecs.js | 47 + .../Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js | 107 +++ ...ugin_a37x_Drawmonster_MP4_No_Title_Meta.js | 42 + ...eAGitGat_HandBrake_H264_VeryFast1080p30.js | 66 ++ ..._HaveAGitGat_HandBrake_H264_Fast1080p30.js | 66 ++ ..._Transcode_Specific_Audio_Stream_Codecs.js | 45 + .../Tdarr_Plugin_a9he_New_file_size_check.js | 68 ++ ...rr_Plugin_b38x_Nosirus_h265_aac_no_meta.js | 45 + ...gin_b39x_the1poet_surround_sound_to_ac3.js | 59 ++ ...Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js | 86 ++ ...Tdarr_Plugin_c0r1_SetDefaultAudioStream.js | 49 ++ ..._d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js | 50 ++ ...in_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js | 47 + ...gin_da11_Dallas_FFmpeg_Presets_H264_MP4.js | 62 ++ ...darr_Plugin_drdd_standardise_all_in_one.js | 110 +++ ..._H.264_MKV_480p30_No_Subs_No_Title_Meta.js | 97 +++ ..._H.264_MKV_720p30_No_Subs_No_Title_Meta.js | 99 +++ ...H.264_MKV_1080p30_No_Subs_No_Title_Meta.js | 96 ++ ...rr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js | 94 ++ ...rr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js | 48 + ...rr_Plugin_henk_Add_Specific_Audio_Codec.js | 85 ++ ...rawmonster_MP4_AAC_No_Subs_No_metaTitle.js | 68 ++ ..._Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js | 66 ++ ...eons001_Downmix_to_stereo_and_apply_DRC.js | 42 + .../Tdarr_Plugin_lmg1_Reorder_Streams.js | 50 ++ ...r_Plugin_nc7x_Drawmonster_No_Title_Meta.js | 42 + ...2_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js | 44 + ...in_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js | 67 ++ .../Tdarr_Plugin_s7x8_winsome_h265.js | 63 ++ tests/checkPlugins.js | 105 ++- tests/helpers/run.js | 55 ++ tests/runTests.js | 51 ++ tests/sampleData/media/sampleAAC_1.json | 334 +++++++ tests/sampleData/media/sampleH264_1.json | 432 +++++++++ tests/sampleData/media/sampleH264_2.json | 775 +++++++++++++++++ tests/sampleData/media/sampleH264_3.json | 821 ++++++++++++++++++ tests/sampleData/media/sampleH265_1.json | 334 +++++++ tests/sampleData/media/sampleMP3_1.json | 314 +++++++ 113 files changed, 7662 insertions(+), 102 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js create mode 100644 tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js create mode 100644 tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js create mode 100644 tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js create mode 100644 tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js create mode 100644 tests/Community/Tdarr_Plugin_00td_action_remux_container.js create mode 100644 tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js create mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js create mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_codec.js create mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js create mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js create mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_size.js create mode 100644 tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js create mode 100644 tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js create mode 100644 tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js create mode 100644 tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js create mode 100644 tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js create mode 100644 tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js create mode 100644 tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js create mode 100644 tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js create mode 100644 tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js create mode 100644 tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js create mode 100644 tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js create mode 100644 tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js create mode 100644 tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js create mode 100644 tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js create mode 100644 tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js create mode 100644 tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js create mode 100644 tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js create mode 100644 tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js create mode 100644 tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js create mode 100644 tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js create mode 100644 tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js create mode 100644 tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js create mode 100644 tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js create mode 100644 tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js create mode 100644 tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js create mode 100644 tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js create mode 100644 tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js create mode 100644 tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js create mode 100644 tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js create mode 100644 tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js create mode 100644 tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js create mode 100644 tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js create mode 100644 tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js create mode 100644 tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js create mode 100644 tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js create mode 100644 tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js create mode 100644 tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js create mode 100644 tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js create mode 100644 tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js create mode 100644 tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js create mode 100644 tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js create mode 100644 tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js create mode 100644 tests/helpers/run.js create mode 100644 tests/runTests.js create mode 100644 tests/sampleData/media/sampleAAC_1.json create mode 100644 tests/sampleData/media/sampleH264_1.json create mode 100644 tests/sampleData/media/sampleH264_2.json create mode 100644 tests/sampleData/media/sampleH264_3.json create mode 100644 tests/sampleData/media/sampleH265_1.json create mode 100644 tests/sampleData/media/sampleMP3_1.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9c76f0f..042233b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,4 +20,4 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm i - - run: npm run checkPlugins && npm run lint + - run: npm run checkPlugins && npm run lint && npm run test diff --git a/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js b/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js index 3c3871d..995603e 100644 --- a/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js +++ b/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js @@ -84,8 +84,8 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { processFile: false, preset: '', container: '', - handBrakeMode: false, - FFmpegMode: false, + handbrakeMode: false, + ffmpegMode: false, reQueueAfter: false, infoLog: '', }; diff --git a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js index 691b173..4f162b2 100644 --- a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js +++ b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js @@ -117,7 +117,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { for (let i = 0; i < items.length; i += 1) { const matchedStreams = []; for (let j = 0; j < streams.length; j += 1) { - if (String(sortType.getValue(streams[j])).includes(String(items[i]))) { + if (String(sortType.getValue(streams[j])) === String(items[i])) { if ( streams[j].codec_long_name && ( diff --git a/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js b/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js index 5198704..5a868a5 100644 --- a/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js +++ b/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove", diff --git a/Community/Tdarr_Plugin_43az_add_to_radarr.js b/Community/Tdarr_Plugin_43az_add_to_radarr.js index eff190d..8129e09 100644 --- a/Community/Tdarr_Plugin_43az_add_to_radarr.js +++ b/Community/Tdarr_Plugin_43az_add_to_radarr.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: 'Tdarr_Plugin_43az_add_to_radarr', diff --git a/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js b/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js index d7cd530..e52695c 100644 --- a/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js +++ b/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js @@ -203,6 +203,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { if (inputs.bitrate_cutoff !== '') { // Checks if currentBitrate is below inputs.bitrate_cutoff // If so then don't convert video. + console.log(currentBitrate) if (currentBitrate <= inputs.bitrate_cutoff) { convertVideo = false; } diff --git a/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js b/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js index afa0182..2b685a3 100644 --- a/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js +++ b/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js @@ -86,6 +86,7 @@ Audio: (Only one audio stream is used!!) /// /////////////////////////////////////////////////////////////////////////////////////////////////// */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js b/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js index 7459154..50277de 100644 --- a/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js +++ b/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js @@ -148,6 +148,7 @@ // ////////////////////////////////////////////////////////////////////////////////////////////////////// +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix", diff --git a/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js b/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js index fb77764..f29ce6f 100644 --- a/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js +++ b/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js @@ -3,6 +3,7 @@ module.exports.dependencies = [ ]; /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_MigzPlex_Autoscan', Stage: 'Post-processing', diff --git a/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js b/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js index 1cbe2bf..dac17b6 100644 --- a/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js +++ b/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js @@ -14,6 +14,7 @@ var secondPass = false; var logOutFile = ''; +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation", diff --git a/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js b/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js index d79f302..d083a33 100644 --- a/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js +++ b/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js @@ -1,6 +1,7 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid", diff --git a/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js b/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js index eef3529..b91e1a9 100644 --- a/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js +++ b/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js @@ -3,6 +3,7 @@ // https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js // Seriously, all I did was make it work for converting things to h264 instead of hevc +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264', Stage: 'Pre-processing', // Preprocessing or Post-processing. Determines when the plugin will be executed. diff --git a/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js b/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js index 63d5ec6..86c6dea 100644 --- a/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js +++ b/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js @@ -4,6 +4,7 @@ module.exports.dependencies = [ ]; /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_TD01_TOAD_Autoscan', Stage: 'Post-processing', diff --git a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js index 1412281..e5bf1af 100644 --- a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js +++ b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js @@ -1,4 +1,5 @@ /* eslint max-classes-per-file: ["error", 2] */ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js b/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js index 4cda5ca..6f1fcc5 100644 --- a/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js +++ b/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js @@ -1,5 +1,6 @@ // eslint-disable-next-line import/no-unresolved +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_a9hf_New_file_duration_check', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js b/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js index c1ebc6a..2dc1a31 100644 --- a/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js +++ b/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js @@ -62,6 +62,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); // eslint-disable-next-line no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); + var response = { processFile: false, preset: "", @@ -70,15 +71,17 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { FFmpegMode: false, reQueueAfter: false, infoLog: "", - addInfo(status, info) { - this.infoLog += (status ? "☑" : "☒") + " " + info + "\n"; - }, + }; + const addInfo = (status, info) => { + response.infoLog += (status ? "☑" : "☒") + " " + info + "\n"; + } + // Check the file is a video if (file.fileMedium !== "video") { console.log("File is not video"); - response.addInfo(BAD, `File is not video`); + addInfo(BAD, `File is not video`); response.processFile = false; return response; } @@ -87,7 +90,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { let preset = getPreset(inputs.FFmpeg_preset); if (preset === null) { - response.addInfo( + addInfo( BAD, `Invalid Preset, \"${inputs.FFmpeg_preset}\" please select from (slow,medium,fast,veryfast)` ); @@ -125,10 +128,10 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (hasBadSubs) - response.addInfo(BAD, "File contains unsupported sub(s), dropping these!"); + addInfo(BAD, "File contains unsupported sub(s), dropping these!"); if (file.ffProbeData.streams[0].codec_name != "h264") { - response.addInfo(BAD, "File is not in h264!"); + addInfo(BAD, "File is not in h264!"); response.preset = ", -map_metadata -1 -map 0:V " + subMap + @@ -139,11 +142,11 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.FFmpegMode = true; return response; } else { - response.addInfo(GOOD, "File is already in h264!"); + addInfo(GOOD, "File is already in h264!"); } if (file.meta.Title != undefined && !jsonString.includes("aac") && hasSubs) { - response.addInfo(BAD, "File has title metadata and no aac and subs"); + addInfo(BAD, "File has title metadata and no aac and subs"); response.preset = ", -map_metadata -1 -map 0:v " + subMap + @@ -156,7 +159,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (!jsonString.includes("aac") && hasSubs) { - response.addInfo(BAD, "File has no aac track and has subs"); + addInfo(BAD, "File has no aac track and has subs"); response.preset = ", -map 0:v " + subMap + @@ -169,7 +172,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (file.meta.Title != undefined && hasSubs) { - response.addInfo(BAD, "File has title and has subs"); + addInfo(BAD, "File has title and has subs"); response.preset = ", -map_metadata -1 -map 0:v " + subMap + @@ -182,7 +185,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (file.meta.Title != undefined) { - response.addInfo(BAD, "File has title metadata"); + addInfo(BAD, "File has title metadata"); response.preset = ", -map_metadata -1 -map 0:v " + subMap + @@ -193,11 +196,11 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.FFmpegMode = true; return response; } else { - response.addInfo(GOOD, "File has no title metadata"); + addInfo(GOOD, "File has no title metadata"); } if (!jsonString.includes("aac")) { - response.addInfo(BAD, "File has no aac track"); + addInfo(BAD, "File has no aac track"); response.preset = ", -map 0:v " + subMap + @@ -208,14 +211,14 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.FFmpegMode = true; return response; } else { - response.addInfo(GOOD, "File has aac track"); + addInfo(GOOD, "File has aac track"); } if (hasSubs) { if (hasBadSubs) { - response.addInfo(BAD, "File has incompatible subs, dropping these..."); + addInfo(BAD, "File has incompatible subs, dropping these..."); } else { - response.addInfo(BAD, "File has compatible subs, copying..."); + addInfo(BAD, "File has compatible subs, copying..."); } response.preset = ", -map 0:v " + subMap + " -map 0:a -c:v copy -c:a copy " + subType; @@ -223,10 +226,10 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.FFmpegMode = true; return response; } else { - response.addInfo(GOOD, "File has no/compatible subs"); + addInfo(GOOD, "File has no/compatible subs"); } - response.addInfo(GOOD, "File meets conditions!"); + addInfo(GOOD, "File meets conditions!"); return response; } diff --git a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js index 9fdd9f8..608b0f5 100644 --- a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js +++ b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js @@ -4,14 +4,14 @@ const details = () => { return { id: "Tdarr_Plugin_drdd_standardise_all_in_one", Stage: "Pre-processing", - Name: "DrDD H265 MKV AC3 audio subtitles [QSV & NVENC]", + Name: "DrDD H265 MKV AC3 audio subtitles [VAAPI & NVENC]", Stage: "Pre-processing", Type: "Video", Operation: "Transcode", Description: "In a single pass ensures all files are in MKV containers and where possible encoded in h265 (settings dependant on file bitrate), converts all multi channel audio to AC3, removes audio commentary and removes subtitles that are not in the configured language or marked as commentary. This plugin is opinionated based on how I like my library to be configured and based on the work done by Migz with his plugins (Thanks!).", Version: "1.0", - Tags: "pre-processing,ffmpeg,qsv h265, nvenc h265", + Tags: "pre-processing,ffmpeg,vaapi,h265, nvenc h265", Inputs: [ { name: "nvenc", @@ -346,7 +346,7 @@ function buildVideoConfiguration(inputs, file, logger) { configuration.RemoveOutputSetting("-c:v copy"); configuration.AddOutputSetting(`-c:v hevc_vaapi ${bitrateSettings}`); - logger.AddError("Transcoding to HEVC using QSV"); + logger.AddError("Transcoding to HEVC using VAAPI"); } /** diff --git a/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js b/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js index 967339c..7b56fdf 100644 --- a/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js +++ b/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js @@ -1,5 +1,6 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e5c3_CnT_Add_Subtitles", diff --git a/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js b/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js index 6b0b0ea..d4b8266 100644 --- a/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js +++ b/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js @@ -1,5 +1,6 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e5c3_CnT_Remove_Letterbox", diff --git a/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js b/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js index 7644d98..9afa86a 100644 --- a/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js +++ b/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_goof1_URL_Plex_Refresh', Stage: 'Post-processing', diff --git a/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js b/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js index 4aa06ae..243b675 100644 --- a/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js +++ b/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js @@ -1,5 +1,6 @@ /* eslint-disable no-await-in-loop */ module.exports.dependencies = ['axios', '@cospired/i18n-iso-languages']; +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js b/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js index 95d04ec..8baf72e 100644 --- a/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js +++ b/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js @@ -23,9 +23,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { FFmpegMode: true, reQueueAfter: true, infoLog: '', - file, - removeFromDB: false, - updateDB: false, container: `.${file.container}`, }; diff --git a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js index 4dcd6ee..75d5e77 100644 --- a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js +++ b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js b/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js index 689d403..6c559b0 100644 --- a/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js +++ b/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s710_nick_h265_nvenc_4K", diff --git a/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js index d5d23f6..acf22fb 100644 --- a/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js +++ b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s7x9_winsome_h265_10bit", diff --git a/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js b/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js index f336a5e..447044d 100644 --- a/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js +++ b/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s7x9_winsome_h265_nvenc", diff --git a/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js b/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js index 00df33b..8c8b8e2 100644 --- a/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js +++ b/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_sdd3_Remove_Commentary_Tracks", diff --git a/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js b/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js index 9be9ed1..71708c3 100644 --- a/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js +++ b/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio", diff --git a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js index 634c9d3..64e71ef 100644 --- a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js +++ b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_vdka_Remove_DataStreams", diff --git a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js index e1d5aee..f5614f8 100644 --- a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js +++ b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js b/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js index 4afd5f3..e0ca948 100644 --- a/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js +++ b/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: 'Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE', diff --git a/Community/Tdarr_Plugin_x7ab_Remove_Subs.js b/Community/Tdarr_Plugin_x7ab_Remove_Subs.js index 7bd12ff..3bf03de 100644 --- a/Community/Tdarr_Plugin_x7ab_Remove_Subs.js +++ b/Community/Tdarr_Plugin_x7ab_Remove_Subs.js @@ -1,4 +1,5 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_x7ab_Remove_Subs", diff --git a/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js b/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js index f5fe57a..26afd05 100644 --- a/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js +++ b/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_x7ac_Remove_Closed_Captions', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js index 88fc14e..716e730 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js b/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js index db917e8..7cff564 100644 --- a/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js +++ b/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js @@ -1,5 +1,6 @@ /* eslint-disable */ +// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_z18s_rename_files_based_on_codec", diff --git a/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js b/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js index d6adedd..1a2f75d 100644 --- a/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js +++ b/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution', Stage: 'Post-processing', diff --git a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js index fbc9de3..ad301d8 100644 --- a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js +++ b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js index 28ee579..dc863a4 100644 --- a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js +++ b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js index 597003f..be10d89 100644 --- a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js +++ b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -1,3 +1,4 @@ +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z80t_keep_original_date.js b/Community/Tdarr_Plugin_z80t_keep_original_date.js index d7f6715..9364705 100644 --- a/Community/Tdarr_Plugin_z80t_keep_original_date.js +++ b/Community/Tdarr_Plugin_z80t_keep_original_date.js @@ -4,6 +4,7 @@ module.exports.dependencies = [ 'touch', ]; +// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z80t_keep_original_date', Stage: 'Post-processing', diff --git a/package-lock.json b/package-lock.json index 5a261a7..136bce7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -174,6 +174,12 @@ "es-abstract": "^1.18.0-next.1" } }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, "ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", @@ -227,14 +233,27 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "chai": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", + "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "loupe": "^2.3.1", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -244,7 +263,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -253,7 +271,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "requires": { "color-name": "~1.1.4" } @@ -261,26 +278,29 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "requires": { "has-flag": "^4.0.0" } } } }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "dev": true + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -346,6 +366,15 @@ "ms": "2.1.2" } }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -474,6 +503,57 @@ "table": "^5.2.3", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "eslint-config-airbnb-base": { @@ -790,6 +870,12 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, "get-intrinsic": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", @@ -873,10 +959,9 @@ "dev": true }, "import-fresh": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.2.tgz", - "integrity": "sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw==", - "dev": true, + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -1091,8 +1176,16 @@ "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "loupe": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", + "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "dev": true, + "requires": { + "get-func-name": "^2.0.0" + } }, "lru-cache": { "version": "6.0.0", @@ -1249,7 +1342,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, "requires": { "callsites": "^3.0.0" } @@ -1296,6 +1388,12 @@ "pify": "^2.0.0" } }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -1375,8 +1473,7 @@ "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" }, "rimraf": { "version": "3.0.2", @@ -1577,6 +1674,12 @@ "prelude-ls": "^1.2.1" } }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, "type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", diff --git a/package.json b/package.json index a1436a8..7897352 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,22 @@ { "name": "tdarr_plugins", "version": "1.0.0", - "description": "There are two types of plugin:", - "main": "Tdarr_Plugin_aaaa_Pre_Proc_Example.js", - "dependencies": {}, + "description": "Tdar Plugins Repo", + "main": "", + "dependencies": { + "chalk": "^4.1.2", + "import-fresh": "^3.3.0", + "lodash": "^4.17.21" + }, "devDependencies": { + "chai": "^4.3.6", "eslint": "^7.14.0", "eslint-config-airbnb-base": "^14.2.1", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jsx-a11y": "^6.4.1" }, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "node ./tests/runTests.js", "lint": "eslint Community methods examples tests --ext js", "lint:fix": "eslint Community methods examples tests --ext js --fix", "checkPlugins": "node ./tests/checkPlugins.js" diff --git a/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js b/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js new file mode 100644 index 0000000..3862352 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js @@ -0,0 +1,92 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -ac 2', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'The required channel count 2 is lower than the highest available channel count (6). Adding! \n', + handbrakeMode: false, + ffmpegMode: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 2', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'The required channel count 2 is lower than the highest available channel count (6). Adding! \n', + handbrakeMode: false, + ffmpegMode: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + channels: 6, + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 6', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'The required channel count 6 is lower than the highest available channel count (6). Adding! \n', + handbrakeMode: false, + ffmpegMode: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + channels: 8, + language: 'fr', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 6', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'The required channel count (8) is higher than the highest channel available in specified lang tag (6). Adding lower channel track. \n', + handbrakeMode: false, + ffmpegMode: true, + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js b/tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js new file mode 100644 index 0000000..5777e28 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js @@ -0,0 +1,74 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Very Fast 1080p30" -e x265 --all-subtitles', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'File is being transcoded using HandBrake \n', + handbrakeMode: true, + ffmpegMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + handbrakePreset: 'Fast 576p25', + videoEncoder: 'nvenc_h265', + keepSubtitles: 'true', + container: 'mp4', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Fast 576p25" -e nvenc_h265 --all-subtitles', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'File is being transcoded using HandBrake \n', + handbrakeMode: true, + ffmpegMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + handbrakePreset: 'Fast 576p25', + videoEncoder: 'nvenc_h265', + keepSubtitles: 'false', + container: 'mov', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Fast 576p25" -e nvenc_h265 ', + container: '.mov', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: 'File is being transcoded using HandBrake \n', + handbrakeMode: true, + ffmpegMode: false, + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js b/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js new file mode 100644 index 0000000..6be2efd --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js @@ -0,0 +1,66 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -map 0 -c copy', + container: '.mkv', + handbrakeMode: false, + ffmpegMode: true, + reQueueAfter: true, + infoLog: 'File is being transcoded using custom arguments \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + cli: 'handbrake', + arguments: '-Z "Very Fast 1080p30" --all-subtitles --all-audio', + container: 'mp4', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Very Fast 1080p30" --all-subtitles --all-audio', + container: '.mp4', + handbrakeMode: true, + ffmpegMode: false, + reQueueAfter: true, + infoLog: 'File is being transcoded using custom arguments \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + cli: 'ffmpeg', + arguments: '-c:v libx265 -crf 23 -ac 6 -c:a aac -preset veryfast', + container: 'mov', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v libx265 -crf 23 -ac 6 -c:a aac -preset veryfast', + container: '.mov', + handbrakeMode: false, + ffmpegMode: true, + reQueueAfter: true, + infoLog: 'File is being transcoded using custom arguments \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js b/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js new file mode 100644 index 0000000..26d68f4 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js @@ -0,0 +1,89 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:s? -map 0:d? -c copy -c:a:0 aac -ac 2', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'No en streams. The required channel count 2 is lower than the highest available channel count (6).Adding it and removing others! \n', + handbrakeMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 2', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'No en streams. The required channel count 2 is lower than the highest available channel count (6).Adding it and removing others! \n', + handbrakeMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + language: 'fr', + channels: '6', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:1 -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 6', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'No fr streams. The required channel count 6 is lower than the highest available channel count (6).Adding it and removing others! \n', + handbrakeMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + audioCodec: 'aac', + language: 'und', + channels: '8', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'The best und stream already exists. It is the only audio stream. \n', + handbrakeMode: false, + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js b/tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js new file mode 100644 index 0000000..2567bac --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js @@ -0,0 +1,72 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + infoLog: 'Streams are in the correct order!', + }, + }, + { + // orig + // 0 vid h264 + // 1 flac eng + // 2 ac3 eng + // 3 eac3 eng + // 4 aac fre + // 5 aac eng + // 6 sub fre + + // expect + // 4 aac fre + // 2 ac3 eng + // 1 flac eng + // 3 eac3 eng + // 5 aac eng + // 6 sub fre + // 0 vid h264 + + // console.log(streams.map(stream => { + // return { + // "index": stream.index, + // codec_name: stream.codec_name, + // codec_type: stream.codec_type, + // language: stream.tags.language, + // } + // })) + + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: { + processOrder: 'codecs,channels,languages,streamTypes', + languages: 'fre,eng', + streamTypes: 'audio,subtitle,video', + codecs: 'ac3,flac,eac3,aac', + channels: '7.1,5.1,2,1', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -c copy -map 0:4 -map 0:2 -map 0:1 -map 0:3 -map 0:5 -map 0:6 -map 0:0', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + infoLog: 'Streams are not in the correct order!', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_remux_container.js b/tests/Community/Tdarr_Plugin_00td_action_remux_container.js new file mode 100644 index 0000000..985688b --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_remux_container.js @@ -0,0 +1,65 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is not in mkv \n', + handbrakeMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + container: 'mkv', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is not in mkv \n', + handbrakeMode: false, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + container: 'mp4', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ', -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is already in mp4 \n', + handbrakeMode: false, + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js b/tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js new file mode 100644 index 0000000..63e1505 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js @@ -0,0 +1,66 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: "File does not have any audio streams which aren't in aac \n", + handbrakeMode: false, + ffmpegMode: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -c:a:1 aac -c:a:2 aac', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: "File has audio streams which aren't in aac \n", + handbrakeMode: false, + ffmpegMode: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: { + audioCodec: 'eac3', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -c:a:1 eac3 -c:a:3 eac3 -c:a:4 eac3', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: "File has audio streams which aren't in eac3 \n", + handbrakeMode: false, + ffmpegMode: true, + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js b/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js new file mode 100644 index 0000000..4c22116 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js @@ -0,0 +1,64 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: '☑File bitrate is within filter limits. Moving to next plugin.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 500, + lowerBound: 0, + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: '☒File bitrate is not within filter limits. Breaking out of plugin stack.\n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 10000, + lowerBound: 0, + }, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: '☑File bitrate is within filter limits. Moving to next plugin.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 10000, + lowerBound: 9000, + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: '☒File bitrate is not within filter limits. Breaking out of plugin stack.\n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_codec.js b/tests/Community/Tdarr_Plugin_00td_filter_by_codec.js new file mode 100644 index 0000000..e8e6cd3 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_codec.js @@ -0,0 +1,59 @@ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { processFile: false, infoLog: '' }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecsToProcess: 'h264', + }, + otherArguments: {}, + }, + output: { processFile: true, infoLog: 'File is in codecsToProcess. Moving to next plugin.' }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecsToProcess: 'h265', + }, + otherArguments: {}, + }, + output: { processFile: false, infoLog: 'File is not in codecsToProcess. Breaking out of plugin stack.' }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecsToNotProcess: 'h264', + }, + otherArguments: {}, + }, + output: { processFile: false, infoLog: 'File is in codecsToNotProcess. Breaking out of plugin stack.' }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecsToNotProcess: 'h265', + }, + otherArguments: {}, + }, + output: { processFile: true, infoLog: 'File is not in codecsToNotProcess. Moving to next plugin.' }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js b/tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js new file mode 100644 index 0000000..4616650 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js @@ -0,0 +1,59 @@ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { processFile: false, infoLog: '' }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecTagStringsToProcess: 'avc1,rand', + }, + otherArguments: {}, + }, + output: { processFile: true, infoLog: 'File is in codecTagStringsToProcess. Moving to next plugin.' }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecTagStringsToNotProcess: 'avc1,rand', + }, + otherArguments: {}, + }, + output: { processFile: false, infoLog: 'File is in codecTagStringsToNotProcess. Breaking out of plugin stack.' }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: { + codecTagStringsToProcess: 'avc1,rand', + }, + otherArguments: {}, + }, + output: { processFile: false, infoLog: 'File is not in codecTagStringsToProcess. Breaking out of plugin stack.' }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: { + codecTagStringsToNotProcess: 'avc1,rand', + }, + otherArguments: {}, + }, + output: { processFile: true, infoLog: 'File is not in codecTagStringsToNotProcess. Moving to next plugin.' }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js b/tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js new file mode 100644 index 0000000..91cc03f --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js @@ -0,0 +1,74 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, infoLog: '', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + resolutionsToProcess: '480p,720p', + }, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: 'File is in resolutionsToProcess. Moving to next plugin.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + resolutionsToProcess: '480p,1080p', + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: 'File is not in resolutionsToProcess. Breaking out of plugin stack.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + resolutionsToNotProcess: '480p,720p', + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: 'File is in resolutionsToNotProcess. Breaking out of plugin stack.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + resolutionsToNotProcess: '480p,1080p', + }, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: 'File is not in resolutionsToNotProcess. Moving to next plugin.', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_size.js b/tests/Community/Tdarr_Plugin_00td_filter_by_size.js new file mode 100644 index 0000000..a869c4c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_00td_filter_by_size.js @@ -0,0 +1,64 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: 'File is within lower and upper bound size limits. Moving to next plugin.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 0.5, + lowerBound: 0, + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: 'File is not within lower and upper bound size limits. Breaking out of plugin stack.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 2, + lowerBound: 0, + }, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: 'File is within lower and upper bound size limits. Moving to next plugin.', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: 4, + lowerBound: 2, + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: 'File is not within lower and upper bound size limits. Breaking out of plugin stack.', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js b/tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js new file mode 100644 index 0000000..9365ddf --- /dev/null +++ b/tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js @@ -0,0 +1,41 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a -map 0:s? -map 0:d? -c copy -c:v:0 libx265 -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☒File is not hevc! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js b/tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js new file mode 100644 index 0000000..c6627a6 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js @@ -0,0 +1,81 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Very Fast 1080p30" --all-subtitles --all-audio', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not in desired codec! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in hevc! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecs_to_exclude: 'h264', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in h264! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecs_to_exclude: 'hevc', + cli: 'handbrake', + transcode_arguments: '-Z "Very Fast 480p30"', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Very Fast 480p30"', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not in desired codec! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js b/tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js new file mode 100644 index 0000000..d6dc22c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js @@ -0,0 +1,41 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a -c copy -c:v:0 libx265 -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☒File is not hevc! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js b/tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js new file mode 100644 index 0000000..88633af --- /dev/null +++ b/tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js @@ -0,0 +1,41 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a -c copy -c:v:0 libx265 -crf 20', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☒File is not hevc! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js b/tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js new file mode 100644 index 0000000..0d7ee54 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js @@ -0,0 +1,41 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a -c copy -c:v:0 hevc_nvenc -crf 20', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☒File is not hevc! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js b/tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js new file mode 100644 index 0000000..95a1b47 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js @@ -0,0 +1,43 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑ Preferred language is already first audio track! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: { + preferred_language: 'fre', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -c copy -map 0:v -map 0:a:3 -disposition:a:0 default -map 0:a:0 -map 0:a:1 -disposition:a:1 0 -map 0:a:2 -disposition:a:2 0 -disposition:a:3 0 -map 0:a:4 -disposition:a:4 0 -map 0:s? -map 0:d? ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒ Desired audio lang is not first audio stream, moving! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js b/tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js new file mode 100644 index 0000000..cc9ef73 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js @@ -0,0 +1,62 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☒ No subtitle tracks in desired language! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_2.json'), + librarySettings: {}, + inputs: { + preferred_language: 'fre', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑ Preferred language is already first subtitle track! \n', + }, + + }, { + input: { + file: require('../sampleData/media/sampleH264_3.json'), + librarySettings: {}, + inputs: { + preferred_language: 'fre', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -c copy -map 0:v -map 0:a -map 0:s:1 -disposition:s:0 default -map 0:s:0 -disposition:s:1 0 -map 0:d? ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒ Desired subtitle lang is not first subtitle stream, moving! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js b/tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js new file mode 100644 index 0000000..9a3053c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js @@ -0,0 +1,44 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑ File is already in h264, no need to transcode! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH265_1.json'), + librarySettings: {}, + inputs: { + handbrake_preset: 'Very Fast 1080p30', + output_container: '.mp4', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Very Fast 1080p30" -e nvenc_h264 --all-audio --all-subtitles', + container: '.mp4', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒ File is not in h264, transcoding! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js b/tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js new file mode 100644 index 0000000..780bf5d --- /dev/null +++ b/tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js @@ -0,0 +1,112 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-vsync 0 -hwaccel cuda -hwaccel_output_format cuda -c:v h264_cuvid ,-map 0:v -map 0:a -map 0:s? -map -:d? -c copy -c:v:0 hevc_nvenc -preset medium -profile:v main10 -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -max_muxing_queue_size 4096 -b:v 967680 -maxrate 1257984 -minrate 677376 -bufsize 1205959 -map_metadata:g -1', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'No valid resolution selected, defaulting to 8KUHD.\n' + + 'Video details: h264-720p \n' + + ' 1280x720x25@8 bits.\n' + + 'Video bitrate is 1206Kbps, overall is 1591Kbps. Calculated target is 1613Kbps.\n' + + '☒H264 Resolution is 720p, bitrate was 1206Kbps. HEVC target bitrate will be 968Kbps.\n' + + '☒Transcoding to HEVC.', + }, + }, { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: { + ffmpegPreset: 'veryslow', + container: 'mkv', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-vsync 0 -hwaccel cuda -hwaccel_output_format cuda -c:v hevc_cuvid ,-map 0:v -map 0:a -map 0:s? -map -:d? -c copy -c:v:0 hevc_nvenc -preset veryslow -profile:v main10 -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -max_muxing_queue_size 4096 -b:v 3207442 -maxrate 4717440 -minrate 2540160 -bufsize 3628800 -map_metadata:g -1', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'No valid resolution selected, defaulting to 8KUHD.\n' + + 'Video details: hevc-1080p \n' + + ' 1920x1080x25@8 bits.\n' + + 'Video bitrate is NaNKbps, overall is 3207Kbps. Calculated target is 3629Kbps.\n' + + '☒HEVC Bitrate for 1080p could not be determined, \n' + + ' using sensible default of 3207Kbps.\n' + + '☒Transcoding to HEVC.', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: { + maxResolution: '720p', + ffmpegPreset: 'veryslow', + container: 'mkv', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-vsync 0 -hwaccel cuda -hwaccel_output_format cuda -c:v hevc_cuvid -resize 1280x720 ,-map 0:v -map 0:a -map 0:s? -map -:d? -c copy -c:v:0 hevc_nvenc -preset veryslow -profile:v main10 -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -max_muxing_queue_size 4096 -b:v 1612800 -maxrate 2096640 -minrate 1128960 -bufsize 1612800 -map_metadata:g -1', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Resizing to 1280x720.\n' + + 'Video details: hevc-1080p \n' + + ' 1920x1080x25@8 bits.\n' + + 'Video bitrate is NaNKbps, overall is 3207Kbps. Calculated target is 1613Kbps.\n' + + '☒HEVC Bitrate for 1080p could not be determined, \n' + + ' using sensible default of 1613Kbps.\n' + + '☒Transcoding to HEVC.', + }, + }, + { + input: { + file: (() => { + // modify so no processing needed + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[0].codec_name = 'hevc'; + return file; + })(), + librarySettings: {}, + inputs: { + maxResolution: '1080p', + ffmpegPreset: 'veryslow', + container: 'mkv', + compressionFactor: '1', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '-vsync 0 -hwaccel cuda -hwaccel_output_format cuda -c:v hevc_cuvid ,-map 0:v -map 0:a -map 0:s? -map -:d? -c copy -c:v:0 hevc_nvenc -preset veryslow -profile:v main10 -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -max_muxing_queue_size 4096 ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Video details: hevc-1080p \n' + + ' 1918x1080x25@8 bits.\n' + + 'Video bitrate is 6454Kbps, overall is 8249Kbps. Calculated target is 51786Kbps.\n' + + '☑HEVC Bitrate is within limits.\n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js b/tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js new file mode 100644 index 0000000..6557f17 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js @@ -0,0 +1,75 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Removing audio track in language und\n' + + '☒ *** All audio tracks would have been removed. Defaulting to keeping all tracks for this file.\n' + + '☒ Transcoding to HEVC using NVidia NVENC\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ' -c:v h264_cuvid,-map 0 -map -0:d -c:v hevc_nvenc -qmin 0 -cq:v 30 -b:v 602k -maxrate:v 2602k -preset medium -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -c:a copy -c:s copy -max_muxing_queue_size 9999 -bf 5 -analyzeduration 2147483647 -probesize 2147483647', + reQueueAfter: true, + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☑ File is in HEVC codec and in MKV\n' + + '☑ No video processing necessary\n' + + '☑ No subtitle processing necessary\n' + + '☑ No need to process file', + processFile: false, + preset: ',-map 0 -map -0:d -c:v copy -c:a copy -c:s copy -max_muxing_queue_size 9999 -bf 5 -analyzeduration 2147483647 -probesize 2147483647', + reQueueAfter: true, + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].bit_rate = undefined; + return file; + })(), + librarySettings: {}, + inputs: { + target_bitrate_720p: '1500000', + }, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Removing audio track in language und\n' + + '☒ *** All audio tracks would have been removed. Defaulting to keeping all tracks for this file.\n' + + '☒ Transcoding to HEVC using NVidia NVENC\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ' -c:v h264_cuvid,-map 0 -map -0:d -c:v hevc_nvenc -qmin 0 -cq:v 30 -b:v 1500k -maxrate:v 3500k -preset medium -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -c:a copy -c:s copy -max_muxing_queue_size 9999 -bf 5 -analyzeduration 2147483647 -probesize 2147483647', + reQueueAfter: true, + }, + }, + +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js new file mode 100644 index 0000000..c725079 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js @@ -0,0 +1,107 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.mkv', + processFile: true, + preset: ', -sn -map 0:v -c:v copy -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -map 0:a -c:a copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Converting video, NOT resizing. 720p, h264 --> 720p, hevc. bitrate = 1517 --> 758, multiplier 0.5. \n' + + 'Not converting audio. \n' + + '2 channels - \n' + + '6 channels - und aac \n' + + '8 channels - ', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.mkv', + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is processed already, nothing to do', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + resize: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.mkv', + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is processed already, nothing to do', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + bitrate_cutoff: '6000', + }, + otherArguments: {}, + }, + output: { + container: '.mkv', + processFile: true, + preset: ', -sn -map 0:v -c:v copy -b:v 3933k -minrate 2753k -maxrate 5112k -bufsize 7866k -map 0:a -c:a copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Converting video, NOT resizing. 1080p, h264 --> 1080p, hevc. bitrate = 7866 --> 3933, multiplier 0.5. \n' + + 'Not converting audio. \n' + + '2 channels - eng flac \n' + + '6 channels - \n' + + '8 channels - ', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + bitrate_cutoff: '8000', + }, + otherArguments: {}, + }, + output: { + container: '.mkv', + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is processed already, nothing to do', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js b/tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js new file mode 100644 index 0000000..ef5221c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js @@ -0,0 +1,59 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + preset: ', -map_metadata 0 -id3v2_version 3 -b:a 320k', + container: '.mp3', + handbrakeMode: false, + ffmpegMode: true, + processFile: false, + reQueueAfter: true, + infoLog: 'undefined☒Codec excluded \n ☑Codec not excluded \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleAAC_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + preset: ', -map_metadata 0 -id3v2_version 3 -b:a 320k', + container: '.mp3', + handbrakeMode: false, + ffmpegMode: true, + processFile: false, + reQueueAfter: true, + infoLog: 'undefined☒Codec excluded \n ☑Codec not excluded \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleMP3_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + preset: ', -map_metadata 0 -id3v2_version 3 -b:a 320k', + container: '.mp3', + handbrakeMode: false, + ffmpegMode: true, + processFile: false, + reQueueAfter: true, + infoLog: 'undefined☒Codec excluded \n ☒Codec excluded \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js new file mode 100644 index 0000000..a329f18 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js @@ -0,0 +1,145 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v h264_cuvid, -map 0 -c:v hevc_nvenc -cq:v 19 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:s copy -max_muxing_queue_size 9999 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mkv. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is already hevc or vp9 & in mkv. \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v h264_cuvid, -map 0 -c:v hevc_nvenc -cq:v 19 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mp4. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + bitrate_cutoff: '10000', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Current bitrate is below set cutoff of 10000. Cancelling plugin. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + bitrate_cutoff: '1000', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v h264_cuvid, -map 0 -c:v hevc_nvenc -cq:v 19 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mp4. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + force_conform: 'false', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is hevc or vp9 but is not in mp4 container. Remuxing. \n', + container: '.mp4', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js new file mode 100644 index 0000000..6e1afa3 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js @@ -0,0 +1,145 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c:v libx265 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -c:a copy -c:s copy -max_muxing_queue_size 9999 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mkv. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is already hevc or vp9 & in mkv. \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c:v libx265 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mp4. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + bitrate_cutoff: '10000', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Current bitrate is below set bitrate cutoff of 10000. Nothing to do, cancelling plugin. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + bitrate_cutoff: '1000', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c:v libx265 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mp4. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + force_conform: 'false', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is hevc or vp9 but is not in mp4 container. Remuxing. \n', + container: '.mp4', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js b/tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js new file mode 100644 index 0000000..16051f0 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js @@ -0,0 +1,45 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy -max_muxing_queue_size 9999 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File is mp4 but requested to be mkv container. Remuxing. \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + force_conform: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in mp4 container. \n', + container: '.mp4', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js b/tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js new file mode 100644 index 0000000..5208106 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js @@ -0,0 +1,46 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -metadata title= -c copy -map 0 -max_muxing_queue_size 9999', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has title metadata. Removing \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File has no title metadata \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js b/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js new file mode 100644 index 0000000..11bd864 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js @@ -0,0 +1,98 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: "☑File doesn't contain audio tracks which are unwanted or that require tagging.\n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + language: 'eng', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:a:3 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Audio stream 0:a:3 has unwanted language tag fre, removing. \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[3].tags.title = 'description'; + return file; + })(), + librarySettings: {}, + inputs: { + language: 'eng', + commentary: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:a:2 -map -0:a:3 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Audio stream 0:a:2 detected as being descriptive, removing. \n' + + '☒Audio stream 0:a:3 has unwanted language tag fre, removing. \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[2].tags.title = 'description'; + file.ffProbeData.streams[3].tags.language = 'und'; + return file; + })(), + librarySettings: {}, + inputs: { + language: 'eng', + commentary: 'true', + tag_language: 'eng', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:a:1 -map -0:a:2 -metadata:s:a:2 language=eng -map -0:a:3 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Audio stream 0:a:1 detected as being descriptive, removing. \n' + + '☒Audio stream 0:a:2 has unwanted language tag und, removing. \n' + + '☒Audio stream 0:a:2 detected as having no language, tagging as eng. \n' + + '☒Audio stream 0:a:3 has unwanted language tag fre, removing. \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js b/tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js new file mode 100644 index 0000000..fa10ac5 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js @@ -0,0 +1,72 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: "☑File doesn't contain subtitle tracks which are unwanted or that require tagging.\n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:s:0 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Subtitle stream 0:s:0 has unwanted language tag fre, removing. \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + + file.ffProbeData.streams[7] = _.cloneDeep(file.ffProbeData.streams[6]); + file.ffProbeData.streams[6].tags.title = 'description'; + file.ffProbeData.streams[7].tags.language = 'und'; + return file; + })(), + librarySettings: {}, + inputs: { + language: 'eng,und', + commentary: 'true', + tag_language: 'eng', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:s:0 -map -0:s:0 -metadata:s:s:1 language=eng -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Subtitle stream 0:s:0 has unwanted language tag fre, removing. \n' + + '☒Subtitle stream 0:s:0 detected as being descriptive, removing. \n' + + '☒Subtitle stream 0:s:1 has no language, tagging as eng. \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js b/tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js new file mode 100644 index 0000000..9d9497c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js @@ -0,0 +1,90 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Plugin has not been configured, please configure required options. Skipping this plugin. \n', + }, + }, + + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + aac_stereo: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: false, + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File contains all required audio formats. \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + aac_stereo: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Audio track is 2 channel but is not AAC. Converting. \n' + + '☒Audio track is 2 channel but is not AAC. Converting. \n' + + '☒Audio track is 2 channel but is not AAC. Converting. \n', + preset: ', -map 0 -c:v copy -c:a copy -c:a:0 aac -c:a:1 aac -c:a:2 aac -strict -2 -c:s copy -max_muxing_queue_size 9999 ', + }, + }, + + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[1].channels = 8; + return file; + })(), + librarySettings: {}, + inputs: { + aac_stereo: 'false', + downmix: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒Audio track is 8 channel, no 6 channel exists. Creating 6 channel from 8 channel. \n', + preset: ', -map 0 -c:v copy -c:a copy -map 0:1 -c:a:0 ac3 -ac 6 -metadata:s:a:0 title="5.1" -strict -2 -c:s copy -max_muxing_queue_size 9999 ', + }, + }, + +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js b/tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js new file mode 100644 index 0000000..d4a111a --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js @@ -0,0 +1,103 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + infoLog: '☑ Streams are in expected order. \n ', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + infoLog: '☑ Streams are in expected order. \n ', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[1].channels = 8; + file.ffProbeData.streams[2].channels = 6; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:0 -map 0:3 -map 0:4 -map 0:5 -map 0:2 -map 0:1 -map 0:6 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + infoLog: '☒ Audio 6ch not second. \n' + + '☒ Audio 2ch not first. \n' + + '☒ Audio 2ch not first. \n' + + '☒ Audio 2ch not first. \n' + + '☒ Streams are out of order, reorganizing streams. Video, Audio, Subtitles. \n', + reQueueAfter: true, + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[1].channels = 8; + file.ffProbeData.streams[2].channels = 6; + const video = file.ffProbeData.streams.splice(0, 1)[0]; + file.ffProbeData.streams.push(video); + const subs = file.ffProbeData.streams.splice(5, 1)[0]; + file.ffProbeData.streams.unshift(subs); + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:6 -map 0:3 -map 0:4 -map 0:5 -map 0:2 -map 0:1 -map 0:0 -c copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + infoLog: '☒ Audio not second. \n' + + '☒ Audio not second. \n' + + '☒ Audio 6ch not second. \n' + + '☒ Audio not second. \n' + + '☒ Audio 2ch not first. \n' + + '☒ Audio not second. \n' + + '☒ Audio 2ch not first. \n' + + '☒ Audio not second. \n' + + '☒ Audio 2ch not first. \n' + + '☒ Video not first. \n' + + '☒ Streams are out of order, reorganizing streams. Video, Audio, Subtitles. \n', + reQueueAfter: true, + }, + }, + +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js b/tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js new file mode 100644 index 0000000..bdb0c02 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js @@ -0,0 +1,46 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + container: '.mp4', + FFmpegMode: true, + reQueueAfter: true, + infoLog: "☑File doesn't contain any unwanted image format streams.\n", + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.ffProbeData.streams[0].codec_name = 'mjpeg'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c copy -max_muxing_queue_size 9999 -map -v:0 ', + handBrakeMode: false, + container: '.mkv', + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has image format stream, removing. \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js b/tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js new file mode 100644 index 0000000..40adead --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js @@ -0,0 +1,47 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: "☑File doesn't contain subtitle or audio codecs which were unwanted or that require tagging.\n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + tag_subtitle_codecs: 'subrip', + tag_audio_codecs: 'aac', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:a:3 -map -0:a:4 -map -0:s:0 -c copy -max_muxing_queue_size 4096', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒audio stream detected as unwanted. removing audio stream 0:a:3 - Français E-AC3 2.0 - aac \n' + + '☒audio stream detected as unwanted. removing audio stream 0:a:4 - Anglais E-AC3 2.0 - aac \n' + + '☒Subtitle stream detected as unwanted. removing subtitle stream 0:s:0 - Français - subrip. \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js b/tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js new file mode 100644 index 0000000..1c5438d --- /dev/null +++ b/tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js @@ -0,0 +1,107 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi ,-map 0:v -map 0:a -map 0:s? -map 0:d? -map 0:t? -c copy -c:v:0 hevc_vaapi -b:v 758k -minrate 530k -maxrate 985k -bufsize 1M -max_muxing_queue_size 1024 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☒ Video stream 0 is not HEVC, transcode required.\n' + + ' ☑ Stream analysis complete, processing required.\n' + + ' ', + container: 'mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑ Stream analysis complete, no processing required.\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + minBitrate: '4000', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi ,-map 0:v -map 0:a -map 0:s? -map 0:d? -map 0:t? -c copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: "☒ Input file's bitrate 1517 is lower than the minimum bitrate threshold of 4000. Skipping this plugin.\n" + + '☑ Stream analysis complete, processing required.\n' + + ' ', + container: 'mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + remuxOnly: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☒ RemuxOnly is enabled and file is not a remux. Unable to process.\n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.file = `remux ${file.file}`; + return file; + })(), + librarySettings: {}, + inputs: { + remuxOnly: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi ,-map 0:v -map 0:a -map 0:s? -map 0:d? -map 0:t? -c copy -c:v:0 hevc_vaapi -b:v 3933k -minrate 2753k -maxrate 5112k -bufsize 1M -max_muxing_queue_size 1024 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☒ Video stream 0 is not HEVC, transcode required.\n' + + ' ☑ Stream analysis complete, processing required.\n' + + ' ', + container: 'mkv', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js new file mode 100644 index 0000000..22d571d --- /dev/null +++ b/tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js @@ -0,0 +1,42 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File has no title metadata \n☑File meets conditions! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js b/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js new file mode 100644 index 0000000..805c984 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js @@ -0,0 +1,66 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n☑File has no subs \n☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Very Fast 1080p30"', + container: '.mp4', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not in h264! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in h264! \n' + + '☑File has no subs \n' + + '☑File has no title metadata☑File has aac track \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js b/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js new file mode 100644 index 0000000..47cc98c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js @@ -0,0 +1,66 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n☑File has no subs \n☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "Fast 1080p30"', + container: '.mp4', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not in h264! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in h264! \n' + + '☑File has no subs \n' + + '☑File has no title metadata☑File has aac track \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js b/tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js new file mode 100644 index 0000000..4bf0913 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js @@ -0,0 +1,45 @@ +/* eslint max-len: 0 */ +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑ File does not have any streams that need to be transcoded! \n', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + codecs_to_transcode: 'aac', + codec: 'eac3', + bitrate: '640k', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -c copy -map 0:v -map 0:1 -c:1 eac3 -b:a 640k -map 0:s? -map 0:d? -max_muxing_queue_size 9999', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: "☒ File has streams which aren't in desired codec! \n", + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js b/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js new file mode 100644 index 0000000..7e1de0d --- /dev/null +++ b/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js @@ -0,0 +1,68 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: {}, + otherArguments: { + originalLibraryFile: require('../sampleData/media/sampleH264_1.json'), + }, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'New file has size 1.008 MB which is 100% of original file size: 1.008 MB', + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: '110', + lowerBound: '35', + }, + otherArguments: { + originalLibraryFile: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.file_size = 3; + return file; + })(), + }, + }, + output: 'New file size not within limits. New file has size 1.008 MB which is 33% of original file size: 3.000 MB. lowerBound is 35%', + error: { + shouldThrow: true, + }, + }, + { + input: { + file: require('../sampleData/media/sampleH264_1.json'), + librarySettings: {}, + inputs: { + upperBound: '120', + lowerBound: '35', + }, + otherArguments: { + originalLibraryFile: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.file_size = 0.1; + return file; + })(), + }, + }, + output: 'New file size not within limits. New file has size 1.008 MB which is 1007% of original file size: 0.100 MB. upperBound is 120%', + error: { + shouldThrow: true, + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js b/tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js new file mode 100644 index 0000000..9c01863 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js @@ -0,0 +1,45 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy -c:v:0 libx265 -preset:v slow -pix_fmt yuv420p10le -x265-params "crf=22:aq-mode=3"', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File is not in hevc! \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in hevc! \n' + + '☑ All audio streams are in aac! \n' + + '☑File has no title metadata \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js b/tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js new file mode 100644 index 0000000..a3b9e80 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js @@ -0,0 +1,59 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c:v copy -c:a copy -c:a:0 ac3 -c:s copy -c:d copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒ File has surround audio which is NOT in ac3! \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑ All surround audio streams are in ac3! \n☑File meets conditions! \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑ All surround audio streams are in ac3! \n☑File meets conditions! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js new file mode 100644 index 0000000..336f2f0 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -0,0 +1,86 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-fflags +genpts -hwaccel qsv -c:v h264_qsv -map 0 -c:v hevc_qsv -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset slow \n' + + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ It looks like the current bitrate is 1517k. \n' + + '\n' + + 'Container for output selected as mkv. \n' + + 'Encode variable bitrate settings: \n' + + 'Target = 759k \n' + + 'Minimum = 569k \n' + + 'Maximum = 949k \n' + + 'File Transcoding... \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + encoder_speedpreset: 'fast', + enable_10bit: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-fflags +genpts -hwaccel qsv -map 0 -c:v hevc_qsv -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset fast \n' + + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ It looks like the current bitrate is 1517k. \n' + + '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n' + + '\n' + + 'Container for output selected as mp4. \n' + + 'Encode variable bitrate settings: \n' + + 'Target = 759k \n' + + 'Minimum = 569k \n' + + 'Maximum = 949k \n' + + 'File Transcoding... \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + encoder_speedpreset: 'fast', + enable_10bit: 'true', + bitrate_cutoff: '2000', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ It looks like the current bitrate is 1517k. \n' + + '☑ Current bitrate is below set cutoff of 2000k. Cancelling plugin. \n', + container: '.mp4', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js b/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js new file mode 100644 index 0000000..1c012bf --- /dev/null +++ b/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js @@ -0,0 +1,49 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + infoLog: '☑ No 2 channel audio stream exists. \n ', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + + file.ffProbeData.streams[1].channels = 6; + return file; + })(), + librarySettings: {}, + inputs: { + channels: '6', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c copy -disposition:1 default -disposition:2 0 -disposition:3 0 -disposition:4 0 -disposition:5 0 ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + infoLog: '☒ Matching audio stream is not set to default. \n' + + '☒ Setting 6 channel matching audio stream to default. Remove default from all other audio streams \n', + reQueueAfter: true, + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js b/tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js new file mode 100644 index 0000000..455b2ca --- /dev/null +++ b/tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js @@ -0,0 +1,50 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v h264_cuvid,-map 0 -dn -c:v hevc_nvenc -pix_fmt p010le -qmin 0 -cq:v 30 -b:v 964k -maxrate:v 2964k -preset slow -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -a53cc 0 -c:a copy -c:s copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☒File is 720p!\n' + + '☒File is not hevc!\n' + + '☒File bitrate is 1205kb!\n' + + 'File bitrate is LOWER than the Default Target Bitrate!\n' + + '☒Target Bitrate set to 964kb!\n' + + 'File is being transcoded!\n', + maxmux: false, + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + maxmux: false, + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js b/tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js new file mode 100644 index 0000000..c80b3dc --- /dev/null +++ b/tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js @@ -0,0 +1,47 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☑File is a video Without Mjpeg! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].codec_name = 'mjpeg'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ',-map 0 -map -0:v:1 -c:v copy -c:a copy -c:s copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not a video but has Mjpeg Stream! \n' + + '☑File is a video With Mjpeg! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js b/tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js new file mode 100644 index 0000000..e382ca8 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js @@ -0,0 +1,62 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:v -map 0:a -c:v copy -c:a copy -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ File is already in h264!\n☒ File has title metadata\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: { + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:V -map 0:a -c:v libx264 -preset medium -c:a aac -strict -2 -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒ File is not in h264!\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: { + FFmpeg_preset: 'fast', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:V -map 0:a -c:v libx264 -preset fast -c:a aac -strict -2 -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒ File is not in h264!\n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js b/tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js new file mode 100644 index 0000000..250a2a7 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js @@ -0,0 +1,110 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Will convert multi channel audio to AC3\n' + + '☒ Transcoding to HEVC (software)\n' + + 'Encoder configuration:\n' + + '• Original Bitrate: 1517\n' + + '• Target Bitrate: 1517\n' + + '• Minimum Bitrate: 1061\n' + + '• Maximum Bitrate: 1972\n' + + '\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -c:v libx265 -b:v 1517k -minrate 1061k -maxrate 1972k -bufsize 1517k -c:a copy -c:a:0 ac3 -c:s copy -max_muxing_queue_size 4096', + reQueueAfter: false, + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + nvenc: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Will convert multi channel audio to AC3\n' + + '☒ Transcoding to HEVC using NVidia NVENC\n' + + 'Encoder configuration:\n' + + '• Original Bitrate: 1517\n' + + '• Target Bitrate: 1517\n' + + '• Minimum Bitrate: 1061\n' + + '• Maximum Bitrate: 1972\n' + + '\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: '-c:v h264_cuvid,-map 0 -map -0:d -c:v hevc_nvenc -cq:v 19 -b:v 1517k -minrate 1061k -maxrate 1972k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:a:0 ac3 -c:s copy -max_muxing_queue_size 4096', + reQueueAfter: false, + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + nvenc: 'false', + qsv: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Will convert multi channel audio to AC3\n' + + '☒ Transcoding to HEVC using VAAPI\n' + + 'Encoder configuration:\n' + + '• Original Bitrate: 1517\n' + + '• Target Bitrate: 1517\n' + + '• Minimum Bitrate: 1061\n' + + '• Maximum Bitrate: 1972\n' + + '\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: '-hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi,-map 0 -map -0:d -c:v hevc_vaapi -b:v 1517k -minrate 1061k -maxrate 1972k -bufsize 1517k -c:a copy -c:a:0 ac3 -c:s copy -max_muxing_queue_size 4096', + reQueueAfter: false, + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.mkv', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☑ No multi channel audio found\n' + + '☑ No audio processing necessary\n' + + '☑ File is in HEVC codec and in MKV\n' + + '☑ No video processing necessary\n' + + '☑ No subtitle processing necessary\n' + + '☑ No need to process file', + processFile: false, + preset: ',-map 0 -map -0:d -c:v copy -c:a copy -c:s copy -max_muxing_queue_size 4096', + reQueueAfter: false, + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js new file mode 100644 index 0000000..edbb610 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js @@ -0,0 +1,97 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "H.264 MKV 480p30"', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not h264 480p! \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "H.264 MKV 480p30"', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not h264 480p! \n', + }, + }, + + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].width = 720; + file.ffProbeData.streams[0].height = 480; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is h264 480p! \n' + + '☑File has no title and has no subs \n' + + '☒File has title metadata \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].width = 720; + file.ffProbeData.streams[0].height = 480; + + file.meta.Title = undefined; + file.container = 'mkv'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is h264 480p! \n' + + '☑File has no title and has no subs \n' + + '☑File has no title metadata \n' + + '☑File has no subs \n' + + '☑File is in mkv container! \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js new file mode 100644 index 0000000..4371d6c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js @@ -0,0 +1,99 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is h264 720p! \n' + + '☑File has no title and has no subs \n' + + '☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "H.264 MKV 720p30"', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not h264 720p! \n', + }, + }, + + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].width = 1280; + file.ffProbeData.streams[0].height = 720; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is h264 720p! \n' + + '☑File has no title and has no subs \n' + + '☒File has title metadata \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].width = 1280; + file.ffProbeData.streams[0].height = 720; + + file.meta.Title = undefined; + file.container = 'mkv'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is h264 720p! \n' + + '☑File has no title and has no subs \n' + + '☑File has no title metadata \n' + + '☑File has no subs \n' + + '☑File is in mkv container! \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js new file mode 100644 index 0000000..046e210 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js @@ -0,0 +1,96 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is h264 1080p!☑File has no title and has no subs \n' + + '☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "H.264 MKV 1080p30"', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☒File is not h264 1080p! \n', + }, + }, + + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].width = 1920; + file.ffProbeData.streams[0].height = 1080; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is h264 1080p!☑File has no title and has no subs \n' + + '☒File has title metadata \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].width = 1920; + file.ffProbeData.streams[0].height = 1080; + + file.meta.Title = undefined; + file.container = 'mkv'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is h264 1080p!☑File has no title and has no subs \n' + + '☑File has no title metadata \n' + + '☑File has no subs \n' + + '☑File is in mkv container! \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js b/tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js new file mode 100644 index 0000000..5a70598 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js @@ -0,0 +1,94 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ', -map 0:v', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: 'Removing unwanted audio...\n' + + 'Found unwanted: und: 1\n' + + 'Found unwanted: und: 1\n' + + 'No unwanted audio found!\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ', -map 0:v -map 0:1', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: 'Removing unwanted audio...\nAdded undefined: 1\nNo unwanted audio found!\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + languages: 'fre', + container: 'mp4', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:4 -map 0:s? -c copy', + container: 'mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Removing unwanted audio...\n' + + 'Found wanted fre: 4\n' + + 'Found unwanted audio\n' + + 'It will be removed\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + languages: 'eng', + container: 'mp4', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:1 -map 0:2 -map 0:3 -map 0:5 -map 0:s? -c copy', + container: 'mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Removing unwanted audio...\n' + + 'Found wanted eng: 1\n' + + 'Found wanted eng: 2\n' + + 'Found wanted eng: 3\n' + + 'Found wanted eng: 5\n' + + 'Found unwanted audio\n' + + 'It will be removed\n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js b/tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js new file mode 100644 index 0000000..86bb3c1 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js @@ -0,0 +1,48 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☒File is not a 4K video \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.video_resolution = '4KUHD'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-sn -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File does not have only AC3 track commentaries! \n' + + '☑File has AC3 track! \n' + + '☒File has subs! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js b/tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js new file mode 100644 index 0000000..71c8098 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js @@ -0,0 +1,85 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ', -c copy -map 0:v ', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☒File is not mkv \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ', -c copy -map 0:v -map 0:a:0? -c:a:0 copy -map 0:a:1? -c:a:1 copy -map 0:a:2? -c:a:2 copy -map 0:a:3? -c:a:3 copy -map 0:a:4? -c:a:4 copy ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: "☑File doesn't contain audio tracks with the specified codec.\n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + input_codecs: 'aac', + output_codec: 'eac3', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -c copy -map 0:v -map 0:a:0? -c:a:0 copy -map 0:a:1? -c:a:1 copy -map 0:a:2? -c:a:2 copy -map 0:a:3? -c:a:3 copy -map 0:a:3? -c:a:4 eac3 -b:a:4 128k -metadata:s:a:4 title="" -metadata:s:a:4 copyright="henk_asac" -disposition:a:4 0 -map 0:a:4? -c:a:5 copy -map 0:a:4? -c:a:6 eac3 -b:a:6 128k -metadata:s:a:6 title="" -metadata:s:a:6 copyright="henk_asac" -disposition:a:6 0 -map 0:s? ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: { + input_codecs: 'aac', + output_codec: 'eac3', + bitrate: '256', + auto_adjust: 'false', + position_new_audio: 'before', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -c copy -map 0:v -map 0:a:0? -c:a:0 copy -map 0:a:1? -c:a:1 copy -map 0:a:2? -c:a:2 copy -map 0:a:3? -c:a:3 eac3 -b:a:3 256k -metadata:s:a:3 title="" -metadata:s:a:3 copyright="henk_asac" -disposition:a:3 0 -map 0:a:3? -c:a:4 copy -map 0:a:4? -c:a:5 eac3 -b:a:5 256k -metadata:s:a:5 title="" -metadata:s:a:5 copyright="henk_asac" -disposition:a:5 0 -map 0:a:4? -c:a:6 copy -map 0:s? ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js b/tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js new file mode 100644 index 0000000..894d3a0 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js @@ -0,0 +1,68 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -c:v copy -c:a copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -c:v copy -c:a copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File has no title metadata \n' + + '☑File has no subs \n' + + '☒File is not in mp4 container! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json')); + file.container = 'mp4'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File has no title metadata \n' + + '☑File has no subs \n' + + '☑File is in mp4 container! \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js b/tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js new file mode 100644 index 0000000..df39e53 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js @@ -0,0 +1,66 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is in mp4 container! \n☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File is not in mp4 container! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json')); + file.container = 'mp4'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is in mp4 container! \n' + + '☑File has no title metadata \n' + + '☑File has aac track \n' + + '☑File meets conditions! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js b/tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js new file mode 100644 index 0000000..229b051 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js @@ -0,0 +1,42 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-sn -vcodec copy -scodec copy -acodec aac -filter:a "dynaudnorm,pan=stereo|FL < 1.0*FL + 0.707*FC + 0.707*BL|FR < 1.0*FR + 0.707*FC + 0.707*BR"', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File matches requirements for processing. Downmixing and applying DRC!', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File has more than 1 audio track - not processing', + container: '.mkv', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js b/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js new file mode 100644 index 0000000..197cc39 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js @@ -0,0 +1,50 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: 'File has video in first stream\n File meets conditions!\n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + + const audio = file.ffProbeData.streams[1]; + // eslint-disable-next-line prefer-destructuring + file.ffProbeData.streams[1] = file.ffProbeData.streams[0]; + file.ffProbeData.streams[0] = audio; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v? -map 0:a? -map 0:s? -map 0:d? -map 0:t? -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Video is not in the first stream', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js new file mode 100644 index 0000000..9dfabae --- /dev/null +++ b/tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js @@ -0,0 +1,42 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map_metadata -1 -map 0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File has no title metadata \n☑File meets conditions! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js b/tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js new file mode 100644 index 0000000..4acaaaf --- /dev/null +++ b/tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js @@ -0,0 +1,44 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c:s copy -movflags use_metadata_tags -c:a aac -b:a 512k -c:v:0 libx265 -preset medium -x265-params crf=18:tune=animation:qcomp=0.7:aq-strength=1.1 -pix_fmt yuv420p10le -f matroska', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☒File is 720p but is not hevc!\n' + + '☒File will be transcoded!\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js b/tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js new file mode 100644 index 0000000..3cdab96 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js @@ -0,0 +1,67 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:s? -c:s srt -map 0:a -c copy -c:v:0 libx265 -preset fast -crf 25', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☒File is 720p but is not hevc!\n' + + '☒File will be transcoded!\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); + file.video_resolution = '480p'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:s? -c:s srt -map 0:a -c copy -c:v:0 libx265 -preset fast -crf 27', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☒File is 480p but is not hevc!\n' + + '☒File will be transcoded!\n', + }, + }, +]; + +run(tests); diff --git a/tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js b/tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js new file mode 100644 index 0000000..36ea9c2 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js @@ -0,0 +1,63 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "H.265 MKV 2160p60" --all-audio --all-subtitles', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: "☒File isn't in hevc! \n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -b:a:0 192k -ac 2', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has no language track in ac3,eac3,dts. No eng track marked so transcoding audio track 1 into ac3! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json')); + file.ffProbeData.streams[1].codec_name = 'ac3'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is in mkv container! \n', + }, + }, +]; + +run(tests); diff --git a/tests/checkPlugins.js b/tests/checkPlugins.js index 725531a..13bab9d 100644 --- a/tests/checkPlugins.js +++ b/tests/checkPlugins.js @@ -1,12 +1,16 @@ /* eslint no-console: 0 */ // --> OFF +/* eslint max-len: 0 */ const fs = require('fs'); +const chalk = require('chalk'); const folders = [ './Community', './examples', ]; +let errorEncountered = false; + folders.forEach((folder) => { const files = fs.readdirSync(folder).filter((row) => row.includes('.js')); @@ -28,16 +32,16 @@ folders.forEach((folder) => { const importLib = 'const lib = require(\'../methods/lib\')();'; if (!read.includes(importLib)) { - console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${importLib}`); + console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${importLib}`)); read = `${importLib}\n${read}`; // fs.writeFileSync(`${folder}/${files[i]}`, read) - process.exit(1); + errorEncountered = true; } const detailsText = 'const details = () =>'; if (!read.includes(detailsText)) { - console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${detailsText}`); - process.exit(1); + console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${detailsText}`)); + errorEncountered = true; } const syncText = 'const plugin = (file, librarySettings, inputs, otherArguments) => {'; @@ -46,27 +50,27 @@ folders.forEach((folder) => { if (!read.includes(syncText) && !read.includes(asyncText) ) { - console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${syncText} or ${asyncText}`); - process.exit(1); + console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${syncText} or ${asyncText}`)); + errorEncountered = true; } const inputsText = 'inputs = lib.loadDefaultValues(inputs, details);'; if (!read.includes(inputsText) ) { - console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${inputsText}`); - process.exit(1); + console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${inputsText}`)); + errorEncountered = true; } const exportText = `module.exports.details = details; module.exports.plugin = plugin;`; if (!read.includes(exportText)) { - console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${exportText}`); + console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${exportText}`)); read = read.replace('module.exports.details = details;', ''); read = read.replace('module.exports.plugin = plugin;', ''); read += `\n${exportText}`; // fs.writeFileSync(`${folder}/${files[i]}`, read) - process.exit(1); + errorEncountered = true; } // check deps are within functions @@ -80,8 +84,8 @@ module.exports.plugin = plugin;`; const countOpen = allBefore.join(keyWord).split('{').length - 1; const countClose = allBefore.join(keyWord).split('}').length - 1; if (countOpen === countClose) { - console.log(`Plugin has requires outside of function '${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin has requires outside of function '${folder}/${files[i]}'`)); + errorEncountered = true; } } } @@ -91,64 +95,66 @@ module.exports.plugin = plugin;`; // eslint-disable-next-line import/no-dynamic-require,global-require pluginDetails = require(`.${folder}/${files[i]}`).details(); } catch (err) { - console.log(err.message); - process.exit(1); + console.log(chalk.red(err.message)); + errorEncountered = true; } const detailsKeys = Object.keys(pluginDetails); + // eslint-disable-next-line no-loop-func detailsOrder.forEach((detail) => { if (detailsKeys.indexOf(detail) === -1) { - console.log(`Plugin details is missing '${folder}/${files[i]}' : ${detail}`); - process.exit(1); + console.log(chalk.red(`Plugin details is missing '${folder}/${files[i]}' : ${detail}`)); + errorEncountered = true; } }); + // eslint-disable-next-line no-loop-func detailsKeys.forEach((detail, index) => { if (detailsOrder[index] !== detail) { - console.log(`Plugin details keys are not in the correct order: '${folder}/${files[i]}' ${detail}`); - process.exit(1); + console.log(chalk.red(`Plugin details keys are not in the correct order: '${folder}/${files[i]}' ${detail}`)); + errorEncountered = true; } }); if (detailsKeys.length < detailsOrder.length) { - console.log(`Plugin details are too few '${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin details are too few '${folder}/${files[i]}'`)); + errorEncountered = true; } if (!['Pre-processing', 'Post-processing'].includes(pluginDetails.Stage)) { - console.log(`Plugin does not have a valid Type'${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin does not have a valid Type'${folder}/${files[i]}'`)); + errorEncountered = true; } if (!['Video', 'Audio', 'Subtitle', 'Any'].includes(pluginDetails.Type)) { - console.log(`Plugin does not have a valid Type'${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin does not have a valid Type'${folder}/${files[i]}'`)); + errorEncountered = true; } if (files[i].split('.js').join('') !== pluginDetails.id) { - console.log(`Plugin file name does not match details id'${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin file name does not match details id'${folder}/${files[i]}'`)); + errorEncountered = true; } if (!['Transcode', 'Filter'].includes(pluginDetails.Operation)) { - console.log(`Plugin does not have a valid Operation '${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin does not have a valid Operation '${folder}/${files[i]}'`)); + errorEncountered = true; } else if (detailsKeys.length > detailsOrder.length) { - console.log(`Plugin details are too many '${folder}/${files[i]}'`); - process.exit(1); + console.log(chalk.red(`Plugin details are too many '${folder}/${files[i]}'`)); + errorEncountered = true; } else if (pluginDetails.Inputs && !Array.isArray(pluginDetails.Inputs)) { // Check default values are set; - console.log(`Plugin Inputs is not an array: ${files[i]}`); - process.exit(1); + console.log(chalk.red(`Plugin Inputs is not an array: ${files[i]}`)); + errorEncountered = true; } else if (pluginDetails.Inputs && Array.isArray(pluginDetails.Inputs)) { const inputs = pluginDetails.Inputs; const savedInputs = {}; for (let j = 0; j < inputs.length; j += 1) { // Prevent duplicate plugin inputs if (savedInputs[inputs[j].name] === true) { - console.log(`Plugin Input already exists: '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input already exists: '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } else { savedInputs[inputs[j].name] = true; } @@ -161,31 +167,31 @@ module.exports.plugin = plugin;`; || inputKeys[3] !== 'inputUI' || inputKeys[4] !== 'tooltip' ) { - console.log(`Plugin Input keys are not in correct order: '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input keys are not in correct order: '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } else if (inputs[j].type === undefined || !pluginInputTypes.includes(inputs[j].type)) { - console.log(`Plugin Input does not have a type: '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input does not have a type: '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } else if ( (inputs[j].type === 'string' && typeof inputs[j].defaultValue !== 'string') || (inputs[j].type === 'number' && typeof inputs[j].defaultValue !== 'number') || (inputs[j].type === 'boolean' && typeof inputs[j].defaultValue !== 'boolean') ) { - console.log(`Plugin Input type does not match defaultValue type: - '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input type does not match defaultValue type: + '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } else if (!['text', 'dropdown'].includes(inputs[j].inputUI.type)) { - console.log(`Plugin Input inputUI is invalid: '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input inputUI is invalid: '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } else if (inputs[j].defaultValue === undefined) { - console.log(`Plugin Input does not have a default value: '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input does not have a default value: '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } const count = read.split(inputs[j].name).length - 1; if (count === 1) { - console.log(`Plugin Input is not used: '${folder}/${files[i]}' : ${inputs[j].name}`); - process.exit(1); + console.log(chalk.red(`Plugin Input is not used: '${folder}/${files[i]}' : ${inputs[j].name}`)); + errorEncountered = true; } } } @@ -195,3 +201,8 @@ module.exports.plugin = plugin;`; }); console.log('Done!'); + +if (errorEncountered) { + console.log('Errors encountered'); + process.exit(1); +} diff --git a/tests/helpers/run.js b/tests/helpers/run.js new file mode 100644 index 0000000..58b6e05 --- /dev/null +++ b/tests/helpers/run.js @@ -0,0 +1,55 @@ +const path = require('path'); +const chai = require('chai'); +const _ = require('lodash'); +const importFresh = require('import-fresh'); + +const scriptName = path.basename(process.mainModule.filename); + +const run = async (tests) => { + try { + for (let i = 0; i < tests.length; i += 1) { + // eslint-disable-next-line no-console + console.log(`${scriptName}: test ${i}`); + const test = tests[i]; + + let testOutput; + let errorEncountered = false; + // eslint-disable-next-line import/no-dynamic-require + const { plugin } = importFresh(`../../Community/${scriptName}`); + + try { + // eslint-disable-next-line no-await-in-loop + testOutput = await plugin( + _.cloneDeep(test.input.file), + _.cloneDeep(test.input.librarySettings), + _.cloneDeep(test.input.inputs), + _.cloneDeep(test.input.otherArguments), + ); + } catch (err1) { + errorEncountered = err1; + } + + if (test.outputModify) { + testOutput = test.outputModify(test.output); + } + + if (test.error && test.error.shouldThrow) { + if (errorEncountered !== false) { + // eslint-disable-next-line no-console + console.log(errorEncountered); + chai.assert.deepEqual(errorEncountered.message, test.output); + } else { + throw new Error('Expected plugin error but none was thrown!'); + } + } else { + chai.assert.deepEqual(testOutput, test.output); + } + } + } catch (err) { + // eslint-disable-next-line no-console + console.error(err); + process.exit(1); + } +}; + +module.exports = run; diff --git a/tests/runTests.js b/tests/runTests.js new file mode 100644 index 0000000..d5d7285 --- /dev/null +++ b/tests/runTests.js @@ -0,0 +1,51 @@ +/* eslint no-console: 0 */ // --> OFF + +const fs = require('fs'); +const chalk = require('chalk'); +const childProcess = require('child_process'); + +const filenames = fs.readdirSync(`${process.cwd()}/Community`).reverse(); + +const run = async () => { + for (let i = 0; i < filenames.length; i += 1) { + const pluginPath = `${process.cwd()}/Community/${filenames[i]}`; + const text = fs.readFileSync(pluginPath); + const pluginTestpath = `${__dirname}/Community/${filenames[i]}`; + + let shouldRunTest = true; + if (!text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) { + console.log(chalk.red(`${filenames[i]} does not have a test but should do.`)); + process.exit(1); + } else if (!text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) { + console.log(chalk.white(`${filenames[i]} running test`)); + } else if (text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) { + console.log(chalk.red(`${filenames[i]} should have // tdarrSkipTest removed`)); + process.exit(1); + } else if (text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) { + console.log(chalk.yellow(`${filenames[i]} skipping tests`)); + shouldRunTest = false; + } + + if (shouldRunTest) { + // eslint-disable-next-line no-await-in-loop + await new Promise((resolve) => { + childProcess.exec(`node "${pluginTestpath}"`, (err, stdout, stderr) => { + if (err) { + console.log(err); + } + console.log(stdout); + console.log(chalk.red(stderr)); + }).on('exit', async (code) => { + if (code !== 0) { + await new Promise((resolve2) => setTimeout(resolve2, 1000)); + process.exit(1); + } else { + resolve(); + } + }); + }); + } + } +}; + +run(); diff --git a/tests/sampleData/media/sampleAAC_1.json b/tests/sampleData/media/sampleAAC_1.json new file mode 100644 index 0000000..81d53e6 --- /dev/null +++ b/tests/sampleData/media/sampleAAC_1.json @@ -0,0 +1,334 @@ +{ + "_id": "C:/Transcode/Source Folder/qsv_h265.mkv", + "file": "C:/Transcode/Source Folder/qsv_h265.mkv", + "DB": "2MY5YD7P8", + "footprintId": "xkZP3IPR6g", + "hasClosedCaptions": false, + "container": "mkv", + "scannerReads": { + "ffProbeRead": "success", + "exiftoolRead": "success", + "mediaInfoRead": "success", + "closedCaptionRead": "\"Unable to run CCExtractor\"" + }, + "ffProbeData": { + "streams": [ + { + "index": 0, + "codec_name": "hevc", + "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)", + "profile": "Main", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1920, + "height": 1080, + "coded_width": 1920, + "coded_height": 1088, + "closed_captions": 0, + "has_b_frames": 1, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": 150, + "color_range": "tv", + "color_space": "bt709", + "color_transfer": "bt709", + "color_primaries": "bt709", + "chroma_location": "left", + "refs": 1, + "r_frame_rate": "25/1", + "avg_frame_rate": "25/1", + "time_base": "1/1000", + "start_pts": 21, + "start_time": "0.021000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "DURATION": "00:00:21.341000000" + } + }, + { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "title": "Stereo", + "DURATION": "00:00:21.375000000" + } + } + ], + "format": { + "filename": "C:/Transcode/Source Folder/qsv_h265.mkv", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "0.000000", + "duration": "21.375000", + "size": "8569883", + "bit_rate": "3207441", + "probe_score": 100, + "tags": { + "creation_time": "2019-09-13T16:46:14.000000Z", + "ENCODER": "Lavf58.20.100" + } + } + }, + "file_size": 8.172877311706543, + "video_resolution": "1080p", + "fileMedium": "video", + "video_codec_name": "hevc", + "audio_codec_name": "", + "lastPluginDetails": "none", + "createdAt": 1653029410394, + "bit_rate": 3207441, + "duration": 21, + "statSync": { + "dev": 3832468976, + "mode": 33060, + "nlink": 1, + "uid": 0, + "gid": 0, + "rdev": 0, + "blksize": 4096, + "ino": 1970324841360027, + "size": 8569883, + "blocks": 16744, + "atimeMs": 1653029410381.1382, + "mtimeMs": 1568393195000, + "ctimeMs": 1650864287188.087, + "birthtimeMs": 1650864302270.2063, + "atime": "2022-05-20T06:50:10.381Z", + "mtime": "2019-09-13T16:46:35.000Z", + "ctime": "2022-04-25T05:24:47.188Z", + "birthtime": "2022-04-25T05:25:02.270Z" + }, + "HealthCheck": "", + "TranscodeDecisionMaker": "", + "lastHealthCheckDate": 0, + "holdUntil": 0, + "lastTranscodeDate": 0, + "bumped": false, + "history": "", + "oldSize": 0, + "newSize": 0, + "videoStreamIndex": 0, + "lastUpdate": 1653027918258, + "meta": { + "SourceFile": "C:/Transcode/Source Folder/qsv_h265.mkv", + "errors": [], + "Duration": 21.375, + "ExifToolVersion": 12.4, + "FileName": "qsv_h265.mkv", + "Directory": "C:/Transcode/Source Folder", + "FileSize": "8.2 MiB", + "FileModifyDate": { + "year": 2019, + "month": 9, + "day": 13, + "hour": 17, + "minute": 46, + "second": 35, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2019:09:13 17:46:35+01:00" + }, + "FileAccessDate": { + "year": 2022, + "month": 5, + "day": 20, + "hour": 7, + "minute": 50, + "second": 9, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:20 07:50:09+01:00" + }, + "FileCreateDate": { + "year": 2022, + "month": 4, + "day": 25, + "hour": 6, + "minute": 25, + "second": 2, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:04:25 06:25:02+01:00" + }, + "FilePermissions": "-r--r--r--", + "FileType": "MKV", + "FileTypeExtension": "mkv", + "MIMEType": "video/x-matroska", + "EBMLVersion": 1, + "EBMLReadVersion": 1, + "DocType": "matroska", + "DocTypeVersion": 4, + "DocTypeReadVersion": 2, + "TimecodeScale": "1 ms", + "MuxingApp": "Lavf58.20.100", + "WritingApp": "HandBrake 1.2.2 2019022300", + "DateTimeOriginal": { + "year": 2019, + "month": 9, + "day": 13, + "hour": 16, + "minute": 46, + "second": 14, + "millisecond": 0, + "tzoffsetMinutes": 0, + "rawValue": "2019:09:13 16:46:14Z" + }, + "VideoFrameRate": 25, + "ImageWidth": 1920, + "ImageHeight": 1080, + "TrackNumber": 2, + "TrackName": "Stereo", + "TrackLanguage": "und", + "CodecID": "A_AAC", + "TrackType": "Audio", + "AudioChannels": 2, + "AudioSampleRate": 48000, + "TagName": "DURATION", + "TagString": "00:00:21.375000000", + "ImageSize": "1920x1080", + "Megapixels": 2.1 + }, + "mediaInfo": { + "@ref": "", + "track": [ + { + "@type": "General", + "UniqueID": "112612991515236890937117095733641799622", + "VideoCount": "1", + "AudioCount": "1", + "Format": "Matroska", + "Format_Version": "4", + "FileSize": "8569883", + "Duration": "21.375", + "OverallBitRate": "3207442", + "FrameRate": "25.000", + "FrameCount": "533", + "IsStreamable": "Yes", + "Encoded_Date": "UTC 2019-09-13 16:46:14", + "Encoded_Application": "HandBrake 1.2.2 2019022300", + "Encoded_Library": "Lavf58.20.100", + "extra": { + "ErrorDetectionType": "Per level 1" + } + }, + { + "@type": "Video", + "StreamOrder": "0", + "ID": "1", + "UniqueID": "1", + "Format": "HEVC", + "Format_Profile": "Main", + "Format_Level": "5", + "Format_Tier": "Main", + "CodecID": "V_MPEGH/ISO/HEVC", + "Duration": "21.320000000", + "Width": "1920", + "Height": "1080", + "Stored_Height": "1088", + "Sampled_Width": "1920", + "Sampled_Height": "1080", + "PixelAspectRatio": "1.000", + "DisplayAspectRatio": "1.778", + "FrameRate_Mode": "CFR", + "FrameRate": "25.000", + "FrameCount": "533", + "ColorSpace": "YUV", + "ChromaSubsampling": "4:2:0", + "BitDepth": "8", + "Delay": "0.021", + "Default": "Yes", + "Forced": "No", + "colour_description_present": "Yes", + "colour_description_present_Source": "Stream", + "colour_range": "Limited", + "colour_range_Source": "Stream", + "colour_primaries": "BT.709", + "colour_primaries_Source": "Stream", + "transfer_characteristics": "BT.709", + "transfer_characteristics_Source": "Stream", + "matrix_coefficients": "BT.709", + "matrix_coefficients_Source": "Stream" + }, + { + "@type": "Audio", + "StreamOrder": "1", + "ID": "2", + "UniqueID": "2", + "Format": "AAC", + "Format_Settings_SBR": "No (Explicit)", + "Format_AdditionalFeatures": "LC", + "CodecID": "A_AAC-2", + "Duration": "21.375000000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "1026000", + "FrameRate": "46.875", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "Title": "Stereo", + "Default": "Yes", + "Forced": "No" + } + ] + } + } \ No newline at end of file diff --git a/tests/sampleData/media/sampleH264_1.json b/tests/sampleData/media/sampleH264_1.json new file mode 100644 index 0000000..9833f8d --- /dev/null +++ b/tests/sampleData/media/sampleH264_1.json @@ -0,0 +1,432 @@ +{ + "_id": "C:/Transcode/Source Folder/SampleVideo_1280x720_1mb.mp4", + "file": "C:/Transcode/Source Folder/SampleVideo_1280x720_1mb.mp4", + "DB": "2MY5YD7P8", + "footprintId": "KA_y0Hm3Ld", + "hasClosedCaptions": false, + "container": "mp4", + "scannerReads": { + "ffProbeRead": "success", + "exiftoolRead": "success", + "mediaInfoRead": "success", + "closedCaptionRead": "\"Unable to run CCExtractor\"" + }, + "ffProbeData": { + "streams": [ + { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "Main", + "codec_type": "video", + "codec_tag_string": "avc1", + "codec_tag": "0x31637661", + "width": 1280, + "height": 720, + "coded_width": 1280, + "coded_height": 720, + "closed_captions": 0, + "has_b_frames": 0, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": 31, + "chroma_location": "left", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "r_frame_rate": "25/1", + "avg_frame_rate": "25/1", + "time_base": "1/12800", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 67584, + "duration": "5.280000", + "bit_rate": "1205959", + "bits_per_raw_sample": "8", + "nb_frames": "132", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "creation_time": "1970-01-01T00:00:00.000000Z", + "language": "und", + "handler_name": "VideoHandler", + "vendor_id": "[0][0][0][0]" + } + }, + { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "mp4a", + "codec_tag": "0x6134706d", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 6, + "channel_layout": "5.1", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/48000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 254976, + "duration": "5.312000", + "bit_rate": "384828", + "nb_frames": "249", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "creation_time": "1970-01-01T00:00:00.000000Z", + "language": "und", + "handler_name": "SoundHandler", + "vendor_id": "[0][0][0][0]" + } + } + ], + "format": { + "filename": "C:/Transcode/Source Folder/SampleVideo_1280x720_1mb.mp4", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "mov,mp4,m4a,3gp,3g2,mj2", + "format_long_name": "QuickTime / MOV", + "start_time": "0.000000", + "duration": "5.312000", + "size": "1056519", + "bit_rate": "1591143", + "probe_score": 100, + "tags": { + "major_brand": "isom", + "minor_version": "512", + "compatible_brands": "isomiso2avc1mp41", + "creation_time": "1970-01-08T00:00:00.000000Z", + "encoder": "Lavf53.24.2", + "title": "Sample title test", + "composer": "th", + "date": "2018", + "genre": "this", + "artist": "hhj", + "comment": "hhk" + } + } + }, + "file_size": 1.0075750350952148, + "video_resolution": "720p", + "fileMedium": "video", + "video_codec_name": "h264", + "audio_codec_name": "", + "lastPluginDetails": "none", + "createdAt": 1653029288316, + "bit_rate": 1591143, + "duration": 5, + "statSync": { + "dev": 3832468976, + "mode": 33060, + "nlink": 1, + "uid": 0, + "gid": 0, + "rdev": 0, + "blksize": 4096, + "ino": 1688849864649366, + "size": 1056519, + "blocks": 2064, + "atimeMs": 1653029288299.0342, + "mtimeMs": 1569306262000, + "ctimeMs": 1650864287160.0793, + "birthtimeMs": 1652683715285.7583, + "atime": "2022-05-20T06:48:08.299Z", + "mtime": "2019-09-24T06:24:22.000Z", + "ctime": "2022-04-25T05:24:47.160Z", + "birthtime": "2022-05-16T06:48:35.286Z" + }, + "HealthCheck": "", + "TranscodeDecisionMaker": "", + "lastHealthCheckDate": 0, + "holdUntil": 0, + "lastTranscodeDate": 0, + "bumped": false, + "history": "", + "oldSize": 0, + "newSize": 0, + "videoStreamIndex": 0, + "lastUpdate": 1653028721083, + "meta": { + "SourceFile": "C:/Transcode/Source Folder/SampleVideo_1280x720_1mb.mp4", + "errors": [], + "Duration": 5.312, + "PreviewDuration": 0, + "SelectionDuration": 0, + "TrackDuration": 5.28, + "MediaDuration": 5.28, + "ExifToolVersion": 12.4, + "FileName": "SampleVideo_1280x720_1mb.mp4", + "Directory": "C:/Transcode/Source Folder", + "FileSize": "1032 KiB", + "FileModifyDate": { + "year": 2019, + "month": 9, + "day": 24, + "hour": 7, + "minute": 24, + "second": 22, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2019:09:24 07:24:22+01:00" + }, + "FileAccessDate": { + "year": 2022, + "month": 5, + "day": 20, + "hour": 7, + "minute": 48, + "second": 6, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:20 07:48:06+01:00" + }, + "FileCreateDate": { + "year": 2022, + "month": 5, + "day": 16, + "hour": 7, + "minute": 48, + "second": 35, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:16 07:48:35+01:00" + }, + "FilePermissions": "-r--r--r--", + "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" + ], + "MediaDataSize": 0, + "MediaDataOffset": 1051515, + "MovieHeaderVersion": 0, + "CreateDate": { + "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, + "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, + "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": "Lavf53.24.2", + "Title": "Sample title test", + "Composer": "th", + "BeatsPerMinute": 0, + "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", + "Megapixels": 0.922, + "AvgBitrate": "1.58 Mbps", + "Rotation": 0 + }, + "mediaInfo": { + "@ref": "", + "track": [ + { + "@type": "General", + "VideoCount": "1", + "AudioCount": "1", + "Format": "MPEG-4", + "Format_Profile": "Base Media", + "CodecID": "isom", + "CodecID_Compatible": "isom/iso2/avc1/mp41", + "FileSize": "1056519", + "Duration": "5.312", + "OverallBitRate_Mode": "VBR", + "OverallBitRate": "1591143", + "FrameRate": "25.000", + "FrameCount": "132", + "StreamSize": "5060", + "HeaderSize": "40", + "DataSize": "1051467", + "FooterSize": "5012", + "IsStreamable": "No", + "Title": "Sample title test", + "Movie": "Sample title test", + "Performer": "hhj", + "Composer": "th", + "Genre": "this", + "Recorded_Date": "2018", + "Encoded_Date": "UTC 1970-01-08 00:00:00", + "Tagged_Date": "UTC 2014-07-19 17:15:29", + "Encoded_Application": "Lavf53.24.2", + "Comment": "hhk" + }, + { + "@type": "Video", + "StreamOrder": "0", + "ID": "1", + "Format": "AVC", + "Format_Profile": "Main", + "Format_Level": "3.1", + "Format_Settings_CABAC": "Yes", + "Format_Settings_RefFrames": "1", + "CodecID": "avc1", + "Duration": "5.280", + "BitRate": "1205959", + "Width": "1280", + "Height": "720", + "Sampled_Width": "1280", + "Sampled_Height": "720", + "PixelAspectRatio": "1.000", + "DisplayAspectRatio": "1.778", + "Rotation": "0.000", + "FrameRate_Mode": "CFR", + "FrameRate_Mode_Original": "VFR", + "FrameRate": "25.000", + "FrameCount": "132", + "ColorSpace": "YUV", + "ChromaSubsampling": "4:2:0", + "BitDepth": "8", + "ScanType": "Progressive", + "StreamSize": "795933", + "Encoded_Date": "UTC 1970-01-01 00:00:00", + "Tagged_Date": "UTC 1970-01-01 00:00:00", + "extra": { + "CodecConfigurationBox": "avcC" + } + }, + { + "@type": "Audio", + "StreamOrder": "1", + "ID": "2", + "Format": "AAC", + "Format_AdditionalFeatures": "LC", + "CodecID": "mp4a-40-2", + "Duration": "5.312", + "BitRate_Mode": "VBR", + "BitRate": "384000", + "BitRate_Maximum": "400392", + "Channels": "6", + "ChannelPositions": "Front: L C R, Side: L R, LFE", + "ChannelLayout": "C L R Ls Rs LFE", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "254976", + "FrameRate": "46.875", + "FrameCount": "249", + "Compression_Mode": "Lossy", + "StreamSize": "255526", + "StreamSize_Proportion": "0.24186", + "Default": "Yes", + "AlternateGroup": "1", + "Encoded_Date": "UTC 1970-01-01 00:00:00", + "Tagged_Date": "UTC 1970-01-01 00:00:00" + } + ] + } + } \ No newline at end of file diff --git a/tests/sampleData/media/sampleH264_2.json b/tests/sampleData/media/sampleH264_2.json new file mode 100644 index 0000000..7ad301b --- /dev/null +++ b/tests/sampleData/media/sampleH264_2.json @@ -0,0 +1,775 @@ +{ + "_id": "C:/Transcode/Source Folder/h264.mkv", + "file": "C:/Transcode/Source Folder/h264.mkv", + "DB": "2MY5YD7P8", + "footprintId": "asxmr-5Iij", + "hasClosedCaptions": false, + "container": "mkv", + "scannerReads": { + "ffProbeRead": "success", + "exiftoolRead": "success", + "mediaInfoRead": "success", + "closedCaptionRead": "success" + }, + "ffProbeData": { + "streams": [ + { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1918, + "height": 1080, + "coded_width": 1918, + "coded_height": 1080, + "closed_captions": 0, + "has_b_frames": 2, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "959:540", + "pix_fmt": "yuv420p", + "level": 41, + "color_range": "tv", + "color_space": "bt709", + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "r_frame_rate": "25/1", + "avg_frame_rate": "25/1", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bits_per_raw_sample": "8", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "fre", + "title": "title video", + "BPS-eng": "6453995", + "DURATION-eng": "00:01:03.960000000", + "NUMBER_OF_FRAMES-eng": "1599", + "NUMBER_OF_BYTES-eng": "51599695", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "DURATION": "00:01:03.986000000" + } + }, + { + "index": 1, + "codec_name": "flac", + "codec_long_name": "FLAC (Free Lossless Audio Codec)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "s32", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 5, + "start_time": "0.005000", + "bits_per_raw_sample": "24", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 flac", + "DURATION": "00:01:04.005000000" + } + }, + { + "index": 2, + "codec_name": "ac3", + "codec_long_name": "ATSC A/52A (AC-3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "192000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 ac3", + "DURATION": "00:01:04.000000000" + } + }, + { + "index": 3, + "codec_name": "eac3", + "codec_long_name": "ATSC A/52B (AC-3, E-AC-3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "192000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 eac3", + "DURATION": "00:01:04.000000000" + } + }, + { + "index": 4, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 5, + "start_time": "0.005000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "fre", + "title": "Français E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 aac", + "DURATION": "00:01:04.004000000" + } + }, + { + "index": 5, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 5, + "start_time": "0.005000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 aac", + "DURATION": "00:01:04.004000000" + } + }, + { + "index": 6, + "codec_name": "subrip", + "codec_long_name": "SubRip subtitle", + "codec_type": "subtitle", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 66031, + "duration": "66.031000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "fre", + "title": "Français", + "BPS-eng": "46", + "DURATION-eng": "00:01:05.840000000", + "NUMBER_OF_FRAMES-eng": "12", + "NUMBER_OF_BYTES-eng": "381", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "DURATION": "00:01:06.031000000" + } + } + ], + "format": { + "filename": "C:/Transcode/Source Folder/h264.mkv", + "nb_streams": 7, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "0.000000", + "duration": "66.031000", + "size": "68084120", + "bit_rate": "8248746", + "probe_score": 100, + "tags": { + "ENCODER": "Lavf58.24.101" + } + } + }, + "file_size": 64.9300765991211, + "video_resolution": "1080p", + "fileMedium": "video", + "video_codec_name": "h264", + "audio_codec_name": "", + "lastPluginDetails": "none", + "createdAt": 1653139154025, + "bit_rate": 8248746, + "duration": 66, + "statSync": { + "dev": 3832468976, + "mode": 33206, + "nlink": 1, + "uid": 0, + "gid": 0, + "rdev": 0, + "blksize": 4096, + "ino": 64176294690080990, + "size": 68084120, + "blocks": 132984, + "atimeMs": 1653139154001.7666, + "mtimeMs": 1594420078270.8928, + "ctimeMs": 1653139134390.225, + "birthtimeMs": 1653139123219.1018, + "atime": "2022-05-21T13:19:14.002Z", + "mtime": "2020-07-10T22:27:58.271Z", + "ctime": "2022-05-21T13:18:54.390Z", + "birthtime": "2022-05-21T13:18:43.219Z" + }, + "HealthCheck": "", + "TranscodeDecisionMaker": "", + "lastHealthCheckDate": 0, + "holdUntil": 0, + "lastTranscodeDate": 0, + "bumped": false, + "history": "", + "oldSize": 0, + "newSize": 0, + "videoStreamIndex": 0, + "meta": { + "SourceFile": "C:/Transcode/Source Folder/h264.mkv", + "errors": [], + "Duration": 66.031, + "ExifToolVersion": 12.4, + "FileName": "h264.mkv", + "Directory": "C:/Transcode/Source Folder", + "FileSize": "65 MiB", + "FileModifyDate": { + "year": 2020, + "month": 7, + "day": 10, + "hour": 23, + "minute": 27, + "second": 58, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2020:07:10 23:27:58+01:00" + }, + "FileAccessDate": { + "year": 2022, + "month": 5, + "day": 21, + "hour": 14, + "minute": 19, + "second": 11, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:21 14:19:11+01:00" + }, + "FileCreateDate": { + "year": 2022, + "month": 5, + "day": 21, + "hour": 14, + "minute": 18, + "second": 43, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:21 14:18:43+01:00" + }, + "FilePermissions": "-rw-rw-rw-", + "FileType": "MKV", + "FileTypeExtension": "mkv", + "MIMEType": "video/x-matroska", + "EBMLVersion": 1, + "EBMLReadVersion": 1, + "DocType": "matroska", + "DocTypeVersion": 4, + "DocTypeReadVersion": 2, + "TimecodeScale": "1 ms", + "MuxingApp": "Lavf58.24.101", + "WritingApp": "Lavf58.24.101", + "VideoFrameRate": 25, + "ImageWidth": 1918, + "ImageHeight": 1080, + "VideoScanType": "Unknown (2)", + "AudioChannels": 2, + "AudioSampleRate": 48000, + "AudioBitsPerSample": 32, + "TrackNumber": 7, + "TrackName": "Français", + "TrackLanguage": "fre", + "TrackDefault": "No", + "CodecID": "S_TEXT/UTF8", + "TrackType": "Subtitle", + "TagLanguage": "eng", + "TagName": "DURATION", + "TagString": "00:01:06.031000000", + "ImageSize": "1918x1080", + "Megapixels": 2.1 + }, + "mediaInfo": { + "@ref": "", + "track": [ + { + "@type": "General", + "UniqueID": "191657682055212276795239999260924509108", + "VideoCount": "1", + "AudioCount": "5", + "TextCount": "1", + "Format": "Matroska", + "Format_Version": "4", + "FileSize": "68084120", + "Duration": "66.031", + "OverallBitRate_Mode": "VBR", + "OverallBitRate": "8248746", + "FrameRate": "25.000", + "FrameCount": "1599", + "StreamSize": "12645964", + "IsStreamable": "Yes", + "Encoded_Application": "Lavf58.24.101", + "Encoded_Library": "Lavf58.24.101", + "extra": { + "ErrorDetectionType": "Per level 1" + } + }, + { + "@type": "Video", + "StreamOrder": "0", + "ID": "1", + "UniqueID": "1", + "Format": "AVC", + "Format_Profile": "High", + "Format_Level": "4.1", + "Format_Settings_CABAC": "Yes", + "Format_Settings_RefFrames": "4", + "CodecID": "V_MPEG4/ISO/AVC", + "Duration": "63.986000000", + "BitRate": "6453995", + "Width": "1918", + "Height": "1080", + "Stored_Width": "1920", + "Stored_Height": "1088", + "Sampled_Width": "1918", + "Sampled_Height": "1080", + "PixelAspectRatio": "1.000", + "DisplayAspectRatio": "1.776", + "FrameRate_Mode": "VFR", + "FrameRate": "25.000", + "FrameCount": "1599", + "ColorSpace": "YUV", + "ChromaSubsampling": "4:2:0", + "BitDepth": "8", + "ScanType": "Progressive", + "Delay": "0.000", + "StreamSize": "51599695", + "Title": "title video", + "Language": "fr", + "Default": "Yes", + "Forced": "No", + "colour_description_present": "Yes", + "colour_description_present_Source": "Container / Stream", + "colour_range": "Limited", + "colour_range_Source": "Container / Stream", + "colour_primaries_Source": "Stream", + "transfer_characteristics_Source": "Stream", + "matrix_coefficients": "BT.709", + "matrix_coefficients_Source": "Container / Stream" + }, + { + "@type": "Audio", + "@typeorder": "1", + "StreamOrder": "1", + "ID": "2", + "UniqueID": "2", + "Format": "FLAC", + "CodecID": "A_FLAC", + "Duration": "64.005000000", + "BitRate_Mode": "VBR", + "BitRate": "96000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1537", + "SamplingRate": "48000", + "SamplingCount": "3072240", + "FrameRate": "31.232", + "FrameCount": "1999", + "BitDepth": "24", + "Compression_Mode": "Lossless", + "Delay": "0.005", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 flac", + "Language": "en", + "Default": "No", + "Forced": "No" + }, + { + "@type": "Audio", + "@typeorder": "2", + "StreamOrder": "2", + "ID": "3", + "UniqueID": "3", + "Format": "AC-3", + "Format_Commercial_IfAny": "Dolby Digital", + "Format_Settings_Endianness": "Big", + "CodecID": "A_AC3", + "Duration": "64.000000000", + "BitRate_Mode": "CBR", + "BitRate": "192000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1536", + "SamplingRate": "48000", + "SamplingCount": "3072000", + "FrameRate": "31.250", + "FrameCount": "1999", + "BitDepth": "32", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 ac3", + "Language": "en", + "ServiceKind": "CM", + "Default": "No", + "Forced": "No", + "extra": { + "bsid": "8", + "dialnorm": "-31", + "dsurmod": "0", + "acmod": "2", + "lfeon": "0", + "dialnorm_Average": "-31", + "dialnorm_Minimum": "-31" + } + }, + { + "@type": "Audio", + "@typeorder": "3", + "StreamOrder": "3", + "ID": "4", + "UniqueID": "4", + "Format": "E-AC-3", + "Format_Commercial_IfAny": "Dolby Digital Plus", + "Format_Settings_Endianness": "Big", + "CodecID": "A_EAC3", + "Duration": "64.000000000", + "BitRate_Mode": "CBR", + "BitRate": "192000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1536", + "SamplingRate": "48000", + "SamplingCount": "3072000", + "FrameRate": "31.250", + "FrameCount": "1999", + "BitDepth": "32", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 eac3", + "Language": "en", + "ServiceKind": "CM", + "Default": "No", + "Forced": "No", + "extra": { + "bsid": "16", + "dialnorm": "-31", + "dsurmod": "0", + "acmod": "2", + "lfeon": "0", + "dialnorm_Average": "-31", + "dialnorm_Minimum": "-31" + } + }, + { + "@type": "Audio", + "@typeorder": "4", + "StreamOrder": "4", + "ID": "5", + "UniqueID": "5", + "Format": "AAC", + "Format_Settings_SBR": "No (Explicit)", + "Format_AdditionalFeatures": "LC", + "CodecID": "A_AAC-2", + "Duration": "64.004000000", + "BitRate": "96000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "3072192", + "FrameRate": "46.875", + "FrameCount": "1999", + "Compression_Mode": "Lossy", + "Delay": "0.005", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Français E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 aac", + "Language": "fr", + "Default": "Yes", + "Forced": "No" + }, + { + "@type": "Audio", + "@typeorder": "5", + "StreamOrder": "5", + "ID": "6", + "UniqueID": "6", + "Format": "AAC", + "Format_Settings_SBR": "No (Explicit)", + "Format_AdditionalFeatures": "LC", + "CodecID": "A_AAC-2", + "Duration": "64.004000000", + "BitRate": "96000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "3072192", + "FrameRate": "46.875", + "FrameCount": "1999", + "Compression_Mode": "Lossy", + "Delay": "0.005", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 aac", + "Language": "en", + "Default": "No", + "Forced": "No" + }, + { + "@type": "Text", + "StreamOrder": "6", + "ID": "7", + "UniqueID": "7", + "Format": "UTF-8", + "CodecID": "S_TEXT/UTF8", + "Duration": "66.031000000", + "BitRate": "46", + "FrameRate": "0.182", + "FrameCount": "12", + "ElementCount": "12", + "StreamSize": "381", + "Title": "Français", + "Language": "fr", + "Default": "No", + "Forced": "No" + } + ] + } +} \ No newline at end of file diff --git a/tests/sampleData/media/sampleH264_3.json b/tests/sampleData/media/sampleH264_3.json new file mode 100644 index 0000000..13ed394 --- /dev/null +++ b/tests/sampleData/media/sampleH264_3.json @@ -0,0 +1,821 @@ +{ + "_id": "C:/Transcode/Source Folder/h264.mkv", + "file": "C:/Transcode/Source Folder/h264.mkv", + "DB": "2MY5YD7P8", + "footprintId": "asxmr-5Iij", + "hasClosedCaptions": false, + "container": "mkv", + "scannerReads": { + "ffProbeRead": "success", + "exiftoolRead": "success", + "mediaInfoRead": "success", + "closedCaptionRead": "success" + }, + "ffProbeData": { + "streams": [ + { + "index": 0, + "codec_name": "h264", + "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", + "profile": "High", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1918, + "height": 1080, + "coded_width": 1918, + "coded_height": 1080, + "closed_captions": 0, + "has_b_frames": 2, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "959:540", + "pix_fmt": "yuv420p", + "level": 41, + "color_range": "tv", + "color_space": "bt709", + "chroma_location": "left", + "field_order": "progressive", + "refs": 1, + "is_avc": "true", + "nal_length_size": "4", + "r_frame_rate": "25/1", + "avg_frame_rate": "25/1", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bits_per_raw_sample": "8", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "fre", + "title": "title video", + "BPS-eng": "6453995", + "DURATION-eng": "00:01:03.960000000", + "NUMBER_OF_FRAMES-eng": "1599", + "NUMBER_OF_BYTES-eng": "51599695", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "DURATION": "00:01:03.986000000" + } + }, + { + "index": 1, + "codec_name": "flac", + "codec_long_name": "FLAC (Free Lossless Audio Codec)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "s32", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 5, + "start_time": "0.005000", + "bits_per_raw_sample": "24", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 flac", + "DURATION": "00:01:04.005000000" + } + }, + { + "index": 2, + "codec_name": "ac3", + "codec_long_name": "ATSC A/52A (AC-3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "192000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 ac3", + "DURATION": "00:01:04.000000000" + } + }, + { + "index": 3, + "codec_name": "eac3", + "codec_long_name": "ATSC A/52B (AC-3, E-AC-3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "192000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 eac3", + "DURATION": "00:01:04.000000000" + } + }, + { + "index": 4, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 5, + "start_time": "0.005000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "fre", + "title": "Français E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 aac", + "DURATION": "00:01:04.004000000" + } + }, + { + "index": 5, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 5, + "start_time": "0.005000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "eng", + "title": "Anglais E-AC3 2.0", + "BPS-eng": "96000", + "DURATION-eng": "00:01:03.968000000", + "NUMBER_OF_FRAMES-eng": "1999", + "NUMBER_OF_BYTES-eng": "767616", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "ENCODER": "Lavc58.42.102 aac", + "DURATION": "00:01:04.004000000" + } + }, + { + "index": 6, + "codec_name": "subrip", + "codec_long_name": "SubRip subtitle", + "codec_type": "subtitle", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 66031, + "duration": "66.031000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "en", + "title": "Français", + "BPS-eng": "46", + "DURATION-eng": "00:01:05.840000000", + "NUMBER_OF_FRAMES-eng": "12", + "NUMBER_OF_BYTES-eng": "381", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "DURATION": "00:01:06.031000000" + } + }, + { + "index": 7, + "codec_name": "subrip", + "codec_long_name": "SubRip subtitle", + "codec_type": "subtitle", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "duration_ts": 66031, + "duration": "66.031000", + "disposition": { + "default": 0, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "language": "fre", + "title": "Français", + "BPS-eng": "46", + "DURATION-eng": "00:01:05.840000000", + "NUMBER_OF_FRAMES-eng": "12", + "NUMBER_OF_BYTES-eng": "381", + "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", + "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", + "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", + "DURATION": "00:01:06.031000000" + } + } + ], + "format": { + "filename": "C:/Transcode/Source Folder/h264.mkv", + "nb_streams": 7, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "0.000000", + "duration": "66.031000", + "size": "68084120", + "bit_rate": "8248746", + "probe_score": 100, + "tags": { + "ENCODER": "Lavf58.24.101" + } + } + }, + "file_size": 64.9300765991211, + "video_resolution": "1080p", + "fileMedium": "video", + "video_codec_name": "h264", + "audio_codec_name": "", + "lastPluginDetails": "none", + "createdAt": 1653139154025, + "bit_rate": 8248746, + "duration": 66, + "statSync": { + "dev": 3832468976, + "mode": 33206, + "nlink": 1, + "uid": 0, + "gid": 0, + "rdev": 0, + "blksize": 4096, + "ino": 64176294690080990, + "size": 68084120, + "blocks": 132984, + "atimeMs": 1653139154001.7666, + "mtimeMs": 1594420078270.8928, + "ctimeMs": 1653139134390.225, + "birthtimeMs": 1653139123219.1018, + "atime": "2022-05-21T13:19:14.002Z", + "mtime": "2020-07-10T22:27:58.271Z", + "ctime": "2022-05-21T13:18:54.390Z", + "birthtime": "2022-05-21T13:18:43.219Z" + }, + "HealthCheck": "", + "TranscodeDecisionMaker": "", + "lastHealthCheckDate": 0, + "holdUntil": 0, + "lastTranscodeDate": 0, + "bumped": false, + "history": "", + "oldSize": 0, + "newSize": 0, + "videoStreamIndex": 0, + "meta": { + "SourceFile": "C:/Transcode/Source Folder/h264.mkv", + "errors": [], + "Duration": 66.031, + "ExifToolVersion": 12.4, + "FileName": "h264.mkv", + "Directory": "C:/Transcode/Source Folder", + "FileSize": "65 MiB", + "FileModifyDate": { + "year": 2020, + "month": 7, + "day": 10, + "hour": 23, + "minute": 27, + "second": 58, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2020:07:10 23:27:58+01:00" + }, + "FileAccessDate": { + "year": 2022, + "month": 5, + "day": 21, + "hour": 14, + "minute": 19, + "second": 11, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:21 14:19:11+01:00" + }, + "FileCreateDate": { + "year": 2022, + "month": 5, + "day": 21, + "hour": 14, + "minute": 18, + "second": 43, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:21 14:18:43+01:00" + }, + "FilePermissions": "-rw-rw-rw-", + "FileType": "MKV", + "FileTypeExtension": "mkv", + "MIMEType": "video/x-matroska", + "EBMLVersion": 1, + "EBMLReadVersion": 1, + "DocType": "matroska", + "DocTypeVersion": 4, + "DocTypeReadVersion": 2, + "TimecodeScale": "1 ms", + "MuxingApp": "Lavf58.24.101", + "WritingApp": "Lavf58.24.101", + "VideoFrameRate": 25, + "ImageWidth": 1918, + "ImageHeight": 1080, + "VideoScanType": "Unknown (2)", + "AudioChannels": 2, + "AudioSampleRate": 48000, + "AudioBitsPerSample": 32, + "TrackNumber": 7, + "TrackName": "Français", + "TrackLanguage": "fre", + "TrackDefault": "No", + "CodecID": "S_TEXT/UTF8", + "TrackType": "Subtitle", + "TagLanguage": "eng", + "TagName": "DURATION", + "TagString": "00:01:06.031000000", + "ImageSize": "1918x1080", + "Megapixels": 2.1 + }, + "mediaInfo": { + "@ref": "", + "track": [ + { + "@type": "General", + "UniqueID": "191657682055212276795239999260924509108", + "VideoCount": "1", + "AudioCount": "5", + "TextCount": "1", + "Format": "Matroska", + "Format_Version": "4", + "FileSize": "68084120", + "Duration": "66.031", + "OverallBitRate_Mode": "VBR", + "OverallBitRate": "8248746", + "FrameRate": "25.000", + "FrameCount": "1599", + "StreamSize": "12645964", + "IsStreamable": "Yes", + "Encoded_Application": "Lavf58.24.101", + "Encoded_Library": "Lavf58.24.101", + "extra": { + "ErrorDetectionType": "Per level 1" + } + }, + { + "@type": "Video", + "StreamOrder": "0", + "ID": "1", + "UniqueID": "1", + "Format": "AVC", + "Format_Profile": "High", + "Format_Level": "4.1", + "Format_Settings_CABAC": "Yes", + "Format_Settings_RefFrames": "4", + "CodecID": "V_MPEG4/ISO/AVC", + "Duration": "63.986000000", + "BitRate": "6453995", + "Width": "1918", + "Height": "1080", + "Stored_Width": "1920", + "Stored_Height": "1088", + "Sampled_Width": "1918", + "Sampled_Height": "1080", + "PixelAspectRatio": "1.000", + "DisplayAspectRatio": "1.776", + "FrameRate_Mode": "VFR", + "FrameRate": "25.000", + "FrameCount": "1599", + "ColorSpace": "YUV", + "ChromaSubsampling": "4:2:0", + "BitDepth": "8", + "ScanType": "Progressive", + "Delay": "0.000", + "StreamSize": "51599695", + "Title": "title video", + "Language": "fr", + "Default": "Yes", + "Forced": "No", + "colour_description_present": "Yes", + "colour_description_present_Source": "Container / Stream", + "colour_range": "Limited", + "colour_range_Source": "Container / Stream", + "colour_primaries_Source": "Stream", + "transfer_characteristics_Source": "Stream", + "matrix_coefficients": "BT.709", + "matrix_coefficients_Source": "Container / Stream" + }, + { + "@type": "Audio", + "@typeorder": "1", + "StreamOrder": "1", + "ID": "2", + "UniqueID": "2", + "Format": "FLAC", + "CodecID": "A_FLAC", + "Duration": "64.005000000", + "BitRate_Mode": "VBR", + "BitRate": "96000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1537", + "SamplingRate": "48000", + "SamplingCount": "3072240", + "FrameRate": "31.232", + "FrameCount": "1999", + "BitDepth": "24", + "Compression_Mode": "Lossless", + "Delay": "0.005", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 flac", + "Language": "en", + "Default": "No", + "Forced": "No" + }, + { + "@type": "Audio", + "@typeorder": "2", + "StreamOrder": "2", + "ID": "3", + "UniqueID": "3", + "Format": "AC-3", + "Format_Commercial_IfAny": "Dolby Digital", + "Format_Settings_Endianness": "Big", + "CodecID": "A_AC3", + "Duration": "64.000000000", + "BitRate_Mode": "CBR", + "BitRate": "192000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1536", + "SamplingRate": "48000", + "SamplingCount": "3072000", + "FrameRate": "31.250", + "FrameCount": "1999", + "BitDepth": "32", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 ac3", + "Language": "en", + "ServiceKind": "CM", + "Default": "No", + "Forced": "No", + "extra": { + "bsid": "8", + "dialnorm": "-31", + "dsurmod": "0", + "acmod": "2", + "lfeon": "0", + "dialnorm_Average": "-31", + "dialnorm_Minimum": "-31" + } + }, + { + "@type": "Audio", + "@typeorder": "3", + "StreamOrder": "3", + "ID": "4", + "UniqueID": "4", + "Format": "E-AC-3", + "Format_Commercial_IfAny": "Dolby Digital Plus", + "Format_Settings_Endianness": "Big", + "CodecID": "A_EAC3", + "Duration": "64.000000000", + "BitRate_Mode": "CBR", + "BitRate": "192000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1536", + "SamplingRate": "48000", + "SamplingCount": "3072000", + "FrameRate": "31.250", + "FrameCount": "1999", + "BitDepth": "32", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 eac3", + "Language": "en", + "ServiceKind": "CM", + "Default": "No", + "Forced": "No", + "extra": { + "bsid": "16", + "dialnorm": "-31", + "dsurmod": "0", + "acmod": "2", + "lfeon": "0", + "dialnorm_Average": "-31", + "dialnorm_Minimum": "-31" + } + }, + { + "@type": "Audio", + "@typeorder": "4", + "StreamOrder": "4", + "ID": "5", + "UniqueID": "5", + "Format": "AAC", + "Format_Settings_SBR": "No (Explicit)", + "Format_AdditionalFeatures": "LC", + "CodecID": "A_AAC-2", + "Duration": "64.004000000", + "BitRate": "96000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "3072192", + "FrameRate": "46.875", + "FrameCount": "1999", + "Compression_Mode": "Lossy", + "Delay": "0.005", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Français E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 aac", + "Language": "fr", + "Default": "Yes", + "Forced": "No" + }, + { + "@type": "Audio", + "@typeorder": "5", + "StreamOrder": "5", + "ID": "6", + "UniqueID": "6", + "Format": "AAC", + "Format_Settings_SBR": "No (Explicit)", + "Format_AdditionalFeatures": "LC", + "CodecID": "A_AAC-2", + "Duration": "64.004000000", + "BitRate": "96000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "3072192", + "FrameRate": "46.875", + "FrameCount": "1999", + "Compression_Mode": "Lossy", + "Delay": "0.005", + "Delay_Source": "Container", + "StreamSize": "767616", + "StreamSize_Proportion": "0.01127", + "Title": "Anglais E-AC3 2.0", + "Encoded_Library": "Lavc58.42.102 aac", + "Language": "en", + "Default": "No", + "Forced": "No" + }, + { + "@type": "Text", + "StreamOrder": "6", + "ID": "7", + "UniqueID": "7", + "Format": "UTF-8", + "CodecID": "S_TEXT/UTF8", + "Duration": "66.031000000", + "BitRate": "46", + "FrameRate": "0.182", + "FrameCount": "12", + "ElementCount": "12", + "StreamSize": "381", + "Title": "Français", + "Language": "fr", + "Default": "No", + "Forced": "No" + } + ] + } +} \ No newline at end of file diff --git a/tests/sampleData/media/sampleH265_1.json b/tests/sampleData/media/sampleH265_1.json new file mode 100644 index 0000000..81d53e6 --- /dev/null +++ b/tests/sampleData/media/sampleH265_1.json @@ -0,0 +1,334 @@ +{ + "_id": "C:/Transcode/Source Folder/qsv_h265.mkv", + "file": "C:/Transcode/Source Folder/qsv_h265.mkv", + "DB": "2MY5YD7P8", + "footprintId": "xkZP3IPR6g", + "hasClosedCaptions": false, + "container": "mkv", + "scannerReads": { + "ffProbeRead": "success", + "exiftoolRead": "success", + "mediaInfoRead": "success", + "closedCaptionRead": "\"Unable to run CCExtractor\"" + }, + "ffProbeData": { + "streams": [ + { + "index": 0, + "codec_name": "hevc", + "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)", + "profile": "Main", + "codec_type": "video", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "width": 1920, + "height": 1080, + "coded_width": 1920, + "coded_height": 1088, + "closed_captions": 0, + "has_b_frames": 1, + "sample_aspect_ratio": "1:1", + "display_aspect_ratio": "16:9", + "pix_fmt": "yuv420p", + "level": 150, + "color_range": "tv", + "color_space": "bt709", + "color_transfer": "bt709", + "color_primaries": "bt709", + "chroma_location": "left", + "refs": 1, + "r_frame_rate": "25/1", + "avg_frame_rate": "25/1", + "time_base": "1/1000", + "start_pts": 21, + "start_time": "0.021000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "DURATION": "00:00:21.341000000" + } + }, + { + "index": 1, + "codec_name": "aac", + "codec_long_name": "AAC (Advanced Audio Coding)", + "profile": "LC", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "title": "Stereo", + "DURATION": "00:00:21.375000000" + } + } + ], + "format": { + "filename": "C:/Transcode/Source Folder/qsv_h265.mkv", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "0.000000", + "duration": "21.375000", + "size": "8569883", + "bit_rate": "3207441", + "probe_score": 100, + "tags": { + "creation_time": "2019-09-13T16:46:14.000000Z", + "ENCODER": "Lavf58.20.100" + } + } + }, + "file_size": 8.172877311706543, + "video_resolution": "1080p", + "fileMedium": "video", + "video_codec_name": "hevc", + "audio_codec_name": "", + "lastPluginDetails": "none", + "createdAt": 1653029410394, + "bit_rate": 3207441, + "duration": 21, + "statSync": { + "dev": 3832468976, + "mode": 33060, + "nlink": 1, + "uid": 0, + "gid": 0, + "rdev": 0, + "blksize": 4096, + "ino": 1970324841360027, + "size": 8569883, + "blocks": 16744, + "atimeMs": 1653029410381.1382, + "mtimeMs": 1568393195000, + "ctimeMs": 1650864287188.087, + "birthtimeMs": 1650864302270.2063, + "atime": "2022-05-20T06:50:10.381Z", + "mtime": "2019-09-13T16:46:35.000Z", + "ctime": "2022-04-25T05:24:47.188Z", + "birthtime": "2022-04-25T05:25:02.270Z" + }, + "HealthCheck": "", + "TranscodeDecisionMaker": "", + "lastHealthCheckDate": 0, + "holdUntil": 0, + "lastTranscodeDate": 0, + "bumped": false, + "history": "", + "oldSize": 0, + "newSize": 0, + "videoStreamIndex": 0, + "lastUpdate": 1653027918258, + "meta": { + "SourceFile": "C:/Transcode/Source Folder/qsv_h265.mkv", + "errors": [], + "Duration": 21.375, + "ExifToolVersion": 12.4, + "FileName": "qsv_h265.mkv", + "Directory": "C:/Transcode/Source Folder", + "FileSize": "8.2 MiB", + "FileModifyDate": { + "year": 2019, + "month": 9, + "day": 13, + "hour": 17, + "minute": 46, + "second": 35, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2019:09:13 17:46:35+01:00" + }, + "FileAccessDate": { + "year": 2022, + "month": 5, + "day": 20, + "hour": 7, + "minute": 50, + "second": 9, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:20 07:50:09+01:00" + }, + "FileCreateDate": { + "year": 2022, + "month": 4, + "day": 25, + "hour": 6, + "minute": 25, + "second": 2, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:04:25 06:25:02+01:00" + }, + "FilePermissions": "-r--r--r--", + "FileType": "MKV", + "FileTypeExtension": "mkv", + "MIMEType": "video/x-matroska", + "EBMLVersion": 1, + "EBMLReadVersion": 1, + "DocType": "matroska", + "DocTypeVersion": 4, + "DocTypeReadVersion": 2, + "TimecodeScale": "1 ms", + "MuxingApp": "Lavf58.20.100", + "WritingApp": "HandBrake 1.2.2 2019022300", + "DateTimeOriginal": { + "year": 2019, + "month": 9, + "day": 13, + "hour": 16, + "minute": 46, + "second": 14, + "millisecond": 0, + "tzoffsetMinutes": 0, + "rawValue": "2019:09:13 16:46:14Z" + }, + "VideoFrameRate": 25, + "ImageWidth": 1920, + "ImageHeight": 1080, + "TrackNumber": 2, + "TrackName": "Stereo", + "TrackLanguage": "und", + "CodecID": "A_AAC", + "TrackType": "Audio", + "AudioChannels": 2, + "AudioSampleRate": 48000, + "TagName": "DURATION", + "TagString": "00:00:21.375000000", + "ImageSize": "1920x1080", + "Megapixels": 2.1 + }, + "mediaInfo": { + "@ref": "", + "track": [ + { + "@type": "General", + "UniqueID": "112612991515236890937117095733641799622", + "VideoCount": "1", + "AudioCount": "1", + "Format": "Matroska", + "Format_Version": "4", + "FileSize": "8569883", + "Duration": "21.375", + "OverallBitRate": "3207442", + "FrameRate": "25.000", + "FrameCount": "533", + "IsStreamable": "Yes", + "Encoded_Date": "UTC 2019-09-13 16:46:14", + "Encoded_Application": "HandBrake 1.2.2 2019022300", + "Encoded_Library": "Lavf58.20.100", + "extra": { + "ErrorDetectionType": "Per level 1" + } + }, + { + "@type": "Video", + "StreamOrder": "0", + "ID": "1", + "UniqueID": "1", + "Format": "HEVC", + "Format_Profile": "Main", + "Format_Level": "5", + "Format_Tier": "Main", + "CodecID": "V_MPEGH/ISO/HEVC", + "Duration": "21.320000000", + "Width": "1920", + "Height": "1080", + "Stored_Height": "1088", + "Sampled_Width": "1920", + "Sampled_Height": "1080", + "PixelAspectRatio": "1.000", + "DisplayAspectRatio": "1.778", + "FrameRate_Mode": "CFR", + "FrameRate": "25.000", + "FrameCount": "533", + "ColorSpace": "YUV", + "ChromaSubsampling": "4:2:0", + "BitDepth": "8", + "Delay": "0.021", + "Default": "Yes", + "Forced": "No", + "colour_description_present": "Yes", + "colour_description_present_Source": "Stream", + "colour_range": "Limited", + "colour_range_Source": "Stream", + "colour_primaries": "BT.709", + "colour_primaries_Source": "Stream", + "transfer_characteristics": "BT.709", + "transfer_characteristics_Source": "Stream", + "matrix_coefficients": "BT.709", + "matrix_coefficients_Source": "Stream" + }, + { + "@type": "Audio", + "StreamOrder": "1", + "ID": "2", + "UniqueID": "2", + "Format": "AAC", + "Format_Settings_SBR": "No (Explicit)", + "Format_AdditionalFeatures": "LC", + "CodecID": "A_AAC-2", + "Duration": "21.375000000", + "Channels": "2", + "ChannelPositions": "Front: L R", + "ChannelLayout": "L R", + "SamplesPerFrame": "1024", + "SamplingRate": "48000", + "SamplingCount": "1026000", + "FrameRate": "46.875", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "Title": "Stereo", + "Default": "Yes", + "Forced": "No" + } + ] + } + } \ No newline at end of file diff --git a/tests/sampleData/media/sampleMP3_1.json b/tests/sampleData/media/sampleMP3_1.json new file mode 100644 index 0000000..6c7dd81 --- /dev/null +++ b/tests/sampleData/media/sampleMP3_1.json @@ -0,0 +1,314 @@ +{ + "_id": "C:/Transcode/Source Folder/sample__-__-__libmp3lame__30s__audio.mkv", + "file": "C:/Transcode/Source Folder/sample__-__-__libmp3lame__30s__audio.mkv", + "DB": "2MY5YD7P8", + "footprintId": "xpsr-dmmd", + "hasClosedCaptions": false, + "container": "mkv", + "scannerReads": { + "ffProbeRead": "success", + "exiftoolRead": "success", + "mediaInfoRead": "success", + "closedCaptionRead": "\"Unable to run CCExtractor\"" + }, + "ffProbeData": { + "streams": [ + { + "index": 0, + "codec_name": "mp3", + "codec_long_name": "MP3 (MPEG audio layer 3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "128000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "GPAC ISO Audio Handler", + "ENCODER": "Lavc57.107.100 libmp3lame", + "DURATION": "00:00:30.023000000" + } + }, + { + "index": 1, + "codec_name": "mp3", + "codec_long_name": "MP3 (MPEG audio layer 3)", + "codec_type": "audio", + "codec_tag_string": "[0][0][0][0]", + "codec_tag": "0x0000", + "sample_fmt": "fltp", + "sample_rate": "48000", + "channels": 2, + "channel_layout": "stereo", + "bits_per_sample": 0, + "r_frame_rate": "0/0", + "avg_frame_rate": "0/0", + "time_base": "1/1000", + "start_pts": 0, + "start_time": "0.000000", + "bit_rate": "128000", + "disposition": { + "default": 1, + "dub": 0, + "original": 0, + "comment": 0, + "lyrics": 0, + "karaoke": 0, + "forced": 0, + "hearing_impaired": 0, + "visual_impaired": 0, + "clean_effects": 0, + "attached_pic": 0, + "timed_thumbnails": 0, + "captions": 0, + "descriptions": 0, + "metadata": 0, + "dependent": 0, + "still_image": 0 + }, + "tags": { + "HANDLER_NAME": "GPAC ISO Audio Handler", + "ENCODER": "Lavc57.107.100 libmp3lame", + "DURATION": "00:00:30.023000000" + } + } + ], + "format": { + "filename": "C:/Transcode/Source Folder/sample__-__-__libmp3lame__30s__audio.mkv", + "nb_streams": 2, + "nb_programs": 0, + "format_name": "matroska,webm", + "format_long_name": "Matroska / WebM", + "start_time": "0.000000", + "duration": "30.023000", + "size": "979815", + "bit_rate": "261083", + "probe_score": 100, + "tags": { + "title": "Big Buck Bunny, Sunflower version", + "GENRE": "Animation", + "MAJOR_BRAND": "isom", + "MINOR_VERSION": "1", + "COMPATIBLE_BRANDS": "isomavc1", + "COMPOSER": "Sacha Goedegebure", + "ARTIST": "Blender Foundation 2008, Janus Bager Kristensen 2013", + "COMMENT": "Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net", + "ENCODER": "Lavf57.83.100" + } + } + }, + "file_size": 0.9344244003295898, + "video_resolution": "", + "fileMedium": "audio", + "video_codec_name": "", + "audio_codec_name": "mp3", + "lastPluginDetails": "none", + "createdAt": 1653224430511, + "bit_rate": 261083, + "duration": 30, + "statSync": { + "dev": 3832468976, + "mode": 33206, + "nlink": 1, + "uid": 0, + "gid": 0, + "rdev": 0, + "blksize": 4096, + "ino": 10133099162447292, + "size": 979815, + "blocks": 1920, + "atimeMs": 1653224430487.7, + "mtimeMs": 1653224386734.2915, + "ctimeMs": 1653224395573.211, + "birthtimeMs": 1653224386247.453, + "atime": "2022-05-22T13:00:30.488Z", + "mtime": "2022-05-22T12:59:46.734Z", + "ctime": "2022-05-22T12:59:55.573Z", + "birthtime": "2022-05-22T12:59:46.247Z" + }, + "HealthCheck": "", + "TranscodeDecisionMaker": "", + "lastHealthCheckDate": 0, + "holdUntil": 0, + "lastTranscodeDate": 0, + "bumped": false, + "history": "", + "oldSize": 0, + "newSize": 0, + "videoStreamIndex": -1, + "meta": { + "SourceFile": "C:/Transcode/Source Folder/sample__-__-__libmp3lame__30s__audio.mkv", + "errors": [], + "Duration": 30.023, + "ExifToolVersion": 12.4, + "FileName": "sample__-__-__libmp3lame__30s__audio.mkv", + "Directory": "C:/Transcode/Source Folder", + "FileSize": "957 KiB", + "ZoneIdentifier": "Exists", + "FileModifyDate": { + "year": 2022, + "month": 5, + "day": 22, + "hour": 13, + "minute": 59, + "second": 46, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:22 13:59:46+01:00" + }, + "FileAccessDate": { + "year": 2022, + "month": 5, + "day": 22, + "hour": 14, + "minute": 0, + "second": 29, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:22 14:00:29+01:00" + }, + "FileCreateDate": { + "year": 2022, + "month": 5, + "day": 22, + "hour": 13, + "minute": 59, + "second": 46, + "millisecond": 0, + "tzoffsetMinutes": 60, + "rawValue": "2022:05:22 13:59:46+01:00" + }, + "FilePermissions": "-rw-rw-rw-", + "FileType": "MKA", + "FileTypeExtension": "mka", + "MIMEType": "audio/x-matroska", + "EBMLVersion": 1, + "EBMLReadVersion": 1, + "DocType": "matroska", + "DocTypeVersion": 4, + "DocTypeReadVersion": 2, + "TimecodeScale": "1 ms", + "Title": "Big Buck Bunny, Sunflower version", + "MuxingApp": "Lavf57.83.100", + "WritingApp": "Lavf57.83.100", + "TrackNumber": 2, + "TrackLanguage": "und", + "CodecID": "A_MPEG/L3", + "TrackType": "Audio", + "AudioChannels": 2, + "AudioSampleRate": 48000, + "AudioBitsPerSample": 32, + "TagName": "DURATION", + "TagString": "00:00:30.023000000" + }, + "mediaInfo": { + "@ref": "", + "track": [ + { + "@type": "General", + "UniqueID": "301354878049300200919944107613778820882", + "AudioCount": "2", + "Format": "Matroska", + "Format_Version": "4", + "FileSize": "979815", + "Duration": "30.023", + "OverallBitRate_Mode": "CBR", + "OverallBitRate": "261084", + "StreamSize": "19079", + "IsStreamable": "Yes", + "Title": "Big Buck Bunny, Sunflower version", + "Track": "Big Buck Bunny, Sunflower version", + "Encoded_Application": "Lavf57.83.100", + "Encoded_Library": "Lavf57.83.100", + "Comment": "Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net", + "extra": { + "ErrorDetectionType": "Per level 1", + "ARTIST": "Blender Foundation 2008, Janus Bager Kristensen 2013", + "COMPOSER": "Sacha Goedegebure", + "GENRE": "Animation" + } + }, + { + "@type": "Audio", + "@typeorder": "1", + "StreamOrder": "0", + "ID": "1", + "UniqueID": "1", + "Format": "MPEG Audio", + "Format_Version": "1", + "Format_Profile": "Layer 3", + "Format_Settings_Mode": "Joint stereo", + "Format_Settings_ModeExtension": "MS Stereo", + "CodecID": "A_MPEG/L3", + "Duration": "30.023000000", + "BitRate_Mode": "CBR", + "BitRate": "128000", + "Channels": "2", + "SamplingRate": "48000", + "SamplingCount": "1441104", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "StreamSize": "480368", + "StreamSize_Proportion": "0.49026", + "Encoded_Library": "Lavc57.107.100 libmp3lame", + "Default": "Yes", + "Forced": "No" + }, + { + "@type": "Audio", + "@typeorder": "2", + "StreamOrder": "1", + "ID": "2", + "UniqueID": "2", + "Format": "MPEG Audio", + "Format_Version": "1", + "Format_Profile": "Layer 3", + "Format_Settings_Mode": "Joint stereo", + "Format_Settings_ModeExtension": "MS Stereo", + "CodecID": "A_MPEG/L3", + "Duration": "30.023000000", + "BitRate_Mode": "CBR", + "BitRate": "128000", + "Channels": "2", + "SamplingRate": "48000", + "SamplingCount": "1441104", + "Compression_Mode": "Lossy", + "Delay": "0.000", + "Delay_Source": "Container", + "StreamSize": "480368", + "StreamSize_Proportion": "0.49026", + "Encoded_Library": "Lavc57.107.100 libmp3lame", + "Default": "Yes", + "Forced": "No" + } + ] + } +} \ No newline at end of file From c729fad9f5d2f40ad36d8bad792daf8566769c59 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:43:42 +0100 Subject: [PATCH 098/126] Revert "Add new tests (#311)" This reverts commit 2a0a7e1bfc127cc7fa0bda2269b8c369c413b40a. --- .github/workflows/lint.yml | 2 +- ...gin_00td_action_handbrake_ffmpeg_custom.js | 4 +- ...gin_00td_action_re_order_all_streams_v2.js | 2 +- ..._Output_embedded_subs_to_SRT_and_remove.js | 1 - Community/Tdarr_Plugin_43az_add_to_radarr.js | 1 - ...de audio and video with HW (PC and Mac).js | 1 - ...Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js | 1 - .../Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js | 1 - .../Tdarr_Plugin_MC93_MigzPlex_Autoscan.js | 1 - ...CLU_2_Pass_Loudnorm_Audio_Normalisation.js | 1 - ...O0dCTlb_Set_File_Permissions_For_UnRaid.js | 1 - ...rr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js | 1 - Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js | 1 - ..._Plugin_VP92_VP9_Match_Bitrate_One_Pass.js | 1 - ...arr_Plugin_a9hf_New_file_duration_check.js | 1 - ...gin_da11_Dallas_FFmpeg_Presets_H264_MP4.js | 41 +- ...darr_Plugin_drdd_standardise_all_in_one.js | 6 +- .../Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js | 1 - .../Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js | 1 - .../Tdarr_Plugin_goof1_URL_Plex_Refresh.js | 1 - ...r_Plugin_henk_Keep_Native_Lang_Plus_Eng.js | 1 - ...eons001_Downmix_to_stereo_and_apply_DRC.js | 3 + ...rr01_drpeppershaker_extract_subs_to_SRT.js | 1 - .../Tdarr_Plugin_s710_nick_h265_nvenc_4K.js | 1 - .../Tdarr_Plugin_s7x9_winsome_h265_10bit.js | 1 - .../Tdarr_Plugin_s7x9_winsome_h265_nvenc.js | 1 - ...rr_Plugin_sdd3_Remove_Commentary_Tracks.js | 1 - ...df5_Thierrrrry_Remove_Non_English_Audio.js | 1 - .../Tdarr_Plugin_vdka_Remove_DataStreams.js | 1 - ..._vdka_Tiered_CPU_CRF_Based_Configurable.js | 1 - ...dka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js | 1 - Community/Tdarr_Plugin_x7ab_Remove_Subs.js | 1 - ...darr_Plugin_x7ac_Remove_Closed_Captions.js | 1 - ...b_TheRealShadoh_FFmpeg_Subs_H264_Medium.js | 1 - ...Plugin_z18s_rename_files_based_on_codec.js | 1 - ...ame_files_based_on_codec_and_resolution.js | 1 - ...1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js | 1 - ...2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js | 1 - ...TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js | 1 - .../Tdarr_Plugin_z80t_keep_original_date.js | 1 - package-lock.json | 147 +--- package.json | 13 +- ...ugin_00td_action_add_audio_stream_codec.js | 92 -- ...gin_00td_action_handbrake_basic_options.js | 74 -- ...gin_00td_action_handbrake_ffmpeg_custom.js | 66 -- ...lugin_00td_action_keep_one_audio_stream.js | 89 -- ...gin_00td_action_re_order_all_streams_v2.js | 72 -- ...darr_Plugin_00td_action_remux_container.js | 65 -- ..._action_standardise_audio_stream_codecs.js | 66 -- .../Tdarr_Plugin_00td_filter_by_bitrate.js | 64 -- .../Tdarr_Plugin_00td_filter_by_codec.js | 59 -- ..._Plugin_00td_filter_by_codec_tag_string.js | 59 -- .../Tdarr_Plugin_00td_filter_by_resolution.js | 74 -- .../Tdarr_Plugin_00td_filter_by_size.js | 64 -- .../Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js | 41 - ...darr_Plugin_075a_Transcode_Customisable.js | 81 -- ...5b_FFMPEG_HEVC_Generic_Video_Audio_Only.js | 41 - ...PEG_HEVC_Generic_Video_Audio_Only_CRF20.js | 41 - ...HEVC_GPU_Generic_Video_Audio_Only_CRF20.js | 41 - ...darr_Plugin_076a_re_order_audio_streams.js | 43 - ...r_Plugin_076b_re_order_subtitle_streams.js | 62 -- ...n_077b_HandBrake_NVENC_264_Configurable.js | 44 - ...lugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js | 112 --- ...r_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js | 75 -- ...de audio and video with HW (PC and Mac).js | 107 --- .../Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js | 59 -- .../Tdarr_Plugin_MC93_Migz1FFMPEG.js | 145 ---- .../Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js | 145 ---- .../Community/Tdarr_Plugin_MC93_Migz1Remux.js | 45 - .../Tdarr_Plugin_MC93_Migz2CleanTitle.js | 46 - .../Tdarr_Plugin_MC93_Migz3CleanAudio.js | 98 --- .../Tdarr_Plugin_MC93_Migz4CleanSubs.js | 72 -- .../Tdarr_Plugin_MC93_Migz5ConvertAudio.js | 90 -- .../Tdarr_Plugin_MC93_Migz6OrderStreams.js | 103 --- .../Tdarr_Plugin_MC93_MigzImageRemoval.js | 46 - ...gin_MP01_MichPasCleanSubsAndAudioCodecs.js | 47 - .../Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js | 107 --- ...ugin_a37x_Drawmonster_MP4_No_Title_Meta.js | 42 - ...eAGitGat_HandBrake_H264_VeryFast1080p30.js | 66 -- ..._HaveAGitGat_HandBrake_H264_Fast1080p30.js | 66 -- ..._Transcode_Specific_Audio_Stream_Codecs.js | 45 - .../Tdarr_Plugin_a9he_New_file_size_check.js | 68 -- ...rr_Plugin_b38x_Nosirus_h265_aac_no_meta.js | 45 - ...gin_b39x_the1poet_surround_sound_to_ac3.js | 59 -- ...Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js | 86 -- ...Tdarr_Plugin_c0r1_SetDefaultAudioStream.js | 49 -- ..._d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js | 50 -- ...in_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js | 47 - ...gin_da11_Dallas_FFmpeg_Presets_H264_MP4.js | 62 -- ...darr_Plugin_drdd_standardise_all_in_one.js | 110 --- ..._H.264_MKV_480p30_No_Subs_No_Title_Meta.js | 97 --- ..._H.264_MKV_720p30_No_Subs_No_Title_Meta.js | 99 --- ...H.264_MKV_1080p30_No_Subs_No_Title_Meta.js | 96 -- ...rr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js | 94 -- ...rr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js | 48 - ...rr_Plugin_henk_Add_Specific_Audio_Codec.js | 85 -- ...rawmonster_MP4_AAC_No_Subs_No_metaTitle.js | 68 -- ..._Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js | 66 -- ...eons001_Downmix_to_stereo_and_apply_DRC.js | 42 - .../Tdarr_Plugin_lmg1_Reorder_Streams.js | 50 -- ...r_Plugin_nc7x_Drawmonster_No_Title_Meta.js | 42 - ...2_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js | 44 - ...in_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js | 67 -- .../Tdarr_Plugin_s7x8_winsome_h265.js | 63 -- tests/checkPlugins.js | 105 +-- tests/helpers/run.js | 55 -- tests/runTests.js | 51 -- tests/sampleData/media/sampleAAC_1.json | 334 ------- tests/sampleData/media/sampleH264_1.json | 432 --------- tests/sampleData/media/sampleH264_2.json | 775 ----------------- tests/sampleData/media/sampleH264_3.json | 821 ------------------ tests/sampleData/media/sampleH265_1.json | 334 ------- tests/sampleData/media/sampleMP3_1.json | 314 ------- 113 files changed, 102 insertions(+), 7662 deletions(-) delete mode 100644 tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js delete mode 100644 tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js delete mode 100644 tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js delete mode 100644 tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js delete mode 100644 tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js delete mode 100644 tests/Community/Tdarr_Plugin_00td_action_remux_container.js delete mode 100644 tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js delete mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js delete mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_codec.js delete mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js delete mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js delete mode 100644 tests/Community/Tdarr_Plugin_00td_filter_by_size.js delete mode 100644 tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js delete mode 100644 tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js delete mode 100644 tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js delete mode 100644 tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js delete mode 100644 tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js delete mode 100644 tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js delete mode 100644 tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js delete mode 100644 tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js delete mode 100644 tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js delete mode 100644 tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js delete mode 100644 tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js delete mode 100644 tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js delete mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js delete mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js delete mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js delete mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js delete mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js delete mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js delete mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js delete mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js delete mode 100644 tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js delete mode 100644 tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js delete mode 100644 tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js delete mode 100644 tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js delete mode 100644 tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js delete mode 100644 tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js delete mode 100644 tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js delete mode 100644 tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js delete mode 100644 tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js delete mode 100644 tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js delete mode 100644 tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js delete mode 100644 tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js delete mode 100644 tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js delete mode 100644 tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js delete mode 100644 tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js delete mode 100644 tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js delete mode 100644 tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js delete mode 100644 tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js delete mode 100644 tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js delete mode 100644 tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js delete mode 100644 tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js delete mode 100644 tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js delete mode 100644 tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js delete mode 100644 tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js delete mode 100644 tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js delete mode 100644 tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js delete mode 100644 tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js delete mode 100644 tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js delete mode 100644 tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js delete mode 100644 tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js delete mode 100644 tests/helpers/run.js delete mode 100644 tests/runTests.js delete mode 100644 tests/sampleData/media/sampleAAC_1.json delete mode 100644 tests/sampleData/media/sampleH264_1.json delete mode 100644 tests/sampleData/media/sampleH264_2.json delete mode 100644 tests/sampleData/media/sampleH264_3.json delete mode 100644 tests/sampleData/media/sampleH265_1.json delete mode 100644 tests/sampleData/media/sampleMP3_1.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 042233b..9c76f0f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,4 +20,4 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm i - - run: npm run checkPlugins && npm run lint && npm run test + - run: npm run checkPlugins && npm run lint diff --git a/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js b/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js index 995603e..3c3871d 100644 --- a/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js +++ b/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js @@ -84,8 +84,8 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { processFile: false, preset: '', container: '', - handbrakeMode: false, - ffmpegMode: false, + handBrakeMode: false, + FFmpegMode: false, reQueueAfter: false, infoLog: '', }; diff --git a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js index 4f162b2..691b173 100644 --- a/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js +++ b/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js @@ -117,7 +117,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { for (let i = 0; i < items.length; i += 1) { const matchedStreams = []; for (let j = 0; j < streams.length; j += 1) { - if (String(sortType.getValue(streams[j])) === String(items[i])) { + if (String(sortType.getValue(streams[j])).includes(String(items[i]))) { if ( streams[j].codec_long_name && ( diff --git a/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js b/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js index 5a868a5..5198704 100644 --- a/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js +++ b/Community/Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_078d_Output_embedded_subs_to_SRT_and_remove", diff --git a/Community/Tdarr_Plugin_43az_add_to_radarr.js b/Community/Tdarr_Plugin_43az_add_to_radarr.js index 8129e09..eff190d 100644 --- a/Community/Tdarr_Plugin_43az_add_to_radarr.js +++ b/Community/Tdarr_Plugin_43az_add_to_radarr.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: 'Tdarr_Plugin_43az_add_to_radarr', diff --git a/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js b/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js index e52695c..d7cd530 100644 --- a/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js +++ b/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js @@ -203,7 +203,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { if (inputs.bitrate_cutoff !== '') { // Checks if currentBitrate is below inputs.bitrate_cutoff // If so then don't convert video. - console.log(currentBitrate) if (currentBitrate <= inputs.bitrate_cutoff) { convertVideo = false; } diff --git a/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js b/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js index 2b685a3..afa0182 100644 --- a/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js +++ b/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js @@ -86,7 +86,6 @@ Audio: (Only one audio stream is used!!) /// /////////////////////////////////////////////////////////////////////////////////////////////////// */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js b/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js index 50277de..7459154 100644 --- a/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js +++ b/Community/Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix.js @@ -148,7 +148,6 @@ // ////////////////////////////////////////////////////////////////////////////////////////////////////// -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_JB69_JBHEVCQSZ_PostFix", diff --git a/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js b/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js index f29ce6f..fb77764 100644 --- a/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js +++ b/Community/Tdarr_Plugin_MC93_MigzPlex_Autoscan.js @@ -3,7 +3,6 @@ module.exports.dependencies = [ ]; /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_MigzPlex_Autoscan', Stage: 'Post-processing', diff --git a/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js b/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js index dac17b6..1cbe2bf 100644 --- a/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js +++ b/Community/Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation.js @@ -14,7 +14,6 @@ var secondPass = false; var logOutFile = ''; -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_NIfPZuCLU_2_Pass_Loudnorm_Audio_Normalisation", diff --git a/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js b/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js index d083a33..d79f302 100644 --- a/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js +++ b/Community/Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid.js @@ -1,7 +1,6 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid", diff --git a/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js b/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js index b91e1a9..eef3529 100644 --- a/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js +++ b/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js @@ -3,7 +3,6 @@ // https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js // Seriously, all I did was make it work for converting things to h264 instead of hevc -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264', Stage: 'Pre-processing', // Preprocessing or Post-processing. Determines when the plugin will be executed. diff --git a/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js b/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js index 86c6dea..63d5ec6 100644 --- a/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js +++ b/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js @@ -4,7 +4,6 @@ module.exports.dependencies = [ ]; /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_TD01_TOAD_Autoscan', Stage: 'Post-processing', diff --git a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js index e5bf1af..1412281 100644 --- a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js +++ b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js @@ -1,5 +1,4 @@ /* eslint max-classes-per-file: ["error", 2] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js b/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js index 6f1fcc5..4cda5ca 100644 --- a/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js +++ b/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js @@ -1,6 +1,5 @@ // eslint-disable-next-line import/no-unresolved -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_a9hf_New_file_duration_check', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js b/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js index 2dc1a31..c1ebc6a 100644 --- a/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js +++ b/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js @@ -62,7 +62,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { const lib = require('../methods/lib')(); // eslint-disable-next-line no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); - var response = { processFile: false, preset: "", @@ -71,17 +70,15 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { FFmpegMode: false, reQueueAfter: false, infoLog: "", - + addInfo(status, info) { + this.infoLog += (status ? "☑" : "☒") + " " + info + "\n"; + }, }; - const addInfo = (status, info) => { - response.infoLog += (status ? "☑" : "☒") + " " + info + "\n"; - } - // Check the file is a video if (file.fileMedium !== "video") { console.log("File is not video"); - addInfo(BAD, `File is not video`); + response.addInfo(BAD, `File is not video`); response.processFile = false; return response; } @@ -90,7 +87,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { let preset = getPreset(inputs.FFmpeg_preset); if (preset === null) { - addInfo( + response.addInfo( BAD, `Invalid Preset, \"${inputs.FFmpeg_preset}\" please select from (slow,medium,fast,veryfast)` ); @@ -128,10 +125,10 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (hasBadSubs) - addInfo(BAD, "File contains unsupported sub(s), dropping these!"); + response.addInfo(BAD, "File contains unsupported sub(s), dropping these!"); if (file.ffProbeData.streams[0].codec_name != "h264") { - addInfo(BAD, "File is not in h264!"); + response.addInfo(BAD, "File is not in h264!"); response.preset = ", -map_metadata -1 -map 0:V " + subMap + @@ -142,11 +139,11 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.FFmpegMode = true; return response; } else { - addInfo(GOOD, "File is already in h264!"); + response.addInfo(GOOD, "File is already in h264!"); } if (file.meta.Title != undefined && !jsonString.includes("aac") && hasSubs) { - addInfo(BAD, "File has title metadata and no aac and subs"); + response.addInfo(BAD, "File has title metadata and no aac and subs"); response.preset = ", -map_metadata -1 -map 0:v " + subMap + @@ -159,7 +156,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (!jsonString.includes("aac") && hasSubs) { - addInfo(BAD, "File has no aac track and has subs"); + response.addInfo(BAD, "File has no aac track and has subs"); response.preset = ", -map 0:v " + subMap + @@ -172,7 +169,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (file.meta.Title != undefined && hasSubs) { - addInfo(BAD, "File has title and has subs"); + response.addInfo(BAD, "File has title and has subs"); response.preset = ", -map_metadata -1 -map 0:v " + subMap + @@ -185,7 +182,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (file.meta.Title != undefined) { - addInfo(BAD, "File has title metadata"); + response.addInfo(BAD, "File has title metadata"); response.preset = ", -map_metadata -1 -map 0:v " + subMap + @@ -196,11 +193,11 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.FFmpegMode = true; return response; } else { - addInfo(GOOD, "File has no title metadata"); + response.addInfo(GOOD, "File has no title metadata"); } if (!jsonString.includes("aac")) { - addInfo(BAD, "File has no aac track"); + response.addInfo(BAD, "File has no aac track"); response.preset = ", -map 0:v " + subMap + @@ -211,14 +208,14 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.FFmpegMode = true; return response; } else { - addInfo(GOOD, "File has aac track"); + response.addInfo(GOOD, "File has aac track"); } if (hasSubs) { if (hasBadSubs) { - addInfo(BAD, "File has incompatible subs, dropping these..."); + response.addInfo(BAD, "File has incompatible subs, dropping these..."); } else { - addInfo(BAD, "File has compatible subs, copying..."); + response.addInfo(BAD, "File has compatible subs, copying..."); } response.preset = ", -map 0:v " + subMap + " -map 0:a -c:v copy -c:a copy " + subType; @@ -226,10 +223,10 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { response.FFmpegMode = true; return response; } else { - addInfo(GOOD, "File has no/compatible subs"); + response.addInfo(GOOD, "File has no/compatible subs"); } - addInfo(GOOD, "File meets conditions!"); + response.addInfo(GOOD, "File meets conditions!"); return response; } diff --git a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js index 608b0f5..9fdd9f8 100644 --- a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js +++ b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js @@ -4,14 +4,14 @@ const details = () => { return { id: "Tdarr_Plugin_drdd_standardise_all_in_one", Stage: "Pre-processing", - Name: "DrDD H265 MKV AC3 audio subtitles [VAAPI & NVENC]", + Name: "DrDD H265 MKV AC3 audio subtitles [QSV & NVENC]", Stage: "Pre-processing", Type: "Video", Operation: "Transcode", Description: "In a single pass ensures all files are in MKV containers and where possible encoded in h265 (settings dependant on file bitrate), converts all multi channel audio to AC3, removes audio commentary and removes subtitles that are not in the configured language or marked as commentary. This plugin is opinionated based on how I like my library to be configured and based on the work done by Migz with his plugins (Thanks!).", Version: "1.0", - Tags: "pre-processing,ffmpeg,vaapi,h265, nvenc h265", + Tags: "pre-processing,ffmpeg,qsv h265, nvenc h265", Inputs: [ { name: "nvenc", @@ -346,7 +346,7 @@ function buildVideoConfiguration(inputs, file, logger) { configuration.RemoveOutputSetting("-c:v copy"); configuration.AddOutputSetting(`-c:v hevc_vaapi ${bitrateSettings}`); - logger.AddError("Transcoding to HEVC using VAAPI"); + logger.AddError("Transcoding to HEVC using QSV"); } /** diff --git a/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js b/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js index 7b56fdf..967339c 100644 --- a/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js +++ b/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js @@ -1,6 +1,5 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e5c3_CnT_Add_Subtitles", diff --git a/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js b/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js index d4b8266..6b0b0ea 100644 --- a/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js +++ b/Community/Tdarr_Plugin_e5c3_CnT_Remove_Letterbox.js @@ -1,6 +1,5 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_e5c3_CnT_Remove_Letterbox", diff --git a/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js b/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js index 9afa86a..7644d98 100644 --- a/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js +++ b/Community/Tdarr_Plugin_goof1_URL_Plex_Refresh.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_goof1_URL_Plex_Refresh', Stage: 'Post-processing', diff --git a/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js b/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js index 243b675..4aa06ae 100644 --- a/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js +++ b/Community/Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng.js @@ -1,6 +1,5 @@ /* eslint-disable no-await-in-loop */ module.exports.dependencies = ['axios', '@cospired/i18n-iso-languages']; -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_henk_Keep_Native_Lang_Plus_Eng', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js b/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js index 8baf72e..95d04ec 100644 --- a/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js +++ b/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js @@ -23,6 +23,9 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { FFmpegMode: true, reQueueAfter: true, infoLog: '', + file, + removeFromDB: false, + updateDB: false, container: `.${file.container}`, }; diff --git a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js index 75d5e77..4dcd6ee 100644 --- a/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js +++ b/Community/Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_rr01_drpeppershaker_extract_subs_to_SRT', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js b/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js index 6c559b0..689d403 100644 --- a/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js +++ b/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s710_nick_h265_nvenc_4K", diff --git a/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js index acf22fb..d5d23f6 100644 --- a/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js +++ b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s7x9_winsome_h265_10bit", diff --git a/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js b/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js index 447044d..f336a5e 100644 --- a/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js +++ b/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s7x9_winsome_h265_nvenc", diff --git a/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js b/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js index 8c8b8e2..00df33b 100644 --- a/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js +++ b/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_sdd3_Remove_Commentary_Tracks", diff --git a/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js b/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js index 71708c3..9be9ed1 100644 --- a/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js +++ b/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio", diff --git a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js index 64e71ef..634c9d3 100644 --- a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js +++ b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_vdka_Remove_DataStreams", diff --git a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js index f5614f8..e1d5aee 100644 --- a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js +++ b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js b/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js index e0ca948..4afd5f3 100644 --- a/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js +++ b/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: 'Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE', diff --git a/Community/Tdarr_Plugin_x7ab_Remove_Subs.js b/Community/Tdarr_Plugin_x7ab_Remove_Subs.js index 3bf03de..7bd12ff 100644 --- a/Community/Tdarr_Plugin_x7ab_Remove_Subs.js +++ b/Community/Tdarr_Plugin_x7ab_Remove_Subs.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_x7ab_Remove_Subs", diff --git a/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js b/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js index 26afd05..f5fe57a 100644 --- a/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js +++ b/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_x7ac_Remove_Closed_Captions', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js index 716e730..88fc14e 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js b/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js index 7cff564..db917e8 100644 --- a/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js +++ b/Community/Tdarr_Plugin_z18s_rename_files_based_on_codec.js @@ -1,6 +1,5 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_z18s_rename_files_based_on_codec", diff --git a/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js b/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js index 1a2f75d..d6adedd 100644 --- a/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js +++ b/Community/Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z18t_rename_files_based_on_codec_and_resolution', Stage: 'Post-processing', diff --git a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js index ad301d8..fbc9de3 100644 --- a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js +++ b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js index dc863a4..28ee579 100644 --- a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js +++ b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js index be10d89..597003f 100644 --- a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js +++ b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast', Stage: 'Pre-processing', diff --git a/Community/Tdarr_Plugin_z80t_keep_original_date.js b/Community/Tdarr_Plugin_z80t_keep_original_date.js index 9364705..d7f6715 100644 --- a/Community/Tdarr_Plugin_z80t_keep_original_date.js +++ b/Community/Tdarr_Plugin_z80t_keep_original_date.js @@ -4,7 +4,6 @@ module.exports.dependencies = [ 'touch', ]; -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z80t_keep_original_date', Stage: 'Post-processing', diff --git a/package-lock.json b/package-lock.json index 136bce7..5a261a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -174,12 +174,6 @@ "es-abstract": "^1.18.0-next.1" } }, - "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true - }, "ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", @@ -233,27 +227,14 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" - }, - "chai": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", - "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", - "dev": true, - "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", - "pathval": "^1.1.1", - "type-detect": "^4.0.5" - } + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true }, "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -263,6 +244,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -271,6 +253,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "requires": { "color-name": "~1.1.4" } @@ -278,29 +261,26 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "requires": { "has-flag": "^4.0.0" } } } }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", - "dev": true - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -366,15 +346,6 @@ "ms": "2.1.2" } }, - "deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", - "dev": true, - "requires": { - "type-detect": "^4.0.0" - } - }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -503,57 +474,6 @@ "table": "^5.2.3", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } } }, "eslint-config-airbnb-base": { @@ -870,12 +790,6 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true - }, "get-intrinsic": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", @@ -959,9 +873,10 @@ "dev": true }, "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.2.tgz", + "integrity": "sha512-cTPNrlvJT6twpYy+YmKUKrTSjWFs3bjYjAhCwm+z4EOCubZxAuO+hHpRN64TqjEaYSHs7tJAE0w1CKMGmsG/lw==", + "dev": true, "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -1176,16 +1091,8 @@ "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "loupe": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", - "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", - "dev": true, - "requires": { - "get-func-name": "^2.0.0" - } + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true }, "lru-cache": { "version": "6.0.0", @@ -1342,6 +1249,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, "requires": { "callsites": "^3.0.0" } @@ -1388,12 +1296,6 @@ "pify": "^2.0.0" } }, - "pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true - }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -1473,7 +1375,8 @@ "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true }, "rimraf": { "version": "3.0.2", @@ -1674,12 +1577,6 @@ "prelude-ls": "^1.2.1" } }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, "type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", diff --git a/package.json b/package.json index 7897352..a1436a8 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,17 @@ { "name": "tdarr_plugins", "version": "1.0.0", - "description": "Tdar Plugins Repo", - "main": "", - "dependencies": { - "chalk": "^4.1.2", - "import-fresh": "^3.3.0", - "lodash": "^4.17.21" - }, + "description": "There are two types of plugin:", + "main": "Tdarr_Plugin_aaaa_Pre_Proc_Example.js", + "dependencies": {}, "devDependencies": { - "chai": "^4.3.6", "eslint": "^7.14.0", "eslint-config-airbnb-base": "^14.2.1", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jsx-a11y": "^6.4.1" }, "scripts": { - "test": "node ./tests/runTests.js", + "test": "echo \"Error: no test specified\" && exit 1", "lint": "eslint Community methods examples tests --ext js", "lint:fix": "eslint Community methods examples tests --ext js --fix", "checkPlugins": "node ./tests/checkPlugins.js" diff --git a/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js b/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js deleted file mode 100644 index 3862352..0000000 --- a/tests/Community/Tdarr_Plugin_00td_action_add_audio_stream_codec.js +++ /dev/null @@ -1,92 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -ac 2', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: true, - infoLog: 'The required channel count 2 is lower than the highest available channel count (6). Adding! \n', - handbrakeMode: false, - ffmpegMode: true, - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - audioCodec: 'eac3', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 2', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: true, - infoLog: 'The required channel count 2 is lower than the highest available channel count (6). Adding! \n', - handbrakeMode: false, - ffmpegMode: true, - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - audioCodec: 'eac3', - channels: 6, - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 6', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: true, - infoLog: 'The required channel count 6 is lower than the highest available channel count (6). Adding! \n', - handbrakeMode: false, - ffmpegMode: true, - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - audioCodec: 'eac3', - channels: 8, - language: 'fr', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:1 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 6', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: true, - infoLog: 'The required channel count (8) is higher than the highest channel available in specified lang tag (6). Adding lower channel track. \n', - handbrakeMode: false, - ffmpegMode: true, - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js b/tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js deleted file mode 100644 index 5777e28..0000000 --- a/tests/Community/Tdarr_Plugin_00td_action_handbrake_basic_options.js +++ /dev/null @@ -1,74 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "Very Fast 1080p30" -e x265 --all-subtitles', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: true, - infoLog: 'File is being transcoded using HandBrake \n', - handbrakeMode: true, - ffmpegMode: false, - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - handbrakePreset: 'Fast 576p25', - videoEncoder: 'nvenc_h265', - keepSubtitles: 'true', - container: 'mp4', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "Fast 576p25" -e nvenc_h265 --all-subtitles', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: true, - infoLog: 'File is being transcoded using HandBrake \n', - handbrakeMode: true, - ffmpegMode: false, - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - handbrakePreset: 'Fast 576p25', - videoEncoder: 'nvenc_h265', - keepSubtitles: 'false', - container: 'mov', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "Fast 576p25" -e nvenc_h265 ', - container: '.mov', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: true, - infoLog: 'File is being transcoded using HandBrake \n', - handbrakeMode: true, - ffmpegMode: false, - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js b/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js deleted file mode 100644 index 6be2efd..0000000 --- a/tests/Community/Tdarr_Plugin_00td_action_handbrake_ffmpeg_custom.js +++ /dev/null @@ -1,66 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ' -map 0 -c copy', - container: '.mkv', - handbrakeMode: false, - ffmpegMode: true, - reQueueAfter: true, - infoLog: 'File is being transcoded using custom arguments \n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - cli: 'handbrake', - arguments: '-Z "Very Fast 1080p30" --all-subtitles --all-audio', - container: 'mp4', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "Very Fast 1080p30" --all-subtitles --all-audio', - container: '.mp4', - handbrakeMode: true, - ffmpegMode: false, - reQueueAfter: true, - infoLog: 'File is being transcoded using custom arguments \n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - cli: 'ffmpeg', - arguments: '-c:v libx265 -crf 23 -ac 6 -c:a aac -preset veryfast', - container: 'mov', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-c:v libx265 -crf 23 -ac 6 -c:a aac -preset veryfast', - container: '.mov', - handbrakeMode: false, - ffmpegMode: true, - reQueueAfter: true, - infoLog: 'File is being transcoded using custom arguments \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js b/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js deleted file mode 100644 index 26d68f4..0000000 --- a/tests/Community/Tdarr_Plugin_00td_action_keep_one_audio_stream.js +++ /dev/null @@ -1,89 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:1 -map 0:s? -map 0:d? -c copy -c:a:0 aac -ac 2', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'No en streams. The required channel count 2 is lower than the highest available channel count (6).Adding it and removing others! \n', - handbrakeMode: false, - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - audioCodec: 'eac3', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:1 -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 2', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'No en streams. The required channel count 2 is lower than the highest available channel count (6).Adding it and removing others! \n', - handbrakeMode: false, - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - audioCodec: 'eac3', - language: 'fr', - channels: '6', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:1 -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -ac 6', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'No fr streams. The required channel count 6 is lower than the highest available channel count (6).Adding it and removing others! \n', - handbrakeMode: false, - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - audioCodec: 'aac', - language: 'und', - channels: '8', - }, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'The best und stream already exists. It is the only audio stream. \n', - handbrakeMode: false, - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js b/tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js deleted file mode 100644 index 2567bac..0000000 --- a/tests/Community/Tdarr_Plugin_00td_action_re_order_all_streams_v2.js +++ /dev/null @@ -1,72 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - infoLog: 'Streams are in the correct order!', - }, - }, - { - // orig - // 0 vid h264 - // 1 flac eng - // 2 ac3 eng - // 3 eac3 eng - // 4 aac fre - // 5 aac eng - // 6 sub fre - - // expect - // 4 aac fre - // 2 ac3 eng - // 1 flac eng - // 3 eac3 eng - // 5 aac eng - // 6 sub fre - // 0 vid h264 - - // console.log(streams.map(stream => { - // return { - // "index": stream.index, - // codec_name: stream.codec_name, - // codec_type: stream.codec_type, - // language: stream.tags.language, - // } - // })) - - input: { - file: require('../sampleData/media/sampleH264_2.json'), - librarySettings: {}, - inputs: { - processOrder: 'codecs,channels,languages,streamTypes', - languages: 'fre,eng', - streamTypes: 'audio,subtitle,video', - codecs: 'ac3,flac,eac3,aac', - channels: '7.1,5.1,2,1', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ' -c copy -map 0:4 -map 0:2 -map 0:1 -map 0:3 -map 0:5 -map 0:6 -map 0:0', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - infoLog: 'Streams are not in the correct order!', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_remux_container.js b/tests/Community/Tdarr_Plugin_00td_action_remux_container.js deleted file mode 100644 index 985688b..0000000 --- a/tests/Community/Tdarr_Plugin_00td_action_remux_container.js +++ /dev/null @@ -1,65 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0 -c copy', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'File is not in mkv \n', - handbrakeMode: false, - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - container: 'mkv', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0 -c copy', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'File is not in mkv \n', - handbrakeMode: false, - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - container: 'mp4', - }, - otherArguments: {}, - }, - output: { - processFile: false, - preset: ', -map 0 -c copy', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'File is already in mp4 \n', - handbrakeMode: false, - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js b/tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js deleted file mode 100644 index 63e1505..0000000 --- a/tests/Community/Tdarr_Plugin_00td_action_standardise_audio_stream_codecs.js +++ /dev/null @@ -1,66 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: true, - infoLog: "File does not have any audio streams which aren't in aac \n", - handbrakeMode: false, - ffmpegMode: true, - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_2.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 aac -c:a:1 aac -c:a:2 aac', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: true, - infoLog: "File has audio streams which aren't in aac \n", - handbrakeMode: false, - ffmpegMode: true, - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_2.json'), - librarySettings: {}, - inputs: { - audioCodec: 'eac3', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 eac3 -c:a:1 eac3 -c:a:3 eac3 -c:a:4 eac3', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: true, - infoLog: "File has audio streams which aren't in eac3 \n", - handbrakeMode: false, - ffmpegMode: true, - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js b/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js deleted file mode 100644 index 4c22116..0000000 --- a/tests/Community/Tdarr_Plugin_00td_filter_by_bitrate.js +++ /dev/null @@ -1,64 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_2.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - infoLog: '☑File bitrate is within filter limits. Moving to next plugin.', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - upperBound: 500, - lowerBound: 0, - }, - otherArguments: {}, - }, - output: { - processFile: false, - infoLog: '☒File bitrate is not within filter limits. Breaking out of plugin stack.\n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - upperBound: 10000, - lowerBound: 0, - }, - otherArguments: {}, - }, - output: { - processFile: true, - infoLog: '☑File bitrate is within filter limits. Moving to next plugin.', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - upperBound: 10000, - lowerBound: 9000, - }, - otherArguments: {}, - }, - output: { - processFile: false, - infoLog: '☒File bitrate is not within filter limits. Breaking out of plugin stack.\n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_codec.js b/tests/Community/Tdarr_Plugin_00td_filter_by_codec.js deleted file mode 100644 index e8e6cd3..0000000 --- a/tests/Community/Tdarr_Plugin_00td_filter_by_codec.js +++ /dev/null @@ -1,59 +0,0 @@ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { processFile: false, infoLog: '' }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - codecsToProcess: 'h264', - }, - otherArguments: {}, - }, - output: { processFile: true, infoLog: 'File is in codecsToProcess. Moving to next plugin.' }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - codecsToProcess: 'h265', - }, - otherArguments: {}, - }, - output: { processFile: false, infoLog: 'File is not in codecsToProcess. Breaking out of plugin stack.' }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - codecsToNotProcess: 'h264', - }, - otherArguments: {}, - }, - output: { processFile: false, infoLog: 'File is in codecsToNotProcess. Breaking out of plugin stack.' }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - codecsToNotProcess: 'h265', - }, - otherArguments: {}, - }, - output: { processFile: true, infoLog: 'File is not in codecsToNotProcess. Moving to next plugin.' }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js b/tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js deleted file mode 100644 index 4616650..0000000 --- a/tests/Community/Tdarr_Plugin_00td_filter_by_codec_tag_string.js +++ /dev/null @@ -1,59 +0,0 @@ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { processFile: false, infoLog: '' }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - codecTagStringsToProcess: 'avc1,rand', - }, - otherArguments: {}, - }, - output: { processFile: true, infoLog: 'File is in codecTagStringsToProcess. Moving to next plugin.' }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - codecTagStringsToNotProcess: 'avc1,rand', - }, - otherArguments: {}, - }, - output: { processFile: false, infoLog: 'File is in codecTagStringsToNotProcess. Breaking out of plugin stack.' }, - }, - { - input: { - file: require('../sampleData/media/sampleH265_1.json'), - librarySettings: {}, - inputs: { - codecTagStringsToProcess: 'avc1,rand', - }, - otherArguments: {}, - }, - output: { processFile: false, infoLog: 'File is not in codecTagStringsToProcess. Breaking out of plugin stack.' }, - }, - { - input: { - file: require('../sampleData/media/sampleH265_1.json'), - librarySettings: {}, - inputs: { - codecTagStringsToNotProcess: 'avc1,rand', - }, - otherArguments: {}, - }, - output: { processFile: true, infoLog: 'File is not in codecTagStringsToNotProcess. Moving to next plugin.' }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js b/tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js deleted file mode 100644 index 91cc03f..0000000 --- a/tests/Community/Tdarr_Plugin_00td_filter_by_resolution.js +++ /dev/null @@ -1,74 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, infoLog: '', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - resolutionsToProcess: '480p,720p', - }, - otherArguments: {}, - }, - output: { - processFile: true, - infoLog: 'File is in resolutionsToProcess. Moving to next plugin.', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - resolutionsToProcess: '480p,1080p', - }, - otherArguments: {}, - }, - output: { - processFile: false, - infoLog: 'File is not in resolutionsToProcess. Breaking out of plugin stack.', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - resolutionsToNotProcess: '480p,720p', - }, - otherArguments: {}, - }, - output: { - processFile: false, - infoLog: 'File is in resolutionsToNotProcess. Breaking out of plugin stack.', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - resolutionsToNotProcess: '480p,1080p', - }, - otherArguments: {}, - }, - output: { - processFile: true, - infoLog: 'File is not in resolutionsToNotProcess. Moving to next plugin.', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_00td_filter_by_size.js b/tests/Community/Tdarr_Plugin_00td_filter_by_size.js deleted file mode 100644 index a869c4c..0000000 --- a/tests/Community/Tdarr_Plugin_00td_filter_by_size.js +++ /dev/null @@ -1,64 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - infoLog: 'File is within lower and upper bound size limits. Moving to next plugin.', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - upperBound: 0.5, - lowerBound: 0, - }, - otherArguments: {}, - }, - output: { - processFile: false, - infoLog: 'File is not within lower and upper bound size limits. Breaking out of plugin stack.', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - upperBound: 2, - lowerBound: 0, - }, - otherArguments: {}, - }, - output: { - processFile: true, - infoLog: 'File is within lower and upper bound size limits. Moving to next plugin.', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - upperBound: 4, - lowerBound: 2, - }, - otherArguments: {}, - }, - output: { - processFile: false, - infoLog: 'File is not within lower and upper bound size limits. Breaking out of plugin stack.', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js b/tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js deleted file mode 100644 index 9365ddf..0000000 --- a/tests/Community/Tdarr_Plugin_075a_FFMPEG_HEVC_Generic.js +++ /dev/null @@ -1,41 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:a -map 0:s? -map 0:d? -c copy -c:v:0 libx265 -max_muxing_queue_size 9999', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is a video! \n☒File is not hevc! \n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH265_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑File is a video! \n☑File is already in hevc! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js b/tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js deleted file mode 100644 index c6627a6..0000000 --- a/tests/Community/Tdarr_Plugin_075a_Transcode_Customisable.js +++ /dev/null @@ -1,81 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "Very Fast 1080p30" --all-subtitles --all-audio', - container: '.mkv', - handBrakeMode: true, - FFmpegMode: false, - reQueueAfter: true, - infoLog: '☒File is not in desired codec! \n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH265_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑File is already in hevc! \n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - codecs_to_exclude: 'h264', - }, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑File is already in h264! \n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - codecs_to_exclude: 'hevc', - cli: 'handbrake', - transcode_arguments: '-Z "Very Fast 480p30"', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "Very Fast 480p30"', - container: '.mkv', - handBrakeMode: true, - FFmpegMode: false, - reQueueAfter: true, - infoLog: '☒File is not in desired codec! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js b/tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js deleted file mode 100644 index d6dc22c..0000000 --- a/tests/Community/Tdarr_Plugin_075b_FFMPEG_HEVC_Generic_Video_Audio_Only.js +++ /dev/null @@ -1,41 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:a -c copy -c:v:0 libx265 -max_muxing_queue_size 9999', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is a video! \n☒File is not hevc! \n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH265_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑File is a video! \n☑File is already in hevc! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js b/tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js deleted file mode 100644 index 88633af..0000000 --- a/tests/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js +++ /dev/null @@ -1,41 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:a -c copy -c:v:0 libx265 -crf 20', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is a video! \n☒File is not hevc! \n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH265_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑File is a video! \n☑File is already in hevc! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js b/tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js deleted file mode 100644 index 0d7ee54..0000000 --- a/tests/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js +++ /dev/null @@ -1,41 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:a -c copy -c:v:0 hevc_nvenc -crf 20', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is a video! \n☒File is not hevc! \n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH265_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑File is a video! \n☑File is already in hevc! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js b/tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js deleted file mode 100644 index 95a1b47..0000000 --- a/tests/Community/Tdarr_Plugin_076a_re_order_audio_streams.js +++ /dev/null @@ -1,43 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_2.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑ Preferred language is already first audio track! \n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_2.json'), - librarySettings: {}, - inputs: { - preferred_language: 'fre', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -c copy -map 0:v -map 0:a:3 -disposition:a:0 default -map 0:a:0 -map 0:a:1 -disposition:a:1 0 -map 0:a:2 -disposition:a:2 0 -disposition:a:3 0 -map 0:a:4 -disposition:a:4 0 -map 0:s? -map 0:d? ', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒ Desired audio lang is not first audio stream, moving! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js b/tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js deleted file mode 100644 index cc9ef73..0000000 --- a/tests/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js +++ /dev/null @@ -1,62 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_2.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☒ No subtitle tracks in desired language! \n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_2.json'), - librarySettings: {}, - inputs: { - preferred_language: 'fre', - }, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑ Preferred language is already first subtitle track! \n', - }, - - }, { - input: { - file: require('../sampleData/media/sampleH264_3.json'), - librarySettings: {}, - inputs: { - preferred_language: 'fre', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -c copy -map 0:v -map 0:a -map 0:s:1 -disposition:s:0 default -map 0:s:0 -disposition:s:1 0 -map 0:d? ', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒ Desired subtitle lang is not first subtitle stream, moving! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js b/tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js deleted file mode 100644 index 9a3053c..0000000 --- a/tests/Community/Tdarr_Plugin_077b_HandBrake_NVENC_264_Configurable.js +++ /dev/null @@ -1,44 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑ File is already in h264, no need to transcode! \n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH265_1.json'), - librarySettings: {}, - inputs: { - handbrake_preset: 'Very Fast 1080p30', - output_container: '.mp4', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "Very Fast 1080p30" -e nvenc_h264 --all-audio --all-subtitles', - container: '.mp4', - handBrakeMode: true, - FFmpegMode: false, - reQueueAfter: true, - infoLog: '☒ File is not in h264, transcoding! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js b/tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js deleted file mode 100644 index 780bf5d..0000000 --- a/tests/Community/Tdarr_Plugin_A47j_FFMPEG_NVENC_HEVC_Video_Only.js +++ /dev/null @@ -1,112 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-vsync 0 -hwaccel cuda -hwaccel_output_format cuda -c:v h264_cuvid ,-map 0:v -map 0:a -map 0:s? -map -:d? -c copy -c:v:0 hevc_nvenc -preset medium -profile:v main10 -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -max_muxing_queue_size 4096 -b:v 967680 -maxrate 1257984 -minrate 677376 -bufsize 1205959 -map_metadata:g -1', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'No valid resolution selected, defaulting to 8KUHD.\n' - + 'Video details: h264-720p \n' - + ' 1280x720x25@8 bits.\n' - + 'Video bitrate is 1206Kbps, overall is 1591Kbps. Calculated target is 1613Kbps.\n' - + '☒H264 Resolution is 720p, bitrate was 1206Kbps. HEVC target bitrate will be 968Kbps.\n' - + '☒Transcoding to HEVC.', - }, - }, { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: { - ffmpegPreset: 'veryslow', - container: 'mkv', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-vsync 0 -hwaccel cuda -hwaccel_output_format cuda -c:v hevc_cuvid ,-map 0:v -map 0:a -map 0:s? -map -:d? -c copy -c:v:0 hevc_nvenc -preset veryslow -profile:v main10 -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -max_muxing_queue_size 4096 -b:v 3207442 -maxrate 4717440 -minrate 2540160 -bufsize 3628800 -map_metadata:g -1', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'No valid resolution selected, defaulting to 8KUHD.\n' - + 'Video details: hevc-1080p \n' - + ' 1920x1080x25@8 bits.\n' - + 'Video bitrate is NaNKbps, overall is 3207Kbps. Calculated target is 3629Kbps.\n' - + '☒HEVC Bitrate for 1080p could not be determined, \n' - + ' using sensible default of 3207Kbps.\n' - + '☒Transcoding to HEVC.', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: { - maxResolution: '720p', - ffmpegPreset: 'veryslow', - container: 'mkv', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-vsync 0 -hwaccel cuda -hwaccel_output_format cuda -c:v hevc_cuvid -resize 1280x720 ,-map 0:v -map 0:a -map 0:s? -map -:d? -c copy -c:v:0 hevc_nvenc -preset veryslow -profile:v main10 -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -max_muxing_queue_size 4096 -b:v 1612800 -maxrate 2096640 -minrate 1128960 -bufsize 1612800 -map_metadata:g -1', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Resizing to 1280x720.\n' - + 'Video details: hevc-1080p \n' - + ' 1920x1080x25@8 bits.\n' - + 'Video bitrate is NaNKbps, overall is 3207Kbps. Calculated target is 1613Kbps.\n' - + '☒HEVC Bitrate for 1080p could not be determined, \n' - + ' using sensible default of 1613Kbps.\n' - + '☒Transcoding to HEVC.', - }, - }, - { - input: { - file: (() => { - // modify so no processing needed - const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); - file.ffProbeData.streams[0].codec_name = 'hevc'; - return file; - })(), - librarySettings: {}, - inputs: { - maxResolution: '1080p', - ffmpegPreset: 'veryslow', - container: 'mkv', - compressionFactor: '1', - }, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '-vsync 0 -hwaccel cuda -hwaccel_output_format cuda -c:v hevc_cuvid ,-map 0:v -map 0:a -map 0:s? -map -:d? -c copy -c:v:0 hevc_nvenc -preset veryslow -profile:v main10 -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -max_muxing_queue_size 4096 ', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Video details: hevc-1080p \n' - + ' 1918x1080x25@8 bits.\n' - + 'Video bitrate is 6454Kbps, overall is 8249Kbps. Calculated target is 51786Kbps.\n' - + '☑HEVC Bitrate is within limits.\n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js b/tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js deleted file mode 100644 index 6557f17..0000000 --- a/tests/Community/Tdarr_Plugin_DOOM_NVENC_Tiered_MKV_CleanAll.js +++ /dev/null @@ -1,75 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - container: '.mkv', - FFmpegMode: true, - handBrakeMode: false, - infoLog: '☒ Removing audio track in language und\n' - + '☒ *** All audio tracks would have been removed. Defaulting to keeping all tracks for this file.\n' - + '☒ Transcoding to HEVC using NVidia NVENC\n' - + '☑ No subtitle processing necessary', - processFile: true, - preset: ' -c:v h264_cuvid,-map 0 -map -0:d -c:v hevc_nvenc -qmin 0 -cq:v 30 -b:v 602k -maxrate:v 2602k -preset medium -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -c:a copy -c:s copy -max_muxing_queue_size 9999 -bf 5 -analyzeduration 2147483647 -probesize 2147483647', - reQueueAfter: true, - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - container: '.mkv', - FFmpegMode: true, - handBrakeMode: false, - infoLog: '☑ File is in HEVC codec and in MKV\n' - + '☑ No video processing necessary\n' - + '☑ No subtitle processing necessary\n' - + '☑ No need to process file', - processFile: false, - preset: ',-map 0 -map -0:d -c:v copy -c:a copy -c:s copy -max_muxing_queue_size 9999 -bf 5 -analyzeduration 2147483647 -probesize 2147483647', - reQueueAfter: true, - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - file.ffProbeData.streams[0].bit_rate = undefined; - return file; - })(), - librarySettings: {}, - inputs: { - target_bitrate_720p: '1500000', - }, - otherArguments: {}, - }, - output: { - container: '.mkv', - FFmpegMode: true, - handBrakeMode: false, - infoLog: '☒ Removing audio track in language und\n' - + '☒ *** All audio tracks would have been removed. Defaulting to keeping all tracks for this file.\n' - + '☒ Transcoding to HEVC using NVidia NVENC\n' - + '☑ No subtitle processing necessary', - processFile: true, - preset: ' -c:v h264_cuvid,-map 0 -map -0:d -c:v hevc_nvenc -qmin 0 -cq:v 30 -b:v 1500k -maxrate:v 3500k -preset medium -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -c:a copy -c:s copy -max_muxing_queue_size 9999 -bf 5 -analyzeduration 2147483647 -probesize 2147483647', - reQueueAfter: true, - }, - }, - -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js deleted file mode 100644 index c725079..0000000 --- a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js +++ /dev/null @@ -1,107 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - container: '.mkv', - processFile: true, - preset: ', -sn -map 0:v -c:v copy -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -map 0:a -c:a copy ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Converting video, NOT resizing. 720p, h264 --> 720p, hevc. bitrate = 1517 --> 758, multiplier 0.5. \n' - + 'Not converting audio. \n' - + '2 channels - \n' - + '6 channels - und aac \n' - + '8 channels - ', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - container: '.mkv', - processFile: false, - preset: '', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'File is processed already, nothing to do', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: { - resize: 'true', - }, - otherArguments: {}, - }, - output: { - container: '.mkv', - processFile: false, - preset: '', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'File is processed already, nothing to do', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: { - bitrate_cutoff: '6000', - }, - otherArguments: {}, - }, - output: { - container: '.mkv', - processFile: true, - preset: ', -sn -map 0:v -c:v copy -b:v 3933k -minrate 2753k -maxrate 5112k -bufsize 7866k -map 0:a -c:a copy ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Converting video, NOT resizing. 1080p, h264 --> 1080p, hevc. bitrate = 7866 --> 3933, multiplier 0.5. \n' - + 'Not converting audio. \n' - + '2 channels - eng flac \n' - + '6 channels - \n' - + '8 channels - ', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: { - bitrate_cutoff: '8000', - }, - otherArguments: {}, - }, - output: { - container: '.mkv', - processFile: false, - preset: '', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'File is processed already, nothing to do', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js b/tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js deleted file mode 100644 index ef5221c..0000000 --- a/tests/Community/Tdarr_Plugin_Greg_MP3_FFMPEG_CPU.js +++ /dev/null @@ -1,59 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - preset: ', -map_metadata 0 -id3v2_version 3 -b:a 320k', - container: '.mp3', - handbrakeMode: false, - ffmpegMode: true, - processFile: false, - reQueueAfter: true, - infoLog: 'undefined☒Codec excluded \n ☑Codec not excluded \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleAAC_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - preset: ', -map_metadata 0 -id3v2_version 3 -b:a 320k', - container: '.mp3', - handbrakeMode: false, - ffmpegMode: true, - processFile: false, - reQueueAfter: true, - infoLog: 'undefined☒Codec excluded \n ☑Codec not excluded \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleMP3_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - preset: ', -map_metadata 0 -id3v2_version 3 -b:a 320k', - container: '.mp3', - handbrakeMode: false, - ffmpegMode: true, - processFile: false, - reQueueAfter: true, - infoLog: 'undefined☒Codec excluded \n ☒Codec excluded \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js deleted file mode 100644 index a329f18..0000000 --- a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js +++ /dev/null @@ -1,145 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-c:v h264_cuvid, -map 0 -c:v hevc_nvenc -cq:v 19 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:s copy -max_muxing_queue_size 9999 ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Container for output selected as mkv. \n' - + 'Current bitrate = 1517 \n' - + 'Bitrate settings: \n' - + 'Target = 758 \n' - + 'Minimum = 530 \n' - + 'Maximum = 985 \n' - + 'File is not hevc or vp9. Transcoding. \n', - container: '.mkv', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'File is already hevc or vp9 & in mkv. \n', - container: '.mkv', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - container: 'mp4', - enable_10bit: 'true', - force_conform: 'true', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-c:v h264_cuvid, -map 0 -c:v hevc_nvenc -cq:v 19 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Container for output selected as mp4. \n' - + 'Current bitrate = 1517 \n' - + 'Bitrate settings: \n' - + 'Target = 758 \n' - + 'Minimum = 530 \n' - + 'Maximum = 985 \n' - + 'File is not hevc or vp9. Transcoding. \n', - container: '.mp4', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - container: 'mp4', - enable_10bit: 'true', - force_conform: 'true', - bitrate_cutoff: '10000', - }, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Current bitrate is below set cutoff of 10000. Cancelling plugin. \n', - container: '.mp4', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - container: 'mp4', - enable_10bit: 'true', - force_conform: 'true', - bitrate_cutoff: '1000', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-c:v h264_cuvid, -map 0 -c:v hevc_nvenc -cq:v 19 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Container for output selected as mp4. \n' - + 'Current bitrate = 1517 \n' - + 'Bitrate settings: \n' - + 'Target = 758 \n' - + 'Minimum = 530 \n' - + 'Maximum = 985 \n' - + 'File is not hevc or vp9. Transcoding. \n', - container: '.mp4', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: { - container: 'mp4', - force_conform: 'false', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0 -c copy ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'File is hevc or vp9 but is not in mp4 container. Remuxing. \n', - container: '.mp4', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js deleted file mode 100644 index 6e1afa3..0000000 --- a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js +++ /dev/null @@ -1,145 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0 -c:v libx265 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -c:a copy -c:s copy -max_muxing_queue_size 9999 ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Container for output selected as mkv. \n' - + 'Current bitrate = 1517 \n' - + 'Bitrate settings: \n' - + 'Target = 758 \n' - + 'Minimum = 530 \n' - + 'Maximum = 985 \n' - + 'File is not hevc or vp9. Transcoding. \n', - container: '.mkv', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'File is already hevc or vp9 & in mkv. \n', - container: '.mkv', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - container: 'mp4', - enable_10bit: 'true', - force_conform: 'true', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0 -c:v libx265 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Container for output selected as mp4. \n' - + 'Current bitrate = 1517 \n' - + 'Bitrate settings: \n' - + 'Target = 758 \n' - + 'Minimum = 530 \n' - + 'Maximum = 985 \n' - + 'File is not hevc or vp9. Transcoding. \n', - container: '.mp4', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - container: 'mp4', - enable_10bit: 'true', - force_conform: 'true', - bitrate_cutoff: '10000', - }, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Current bitrate is below set bitrate cutoff of 10000. Nothing to do, cancelling plugin. \n', - container: '.mp4', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - container: 'mp4', - enable_10bit: 'true', - force_conform: 'true', - bitrate_cutoff: '1000', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0 -c:v libx265 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Container for output selected as mp4. \n' - + 'Current bitrate = 1517 \n' - + 'Bitrate settings: \n' - + 'Target = 758 \n' - + 'Minimum = 530 \n' - + 'Maximum = 985 \n' - + 'File is not hevc or vp9. Transcoding. \n', - container: '.mp4', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: { - container: 'mp4', - force_conform: 'false', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0 -c copy ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'File is hevc or vp9 but is not in mp4 container. Remuxing. \n', - container: '.mp4', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js b/tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js deleted file mode 100644 index 16051f0..0000000 --- a/tests/Community/Tdarr_Plugin_MC93_Migz1Remux.js +++ /dev/null @@ -1,45 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0 -c copy -max_muxing_queue_size 9999 ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒File is mp4 but requested to be mkv container. Remuxing. \n', - container: '.mkv', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - container: 'mp4', - force_conform: 'true', - }, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is already in mp4 container. \n', - container: '.mp4', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js b/tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js deleted file mode 100644 index 5208106..0000000 --- a/tests/Community/Tdarr_Plugin_MC93_Migz2CleanTitle.js +++ /dev/null @@ -1,46 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -metadata title= -c copy -map 0 -max_muxing_queue_size 9999', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒File has title metadata. Removing \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - file.meta.Title = undefined; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☑File has no title metadata \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js b/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js deleted file mode 100644 index 11bd864..0000000 --- a/tests/Community/Tdarr_Plugin_MC93_Migz3CleanAudio.js +++ /dev/null @@ -1,98 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: "☑File doesn't contain audio tracks which are unwanted or that require tagging.\n", - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: { - language: 'eng', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0 -map -0:a:3 -c copy -max_muxing_queue_size 9999', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒Audio stream 0:a:3 has unwanted language tag fre, removing. \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); - file.ffProbeData.streams[3].tags.title = 'description'; - return file; - })(), - librarySettings: {}, - inputs: { - language: 'eng', - commentary: 'true', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0 -map -0:a:2 -map -0:a:3 -c copy -max_muxing_queue_size 9999', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒Audio stream 0:a:2 detected as being descriptive, removing. \n' - + '☒Audio stream 0:a:3 has unwanted language tag fre, removing. \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); - file.ffProbeData.streams[2].tags.title = 'description'; - file.ffProbeData.streams[3].tags.language = 'und'; - return file; - })(), - librarySettings: {}, - inputs: { - language: 'eng', - commentary: 'true', - tag_language: 'eng', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0 -map -0:a:1 -map -0:a:2 -metadata:s:a:2 language=eng -map -0:a:3 -c copy -max_muxing_queue_size 9999', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒Audio stream 0:a:1 detected as being descriptive, removing. \n' - + '☒Audio stream 0:a:2 has unwanted language tag und, removing. \n' - + '☒Audio stream 0:a:2 detected as having no language, tagging as eng. \n' - + '☒Audio stream 0:a:3 has unwanted language tag fre, removing. \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js b/tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js deleted file mode 100644 index fa10ac5..0000000 --- a/tests/Community/Tdarr_Plugin_MC93_Migz4CleanSubs.js +++ /dev/null @@ -1,72 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: "☑File doesn't contain subtitle tracks which are unwanted or that require tagging.\n", - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0 -map -0:s:0 -c copy -max_muxing_queue_size 9999', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒Subtitle stream 0:s:0 has unwanted language tag fre, removing. \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); - - file.ffProbeData.streams[7] = _.cloneDeep(file.ffProbeData.streams[6]); - file.ffProbeData.streams[6].tags.title = 'description'; - file.ffProbeData.streams[7].tags.language = 'und'; - return file; - })(), - librarySettings: {}, - inputs: { - language: 'eng,und', - commentary: 'true', - tag_language: 'eng', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0 -map -0:s:0 -map -0:s:0 -metadata:s:s:1 language=eng -c copy -max_muxing_queue_size 9999', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒Subtitle stream 0:s:0 has unwanted language tag fre, removing. \n' - + '☒Subtitle stream 0:s:0 detected as being descriptive, removing. \n' - + '☒Subtitle stream 0:s:1 has no language, tagging as eng. \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js b/tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js deleted file mode 100644 index 9d9497c..0000000 --- a/tests/Community/Tdarr_Plugin_MC93_Migz5ConvertAudio.js +++ /dev/null @@ -1,90 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒Plugin has not been configured, please configure required options. Skipping this plugin. \n', - }, - }, - - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - aac_stereo: 'true', - }, - otherArguments: {}, - }, - output: { - processFile: false, - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File contains all required audio formats. \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: { - aac_stereo: 'true', - }, - otherArguments: {}, - }, - output: { - processFile: true, - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒Audio track is 2 channel but is not AAC. Converting. \n' - + '☒Audio track is 2 channel but is not AAC. Converting. \n' - + '☒Audio track is 2 channel but is not AAC. Converting. \n', - preset: ', -map 0 -c:v copy -c:a copy -c:a:0 aac -c:a:1 aac -c:a:2 aac -strict -2 -c:s copy -max_muxing_queue_size 9999 ', - }, - }, - - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); - file.ffProbeData.streams[1].channels = 8; - return file; - })(), - librarySettings: {}, - inputs: { - aac_stereo: 'false', - downmix: 'true', - }, - otherArguments: {}, - }, - output: { - processFile: true, - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒Audio track is 8 channel, no 6 channel exists. Creating 6 channel from 8 channel. \n', - preset: ', -map 0 -c:v copy -c:a copy -map 0:1 -c:a:0 ac3 -ac 6 -metadata:s:a:0 title="5.1" -strict -2 -c:s copy -max_muxing_queue_size 9999 ', - }, - }, - -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js b/tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js deleted file mode 100644 index d4a111a..0000000 --- a/tests/Community/Tdarr_Plugin_MC93_Migz6OrderStreams.js +++ /dev/null @@ -1,103 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - infoLog: '☑ Streams are in expected order. \n ', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - infoLog: '☑ Streams are in expected order. \n ', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); - file.ffProbeData.streams[1].channels = 8; - file.ffProbeData.streams[2].channels = 6; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:0 -map 0:3 -map 0:4 -map 0:5 -map 0:2 -map 0:1 -map 0:6 -c copy -max_muxing_queue_size 9999', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - infoLog: '☒ Audio 6ch not second. \n' - + '☒ Audio 2ch not first. \n' - + '☒ Audio 2ch not first. \n' - + '☒ Audio 2ch not first. \n' - + '☒ Streams are out of order, reorganizing streams. Video, Audio, Subtitles. \n', - reQueueAfter: true, - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); - file.ffProbeData.streams[1].channels = 8; - file.ffProbeData.streams[2].channels = 6; - const video = file.ffProbeData.streams.splice(0, 1)[0]; - file.ffProbeData.streams.push(video); - const subs = file.ffProbeData.streams.splice(5, 1)[0]; - file.ffProbeData.streams.unshift(subs); - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:6 -map 0:3 -map 0:4 -map 0:5 -map 0:2 -map 0:1 -map 0:0 -c copy -max_muxing_queue_size 9999', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - infoLog: '☒ Audio not second. \n' - + '☒ Audio not second. \n' - + '☒ Audio 6ch not second. \n' - + '☒ Audio not second. \n' - + '☒ Audio 2ch not first. \n' - + '☒ Audio not second. \n' - + '☒ Audio 2ch not first. \n' - + '☒ Audio not second. \n' - + '☒ Audio 2ch not first. \n' - + '☒ Video not first. \n' - + '☒ Streams are out of order, reorganizing streams. Video, Audio, Subtitles. \n', - reQueueAfter: true, - }, - }, - -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js b/tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js deleted file mode 100644 index bdb0c02..0000000 --- a/tests/Community/Tdarr_Plugin_MC93_MigzImageRemoval.js +++ /dev/null @@ -1,46 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - handBrakeMode: false, - container: '.mp4', - FFmpegMode: true, - reQueueAfter: true, - infoLog: "☑File doesn't contain any unwanted image format streams.\n", - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); - file.ffProbeData.streams[0].codec_name = 'mjpeg'; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0 -c copy -max_muxing_queue_size 9999 -map -v:0 ', - handBrakeMode: false, - container: '.mkv', - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒File has image format stream, removing. \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js b/tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js deleted file mode 100644 index 40adead..0000000 --- a/tests/Community/Tdarr_Plugin_MP01_MichPasCleanSubsAndAudioCodecs.js +++ /dev/null @@ -1,47 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: "☑File doesn't contain subtitle or audio codecs which were unwanted or that require tagging.\n", - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: { - tag_subtitle_codecs: 'subrip', - tag_audio_codecs: 'aac', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0 -map -0:a:3 -map -0:a:4 -map -0:s:0 -c copy -max_muxing_queue_size 4096', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒audio stream detected as unwanted. removing audio stream 0:a:3 - Français E-AC3 2.0 - aac \n' - + '☒audio stream detected as unwanted. removing audio stream 0:a:4 - Anglais E-AC3 2.0 - aac \n' - + '☒Subtitle stream detected as unwanted. removing subtitle stream 0:s:0 - Français - subrip. \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js b/tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js deleted file mode 100644 index 1c5438d..0000000 --- a/tests/Community/Tdarr_Plugin_Mthr_VaapiHEVCTranscode.js +++ /dev/null @@ -1,107 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi ,-map 0:v -map 0:a -map 0:s? -map 0:d? -map 0:t? -c copy -c:v:0 hevc_vaapi -b:v 758k -minrate 530k -maxrate 985k -bufsize 1M -max_muxing_queue_size 1024 ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☒ Video stream 0 is not HEVC, transcode required.\n' - + ' ☑ Stream analysis complete, processing required.\n' - + ' ', - container: 'mp4', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☑ Stream analysis complete, no processing required.\n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - minBitrate: '4000', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi ,-map 0:v -map 0:a -map 0:s? -map 0:d? -map 0:t? -c copy ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: "☒ Input file's bitrate 1517 is lower than the minimum bitrate threshold of 4000. Skipping this plugin.\n" - + '☑ Stream analysis complete, processing required.\n' - + ' ', - container: 'mp4', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - remuxOnly: 'true', - }, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☒ RemuxOnly is enabled and file is not a remux. Unable to process.\n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); - file.file = `remux ${file.file}`; - return file; - })(), - librarySettings: {}, - inputs: { - remuxOnly: 'true', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi ,-map 0:v -map 0:a -map 0:s? -map 0:d? -map 0:t? -c copy -c:v:0 hevc_vaapi -b:v 3933k -minrate 2753k -maxrate 5112k -bufsize 1M -max_muxing_queue_size 1024 ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☒ Video stream 0 is not HEVC, transcode required.\n' - + ' ☑ Stream analysis complete, processing required.\n' - + ' ', - container: 'mkv', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js deleted file mode 100644 index 22d571d..0000000 --- a/tests/Community/Tdarr_Plugin_a37x_Drawmonster_MP4_No_Title_Meta.js +++ /dev/null @@ -1,42 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map_metadata -1 -map 0 -c copy', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒File has title metadata \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☑File has no title metadata \n☑File meets conditions! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js b/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js deleted file mode 100644 index 805c984..0000000 --- a/tests/Community/Tdarr_Plugin_a8hc_HaveAGitGat_HandBrake_H264_VeryFast1080p30.js +++ /dev/null @@ -1,66 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map_metadata -1 -map 0 -c copy', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is already in h264! \n☑File has no subs \n☒File has title metadata \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "Very Fast 1080p30"', - container: '.mp4', - handBrakeMode: true, - FFmpegMode: false, - reQueueAfter: true, - infoLog: '☒File is not in h264! \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - file.meta.Title = undefined; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑File is already in h264! \n' - + '☑File has no subs \n' - + '☑File has no title metadata☑File has aac track \n' - + '☑File meets conditions! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js b/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js deleted file mode 100644 index 47cc98c..0000000 --- a/tests/Community/Tdarr_Plugin_a9hc_HaveAGitGat_HandBrake_H264_Fast1080p30.js +++ /dev/null @@ -1,66 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map_metadata -1 -map 0 -c copy', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is already in h264! \n☑File has no subs \n☒File has title metadata \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "Fast 1080p30"', - container: '.mp4', - handBrakeMode: true, - FFmpegMode: false, - reQueueAfter: true, - infoLog: '☒File is not in h264! \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - file.meta.Title = undefined; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑File is already in h264! \n' - + '☑File has no subs \n' - + '☑File has no title metadata☑File has aac track \n' - + '☑File meets conditions! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js b/tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js deleted file mode 100644 index 4bf0913..0000000 --- a/tests/Community/Tdarr_Plugin_a9hd_FFMPEG_Transcode_Specific_Audio_Stream_Codecs.js +++ /dev/null @@ -1,45 +0,0 @@ -/* eslint max-len: 0 */ -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑ File does not have any streams that need to be transcoded! \n', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - codecs_to_transcode: 'aac', - codec: 'eac3', - bitrate: '640k', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -c copy -map 0:v -map 0:1 -c:1 eac3 -b:a 640k -map 0:s? -map 0:d? -max_muxing_queue_size 9999', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: "☒ File has streams which aren't in desired codec! \n", - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js b/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js deleted file mode 100644 index 7e1de0d..0000000 --- a/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js +++ /dev/null @@ -1,68 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: {}, - otherArguments: { - originalLibraryFile: require('../sampleData/media/sampleH264_1.json'), - }, - }, - output: { - processFile: false, - preset: '', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'New file has size 1.008 MB which is 100% of original file size: 1.008 MB', - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - upperBound: '110', - lowerBound: '35', - }, - otherArguments: { - originalLibraryFile: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - file.file_size = 3; - return file; - })(), - }, - }, - output: 'New file size not within limits. New file has size 1.008 MB which is 33% of original file size: 3.000 MB. lowerBound is 35%', - error: { - shouldThrow: true, - }, - }, - { - input: { - file: require('../sampleData/media/sampleH264_1.json'), - librarySettings: {}, - inputs: { - upperBound: '120', - lowerBound: '35', - }, - otherArguments: { - originalLibraryFile: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - file.file_size = 0.1; - return file; - })(), - }, - }, - output: 'New file size not within limits. New file has size 1.008 MB which is 1007% of original file size: 0.100 MB. upperBound is 120%', - error: { - shouldThrow: true, - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js b/tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js deleted file mode 100644 index 9c01863..0000000 --- a/tests/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js +++ /dev/null @@ -1,45 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0 -c copy -c:v:0 libx265 -preset:v slow -pix_fmt yuv420p10le -x265-params "crf=22:aq-mode=3"', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒File is not in hevc! \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑File is already in hevc! \n' - + '☑ All audio streams are in aac! \n' - + '☑File has no title metadata \n' - + '☑File meets conditions! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js b/tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js deleted file mode 100644 index a3b9e80..0000000 --- a/tests/Community/Tdarr_Plugin_b39x_the1poet_surround_sound_to_ac3.js +++ /dev/null @@ -1,59 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0 -c:v copy -c:a copy -c:a:0 ac3 -c:s copy -c:d copy', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒ File has surround audio which is NOT in ac3! \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑ All surround audio streams are in ac3! \n☑File meets conditions! \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: '☑ All surround audio streams are in ac3! \n☑File meets conditions! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js deleted file mode 100644 index 336f2f0..0000000 --- a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js +++ /dev/null @@ -1,86 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-fflags +genpts -hwaccel qsv -c:v h264_qsv -map 0 -c:v hevc_qsv -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset slow \n' - + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑ It looks like the current bitrate is 1517k. \n' - + '\n' - + 'Container for output selected as mkv. \n' - + 'Encode variable bitrate settings: \n' - + 'Target = 759k \n' - + 'Minimum = 569k \n' - + 'Maximum = 949k \n' - + 'File Transcoding... \n', - container: '.mkv', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - container: 'mp4', - encoder_speedpreset: 'fast', - enable_10bit: 'true', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-fflags +genpts -hwaccel qsv -map 0 -c:v hevc_qsv -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset fast \n' - + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -pix_fmt p010le ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑ It looks like the current bitrate is 1517k. \n' - + '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n' - + '\n' - + 'Container for output selected as mp4. \n' - + 'Encode variable bitrate settings: \n' - + 'Target = 759k \n' - + 'Minimum = 569k \n' - + 'Maximum = 949k \n' - + 'File Transcoding... \n', - container: '.mp4', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - container: 'mp4', - encoder_speedpreset: 'fast', - enable_10bit: 'true', - bitrate_cutoff: '2000', - }, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑ It looks like the current bitrate is 1517k. \n' - + '☑ Current bitrate is below set cutoff of 2000k. Cancelling plugin. \n', - container: '.mp4', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js b/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js deleted file mode 100644 index 1c012bf..0000000 --- a/tests/Community/Tdarr_Plugin_c0r1_SetDefaultAudioStream.js +++ /dev/null @@ -1,49 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - infoLog: '☑ No 2 channel audio stream exists. \n ', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); - - file.ffProbeData.streams[1].channels = 6; - return file; - })(), - librarySettings: {}, - inputs: { - channels: '6', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0 -c copy -disposition:1 default -disposition:2 0 -disposition:3 0 -disposition:4 0 -disposition:5 0 ', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - infoLog: '☒ Matching audio stream is not set to default. \n' - + '☒ Setting 6 channel matching audio stream to default. Remove default from all other audio streams \n', - reQueueAfter: true, - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js b/tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js deleted file mode 100644 index 455b2ca..0000000 --- a/tests/Community/Tdarr_Plugin_d5d3_iiDrakeii_FFMPEG_NVENC_Tiered_MKV.js +++ /dev/null @@ -1,50 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-c:v h264_cuvid,-map 0 -dn -c:v hevc_nvenc -pix_fmt p010le -qmin 0 -cq:v 30 -b:v 964k -maxrate:v 2964k -preset slow -rc-lookahead 32 -spatial_aq:v 1 -aq-strength:v 8 -a53cc 0 -c:a copy -c:s copy', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is a video! \n' - + '☒File is 720p!\n' - + '☒File is not hevc!\n' - + '☒File bitrate is 1205kb!\n' - + 'File bitrate is LOWER than the Default Target Bitrate!\n' - + '☒Target Bitrate set to 964kb!\n' - + 'File is being transcoded!\n', - maxmux: false, - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: true, - infoLog: '☑File is a video! \n☑File is already in hevc! \n', - maxmux: false, - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js b/tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js deleted file mode 100644 index c80b3dc..0000000 --- a/tests/Community/Tdarr_Plugin_d5d4_iiDrakeii_Not_A_Video_Mjpeg_Fix.js +++ /dev/null @@ -1,47 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: true, - infoLog: '☑File is a video Without Mjpeg! \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - file.ffProbeData.streams[0].codec_name = 'mjpeg'; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: ',-map 0 -map -0:v:1 -c:v copy -c:a copy -c:s copy', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: true, - infoLog: '☒File is not a video but has Mjpeg Stream! \n' - + '☑File is a video With Mjpeg! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js b/tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js deleted file mode 100644 index e382ca8..0000000 --- a/tests/Community/Tdarr_Plugin_da11_Dallas_FFmpeg_Presets_H264_MP4.js +++ /dev/null @@ -1,62 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map_metadata -1 -map 0:v -map 0:a -c:v copy -c:a copy -c:s mov_text', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑ File is already in h264!\n☒ File has title metadata\n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: { - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map_metadata -1 -map 0:V -map 0:a -c:v libx264 -preset medium -c:a aac -strict -2 -c:s mov_text', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒ File is not in h264!\n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: { - FFmpeg_preset: 'fast', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map_metadata -1 -map 0:V -map 0:a -c:v libx264 -preset fast -c:a aac -strict -2 -c:s mov_text', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒ File is not in h264!\n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js b/tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js deleted file mode 100644 index 250a2a7..0000000 --- a/tests/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js +++ /dev/null @@ -1,110 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - container: '.mkv', - FFmpegMode: true, - handBrakeMode: false, - infoLog: '☒ Will convert multi channel audio to AC3\n' - + '☒ Transcoding to HEVC (software)\n' - + 'Encoder configuration:\n' - + '• Original Bitrate: 1517\n' - + '• Target Bitrate: 1517\n' - + '• Minimum Bitrate: 1061\n' - + '• Maximum Bitrate: 1972\n' - + '\n' - + '☑ No subtitle processing necessary', - processFile: true, - preset: ',-map 0 -map -0:d -c:v libx265 -b:v 1517k -minrate 1061k -maxrate 1972k -bufsize 1517k -c:a copy -c:a:0 ac3 -c:s copy -max_muxing_queue_size 4096', - reQueueAfter: false, - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - nvenc: 'true', - }, - otherArguments: {}, - }, - output: { - container: '.mkv', - FFmpegMode: true, - handBrakeMode: false, - infoLog: '☒ Will convert multi channel audio to AC3\n' - + '☒ Transcoding to HEVC using NVidia NVENC\n' - + 'Encoder configuration:\n' - + '• Original Bitrate: 1517\n' - + '• Target Bitrate: 1517\n' - + '• Minimum Bitrate: 1061\n' - + '• Maximum Bitrate: 1972\n' - + '\n' - + '☑ No subtitle processing necessary', - processFile: true, - preset: '-c:v h264_cuvid,-map 0 -map -0:d -c:v hevc_nvenc -cq:v 19 -b:v 1517k -minrate 1061k -maxrate 1972k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:a:0 ac3 -c:s copy -max_muxing_queue_size 4096', - reQueueAfter: false, - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: { - nvenc: 'false', - qsv: 'true', - }, - otherArguments: {}, - }, - output: { - container: '.mkv', - FFmpegMode: true, - handBrakeMode: false, - infoLog: '☒ Will convert multi channel audio to AC3\n' - + '☒ Transcoding to HEVC using VAAPI\n' - + 'Encoder configuration:\n' - + '• Original Bitrate: 1517\n' - + '• Target Bitrate: 1517\n' - + '• Minimum Bitrate: 1061\n' - + '• Maximum Bitrate: 1972\n' - + '\n' - + '☑ No subtitle processing necessary', - processFile: true, - preset: '-hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi,-map 0 -map -0:d -c:v hevc_vaapi -b:v 1517k -minrate 1061k -maxrate 1972k -bufsize 1517k -c:a copy -c:a:0 ac3 -c:s copy -max_muxing_queue_size 4096', - reQueueAfter: false, - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - container: '.mkv', - FFmpegMode: true, - handBrakeMode: false, - infoLog: '☑ No multi channel audio found\n' - + '☑ No audio processing necessary\n' - + '☑ File is in HEVC codec and in MKV\n' - + '☑ No video processing necessary\n' - + '☑ No subtitle processing necessary\n' - + '☑ No need to process file', - processFile: false, - preset: ',-map 0 -map -0:d -c:v copy -c:a copy -c:s copy -max_muxing_queue_size 4096', - reQueueAfter: false, - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js deleted file mode 100644 index edbb610..0000000 --- a/tests/Community/Tdarr_Plugin_e3jc_Tharic_H.264_MKV_480p30_No_Subs_No_Title_Meta.js +++ /dev/null @@ -1,97 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "H.264 MKV 480p30"', - container: '.mkv', - handBrakeMode: true, - FFmpegMode: false, - reQueueAfter: true, - infoLog: '☒File is not h264 480p! \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "H.264 MKV 480p30"', - container: '.mkv', - handBrakeMode: true, - FFmpegMode: false, - reQueueAfter: true, - infoLog: '☒File is not h264 480p! \n', - }, - }, - - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - file.ffProbeData.streams[0].width = 720; - file.ffProbeData.streams[0].height = 480; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map_metadata -1 -map 0 -c copy', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is h264 480p! \n' - + '☑File has no title and has no subs \n' - + '☒File has title metadata \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - file.ffProbeData.streams[0].width = 720; - file.ffProbeData.streams[0].height = 480; - - file.meta.Title = undefined; - file.container = 'mkv'; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☑File is h264 480p! \n' - + '☑File has no title and has no subs \n' - + '☑File has no title metadata \n' - + '☑File has no subs \n' - + '☑File is in mkv container! \n' - + '☑File meets conditions! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js deleted file mode 100644 index 4371d6c..0000000 --- a/tests/Community/Tdarr_Plugin_e3jd_Tharic_H.264_MKV_720p30_No_Subs_No_Title_Meta.js +++ /dev/null @@ -1,99 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map_metadata -1 -map 0 -c copy', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is h264 720p! \n' - + '☑File has no title and has no subs \n' - + '☒File has title metadata \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "H.264 MKV 720p30"', - container: '.mkv', - handBrakeMode: true, - FFmpegMode: false, - reQueueAfter: true, - infoLog: '☒File is not h264 720p! \n', - }, - }, - - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - file.ffProbeData.streams[0].width = 1280; - file.ffProbeData.streams[0].height = 720; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map_metadata -1 -map 0 -c copy', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is h264 720p! \n' - + '☑File has no title and has no subs \n' - + '☒File has title metadata \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - file.ffProbeData.streams[0].width = 1280; - file.ffProbeData.streams[0].height = 720; - - file.meta.Title = undefined; - file.container = 'mkv'; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☑File is h264 720p! \n' - + '☑File has no title and has no subs \n' - + '☑File has no title metadata \n' - + '☑File has no subs \n' - + '☑File is in mkv container! \n' - + '☑File meets conditions! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js deleted file mode 100644 index 046e210..0000000 --- a/tests/Community/Tdarr_Plugin_e3je_Tharic_H.264_MKV_1080p30_No_Subs_No_Title_Meta.js +++ /dev/null @@ -1,96 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map_metadata -1 -map 0 -c copy', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is h264 1080p!☑File has no title and has no subs \n' - + '☒File has title metadata \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "H.264 MKV 1080p30"', - container: '.mkv', - handBrakeMode: true, - FFmpegMode: false, - reQueueAfter: true, - infoLog: '☒File is not h264 1080p! \n', - }, - }, - - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - file.ffProbeData.streams[0].width = 1920; - file.ffProbeData.streams[0].height = 1080; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map_metadata -1 -map 0 -c copy', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is h264 1080p!☑File has no title and has no subs \n' - + '☒File has title metadata \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - file.ffProbeData.streams[0].width = 1920; - file.ffProbeData.streams[0].height = 1080; - - file.meta.Title = undefined; - file.container = 'mkv'; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☑File is h264 1080p!☑File has no title and has no subs \n' - + '☑File has no title metadata \n' - + '☑File has no subs \n' - + '☑File is in mkv container! \n' - + '☑File meets conditions! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js b/tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js deleted file mode 100644 index 5a70598..0000000 --- a/tests/Community/Tdarr_Plugin_e5c3_CnT_Keep_Preferred_Audio.js +++ /dev/null @@ -1,94 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: ', -map 0:v', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: 'Removing unwanted audio...\n' - + 'Found unwanted: und: 1\n' - + 'Found unwanted: und: 1\n' - + 'No unwanted audio found!\n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: ', -map 0:v -map 0:1', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: false, - reQueueAfter: false, - infoLog: 'Removing unwanted audio...\nAdded undefined: 1\nNo unwanted audio found!\n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: { - languages: 'fre', - container: 'mp4', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0:v -map 0:4 -map 0:s? -c copy', - container: 'mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Removing unwanted audio...\n' - + 'Found wanted fre: 4\n' - + 'Found unwanted audio\n' - + 'It will be removed\n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: { - languages: 'eng', - container: 'mp4', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0:v -map 0:1 -map 0:2 -map 0:3 -map 0:5 -map 0:s? -c copy', - container: 'mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Removing unwanted audio...\n' - + 'Found wanted eng: 1\n' - + 'Found wanted eng: 2\n' - + 'Found wanted eng: 3\n' - + 'Found wanted eng: 5\n' - + 'Found unwanted audio\n' - + 'It will be removed\n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js b/tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js deleted file mode 100644 index 86bb3c1..0000000 --- a/tests/Community/Tdarr_Plugin_fd5T_Sparticus_4K_AC3_No_Subs.js +++ /dev/null @@ -1,48 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☒File is not a 4K video \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); - file.video_resolution = '4KUHD'; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-sn -map 0 -c copy', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File does not have only AC3 track commentaries! \n' - + '☑File has AC3 track! \n' - + '☒File has subs! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js b/tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js deleted file mode 100644 index 71c8098..0000000 --- a/tests/Community/Tdarr_Plugin_henk_Add_Specific_Audio_Codec.js +++ /dev/null @@ -1,85 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: ', -c copy -map 0:v ', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☒File is not mkv \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: ', -c copy -map 0:v -map 0:a:0? -c:a:0 copy -map 0:a:1? -c:a:1 copy -map 0:a:2? -c:a:2 copy -map 0:a:3? -c:a:3 copy -map 0:a:4? -c:a:4 copy ', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: "☑File doesn't contain audio tracks with the specified codec.\n", - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: { - input_codecs: 'aac', - output_codec: 'eac3', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -c copy -map 0:v -map 0:a:0? -c:a:0 copy -map 0:a:1? -c:a:1 copy -map 0:a:2? -c:a:2 copy -map 0:a:3? -c:a:3 copy -map 0:a:3? -c:a:4 eac3 -b:a:4 128k -metadata:s:a:4 title="" -metadata:s:a:4 copyright="henk_asac" -disposition:a:4 0 -map 0:a:4? -c:a:5 copy -map 0:a:4? -c:a:6 eac3 -b:a:6 128k -metadata:s:a:6 title="" -metadata:s:a:6 copyright="henk_asac" -disposition:a:6 0 -map 0:s? ', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: { - input_codecs: 'aac', - output_codec: 'eac3', - bitrate: '256', - auto_adjust: 'false', - position_new_audio: 'before', - }, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -c copy -map 0:v -map 0:a:0? -c:a:0 copy -map 0:a:1? -c:a:1 copy -map 0:a:2? -c:a:2 copy -map 0:a:3? -c:a:3 eac3 -b:a:3 256k -metadata:s:a:3 title="" -metadata:s:a:3 copyright="henk_asac" -disposition:a:3 0 -map 0:a:3? -c:a:4 copy -map 0:a:4? -c:a:5 eac3 -b:a:5 256k -metadata:s:a:5 title="" -metadata:s:a:5 copyright="henk_asac" -disposition:a:5 0 -map 0:a:4? -c:a:6 copy -map 0:s? ', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js b/tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js deleted file mode 100644 index 894d3a0..0000000 --- a/tests/Community/Tdarr_Plugin_hk75_Drawmonster_MP4_AAC_No_Subs_No_metaTitle.js +++ /dev/null @@ -1,68 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map_metadata -1 -c:v copy -c:a copy', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒File has title metadata \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -c:v copy -c:a copy', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File has no title metadata \n' - + '☑File has no subs \n' - + '☒File is not in mp4 container! \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json')); - file.container = 'mp4'; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☑File has no title metadata \n' - + '☑File has no subs \n' - + '☑File is in mp4 container! \n' - + '☑File meets conditions! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js b/tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js deleted file mode 100644 index df39e53..0000000 --- a/tests/Community/Tdarr_Plugin_hk76_GilbN_MP4_AAC_No_metaTitle.js +++ /dev/null @@ -1,66 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map_metadata -1 -map 0 -c copy', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is in mp4 container! \n☒File has title metadata \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ', -map 0 -c copy', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒File is not in mp4 container! \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json')); - file.container = 'mp4'; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☑File is in mp4 container! \n' - + '☑File has no title metadata \n' - + '☑File has aac track \n' - + '☑File meets conditions! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js b/tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js deleted file mode 100644 index 229b051..0000000 --- a/tests/Community/Tdarr_Plugin_jeons001_Downmix_to_stereo_and_apply_DRC.js +++ /dev/null @@ -1,42 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-sn -vcodec copy -scodec copy -acodec aac -filter:a "dynaudnorm,pan=stereo|FL < 1.0*FL + 0.707*FC + 0.707*BL|FR < 1.0*FR + 0.707*FC + 0.707*BR"', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'File matches requirements for processing. Downmixing and applying DRC!', - container: '.mp4', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'File has more than 1 audio track - not processing', - container: '.mkv', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js b/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js deleted file mode 100644 index 197cc39..0000000 --- a/tests/Community/Tdarr_Plugin_lmg1_Reorder_Streams.js +++ /dev/null @@ -1,50 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: 'File has video in first stream\n File meets conditions!\n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); - - const audio = file.ffProbeData.streams[1]; - // eslint-disable-next-line prefer-destructuring - file.ffProbeData.streams[1] = file.ffProbeData.streams[0]; - file.ffProbeData.streams[0] = audio; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v? -map 0:a? -map 0:s? -map 0:d? -map 0:t? -c copy', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Video is not in the first stream', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js b/tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js deleted file mode 100644 index 9dfabae..0000000 --- a/tests/Community/Tdarr_Plugin_nc7x_Drawmonster_No_Title_Meta.js +++ /dev/null @@ -1,42 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map_metadata -1 -map 0 -c copy', - container: '.mp4', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒File has title metadata \n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☑File has no title metadata \n☑File meets conditions! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js b/tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js deleted file mode 100644 index 4acaaaf..0000000 --- a/tests/Community/Tdarr_Plugin_r002_rootuser_FFMPEG_HQ_HEVC_MKV_Animation.js +++ /dev/null @@ -1,44 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0 -c:s copy -movflags use_metadata_tags -c:a aac -b:a 512k -c:v:0 libx265 -preset medium -x265-params crf=18:tune=animation:qcomp=0.7:aq-strength=1.1 -pix_fmt yuv420p10le -f matroska', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is a video! \n' - + '☒File is 720p but is not hevc!\n' - + '☒File will be transcoded!\n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is a video! \n☑File is already in hevc! \n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js b/tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js deleted file mode 100644 index 3cdab96..0000000 --- a/tests/Community/Tdarr_Plugin_raf4_Floorpie_FFmpeg_Tiered_HEVC_MKV.js +++ /dev/null @@ -1,67 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:s? -c:s srt -map 0:a -c copy -c:v:0 libx265 -preset fast -crf 25', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is a video! \n' - + '☒File is 720p but is not hevc!\n' - + '☒File will be transcoded!\n', - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is a video! \n☑File is already in hevc! \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH264_2.json')); - file.video_resolution = '480p'; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:s? -c:s srt -map 0:a -c copy -c:v:0 libx265 -preset fast -crf 27', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑File is a video! \n' - + '☒File is 480p but is not hevc!\n' - + '☒File will be transcoded!\n', - }, - }, -]; - -run(tests); diff --git a/tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js b/tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js deleted file mode 100644 index 36ea9c2..0000000 --- a/tests/Community/Tdarr_Plugin_s7x8_winsome_h265.js +++ /dev/null @@ -1,63 +0,0 @@ -/* eslint max-len: 0 */ -const _ = require('lodash'); -const run = require('../helpers/run'); - -const tests = [ - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: '-Z "H.265 MKV 2160p60" --all-audio --all-subtitles', - container: '.mkv', - handBrakeMode: true, - FFmpegMode: false, - reQueueAfter: true, - infoLog: "☒File isn't in hevc! \n", - }, - }, - { - input: { - file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: true, - preset: ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -b:a:0 192k -ac 2', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☒File has no language track in ac3,eac3,dts. No eng track marked so transcoding audio track 1 into ac3! \n', - }, - }, - { - input: { - file: (() => { - const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json')); - file.ffProbeData.streams[1].codec_name = 'ac3'; - return file; - })(), - librarySettings: {}, - inputs: {}, - otherArguments: {}, - }, - output: { - processFile: false, - preset: '', - container: '.mkv', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: false, - infoLog: '☑File is in mkv container! \n', - }, - }, -]; - -run(tests); diff --git a/tests/checkPlugins.js b/tests/checkPlugins.js index 13bab9d..725531a 100644 --- a/tests/checkPlugins.js +++ b/tests/checkPlugins.js @@ -1,16 +1,12 @@ /* eslint no-console: 0 */ // --> OFF -/* eslint max-len: 0 */ const fs = require('fs'); -const chalk = require('chalk'); const folders = [ './Community', './examples', ]; -let errorEncountered = false; - folders.forEach((folder) => { const files = fs.readdirSync(folder).filter((row) => row.includes('.js')); @@ -32,16 +28,16 @@ folders.forEach((folder) => { const importLib = 'const lib = require(\'../methods/lib\')();'; if (!read.includes(importLib)) { - console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${importLib}`)); + console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${importLib}`); read = `${importLib}\n${read}`; // fs.writeFileSync(`${folder}/${files[i]}`, read) - errorEncountered = true; + process.exit(1); } const detailsText = 'const details = () =>'; if (!read.includes(detailsText)) { - console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${detailsText}`)); - errorEncountered = true; + console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${detailsText}`); + process.exit(1); } const syncText = 'const plugin = (file, librarySettings, inputs, otherArguments) => {'; @@ -50,27 +46,27 @@ folders.forEach((folder) => { if (!read.includes(syncText) && !read.includes(asyncText) ) { - console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${syncText} or ${asyncText}`)); - errorEncountered = true; + console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${syncText} or ${asyncText}`); + process.exit(1); } const inputsText = 'inputs = lib.loadDefaultValues(inputs, details);'; if (!read.includes(inputsText) ) { - console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${inputsText}`)); - errorEncountered = true; + console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${inputsText}`); + process.exit(1); } const exportText = `module.exports.details = details; module.exports.plugin = plugin;`; if (!read.includes(exportText)) { - console.log(chalk.red(`Plugin error: '${folder}/${files[i]}' does not contain ${exportText}`)); + console.log(`Plugin error: '${folder}/${files[i]}' does not contain ${exportText}`); read = read.replace('module.exports.details = details;', ''); read = read.replace('module.exports.plugin = plugin;', ''); read += `\n${exportText}`; // fs.writeFileSync(`${folder}/${files[i]}`, read) - errorEncountered = true; + process.exit(1); } // check deps are within functions @@ -84,8 +80,8 @@ module.exports.plugin = plugin;`; const countOpen = allBefore.join(keyWord).split('{').length - 1; const countClose = allBefore.join(keyWord).split('}').length - 1; if (countOpen === countClose) { - console.log(chalk.red(`Plugin has requires outside of function '${folder}/${files[i]}'`)); - errorEncountered = true; + console.log(`Plugin has requires outside of function '${folder}/${files[i]}'`); + process.exit(1); } } } @@ -95,66 +91,64 @@ module.exports.plugin = plugin;`; // eslint-disable-next-line import/no-dynamic-require,global-require pluginDetails = require(`.${folder}/${files[i]}`).details(); } catch (err) { - console.log(chalk.red(err.message)); - errorEncountered = true; + console.log(err.message); + process.exit(1); } const detailsKeys = Object.keys(pluginDetails); - // eslint-disable-next-line no-loop-func detailsOrder.forEach((detail) => { if (detailsKeys.indexOf(detail) === -1) { - console.log(chalk.red(`Plugin details is missing '${folder}/${files[i]}' : ${detail}`)); - errorEncountered = true; + console.log(`Plugin details is missing '${folder}/${files[i]}' : ${detail}`); + process.exit(1); } }); - // eslint-disable-next-line no-loop-func detailsKeys.forEach((detail, index) => { if (detailsOrder[index] !== detail) { - console.log(chalk.red(`Plugin details keys are not in the correct order: '${folder}/${files[i]}' ${detail}`)); - errorEncountered = true; + console.log(`Plugin details keys are not in the correct order: '${folder}/${files[i]}' ${detail}`); + process.exit(1); } }); if (detailsKeys.length < detailsOrder.length) { - console.log(chalk.red(`Plugin details are too few '${folder}/${files[i]}'`)); - errorEncountered = true; + console.log(`Plugin details are too few '${folder}/${files[i]}'`); + process.exit(1); } if (!['Pre-processing', 'Post-processing'].includes(pluginDetails.Stage)) { - console.log(chalk.red(`Plugin does not have a valid Type'${folder}/${files[i]}'`)); - errorEncountered = true; + console.log(`Plugin does not have a valid Type'${folder}/${files[i]}'`); + process.exit(1); } if (!['Video', 'Audio', 'Subtitle', 'Any'].includes(pluginDetails.Type)) { - console.log(chalk.red(`Plugin does not have a valid Type'${folder}/${files[i]}'`)); - errorEncountered = true; + console.log(`Plugin does not have a valid Type'${folder}/${files[i]}'`); + process.exit(1); } if (files[i].split('.js').join('') !== pluginDetails.id) { - console.log(chalk.red(`Plugin file name does not match details id'${folder}/${files[i]}'`)); - errorEncountered = true; + console.log(`Plugin file name does not match details id'${folder}/${files[i]}'`); + process.exit(1); } if (!['Transcode', 'Filter'].includes(pluginDetails.Operation)) { - console.log(chalk.red(`Plugin does not have a valid Operation '${folder}/${files[i]}'`)); - errorEncountered = true; + console.log(`Plugin does not have a valid Operation '${folder}/${files[i]}'`); + process.exit(1); } else if (detailsKeys.length > detailsOrder.length) { - console.log(chalk.red(`Plugin details are too many '${folder}/${files[i]}'`)); - errorEncountered = true; + console.log(`Plugin details are too many '${folder}/${files[i]}'`); + process.exit(1); } else if (pluginDetails.Inputs && !Array.isArray(pluginDetails.Inputs)) { // Check default values are set; - console.log(chalk.red(`Plugin Inputs is not an array: ${files[i]}`)); - errorEncountered = true; + console.log(`Plugin Inputs is not an array: ${files[i]}`); + process.exit(1); } else if (pluginDetails.Inputs && Array.isArray(pluginDetails.Inputs)) { const inputs = pluginDetails.Inputs; const savedInputs = {}; for (let j = 0; j < inputs.length; j += 1) { // Prevent duplicate plugin inputs if (savedInputs[inputs[j].name] === true) { - console.log(chalk.red(`Plugin Input already exists: '${folder}/${files[i]}' : ${inputs[j].name}`)); - errorEncountered = true; + console.log(`Plugin Input already exists: '${folder}/${files[i]}' : ${inputs[j].name}`); + process.exit(1); } else { savedInputs[inputs[j].name] = true; } @@ -167,31 +161,31 @@ module.exports.plugin = plugin;`; || inputKeys[3] !== 'inputUI' || inputKeys[4] !== 'tooltip' ) { - console.log(chalk.red(`Plugin Input keys are not in correct order: '${folder}/${files[i]}' : ${inputs[j].name}`)); - errorEncountered = true; + console.log(`Plugin Input keys are not in correct order: '${folder}/${files[i]}' : ${inputs[j].name}`); + process.exit(1); } else if (inputs[j].type === undefined || !pluginInputTypes.includes(inputs[j].type)) { - console.log(chalk.red(`Plugin Input does not have a type: '${folder}/${files[i]}' : ${inputs[j].name}`)); - errorEncountered = true; + console.log(`Plugin Input does not have a type: '${folder}/${files[i]}' : ${inputs[j].name}`); + process.exit(1); } else if ( (inputs[j].type === 'string' && typeof inputs[j].defaultValue !== 'string') || (inputs[j].type === 'number' && typeof inputs[j].defaultValue !== 'number') || (inputs[j].type === 'boolean' && typeof inputs[j].defaultValue !== 'boolean') ) { - console.log(chalk.red(`Plugin Input type does not match defaultValue type: - '${folder}/${files[i]}' : ${inputs[j].name}`)); - errorEncountered = true; + console.log(`Plugin Input type does not match defaultValue type: + '${folder}/${files[i]}' : ${inputs[j].name}`); + process.exit(1); } else if (!['text', 'dropdown'].includes(inputs[j].inputUI.type)) { - console.log(chalk.red(`Plugin Input inputUI is invalid: '${folder}/${files[i]}' : ${inputs[j].name}`)); - errorEncountered = true; + console.log(`Plugin Input inputUI is invalid: '${folder}/${files[i]}' : ${inputs[j].name}`); + process.exit(1); } else if (inputs[j].defaultValue === undefined) { - console.log(chalk.red(`Plugin Input does not have a default value: '${folder}/${files[i]}' : ${inputs[j].name}`)); - errorEncountered = true; + console.log(`Plugin Input does not have a default value: '${folder}/${files[i]}' : ${inputs[j].name}`); + process.exit(1); } const count = read.split(inputs[j].name).length - 1; if (count === 1) { - console.log(chalk.red(`Plugin Input is not used: '${folder}/${files[i]}' : ${inputs[j].name}`)); - errorEncountered = true; + console.log(`Plugin Input is not used: '${folder}/${files[i]}' : ${inputs[j].name}`); + process.exit(1); } } } @@ -201,8 +195,3 @@ module.exports.plugin = plugin;`; }); console.log('Done!'); - -if (errorEncountered) { - console.log('Errors encountered'); - process.exit(1); -} diff --git a/tests/helpers/run.js b/tests/helpers/run.js deleted file mode 100644 index 58b6e05..0000000 --- a/tests/helpers/run.js +++ /dev/null @@ -1,55 +0,0 @@ -const path = require('path'); -const chai = require('chai'); -const _ = require('lodash'); -const importFresh = require('import-fresh'); - -const scriptName = path.basename(process.mainModule.filename); - -const run = async (tests) => { - try { - for (let i = 0; i < tests.length; i += 1) { - // eslint-disable-next-line no-console - console.log(`${scriptName}: test ${i}`); - const test = tests[i]; - - let testOutput; - let errorEncountered = false; - // eslint-disable-next-line import/no-dynamic-require - const { plugin } = importFresh(`../../Community/${scriptName}`); - - try { - // eslint-disable-next-line no-await-in-loop - testOutput = await plugin( - _.cloneDeep(test.input.file), - _.cloneDeep(test.input.librarySettings), - _.cloneDeep(test.input.inputs), - _.cloneDeep(test.input.otherArguments), - ); - } catch (err1) { - errorEncountered = err1; - } - - if (test.outputModify) { - testOutput = test.outputModify(test.output); - } - - if (test.error && test.error.shouldThrow) { - if (errorEncountered !== false) { - // eslint-disable-next-line no-console - console.log(errorEncountered); - chai.assert.deepEqual(errorEncountered.message, test.output); - } else { - throw new Error('Expected plugin error but none was thrown!'); - } - } else { - chai.assert.deepEqual(testOutput, test.output); - } - } - } catch (err) { - // eslint-disable-next-line no-console - console.error(err); - process.exit(1); - } -}; - -module.exports = run; diff --git a/tests/runTests.js b/tests/runTests.js deleted file mode 100644 index d5d7285..0000000 --- a/tests/runTests.js +++ /dev/null @@ -1,51 +0,0 @@ -/* eslint no-console: 0 */ // --> OFF - -const fs = require('fs'); -const chalk = require('chalk'); -const childProcess = require('child_process'); - -const filenames = fs.readdirSync(`${process.cwd()}/Community`).reverse(); - -const run = async () => { - for (let i = 0; i < filenames.length; i += 1) { - const pluginPath = `${process.cwd()}/Community/${filenames[i]}`; - const text = fs.readFileSync(pluginPath); - const pluginTestpath = `${__dirname}/Community/${filenames[i]}`; - - let shouldRunTest = true; - if (!text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) { - console.log(chalk.red(`${filenames[i]} does not have a test but should do.`)); - process.exit(1); - } else if (!text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) { - console.log(chalk.white(`${filenames[i]} running test`)); - } else if (text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) { - console.log(chalk.red(`${filenames[i]} should have // tdarrSkipTest removed`)); - process.exit(1); - } else if (text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) { - console.log(chalk.yellow(`${filenames[i]} skipping tests`)); - shouldRunTest = false; - } - - if (shouldRunTest) { - // eslint-disable-next-line no-await-in-loop - await new Promise((resolve) => { - childProcess.exec(`node "${pluginTestpath}"`, (err, stdout, stderr) => { - if (err) { - console.log(err); - } - console.log(stdout); - console.log(chalk.red(stderr)); - }).on('exit', async (code) => { - if (code !== 0) { - await new Promise((resolve2) => setTimeout(resolve2, 1000)); - process.exit(1); - } else { - resolve(); - } - }); - }); - } - } -}; - -run(); diff --git a/tests/sampleData/media/sampleAAC_1.json b/tests/sampleData/media/sampleAAC_1.json deleted file mode 100644 index 81d53e6..0000000 --- a/tests/sampleData/media/sampleAAC_1.json +++ /dev/null @@ -1,334 +0,0 @@ -{ - "_id": "C:/Transcode/Source Folder/qsv_h265.mkv", - "file": "C:/Transcode/Source Folder/qsv_h265.mkv", - "DB": "2MY5YD7P8", - "footprintId": "xkZP3IPR6g", - "hasClosedCaptions": false, - "container": "mkv", - "scannerReads": { - "ffProbeRead": "success", - "exiftoolRead": "success", - "mediaInfoRead": "success", - "closedCaptionRead": "\"Unable to run CCExtractor\"" - }, - "ffProbeData": { - "streams": [ - { - "index": 0, - "codec_name": "hevc", - "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)", - "profile": "Main", - "codec_type": "video", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "width": 1920, - "height": 1080, - "coded_width": 1920, - "coded_height": 1088, - "closed_captions": 0, - "has_b_frames": 1, - "sample_aspect_ratio": "1:1", - "display_aspect_ratio": "16:9", - "pix_fmt": "yuv420p", - "level": 150, - "color_range": "tv", - "color_space": "bt709", - "color_transfer": "bt709", - "color_primaries": "bt709", - "chroma_location": "left", - "refs": 1, - "r_frame_rate": "25/1", - "avg_frame_rate": "25/1", - "time_base": "1/1000", - "start_pts": 21, - "start_time": "0.021000", - "disposition": { - "default": 1, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "DURATION": "00:00:21.341000000" - } - }, - { - "index": 1, - "codec_name": "aac", - "codec_long_name": "AAC (Advanced Audio Coding)", - "profile": "LC", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "fltp", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 0, - "start_time": "0.000000", - "disposition": { - "default": 1, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "title": "Stereo", - "DURATION": "00:00:21.375000000" - } - } - ], - "format": { - "filename": "C:/Transcode/Source Folder/qsv_h265.mkv", - "nb_streams": 2, - "nb_programs": 0, - "format_name": "matroska,webm", - "format_long_name": "Matroska / WebM", - "start_time": "0.000000", - "duration": "21.375000", - "size": "8569883", - "bit_rate": "3207441", - "probe_score": 100, - "tags": { - "creation_time": "2019-09-13T16:46:14.000000Z", - "ENCODER": "Lavf58.20.100" - } - } - }, - "file_size": 8.172877311706543, - "video_resolution": "1080p", - "fileMedium": "video", - "video_codec_name": "hevc", - "audio_codec_name": "", - "lastPluginDetails": "none", - "createdAt": 1653029410394, - "bit_rate": 3207441, - "duration": 21, - "statSync": { - "dev": 3832468976, - "mode": 33060, - "nlink": 1, - "uid": 0, - "gid": 0, - "rdev": 0, - "blksize": 4096, - "ino": 1970324841360027, - "size": 8569883, - "blocks": 16744, - "atimeMs": 1653029410381.1382, - "mtimeMs": 1568393195000, - "ctimeMs": 1650864287188.087, - "birthtimeMs": 1650864302270.2063, - "atime": "2022-05-20T06:50:10.381Z", - "mtime": "2019-09-13T16:46:35.000Z", - "ctime": "2022-04-25T05:24:47.188Z", - "birthtime": "2022-04-25T05:25:02.270Z" - }, - "HealthCheck": "", - "TranscodeDecisionMaker": "", - "lastHealthCheckDate": 0, - "holdUntil": 0, - "lastTranscodeDate": 0, - "bumped": false, - "history": "", - "oldSize": 0, - "newSize": 0, - "videoStreamIndex": 0, - "lastUpdate": 1653027918258, - "meta": { - "SourceFile": "C:/Transcode/Source Folder/qsv_h265.mkv", - "errors": [], - "Duration": 21.375, - "ExifToolVersion": 12.4, - "FileName": "qsv_h265.mkv", - "Directory": "C:/Transcode/Source Folder", - "FileSize": "8.2 MiB", - "FileModifyDate": { - "year": 2019, - "month": 9, - "day": 13, - "hour": 17, - "minute": 46, - "second": 35, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2019:09:13 17:46:35+01:00" - }, - "FileAccessDate": { - "year": 2022, - "month": 5, - "day": 20, - "hour": 7, - "minute": 50, - "second": 9, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2022:05:20 07:50:09+01:00" - }, - "FileCreateDate": { - "year": 2022, - "month": 4, - "day": 25, - "hour": 6, - "minute": 25, - "second": 2, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2022:04:25 06:25:02+01:00" - }, - "FilePermissions": "-r--r--r--", - "FileType": "MKV", - "FileTypeExtension": "mkv", - "MIMEType": "video/x-matroska", - "EBMLVersion": 1, - "EBMLReadVersion": 1, - "DocType": "matroska", - "DocTypeVersion": 4, - "DocTypeReadVersion": 2, - "TimecodeScale": "1 ms", - "MuxingApp": "Lavf58.20.100", - "WritingApp": "HandBrake 1.2.2 2019022300", - "DateTimeOriginal": { - "year": 2019, - "month": 9, - "day": 13, - "hour": 16, - "minute": 46, - "second": 14, - "millisecond": 0, - "tzoffsetMinutes": 0, - "rawValue": "2019:09:13 16:46:14Z" - }, - "VideoFrameRate": 25, - "ImageWidth": 1920, - "ImageHeight": 1080, - "TrackNumber": 2, - "TrackName": "Stereo", - "TrackLanguage": "und", - "CodecID": "A_AAC", - "TrackType": "Audio", - "AudioChannels": 2, - "AudioSampleRate": 48000, - "TagName": "DURATION", - "TagString": "00:00:21.375000000", - "ImageSize": "1920x1080", - "Megapixels": 2.1 - }, - "mediaInfo": { - "@ref": "", - "track": [ - { - "@type": "General", - "UniqueID": "112612991515236890937117095733641799622", - "VideoCount": "1", - "AudioCount": "1", - "Format": "Matroska", - "Format_Version": "4", - "FileSize": "8569883", - "Duration": "21.375", - "OverallBitRate": "3207442", - "FrameRate": "25.000", - "FrameCount": "533", - "IsStreamable": "Yes", - "Encoded_Date": "UTC 2019-09-13 16:46:14", - "Encoded_Application": "HandBrake 1.2.2 2019022300", - "Encoded_Library": "Lavf58.20.100", - "extra": { - "ErrorDetectionType": "Per level 1" - } - }, - { - "@type": "Video", - "StreamOrder": "0", - "ID": "1", - "UniqueID": "1", - "Format": "HEVC", - "Format_Profile": "Main", - "Format_Level": "5", - "Format_Tier": "Main", - "CodecID": "V_MPEGH/ISO/HEVC", - "Duration": "21.320000000", - "Width": "1920", - "Height": "1080", - "Stored_Height": "1088", - "Sampled_Width": "1920", - "Sampled_Height": "1080", - "PixelAspectRatio": "1.000", - "DisplayAspectRatio": "1.778", - "FrameRate_Mode": "CFR", - "FrameRate": "25.000", - "FrameCount": "533", - "ColorSpace": "YUV", - "ChromaSubsampling": "4:2:0", - "BitDepth": "8", - "Delay": "0.021", - "Default": "Yes", - "Forced": "No", - "colour_description_present": "Yes", - "colour_description_present_Source": "Stream", - "colour_range": "Limited", - "colour_range_Source": "Stream", - "colour_primaries": "BT.709", - "colour_primaries_Source": "Stream", - "transfer_characteristics": "BT.709", - "transfer_characteristics_Source": "Stream", - "matrix_coefficients": "BT.709", - "matrix_coefficients_Source": "Stream" - }, - { - "@type": "Audio", - "StreamOrder": "1", - "ID": "2", - "UniqueID": "2", - "Format": "AAC", - "Format_Settings_SBR": "No (Explicit)", - "Format_AdditionalFeatures": "LC", - "CodecID": "A_AAC-2", - "Duration": "21.375000000", - "Channels": "2", - "ChannelPositions": "Front: L R", - "ChannelLayout": "L R", - "SamplesPerFrame": "1024", - "SamplingRate": "48000", - "SamplingCount": "1026000", - "FrameRate": "46.875", - "Compression_Mode": "Lossy", - "Delay": "0.000", - "Delay_Source": "Container", - "Title": "Stereo", - "Default": "Yes", - "Forced": "No" - } - ] - } - } \ No newline at end of file diff --git a/tests/sampleData/media/sampleH264_1.json b/tests/sampleData/media/sampleH264_1.json deleted file mode 100644 index 9833f8d..0000000 --- a/tests/sampleData/media/sampleH264_1.json +++ /dev/null @@ -1,432 +0,0 @@ -{ - "_id": "C:/Transcode/Source Folder/SampleVideo_1280x720_1mb.mp4", - "file": "C:/Transcode/Source Folder/SampleVideo_1280x720_1mb.mp4", - "DB": "2MY5YD7P8", - "footprintId": "KA_y0Hm3Ld", - "hasClosedCaptions": false, - "container": "mp4", - "scannerReads": { - "ffProbeRead": "success", - "exiftoolRead": "success", - "mediaInfoRead": "success", - "closedCaptionRead": "\"Unable to run CCExtractor\"" - }, - "ffProbeData": { - "streams": [ - { - "index": 0, - "codec_name": "h264", - "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", - "profile": "Main", - "codec_type": "video", - "codec_tag_string": "avc1", - "codec_tag": "0x31637661", - "width": 1280, - "height": 720, - "coded_width": 1280, - "coded_height": 720, - "closed_captions": 0, - "has_b_frames": 0, - "sample_aspect_ratio": "1:1", - "display_aspect_ratio": "16:9", - "pix_fmt": "yuv420p", - "level": 31, - "chroma_location": "left", - "refs": 1, - "is_avc": "true", - "nal_length_size": "4", - "r_frame_rate": "25/1", - "avg_frame_rate": "25/1", - "time_base": "1/12800", - "start_pts": 0, - "start_time": "0.000000", - "duration_ts": 67584, - "duration": "5.280000", - "bit_rate": "1205959", - "bits_per_raw_sample": "8", - "nb_frames": "132", - "disposition": { - "default": 1, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "creation_time": "1970-01-01T00:00:00.000000Z", - "language": "und", - "handler_name": "VideoHandler", - "vendor_id": "[0][0][0][0]" - } - }, - { - "index": 1, - "codec_name": "aac", - "codec_long_name": "AAC (Advanced Audio Coding)", - "profile": "LC", - "codec_type": "audio", - "codec_tag_string": "mp4a", - "codec_tag": "0x6134706d", - "sample_fmt": "fltp", - "sample_rate": "48000", - "channels": 6, - "channel_layout": "5.1", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/48000", - "start_pts": 0, - "start_time": "0.000000", - "duration_ts": 254976, - "duration": "5.312000", - "bit_rate": "384828", - "nb_frames": "249", - "disposition": { - "default": 1, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "creation_time": "1970-01-01T00:00:00.000000Z", - "language": "und", - "handler_name": "SoundHandler", - "vendor_id": "[0][0][0][0]" - } - } - ], - "format": { - "filename": "C:/Transcode/Source Folder/SampleVideo_1280x720_1mb.mp4", - "nb_streams": 2, - "nb_programs": 0, - "format_name": "mov,mp4,m4a,3gp,3g2,mj2", - "format_long_name": "QuickTime / MOV", - "start_time": "0.000000", - "duration": "5.312000", - "size": "1056519", - "bit_rate": "1591143", - "probe_score": 100, - "tags": { - "major_brand": "isom", - "minor_version": "512", - "compatible_brands": "isomiso2avc1mp41", - "creation_time": "1970-01-08T00:00:00.000000Z", - "encoder": "Lavf53.24.2", - "title": "Sample title test", - "composer": "th", - "date": "2018", - "genre": "this", - "artist": "hhj", - "comment": "hhk" - } - } - }, - "file_size": 1.0075750350952148, - "video_resolution": "720p", - "fileMedium": "video", - "video_codec_name": "h264", - "audio_codec_name": "", - "lastPluginDetails": "none", - "createdAt": 1653029288316, - "bit_rate": 1591143, - "duration": 5, - "statSync": { - "dev": 3832468976, - "mode": 33060, - "nlink": 1, - "uid": 0, - "gid": 0, - "rdev": 0, - "blksize": 4096, - "ino": 1688849864649366, - "size": 1056519, - "blocks": 2064, - "atimeMs": 1653029288299.0342, - "mtimeMs": 1569306262000, - "ctimeMs": 1650864287160.0793, - "birthtimeMs": 1652683715285.7583, - "atime": "2022-05-20T06:48:08.299Z", - "mtime": "2019-09-24T06:24:22.000Z", - "ctime": "2022-04-25T05:24:47.160Z", - "birthtime": "2022-05-16T06:48:35.286Z" - }, - "HealthCheck": "", - "TranscodeDecisionMaker": "", - "lastHealthCheckDate": 0, - "holdUntil": 0, - "lastTranscodeDate": 0, - "bumped": false, - "history": "", - "oldSize": 0, - "newSize": 0, - "videoStreamIndex": 0, - "lastUpdate": 1653028721083, - "meta": { - "SourceFile": "C:/Transcode/Source Folder/SampleVideo_1280x720_1mb.mp4", - "errors": [], - "Duration": 5.312, - "PreviewDuration": 0, - "SelectionDuration": 0, - "TrackDuration": 5.28, - "MediaDuration": 5.28, - "ExifToolVersion": 12.4, - "FileName": "SampleVideo_1280x720_1mb.mp4", - "Directory": "C:/Transcode/Source Folder", - "FileSize": "1032 KiB", - "FileModifyDate": { - "year": 2019, - "month": 9, - "day": 24, - "hour": 7, - "minute": 24, - "second": 22, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2019:09:24 07:24:22+01:00" - }, - "FileAccessDate": { - "year": 2022, - "month": 5, - "day": 20, - "hour": 7, - "minute": 48, - "second": 6, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2022:05:20 07:48:06+01:00" - }, - "FileCreateDate": { - "year": 2022, - "month": 5, - "day": 16, - "hour": 7, - "minute": 48, - "second": 35, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2022:05:16 07:48:35+01:00" - }, - "FilePermissions": "-r--r--r--", - "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" - ], - "MediaDataSize": 0, - "MediaDataOffset": 1051515, - "MovieHeaderVersion": 0, - "CreateDate": { - "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, - "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, - "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": "Lavf53.24.2", - "Title": "Sample title test", - "Composer": "th", - "BeatsPerMinute": 0, - "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", - "Megapixels": 0.922, - "AvgBitrate": "1.58 Mbps", - "Rotation": 0 - }, - "mediaInfo": { - "@ref": "", - "track": [ - { - "@type": "General", - "VideoCount": "1", - "AudioCount": "1", - "Format": "MPEG-4", - "Format_Profile": "Base Media", - "CodecID": "isom", - "CodecID_Compatible": "isom/iso2/avc1/mp41", - "FileSize": "1056519", - "Duration": "5.312", - "OverallBitRate_Mode": "VBR", - "OverallBitRate": "1591143", - "FrameRate": "25.000", - "FrameCount": "132", - "StreamSize": "5060", - "HeaderSize": "40", - "DataSize": "1051467", - "FooterSize": "5012", - "IsStreamable": "No", - "Title": "Sample title test", - "Movie": "Sample title test", - "Performer": "hhj", - "Composer": "th", - "Genre": "this", - "Recorded_Date": "2018", - "Encoded_Date": "UTC 1970-01-08 00:00:00", - "Tagged_Date": "UTC 2014-07-19 17:15:29", - "Encoded_Application": "Lavf53.24.2", - "Comment": "hhk" - }, - { - "@type": "Video", - "StreamOrder": "0", - "ID": "1", - "Format": "AVC", - "Format_Profile": "Main", - "Format_Level": "3.1", - "Format_Settings_CABAC": "Yes", - "Format_Settings_RefFrames": "1", - "CodecID": "avc1", - "Duration": "5.280", - "BitRate": "1205959", - "Width": "1280", - "Height": "720", - "Sampled_Width": "1280", - "Sampled_Height": "720", - "PixelAspectRatio": "1.000", - "DisplayAspectRatio": "1.778", - "Rotation": "0.000", - "FrameRate_Mode": "CFR", - "FrameRate_Mode_Original": "VFR", - "FrameRate": "25.000", - "FrameCount": "132", - "ColorSpace": "YUV", - "ChromaSubsampling": "4:2:0", - "BitDepth": "8", - "ScanType": "Progressive", - "StreamSize": "795933", - "Encoded_Date": "UTC 1970-01-01 00:00:00", - "Tagged_Date": "UTC 1970-01-01 00:00:00", - "extra": { - "CodecConfigurationBox": "avcC" - } - }, - { - "@type": "Audio", - "StreamOrder": "1", - "ID": "2", - "Format": "AAC", - "Format_AdditionalFeatures": "LC", - "CodecID": "mp4a-40-2", - "Duration": "5.312", - "BitRate_Mode": "VBR", - "BitRate": "384000", - "BitRate_Maximum": "400392", - "Channels": "6", - "ChannelPositions": "Front: L C R, Side: L R, LFE", - "ChannelLayout": "C L R Ls Rs LFE", - "SamplesPerFrame": "1024", - "SamplingRate": "48000", - "SamplingCount": "254976", - "FrameRate": "46.875", - "FrameCount": "249", - "Compression_Mode": "Lossy", - "StreamSize": "255526", - "StreamSize_Proportion": "0.24186", - "Default": "Yes", - "AlternateGroup": "1", - "Encoded_Date": "UTC 1970-01-01 00:00:00", - "Tagged_Date": "UTC 1970-01-01 00:00:00" - } - ] - } - } \ No newline at end of file diff --git a/tests/sampleData/media/sampleH264_2.json b/tests/sampleData/media/sampleH264_2.json deleted file mode 100644 index 7ad301b..0000000 --- a/tests/sampleData/media/sampleH264_2.json +++ /dev/null @@ -1,775 +0,0 @@ -{ - "_id": "C:/Transcode/Source Folder/h264.mkv", - "file": "C:/Transcode/Source Folder/h264.mkv", - "DB": "2MY5YD7P8", - "footprintId": "asxmr-5Iij", - "hasClosedCaptions": false, - "container": "mkv", - "scannerReads": { - "ffProbeRead": "success", - "exiftoolRead": "success", - "mediaInfoRead": "success", - "closedCaptionRead": "success" - }, - "ffProbeData": { - "streams": [ - { - "index": 0, - "codec_name": "h264", - "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", - "profile": "High", - "codec_type": "video", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "width": 1918, - "height": 1080, - "coded_width": 1918, - "coded_height": 1080, - "closed_captions": 0, - "has_b_frames": 2, - "sample_aspect_ratio": "1:1", - "display_aspect_ratio": "959:540", - "pix_fmt": "yuv420p", - "level": 41, - "color_range": "tv", - "color_space": "bt709", - "chroma_location": "left", - "field_order": "progressive", - "refs": 1, - "is_avc": "true", - "nal_length_size": "4", - "r_frame_rate": "25/1", - "avg_frame_rate": "25/1", - "time_base": "1/1000", - "start_pts": 0, - "start_time": "0.000000", - "bits_per_raw_sample": "8", - "disposition": { - "default": 1, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "fre", - "title": "title video", - "BPS-eng": "6453995", - "DURATION-eng": "00:01:03.960000000", - "NUMBER_OF_FRAMES-eng": "1599", - "NUMBER_OF_BYTES-eng": "51599695", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "DURATION": "00:01:03.986000000" - } - }, - { - "index": 1, - "codec_name": "flac", - "codec_long_name": "FLAC (Free Lossless Audio Codec)", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "s32", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 5, - "start_time": "0.005000", - "bits_per_raw_sample": "24", - "disposition": { - "default": 0, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "eng", - "title": "Anglais E-AC3 2.0", - "BPS-eng": "96000", - "DURATION-eng": "00:01:03.968000000", - "NUMBER_OF_FRAMES-eng": "1999", - "NUMBER_OF_BYTES-eng": "767616", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "ENCODER": "Lavc58.42.102 flac", - "DURATION": "00:01:04.005000000" - } - }, - { - "index": 2, - "codec_name": "ac3", - "codec_long_name": "ATSC A/52A (AC-3)", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "fltp", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 0, - "start_time": "0.000000", - "bit_rate": "192000", - "disposition": { - "default": 0, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "eng", - "title": "Anglais E-AC3 2.0", - "BPS-eng": "96000", - "DURATION-eng": "00:01:03.968000000", - "NUMBER_OF_FRAMES-eng": "1999", - "NUMBER_OF_BYTES-eng": "767616", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "ENCODER": "Lavc58.42.102 ac3", - "DURATION": "00:01:04.000000000" - } - }, - { - "index": 3, - "codec_name": "eac3", - "codec_long_name": "ATSC A/52B (AC-3, E-AC-3)", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "fltp", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 0, - "start_time": "0.000000", - "bit_rate": "192000", - "disposition": { - "default": 0, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "eng", - "title": "Anglais E-AC3 2.0", - "BPS-eng": "96000", - "DURATION-eng": "00:01:03.968000000", - "NUMBER_OF_FRAMES-eng": "1999", - "NUMBER_OF_BYTES-eng": "767616", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "ENCODER": "Lavc58.42.102 eac3", - "DURATION": "00:01:04.000000000" - } - }, - { - "index": 4, - "codec_name": "aac", - "codec_long_name": "AAC (Advanced Audio Coding)", - "profile": "LC", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "fltp", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 5, - "start_time": "0.005000", - "disposition": { - "default": 1, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "fre", - "title": "Français E-AC3 2.0", - "BPS-eng": "96000", - "DURATION-eng": "00:01:03.968000000", - "NUMBER_OF_FRAMES-eng": "1999", - "NUMBER_OF_BYTES-eng": "767616", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "ENCODER": "Lavc58.42.102 aac", - "DURATION": "00:01:04.004000000" - } - }, - { - "index": 5, - "codec_name": "aac", - "codec_long_name": "AAC (Advanced Audio Coding)", - "profile": "LC", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "fltp", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 5, - "start_time": "0.005000", - "disposition": { - "default": 0, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "eng", - "title": "Anglais E-AC3 2.0", - "BPS-eng": "96000", - "DURATION-eng": "00:01:03.968000000", - "NUMBER_OF_FRAMES-eng": "1999", - "NUMBER_OF_BYTES-eng": "767616", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "ENCODER": "Lavc58.42.102 aac", - "DURATION": "00:01:04.004000000" - } - }, - { - "index": 6, - "codec_name": "subrip", - "codec_long_name": "SubRip subtitle", - "codec_type": "subtitle", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 0, - "start_time": "0.000000", - "duration_ts": 66031, - "duration": "66.031000", - "disposition": { - "default": 0, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "fre", - "title": "Français", - "BPS-eng": "46", - "DURATION-eng": "00:01:05.840000000", - "NUMBER_OF_FRAMES-eng": "12", - "NUMBER_OF_BYTES-eng": "381", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "DURATION": "00:01:06.031000000" - } - } - ], - "format": { - "filename": "C:/Transcode/Source Folder/h264.mkv", - "nb_streams": 7, - "nb_programs": 0, - "format_name": "matroska,webm", - "format_long_name": "Matroska / WebM", - "start_time": "0.000000", - "duration": "66.031000", - "size": "68084120", - "bit_rate": "8248746", - "probe_score": 100, - "tags": { - "ENCODER": "Lavf58.24.101" - } - } - }, - "file_size": 64.9300765991211, - "video_resolution": "1080p", - "fileMedium": "video", - "video_codec_name": "h264", - "audio_codec_name": "", - "lastPluginDetails": "none", - "createdAt": 1653139154025, - "bit_rate": 8248746, - "duration": 66, - "statSync": { - "dev": 3832468976, - "mode": 33206, - "nlink": 1, - "uid": 0, - "gid": 0, - "rdev": 0, - "blksize": 4096, - "ino": 64176294690080990, - "size": 68084120, - "blocks": 132984, - "atimeMs": 1653139154001.7666, - "mtimeMs": 1594420078270.8928, - "ctimeMs": 1653139134390.225, - "birthtimeMs": 1653139123219.1018, - "atime": "2022-05-21T13:19:14.002Z", - "mtime": "2020-07-10T22:27:58.271Z", - "ctime": "2022-05-21T13:18:54.390Z", - "birthtime": "2022-05-21T13:18:43.219Z" - }, - "HealthCheck": "", - "TranscodeDecisionMaker": "", - "lastHealthCheckDate": 0, - "holdUntil": 0, - "lastTranscodeDate": 0, - "bumped": false, - "history": "", - "oldSize": 0, - "newSize": 0, - "videoStreamIndex": 0, - "meta": { - "SourceFile": "C:/Transcode/Source Folder/h264.mkv", - "errors": [], - "Duration": 66.031, - "ExifToolVersion": 12.4, - "FileName": "h264.mkv", - "Directory": "C:/Transcode/Source Folder", - "FileSize": "65 MiB", - "FileModifyDate": { - "year": 2020, - "month": 7, - "day": 10, - "hour": 23, - "minute": 27, - "second": 58, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2020:07:10 23:27:58+01:00" - }, - "FileAccessDate": { - "year": 2022, - "month": 5, - "day": 21, - "hour": 14, - "minute": 19, - "second": 11, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2022:05:21 14:19:11+01:00" - }, - "FileCreateDate": { - "year": 2022, - "month": 5, - "day": 21, - "hour": 14, - "minute": 18, - "second": 43, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2022:05:21 14:18:43+01:00" - }, - "FilePermissions": "-rw-rw-rw-", - "FileType": "MKV", - "FileTypeExtension": "mkv", - "MIMEType": "video/x-matroska", - "EBMLVersion": 1, - "EBMLReadVersion": 1, - "DocType": "matroska", - "DocTypeVersion": 4, - "DocTypeReadVersion": 2, - "TimecodeScale": "1 ms", - "MuxingApp": "Lavf58.24.101", - "WritingApp": "Lavf58.24.101", - "VideoFrameRate": 25, - "ImageWidth": 1918, - "ImageHeight": 1080, - "VideoScanType": "Unknown (2)", - "AudioChannels": 2, - "AudioSampleRate": 48000, - "AudioBitsPerSample": 32, - "TrackNumber": 7, - "TrackName": "Français", - "TrackLanguage": "fre", - "TrackDefault": "No", - "CodecID": "S_TEXT/UTF8", - "TrackType": "Subtitle", - "TagLanguage": "eng", - "TagName": "DURATION", - "TagString": "00:01:06.031000000", - "ImageSize": "1918x1080", - "Megapixels": 2.1 - }, - "mediaInfo": { - "@ref": "", - "track": [ - { - "@type": "General", - "UniqueID": "191657682055212276795239999260924509108", - "VideoCount": "1", - "AudioCount": "5", - "TextCount": "1", - "Format": "Matroska", - "Format_Version": "4", - "FileSize": "68084120", - "Duration": "66.031", - "OverallBitRate_Mode": "VBR", - "OverallBitRate": "8248746", - "FrameRate": "25.000", - "FrameCount": "1599", - "StreamSize": "12645964", - "IsStreamable": "Yes", - "Encoded_Application": "Lavf58.24.101", - "Encoded_Library": "Lavf58.24.101", - "extra": { - "ErrorDetectionType": "Per level 1" - } - }, - { - "@type": "Video", - "StreamOrder": "0", - "ID": "1", - "UniqueID": "1", - "Format": "AVC", - "Format_Profile": "High", - "Format_Level": "4.1", - "Format_Settings_CABAC": "Yes", - "Format_Settings_RefFrames": "4", - "CodecID": "V_MPEG4/ISO/AVC", - "Duration": "63.986000000", - "BitRate": "6453995", - "Width": "1918", - "Height": "1080", - "Stored_Width": "1920", - "Stored_Height": "1088", - "Sampled_Width": "1918", - "Sampled_Height": "1080", - "PixelAspectRatio": "1.000", - "DisplayAspectRatio": "1.776", - "FrameRate_Mode": "VFR", - "FrameRate": "25.000", - "FrameCount": "1599", - "ColorSpace": "YUV", - "ChromaSubsampling": "4:2:0", - "BitDepth": "8", - "ScanType": "Progressive", - "Delay": "0.000", - "StreamSize": "51599695", - "Title": "title video", - "Language": "fr", - "Default": "Yes", - "Forced": "No", - "colour_description_present": "Yes", - "colour_description_present_Source": "Container / Stream", - "colour_range": "Limited", - "colour_range_Source": "Container / Stream", - "colour_primaries_Source": "Stream", - "transfer_characteristics_Source": "Stream", - "matrix_coefficients": "BT.709", - "matrix_coefficients_Source": "Container / Stream" - }, - { - "@type": "Audio", - "@typeorder": "1", - "StreamOrder": "1", - "ID": "2", - "UniqueID": "2", - "Format": "FLAC", - "CodecID": "A_FLAC", - "Duration": "64.005000000", - "BitRate_Mode": "VBR", - "BitRate": "96000", - "Channels": "2", - "ChannelPositions": "Front: L R", - "ChannelLayout": "L R", - "SamplesPerFrame": "1537", - "SamplingRate": "48000", - "SamplingCount": "3072240", - "FrameRate": "31.232", - "FrameCount": "1999", - "BitDepth": "24", - "Compression_Mode": "Lossless", - "Delay": "0.005", - "Delay_Source": "Container", - "StreamSize": "767616", - "StreamSize_Proportion": "0.01127", - "Title": "Anglais E-AC3 2.0", - "Encoded_Library": "Lavc58.42.102 flac", - "Language": "en", - "Default": "No", - "Forced": "No" - }, - { - "@type": "Audio", - "@typeorder": "2", - "StreamOrder": "2", - "ID": "3", - "UniqueID": "3", - "Format": "AC-3", - "Format_Commercial_IfAny": "Dolby Digital", - "Format_Settings_Endianness": "Big", - "CodecID": "A_AC3", - "Duration": "64.000000000", - "BitRate_Mode": "CBR", - "BitRate": "192000", - "Channels": "2", - "ChannelPositions": "Front: L R", - "ChannelLayout": "L R", - "SamplesPerFrame": "1536", - "SamplingRate": "48000", - "SamplingCount": "3072000", - "FrameRate": "31.250", - "FrameCount": "1999", - "BitDepth": "32", - "Compression_Mode": "Lossy", - "Delay": "0.000", - "Delay_Source": "Container", - "StreamSize": "767616", - "StreamSize_Proportion": "0.01127", - "Title": "Anglais E-AC3 2.0", - "Encoded_Library": "Lavc58.42.102 ac3", - "Language": "en", - "ServiceKind": "CM", - "Default": "No", - "Forced": "No", - "extra": { - "bsid": "8", - "dialnorm": "-31", - "dsurmod": "0", - "acmod": "2", - "lfeon": "0", - "dialnorm_Average": "-31", - "dialnorm_Minimum": "-31" - } - }, - { - "@type": "Audio", - "@typeorder": "3", - "StreamOrder": "3", - "ID": "4", - "UniqueID": "4", - "Format": "E-AC-3", - "Format_Commercial_IfAny": "Dolby Digital Plus", - "Format_Settings_Endianness": "Big", - "CodecID": "A_EAC3", - "Duration": "64.000000000", - "BitRate_Mode": "CBR", - "BitRate": "192000", - "Channels": "2", - "ChannelPositions": "Front: L R", - "ChannelLayout": "L R", - "SamplesPerFrame": "1536", - "SamplingRate": "48000", - "SamplingCount": "3072000", - "FrameRate": "31.250", - "FrameCount": "1999", - "BitDepth": "32", - "Compression_Mode": "Lossy", - "Delay": "0.000", - "Delay_Source": "Container", - "StreamSize": "767616", - "StreamSize_Proportion": "0.01127", - "Title": "Anglais E-AC3 2.0", - "Encoded_Library": "Lavc58.42.102 eac3", - "Language": "en", - "ServiceKind": "CM", - "Default": "No", - "Forced": "No", - "extra": { - "bsid": "16", - "dialnorm": "-31", - "dsurmod": "0", - "acmod": "2", - "lfeon": "0", - "dialnorm_Average": "-31", - "dialnorm_Minimum": "-31" - } - }, - { - "@type": "Audio", - "@typeorder": "4", - "StreamOrder": "4", - "ID": "5", - "UniqueID": "5", - "Format": "AAC", - "Format_Settings_SBR": "No (Explicit)", - "Format_AdditionalFeatures": "LC", - "CodecID": "A_AAC-2", - "Duration": "64.004000000", - "BitRate": "96000", - "Channels": "2", - "ChannelPositions": "Front: L R", - "ChannelLayout": "L R", - "SamplesPerFrame": "1024", - "SamplingRate": "48000", - "SamplingCount": "3072192", - "FrameRate": "46.875", - "FrameCount": "1999", - "Compression_Mode": "Lossy", - "Delay": "0.005", - "Delay_Source": "Container", - "StreamSize": "767616", - "StreamSize_Proportion": "0.01127", - "Title": "Français E-AC3 2.0", - "Encoded_Library": "Lavc58.42.102 aac", - "Language": "fr", - "Default": "Yes", - "Forced": "No" - }, - { - "@type": "Audio", - "@typeorder": "5", - "StreamOrder": "5", - "ID": "6", - "UniqueID": "6", - "Format": "AAC", - "Format_Settings_SBR": "No (Explicit)", - "Format_AdditionalFeatures": "LC", - "CodecID": "A_AAC-2", - "Duration": "64.004000000", - "BitRate": "96000", - "Channels": "2", - "ChannelPositions": "Front: L R", - "ChannelLayout": "L R", - "SamplesPerFrame": "1024", - "SamplingRate": "48000", - "SamplingCount": "3072192", - "FrameRate": "46.875", - "FrameCount": "1999", - "Compression_Mode": "Lossy", - "Delay": "0.005", - "Delay_Source": "Container", - "StreamSize": "767616", - "StreamSize_Proportion": "0.01127", - "Title": "Anglais E-AC3 2.0", - "Encoded_Library": "Lavc58.42.102 aac", - "Language": "en", - "Default": "No", - "Forced": "No" - }, - { - "@type": "Text", - "StreamOrder": "6", - "ID": "7", - "UniqueID": "7", - "Format": "UTF-8", - "CodecID": "S_TEXT/UTF8", - "Duration": "66.031000000", - "BitRate": "46", - "FrameRate": "0.182", - "FrameCount": "12", - "ElementCount": "12", - "StreamSize": "381", - "Title": "Français", - "Language": "fr", - "Default": "No", - "Forced": "No" - } - ] - } -} \ No newline at end of file diff --git a/tests/sampleData/media/sampleH264_3.json b/tests/sampleData/media/sampleH264_3.json deleted file mode 100644 index 13ed394..0000000 --- a/tests/sampleData/media/sampleH264_3.json +++ /dev/null @@ -1,821 +0,0 @@ -{ - "_id": "C:/Transcode/Source Folder/h264.mkv", - "file": "C:/Transcode/Source Folder/h264.mkv", - "DB": "2MY5YD7P8", - "footprintId": "asxmr-5Iij", - "hasClosedCaptions": false, - "container": "mkv", - "scannerReads": { - "ffProbeRead": "success", - "exiftoolRead": "success", - "mediaInfoRead": "success", - "closedCaptionRead": "success" - }, - "ffProbeData": { - "streams": [ - { - "index": 0, - "codec_name": "h264", - "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", - "profile": "High", - "codec_type": "video", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "width": 1918, - "height": 1080, - "coded_width": 1918, - "coded_height": 1080, - "closed_captions": 0, - "has_b_frames": 2, - "sample_aspect_ratio": "1:1", - "display_aspect_ratio": "959:540", - "pix_fmt": "yuv420p", - "level": 41, - "color_range": "tv", - "color_space": "bt709", - "chroma_location": "left", - "field_order": "progressive", - "refs": 1, - "is_avc": "true", - "nal_length_size": "4", - "r_frame_rate": "25/1", - "avg_frame_rate": "25/1", - "time_base": "1/1000", - "start_pts": 0, - "start_time": "0.000000", - "bits_per_raw_sample": "8", - "disposition": { - "default": 1, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "fre", - "title": "title video", - "BPS-eng": "6453995", - "DURATION-eng": "00:01:03.960000000", - "NUMBER_OF_FRAMES-eng": "1599", - "NUMBER_OF_BYTES-eng": "51599695", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "DURATION": "00:01:03.986000000" - } - }, - { - "index": 1, - "codec_name": "flac", - "codec_long_name": "FLAC (Free Lossless Audio Codec)", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "s32", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 5, - "start_time": "0.005000", - "bits_per_raw_sample": "24", - "disposition": { - "default": 0, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "eng", - "title": "Anglais E-AC3 2.0", - "BPS-eng": "96000", - "DURATION-eng": "00:01:03.968000000", - "NUMBER_OF_FRAMES-eng": "1999", - "NUMBER_OF_BYTES-eng": "767616", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "ENCODER": "Lavc58.42.102 flac", - "DURATION": "00:01:04.005000000" - } - }, - { - "index": 2, - "codec_name": "ac3", - "codec_long_name": "ATSC A/52A (AC-3)", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "fltp", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 0, - "start_time": "0.000000", - "bit_rate": "192000", - "disposition": { - "default": 0, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "eng", - "title": "Anglais E-AC3 2.0", - "BPS-eng": "96000", - "DURATION-eng": "00:01:03.968000000", - "NUMBER_OF_FRAMES-eng": "1999", - "NUMBER_OF_BYTES-eng": "767616", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "ENCODER": "Lavc58.42.102 ac3", - "DURATION": "00:01:04.000000000" - } - }, - { - "index": 3, - "codec_name": "eac3", - "codec_long_name": "ATSC A/52B (AC-3, E-AC-3)", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "fltp", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 0, - "start_time": "0.000000", - "bit_rate": "192000", - "disposition": { - "default": 0, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "eng", - "title": "Anglais E-AC3 2.0", - "BPS-eng": "96000", - "DURATION-eng": "00:01:03.968000000", - "NUMBER_OF_FRAMES-eng": "1999", - "NUMBER_OF_BYTES-eng": "767616", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "ENCODER": "Lavc58.42.102 eac3", - "DURATION": "00:01:04.000000000" - } - }, - { - "index": 4, - "codec_name": "aac", - "codec_long_name": "AAC (Advanced Audio Coding)", - "profile": "LC", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "fltp", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 5, - "start_time": "0.005000", - "disposition": { - "default": 1, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "fre", - "title": "Français E-AC3 2.0", - "BPS-eng": "96000", - "DURATION-eng": "00:01:03.968000000", - "NUMBER_OF_FRAMES-eng": "1999", - "NUMBER_OF_BYTES-eng": "767616", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "ENCODER": "Lavc58.42.102 aac", - "DURATION": "00:01:04.004000000" - } - }, - { - "index": 5, - "codec_name": "aac", - "codec_long_name": "AAC (Advanced Audio Coding)", - "profile": "LC", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "fltp", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 5, - "start_time": "0.005000", - "disposition": { - "default": 0, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "eng", - "title": "Anglais E-AC3 2.0", - "BPS-eng": "96000", - "DURATION-eng": "00:01:03.968000000", - "NUMBER_OF_FRAMES-eng": "1999", - "NUMBER_OF_BYTES-eng": "767616", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "ENCODER": "Lavc58.42.102 aac", - "DURATION": "00:01:04.004000000" - } - }, - { - "index": 6, - "codec_name": "subrip", - "codec_long_name": "SubRip subtitle", - "codec_type": "subtitle", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 0, - "start_time": "0.000000", - "duration_ts": 66031, - "duration": "66.031000", - "disposition": { - "default": 0, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "en", - "title": "Français", - "BPS-eng": "46", - "DURATION-eng": "00:01:05.840000000", - "NUMBER_OF_FRAMES-eng": "12", - "NUMBER_OF_BYTES-eng": "381", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "DURATION": "00:01:06.031000000" - } - }, - { - "index": 7, - "codec_name": "subrip", - "codec_long_name": "SubRip subtitle", - "codec_type": "subtitle", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 0, - "start_time": "0.000000", - "duration_ts": 66031, - "duration": "66.031000", - "disposition": { - "default": 0, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "language": "fre", - "title": "Français", - "BPS-eng": "46", - "DURATION-eng": "00:01:05.840000000", - "NUMBER_OF_FRAMES-eng": "12", - "NUMBER_OF_BYTES-eng": "381", - "_STATISTICS_WRITING_APP-eng": "mkvmerge v23.0.0 ('title') 64-bit", - "_STATISTICS_WRITING_DATE_UTC-eng": "2018-06-14 17:49:29", - "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES", - "DURATION": "00:01:06.031000000" - } - } - ], - "format": { - "filename": "C:/Transcode/Source Folder/h264.mkv", - "nb_streams": 7, - "nb_programs": 0, - "format_name": "matroska,webm", - "format_long_name": "Matroska / WebM", - "start_time": "0.000000", - "duration": "66.031000", - "size": "68084120", - "bit_rate": "8248746", - "probe_score": 100, - "tags": { - "ENCODER": "Lavf58.24.101" - } - } - }, - "file_size": 64.9300765991211, - "video_resolution": "1080p", - "fileMedium": "video", - "video_codec_name": "h264", - "audio_codec_name": "", - "lastPluginDetails": "none", - "createdAt": 1653139154025, - "bit_rate": 8248746, - "duration": 66, - "statSync": { - "dev": 3832468976, - "mode": 33206, - "nlink": 1, - "uid": 0, - "gid": 0, - "rdev": 0, - "blksize": 4096, - "ino": 64176294690080990, - "size": 68084120, - "blocks": 132984, - "atimeMs": 1653139154001.7666, - "mtimeMs": 1594420078270.8928, - "ctimeMs": 1653139134390.225, - "birthtimeMs": 1653139123219.1018, - "atime": "2022-05-21T13:19:14.002Z", - "mtime": "2020-07-10T22:27:58.271Z", - "ctime": "2022-05-21T13:18:54.390Z", - "birthtime": "2022-05-21T13:18:43.219Z" - }, - "HealthCheck": "", - "TranscodeDecisionMaker": "", - "lastHealthCheckDate": 0, - "holdUntil": 0, - "lastTranscodeDate": 0, - "bumped": false, - "history": "", - "oldSize": 0, - "newSize": 0, - "videoStreamIndex": 0, - "meta": { - "SourceFile": "C:/Transcode/Source Folder/h264.mkv", - "errors": [], - "Duration": 66.031, - "ExifToolVersion": 12.4, - "FileName": "h264.mkv", - "Directory": "C:/Transcode/Source Folder", - "FileSize": "65 MiB", - "FileModifyDate": { - "year": 2020, - "month": 7, - "day": 10, - "hour": 23, - "minute": 27, - "second": 58, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2020:07:10 23:27:58+01:00" - }, - "FileAccessDate": { - "year": 2022, - "month": 5, - "day": 21, - "hour": 14, - "minute": 19, - "second": 11, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2022:05:21 14:19:11+01:00" - }, - "FileCreateDate": { - "year": 2022, - "month": 5, - "day": 21, - "hour": 14, - "minute": 18, - "second": 43, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2022:05:21 14:18:43+01:00" - }, - "FilePermissions": "-rw-rw-rw-", - "FileType": "MKV", - "FileTypeExtension": "mkv", - "MIMEType": "video/x-matroska", - "EBMLVersion": 1, - "EBMLReadVersion": 1, - "DocType": "matroska", - "DocTypeVersion": 4, - "DocTypeReadVersion": 2, - "TimecodeScale": "1 ms", - "MuxingApp": "Lavf58.24.101", - "WritingApp": "Lavf58.24.101", - "VideoFrameRate": 25, - "ImageWidth": 1918, - "ImageHeight": 1080, - "VideoScanType": "Unknown (2)", - "AudioChannels": 2, - "AudioSampleRate": 48000, - "AudioBitsPerSample": 32, - "TrackNumber": 7, - "TrackName": "Français", - "TrackLanguage": "fre", - "TrackDefault": "No", - "CodecID": "S_TEXT/UTF8", - "TrackType": "Subtitle", - "TagLanguage": "eng", - "TagName": "DURATION", - "TagString": "00:01:06.031000000", - "ImageSize": "1918x1080", - "Megapixels": 2.1 - }, - "mediaInfo": { - "@ref": "", - "track": [ - { - "@type": "General", - "UniqueID": "191657682055212276795239999260924509108", - "VideoCount": "1", - "AudioCount": "5", - "TextCount": "1", - "Format": "Matroska", - "Format_Version": "4", - "FileSize": "68084120", - "Duration": "66.031", - "OverallBitRate_Mode": "VBR", - "OverallBitRate": "8248746", - "FrameRate": "25.000", - "FrameCount": "1599", - "StreamSize": "12645964", - "IsStreamable": "Yes", - "Encoded_Application": "Lavf58.24.101", - "Encoded_Library": "Lavf58.24.101", - "extra": { - "ErrorDetectionType": "Per level 1" - } - }, - { - "@type": "Video", - "StreamOrder": "0", - "ID": "1", - "UniqueID": "1", - "Format": "AVC", - "Format_Profile": "High", - "Format_Level": "4.1", - "Format_Settings_CABAC": "Yes", - "Format_Settings_RefFrames": "4", - "CodecID": "V_MPEG4/ISO/AVC", - "Duration": "63.986000000", - "BitRate": "6453995", - "Width": "1918", - "Height": "1080", - "Stored_Width": "1920", - "Stored_Height": "1088", - "Sampled_Width": "1918", - "Sampled_Height": "1080", - "PixelAspectRatio": "1.000", - "DisplayAspectRatio": "1.776", - "FrameRate_Mode": "VFR", - "FrameRate": "25.000", - "FrameCount": "1599", - "ColorSpace": "YUV", - "ChromaSubsampling": "4:2:0", - "BitDepth": "8", - "ScanType": "Progressive", - "Delay": "0.000", - "StreamSize": "51599695", - "Title": "title video", - "Language": "fr", - "Default": "Yes", - "Forced": "No", - "colour_description_present": "Yes", - "colour_description_present_Source": "Container / Stream", - "colour_range": "Limited", - "colour_range_Source": "Container / Stream", - "colour_primaries_Source": "Stream", - "transfer_characteristics_Source": "Stream", - "matrix_coefficients": "BT.709", - "matrix_coefficients_Source": "Container / Stream" - }, - { - "@type": "Audio", - "@typeorder": "1", - "StreamOrder": "1", - "ID": "2", - "UniqueID": "2", - "Format": "FLAC", - "CodecID": "A_FLAC", - "Duration": "64.005000000", - "BitRate_Mode": "VBR", - "BitRate": "96000", - "Channels": "2", - "ChannelPositions": "Front: L R", - "ChannelLayout": "L R", - "SamplesPerFrame": "1537", - "SamplingRate": "48000", - "SamplingCount": "3072240", - "FrameRate": "31.232", - "FrameCount": "1999", - "BitDepth": "24", - "Compression_Mode": "Lossless", - "Delay": "0.005", - "Delay_Source": "Container", - "StreamSize": "767616", - "StreamSize_Proportion": "0.01127", - "Title": "Anglais E-AC3 2.0", - "Encoded_Library": "Lavc58.42.102 flac", - "Language": "en", - "Default": "No", - "Forced": "No" - }, - { - "@type": "Audio", - "@typeorder": "2", - "StreamOrder": "2", - "ID": "3", - "UniqueID": "3", - "Format": "AC-3", - "Format_Commercial_IfAny": "Dolby Digital", - "Format_Settings_Endianness": "Big", - "CodecID": "A_AC3", - "Duration": "64.000000000", - "BitRate_Mode": "CBR", - "BitRate": "192000", - "Channels": "2", - "ChannelPositions": "Front: L R", - "ChannelLayout": "L R", - "SamplesPerFrame": "1536", - "SamplingRate": "48000", - "SamplingCount": "3072000", - "FrameRate": "31.250", - "FrameCount": "1999", - "BitDepth": "32", - "Compression_Mode": "Lossy", - "Delay": "0.000", - "Delay_Source": "Container", - "StreamSize": "767616", - "StreamSize_Proportion": "0.01127", - "Title": "Anglais E-AC3 2.0", - "Encoded_Library": "Lavc58.42.102 ac3", - "Language": "en", - "ServiceKind": "CM", - "Default": "No", - "Forced": "No", - "extra": { - "bsid": "8", - "dialnorm": "-31", - "dsurmod": "0", - "acmod": "2", - "lfeon": "0", - "dialnorm_Average": "-31", - "dialnorm_Minimum": "-31" - } - }, - { - "@type": "Audio", - "@typeorder": "3", - "StreamOrder": "3", - "ID": "4", - "UniqueID": "4", - "Format": "E-AC-3", - "Format_Commercial_IfAny": "Dolby Digital Plus", - "Format_Settings_Endianness": "Big", - "CodecID": "A_EAC3", - "Duration": "64.000000000", - "BitRate_Mode": "CBR", - "BitRate": "192000", - "Channels": "2", - "ChannelPositions": "Front: L R", - "ChannelLayout": "L R", - "SamplesPerFrame": "1536", - "SamplingRate": "48000", - "SamplingCount": "3072000", - "FrameRate": "31.250", - "FrameCount": "1999", - "BitDepth": "32", - "Compression_Mode": "Lossy", - "Delay": "0.000", - "Delay_Source": "Container", - "StreamSize": "767616", - "StreamSize_Proportion": "0.01127", - "Title": "Anglais E-AC3 2.0", - "Encoded_Library": "Lavc58.42.102 eac3", - "Language": "en", - "ServiceKind": "CM", - "Default": "No", - "Forced": "No", - "extra": { - "bsid": "16", - "dialnorm": "-31", - "dsurmod": "0", - "acmod": "2", - "lfeon": "0", - "dialnorm_Average": "-31", - "dialnorm_Minimum": "-31" - } - }, - { - "@type": "Audio", - "@typeorder": "4", - "StreamOrder": "4", - "ID": "5", - "UniqueID": "5", - "Format": "AAC", - "Format_Settings_SBR": "No (Explicit)", - "Format_AdditionalFeatures": "LC", - "CodecID": "A_AAC-2", - "Duration": "64.004000000", - "BitRate": "96000", - "Channels": "2", - "ChannelPositions": "Front: L R", - "ChannelLayout": "L R", - "SamplesPerFrame": "1024", - "SamplingRate": "48000", - "SamplingCount": "3072192", - "FrameRate": "46.875", - "FrameCount": "1999", - "Compression_Mode": "Lossy", - "Delay": "0.005", - "Delay_Source": "Container", - "StreamSize": "767616", - "StreamSize_Proportion": "0.01127", - "Title": "Français E-AC3 2.0", - "Encoded_Library": "Lavc58.42.102 aac", - "Language": "fr", - "Default": "Yes", - "Forced": "No" - }, - { - "@type": "Audio", - "@typeorder": "5", - "StreamOrder": "5", - "ID": "6", - "UniqueID": "6", - "Format": "AAC", - "Format_Settings_SBR": "No (Explicit)", - "Format_AdditionalFeatures": "LC", - "CodecID": "A_AAC-2", - "Duration": "64.004000000", - "BitRate": "96000", - "Channels": "2", - "ChannelPositions": "Front: L R", - "ChannelLayout": "L R", - "SamplesPerFrame": "1024", - "SamplingRate": "48000", - "SamplingCount": "3072192", - "FrameRate": "46.875", - "FrameCount": "1999", - "Compression_Mode": "Lossy", - "Delay": "0.005", - "Delay_Source": "Container", - "StreamSize": "767616", - "StreamSize_Proportion": "0.01127", - "Title": "Anglais E-AC3 2.0", - "Encoded_Library": "Lavc58.42.102 aac", - "Language": "en", - "Default": "No", - "Forced": "No" - }, - { - "@type": "Text", - "StreamOrder": "6", - "ID": "7", - "UniqueID": "7", - "Format": "UTF-8", - "CodecID": "S_TEXT/UTF8", - "Duration": "66.031000000", - "BitRate": "46", - "FrameRate": "0.182", - "FrameCount": "12", - "ElementCount": "12", - "StreamSize": "381", - "Title": "Français", - "Language": "fr", - "Default": "No", - "Forced": "No" - } - ] - } -} \ No newline at end of file diff --git a/tests/sampleData/media/sampleH265_1.json b/tests/sampleData/media/sampleH265_1.json deleted file mode 100644 index 81d53e6..0000000 --- a/tests/sampleData/media/sampleH265_1.json +++ /dev/null @@ -1,334 +0,0 @@ -{ - "_id": "C:/Transcode/Source Folder/qsv_h265.mkv", - "file": "C:/Transcode/Source Folder/qsv_h265.mkv", - "DB": "2MY5YD7P8", - "footprintId": "xkZP3IPR6g", - "hasClosedCaptions": false, - "container": "mkv", - "scannerReads": { - "ffProbeRead": "success", - "exiftoolRead": "success", - "mediaInfoRead": "success", - "closedCaptionRead": "\"Unable to run CCExtractor\"" - }, - "ffProbeData": { - "streams": [ - { - "index": 0, - "codec_name": "hevc", - "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)", - "profile": "Main", - "codec_type": "video", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "width": 1920, - "height": 1080, - "coded_width": 1920, - "coded_height": 1088, - "closed_captions": 0, - "has_b_frames": 1, - "sample_aspect_ratio": "1:1", - "display_aspect_ratio": "16:9", - "pix_fmt": "yuv420p", - "level": 150, - "color_range": "tv", - "color_space": "bt709", - "color_transfer": "bt709", - "color_primaries": "bt709", - "chroma_location": "left", - "refs": 1, - "r_frame_rate": "25/1", - "avg_frame_rate": "25/1", - "time_base": "1/1000", - "start_pts": 21, - "start_time": "0.021000", - "disposition": { - "default": 1, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "DURATION": "00:00:21.341000000" - } - }, - { - "index": 1, - "codec_name": "aac", - "codec_long_name": "AAC (Advanced Audio Coding)", - "profile": "LC", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "fltp", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 0, - "start_time": "0.000000", - "disposition": { - "default": 1, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "title": "Stereo", - "DURATION": "00:00:21.375000000" - } - } - ], - "format": { - "filename": "C:/Transcode/Source Folder/qsv_h265.mkv", - "nb_streams": 2, - "nb_programs": 0, - "format_name": "matroska,webm", - "format_long_name": "Matroska / WebM", - "start_time": "0.000000", - "duration": "21.375000", - "size": "8569883", - "bit_rate": "3207441", - "probe_score": 100, - "tags": { - "creation_time": "2019-09-13T16:46:14.000000Z", - "ENCODER": "Lavf58.20.100" - } - } - }, - "file_size": 8.172877311706543, - "video_resolution": "1080p", - "fileMedium": "video", - "video_codec_name": "hevc", - "audio_codec_name": "", - "lastPluginDetails": "none", - "createdAt": 1653029410394, - "bit_rate": 3207441, - "duration": 21, - "statSync": { - "dev": 3832468976, - "mode": 33060, - "nlink": 1, - "uid": 0, - "gid": 0, - "rdev": 0, - "blksize": 4096, - "ino": 1970324841360027, - "size": 8569883, - "blocks": 16744, - "atimeMs": 1653029410381.1382, - "mtimeMs": 1568393195000, - "ctimeMs": 1650864287188.087, - "birthtimeMs": 1650864302270.2063, - "atime": "2022-05-20T06:50:10.381Z", - "mtime": "2019-09-13T16:46:35.000Z", - "ctime": "2022-04-25T05:24:47.188Z", - "birthtime": "2022-04-25T05:25:02.270Z" - }, - "HealthCheck": "", - "TranscodeDecisionMaker": "", - "lastHealthCheckDate": 0, - "holdUntil": 0, - "lastTranscodeDate": 0, - "bumped": false, - "history": "", - "oldSize": 0, - "newSize": 0, - "videoStreamIndex": 0, - "lastUpdate": 1653027918258, - "meta": { - "SourceFile": "C:/Transcode/Source Folder/qsv_h265.mkv", - "errors": [], - "Duration": 21.375, - "ExifToolVersion": 12.4, - "FileName": "qsv_h265.mkv", - "Directory": "C:/Transcode/Source Folder", - "FileSize": "8.2 MiB", - "FileModifyDate": { - "year": 2019, - "month": 9, - "day": 13, - "hour": 17, - "minute": 46, - "second": 35, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2019:09:13 17:46:35+01:00" - }, - "FileAccessDate": { - "year": 2022, - "month": 5, - "day": 20, - "hour": 7, - "minute": 50, - "second": 9, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2022:05:20 07:50:09+01:00" - }, - "FileCreateDate": { - "year": 2022, - "month": 4, - "day": 25, - "hour": 6, - "minute": 25, - "second": 2, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2022:04:25 06:25:02+01:00" - }, - "FilePermissions": "-r--r--r--", - "FileType": "MKV", - "FileTypeExtension": "mkv", - "MIMEType": "video/x-matroska", - "EBMLVersion": 1, - "EBMLReadVersion": 1, - "DocType": "matroska", - "DocTypeVersion": 4, - "DocTypeReadVersion": 2, - "TimecodeScale": "1 ms", - "MuxingApp": "Lavf58.20.100", - "WritingApp": "HandBrake 1.2.2 2019022300", - "DateTimeOriginal": { - "year": 2019, - "month": 9, - "day": 13, - "hour": 16, - "minute": 46, - "second": 14, - "millisecond": 0, - "tzoffsetMinutes": 0, - "rawValue": "2019:09:13 16:46:14Z" - }, - "VideoFrameRate": 25, - "ImageWidth": 1920, - "ImageHeight": 1080, - "TrackNumber": 2, - "TrackName": "Stereo", - "TrackLanguage": "und", - "CodecID": "A_AAC", - "TrackType": "Audio", - "AudioChannels": 2, - "AudioSampleRate": 48000, - "TagName": "DURATION", - "TagString": "00:00:21.375000000", - "ImageSize": "1920x1080", - "Megapixels": 2.1 - }, - "mediaInfo": { - "@ref": "", - "track": [ - { - "@type": "General", - "UniqueID": "112612991515236890937117095733641799622", - "VideoCount": "1", - "AudioCount": "1", - "Format": "Matroska", - "Format_Version": "4", - "FileSize": "8569883", - "Duration": "21.375", - "OverallBitRate": "3207442", - "FrameRate": "25.000", - "FrameCount": "533", - "IsStreamable": "Yes", - "Encoded_Date": "UTC 2019-09-13 16:46:14", - "Encoded_Application": "HandBrake 1.2.2 2019022300", - "Encoded_Library": "Lavf58.20.100", - "extra": { - "ErrorDetectionType": "Per level 1" - } - }, - { - "@type": "Video", - "StreamOrder": "0", - "ID": "1", - "UniqueID": "1", - "Format": "HEVC", - "Format_Profile": "Main", - "Format_Level": "5", - "Format_Tier": "Main", - "CodecID": "V_MPEGH/ISO/HEVC", - "Duration": "21.320000000", - "Width": "1920", - "Height": "1080", - "Stored_Height": "1088", - "Sampled_Width": "1920", - "Sampled_Height": "1080", - "PixelAspectRatio": "1.000", - "DisplayAspectRatio": "1.778", - "FrameRate_Mode": "CFR", - "FrameRate": "25.000", - "FrameCount": "533", - "ColorSpace": "YUV", - "ChromaSubsampling": "4:2:0", - "BitDepth": "8", - "Delay": "0.021", - "Default": "Yes", - "Forced": "No", - "colour_description_present": "Yes", - "colour_description_present_Source": "Stream", - "colour_range": "Limited", - "colour_range_Source": "Stream", - "colour_primaries": "BT.709", - "colour_primaries_Source": "Stream", - "transfer_characteristics": "BT.709", - "transfer_characteristics_Source": "Stream", - "matrix_coefficients": "BT.709", - "matrix_coefficients_Source": "Stream" - }, - { - "@type": "Audio", - "StreamOrder": "1", - "ID": "2", - "UniqueID": "2", - "Format": "AAC", - "Format_Settings_SBR": "No (Explicit)", - "Format_AdditionalFeatures": "LC", - "CodecID": "A_AAC-2", - "Duration": "21.375000000", - "Channels": "2", - "ChannelPositions": "Front: L R", - "ChannelLayout": "L R", - "SamplesPerFrame": "1024", - "SamplingRate": "48000", - "SamplingCount": "1026000", - "FrameRate": "46.875", - "Compression_Mode": "Lossy", - "Delay": "0.000", - "Delay_Source": "Container", - "Title": "Stereo", - "Default": "Yes", - "Forced": "No" - } - ] - } - } \ No newline at end of file diff --git a/tests/sampleData/media/sampleMP3_1.json b/tests/sampleData/media/sampleMP3_1.json deleted file mode 100644 index 6c7dd81..0000000 --- a/tests/sampleData/media/sampleMP3_1.json +++ /dev/null @@ -1,314 +0,0 @@ -{ - "_id": "C:/Transcode/Source Folder/sample__-__-__libmp3lame__30s__audio.mkv", - "file": "C:/Transcode/Source Folder/sample__-__-__libmp3lame__30s__audio.mkv", - "DB": "2MY5YD7P8", - "footprintId": "xpsr-dmmd", - "hasClosedCaptions": false, - "container": "mkv", - "scannerReads": { - "ffProbeRead": "success", - "exiftoolRead": "success", - "mediaInfoRead": "success", - "closedCaptionRead": "\"Unable to run CCExtractor\"" - }, - "ffProbeData": { - "streams": [ - { - "index": 0, - "codec_name": "mp3", - "codec_long_name": "MP3 (MPEG audio layer 3)", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "fltp", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 0, - "start_time": "0.000000", - "bit_rate": "128000", - "disposition": { - "default": 1, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "HANDLER_NAME": "GPAC ISO Audio Handler", - "ENCODER": "Lavc57.107.100 libmp3lame", - "DURATION": "00:00:30.023000000" - } - }, - { - "index": 1, - "codec_name": "mp3", - "codec_long_name": "MP3 (MPEG audio layer 3)", - "codec_type": "audio", - "codec_tag_string": "[0][0][0][0]", - "codec_tag": "0x0000", - "sample_fmt": "fltp", - "sample_rate": "48000", - "channels": 2, - "channel_layout": "stereo", - "bits_per_sample": 0, - "r_frame_rate": "0/0", - "avg_frame_rate": "0/0", - "time_base": "1/1000", - "start_pts": 0, - "start_time": "0.000000", - "bit_rate": "128000", - "disposition": { - "default": 1, - "dub": 0, - "original": 0, - "comment": 0, - "lyrics": 0, - "karaoke": 0, - "forced": 0, - "hearing_impaired": 0, - "visual_impaired": 0, - "clean_effects": 0, - "attached_pic": 0, - "timed_thumbnails": 0, - "captions": 0, - "descriptions": 0, - "metadata": 0, - "dependent": 0, - "still_image": 0 - }, - "tags": { - "HANDLER_NAME": "GPAC ISO Audio Handler", - "ENCODER": "Lavc57.107.100 libmp3lame", - "DURATION": "00:00:30.023000000" - } - } - ], - "format": { - "filename": "C:/Transcode/Source Folder/sample__-__-__libmp3lame__30s__audio.mkv", - "nb_streams": 2, - "nb_programs": 0, - "format_name": "matroska,webm", - "format_long_name": "Matroska / WebM", - "start_time": "0.000000", - "duration": "30.023000", - "size": "979815", - "bit_rate": "261083", - "probe_score": 100, - "tags": { - "title": "Big Buck Bunny, Sunflower version", - "GENRE": "Animation", - "MAJOR_BRAND": "isom", - "MINOR_VERSION": "1", - "COMPATIBLE_BRANDS": "isomavc1", - "COMPOSER": "Sacha Goedegebure", - "ARTIST": "Blender Foundation 2008, Janus Bager Kristensen 2013", - "COMMENT": "Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net", - "ENCODER": "Lavf57.83.100" - } - } - }, - "file_size": 0.9344244003295898, - "video_resolution": "", - "fileMedium": "audio", - "video_codec_name": "", - "audio_codec_name": "mp3", - "lastPluginDetails": "none", - "createdAt": 1653224430511, - "bit_rate": 261083, - "duration": 30, - "statSync": { - "dev": 3832468976, - "mode": 33206, - "nlink": 1, - "uid": 0, - "gid": 0, - "rdev": 0, - "blksize": 4096, - "ino": 10133099162447292, - "size": 979815, - "blocks": 1920, - "atimeMs": 1653224430487.7, - "mtimeMs": 1653224386734.2915, - "ctimeMs": 1653224395573.211, - "birthtimeMs": 1653224386247.453, - "atime": "2022-05-22T13:00:30.488Z", - "mtime": "2022-05-22T12:59:46.734Z", - "ctime": "2022-05-22T12:59:55.573Z", - "birthtime": "2022-05-22T12:59:46.247Z" - }, - "HealthCheck": "", - "TranscodeDecisionMaker": "", - "lastHealthCheckDate": 0, - "holdUntil": 0, - "lastTranscodeDate": 0, - "bumped": false, - "history": "", - "oldSize": 0, - "newSize": 0, - "videoStreamIndex": -1, - "meta": { - "SourceFile": "C:/Transcode/Source Folder/sample__-__-__libmp3lame__30s__audio.mkv", - "errors": [], - "Duration": 30.023, - "ExifToolVersion": 12.4, - "FileName": "sample__-__-__libmp3lame__30s__audio.mkv", - "Directory": "C:/Transcode/Source Folder", - "FileSize": "957 KiB", - "ZoneIdentifier": "Exists", - "FileModifyDate": { - "year": 2022, - "month": 5, - "day": 22, - "hour": 13, - "minute": 59, - "second": 46, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2022:05:22 13:59:46+01:00" - }, - "FileAccessDate": { - "year": 2022, - "month": 5, - "day": 22, - "hour": 14, - "minute": 0, - "second": 29, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2022:05:22 14:00:29+01:00" - }, - "FileCreateDate": { - "year": 2022, - "month": 5, - "day": 22, - "hour": 13, - "minute": 59, - "second": 46, - "millisecond": 0, - "tzoffsetMinutes": 60, - "rawValue": "2022:05:22 13:59:46+01:00" - }, - "FilePermissions": "-rw-rw-rw-", - "FileType": "MKA", - "FileTypeExtension": "mka", - "MIMEType": "audio/x-matroska", - "EBMLVersion": 1, - "EBMLReadVersion": 1, - "DocType": "matroska", - "DocTypeVersion": 4, - "DocTypeReadVersion": 2, - "TimecodeScale": "1 ms", - "Title": "Big Buck Bunny, Sunflower version", - "MuxingApp": "Lavf57.83.100", - "WritingApp": "Lavf57.83.100", - "TrackNumber": 2, - "TrackLanguage": "und", - "CodecID": "A_MPEG/L3", - "TrackType": "Audio", - "AudioChannels": 2, - "AudioSampleRate": 48000, - "AudioBitsPerSample": 32, - "TagName": "DURATION", - "TagString": "00:00:30.023000000" - }, - "mediaInfo": { - "@ref": "", - "track": [ - { - "@type": "General", - "UniqueID": "301354878049300200919944107613778820882", - "AudioCount": "2", - "Format": "Matroska", - "Format_Version": "4", - "FileSize": "979815", - "Duration": "30.023", - "OverallBitRate_Mode": "CBR", - "OverallBitRate": "261084", - "StreamSize": "19079", - "IsStreamable": "Yes", - "Title": "Big Buck Bunny, Sunflower version", - "Track": "Big Buck Bunny, Sunflower version", - "Encoded_Application": "Lavf57.83.100", - "Encoded_Library": "Lavf57.83.100", - "Comment": "Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net", - "extra": { - "ErrorDetectionType": "Per level 1", - "ARTIST": "Blender Foundation 2008, Janus Bager Kristensen 2013", - "COMPOSER": "Sacha Goedegebure", - "GENRE": "Animation" - } - }, - { - "@type": "Audio", - "@typeorder": "1", - "StreamOrder": "0", - "ID": "1", - "UniqueID": "1", - "Format": "MPEG Audio", - "Format_Version": "1", - "Format_Profile": "Layer 3", - "Format_Settings_Mode": "Joint stereo", - "Format_Settings_ModeExtension": "MS Stereo", - "CodecID": "A_MPEG/L3", - "Duration": "30.023000000", - "BitRate_Mode": "CBR", - "BitRate": "128000", - "Channels": "2", - "SamplingRate": "48000", - "SamplingCount": "1441104", - "Compression_Mode": "Lossy", - "Delay": "0.000", - "Delay_Source": "Container", - "StreamSize": "480368", - "StreamSize_Proportion": "0.49026", - "Encoded_Library": "Lavc57.107.100 libmp3lame", - "Default": "Yes", - "Forced": "No" - }, - { - "@type": "Audio", - "@typeorder": "2", - "StreamOrder": "1", - "ID": "2", - "UniqueID": "2", - "Format": "MPEG Audio", - "Format_Version": "1", - "Format_Profile": "Layer 3", - "Format_Settings_Mode": "Joint stereo", - "Format_Settings_ModeExtension": "MS Stereo", - "CodecID": "A_MPEG/L3", - "Duration": "30.023000000", - "BitRate_Mode": "CBR", - "BitRate": "128000", - "Channels": "2", - "SamplingRate": "48000", - "SamplingCount": "1441104", - "Compression_Mode": "Lossy", - "Delay": "0.000", - "Delay_Source": "Container", - "StreamSize": "480368", - "StreamSize_Proportion": "0.49026", - "Encoded_Library": "Lavc57.107.100 libmp3lame", - "Default": "Yes", - "Forced": "No" - } - ] - } -} \ No newline at end of file From 4db8e9d67ae4eaa861a87571c6b03bc19e730915 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 05:28:49 +0100 Subject: [PATCH 099/126] revert --- Community/Tdarr_Plugin_drdd_standardise_all_in_one.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js index 608b0f5..ea8dc7c 100644 --- a/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js +++ b/Community/Tdarr_Plugin_drdd_standardise_all_in_one.js @@ -9,7 +9,7 @@ const details = () => { Type: "Video", Operation: "Transcode", Description: - "In a single pass ensures all files are in MKV containers and where possible encoded in h265 (settings dependant on file bitrate), converts all multi channel audio to AC3, removes audio commentary and removes subtitles that are not in the configured language or marked as commentary. This plugin is opinionated based on how I like my library to be configured and based on the work done by Migz with his plugins (Thanks!).", + "[Non-Windows] In a single pass ensures all files are in MKV containers and where possible encoded in h265 (settings dependant on file bitrate), converts all multi channel audio to AC3, removes audio commentary and removes subtitles that are not in the configured language or marked as commentary. This plugin is opinionated based on how I like my library to be configured and based on the work done by Migz with his plugins (Thanks!).", Version: "1.0", Tags: "pre-processing,ffmpeg,vaapi,h265, nvenc h265", Inputs: [ From 1534f608898234d64cc64353c57f8c8634371a7f Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 05:33:50 +0100 Subject: [PATCH 100/126] Add Tdarr_Plugin_s7x9_winsome_h265_10bit test --- .../Tdarr_Plugin_s7x9_winsome_h265_10bit.js | 1 - .../Tdarr_Plugin_s7x9_winsome_h265_10bit.js | 63 +++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js diff --git a/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js index acf22fb..d5d23f6 100644 --- a/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js +++ b/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s7x9_winsome_h265_10bit", diff --git a/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js b/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js new file mode 100644 index 0000000..6fad6fc --- /dev/null +++ b/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_10bit.js @@ -0,0 +1,63 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "H.265 MKV 2160p60" -e x265_10bit --all-audio --all-subtitles', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: "☒File isn't in hevc! \n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -b:a:0 192k -ac 2', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has no language track in ac3,eac3,dts. No eng track marked so transcoding audio track 1 into ac3! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json')); + file.ffProbeData.streams[1].codec_name = 'ac3'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is in mkv container! \n', + }, + }, +]; + +run(tests); From 1b3763e9a473c6ee38e66c267ec4e90a632a9c91 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 05:35:35 +0100 Subject: [PATCH 101/126] Add Tdarr_Plugin_s7x9_winsome_h265_nvenc test --- .../Tdarr_Plugin_s7x9_winsome_h265_nvenc.js | 1 - .../Tdarr_Plugin_s7x9_winsome_h265_nvenc.js | 63 +++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js diff --git a/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js b/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js index 447044d..f336a5e 100644 --- a/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js +++ b/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s7x9_winsome_h265_nvenc", diff --git a/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js b/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js new file mode 100644 index 0000000..e81f664 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_s7x9_winsome_h265_nvenc.js @@ -0,0 +1,63 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "H.265 MKV 2160p60" --all-audio --all-subtitles -e nvenc_h265', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: "☒File isn't in hevc! \n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -b:a:0 192k -ac 2', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has no language track in ac3,eac3,dts. No eng track marked so transcoding audio track 1 into ac3! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json')); + file.ffProbeData.streams[1].codec_name = 'ac3'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is in mkv container! \n', + }, + }, +]; + +run(tests); From ee61a579c3b085ee5659926a382a7adfbc53e85b Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 05:43:29 +0100 Subject: [PATCH 102/126] Add Tdarr_Plugin_s710_nick_h265_nvenc_4K test --- .../Tdarr_Plugin_s710_nick_h265_nvenc_4K.js | 3 +- .../Tdarr_Plugin_s710_nick_h265_nvenc_4K.js | 84 +++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js diff --git a/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js b/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js index 6c559b0..8f3cd50 100644 --- a/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js +++ b/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_s710_nick_h265_nvenc_4K", @@ -46,6 +45,8 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { var jsonString = JSON.stringify(file); response.container = ".mkv"; + console.log(file.ffProbeData.streams[0].codec_name); + console.log(file.video_resolution); if ( file.ffProbeData.streams[0].codec_name == "hevc" || file.video_resolution !== "4KUHD" diff --git a/tests/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js b/tests/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js new file mode 100644 index 0000000..a6aa2ff --- /dev/null +++ b/tests/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js @@ -0,0 +1,84 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -b:a:0 192k -ac 2', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has no language track in ac3,eac3,dts. No eng track marked so transcoding audio track 1 into ac3! \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0:v -map 0:a:0 -map 0:a -map 0:s? -map 0:d? -c copy -c:a:0 ac3 -b:a:0 192k -ac 2', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has no language track in ac3,eac3,dts. No eng track marked so transcoding audio track 1 into ac3! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json')); + file.ffProbeData.streams[1].codec_name = 'ac3'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is in mkv container! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '4KUHD'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-Z "H.265 MKV 2160p60" --all-audio --all-subtitles', + container: '.mkv', + handBrakeMode: true, + FFmpegMode: false, + reQueueAfter: true, + infoLog: "☒ 4K file isn't in hevc! \n", + }, + }, +]; + +run(tests); From 457c88efbad3871fdd205c29a328a17d4b634788 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 05:45:24 +0100 Subject: [PATCH 103/126] Add Tdarr_Plugin_sdd3_Remove_Commentary_Tracks test --- ...rr_Plugin_sdd3_Remove_Commentary_Tracks.js | 1 - ...rr_Plugin_sdd3_Remove_Commentary_Tracks.js | 48 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js diff --git a/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js b/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js index 8c8b8e2..00df33b 100644 --- a/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js +++ b/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_sdd3_Remove_Commentary_Tracks", diff --git a/tests/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js b/tests/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js new file mode 100644 index 0000000..0cbc716 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_sdd3_Remove_Commentary_Tracks.js @@ -0,0 +1,48 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is a video! \n' + + "☑File doesn't contain commentary tracks! \n" + + '☑File meets conditions! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[1].tags.title = 'commentary'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:a:0 -c copy', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☒File contains commentary tracks. Removing! \n', + }, + }, +]; + +run(tests); From 10a693bc5c627527fffc979311469c569593091d Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 05:52:10 +0100 Subject: [PATCH 104/126] Add Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio test --- .../Tdarr_Plugin_s710_nick_h265_nvenc_4K.js | 2 - ...df5_Thierrrrry_Remove_Non_English_Audio.js | 1 - ...df5_Thierrrrry_Remove_Non_English_Audio.js | 63 +++++++++++++++++++ 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js diff --git a/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js b/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js index 8f3cd50..689d403 100644 --- a/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js +++ b/Community/Tdarr_Plugin_s710_nick_h265_nvenc_4K.js @@ -45,8 +45,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { var jsonString = JSON.stringify(file); response.container = ".mkv"; - console.log(file.ffProbeData.streams[0].codec_name); - console.log(file.video_resolution); if ( file.ffProbeData.streams[0].codec_name == "hevc" || file.video_resolution !== "4KUHD" diff --git a/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js b/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js index 71708c3..9be9ed1 100644 --- a/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js +++ b/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio", diff --git a/tests/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js b/tests/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js new file mode 100644 index 0000000..10424ec --- /dev/null +++ b/tests/Community/Tdarr_Plugin_sdf5_Thierrrrry_Remove_Non_English_Audio.js @@ -0,0 +1,63 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: "☑File doesn't contain tracks which are not english or undefined! \n", + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[1].tags.language = 'fre'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: "☑File doesn't contain tracks which are not english or undefined! \n", + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -map -0:a:3 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File contains tracks which are not english or undefined. Removing! \n', + }, + }, +]; + +run(tests); From 9df4e56c16a5ae305971bcbb2192b006fb2ea691 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 05:57:22 +0100 Subject: [PATCH 105/126] Add Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264 test --- ...rr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js | 1 - ...rr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js | 106 ++++++++++++++++++ 2 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js diff --git a/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js b/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js index b91e1a9..eef3529 100644 --- a/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js +++ b/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js @@ -3,7 +3,6 @@ // https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js // Seriously, all I did was make it work for converting things to h264 instead of hevc -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264', Stage: 'Pre-processing', // Preprocessing or Post-processing. Determines when the plugin will be executed. diff --git a/tests/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js b/tests/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js new file mode 100644 index 0000000..d1fbf71 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_SV6x_Smoove1FFMPEG_NVENC_H264.js @@ -0,0 +1,106 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: 'File is already H264 but file is not in mkv. Remuxing \n', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + container: '.mkv', + preset: ', -map 0 -c copy ', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.container = 'mkv'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: 'File is already H264 and in mkv \n', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: 'Target bitrate could not be calculated. Skipping this plugin. \n', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + container: '.mkv', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].codec_name = 'hevc'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + infoLog: 'Container for output selected as mkv. \n' + + 'Current bitrate = 1526 \n' + + 'Bitrate settings: \n' + + 'Target = 1526 \n' + + 'Minimum = 1068 \n' + + 'Maximum = 1983 \n' + + 'File is not h264. Transcoding. \n', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + container: '.mkv', + preset: 'undefined,-map 0 -c:v h264_nvenc -preset fast -crf 23 -tune film -b:v 1526k -minrate 1068k -maxrate 1983k -bufsize 1526k -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt yuv420p ', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + }, + otherArguments: {}, + }, + output: { + processFile: false, + infoLog: 'File is already H264 and in mp4 \n', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + container: '.mp4', + }, + }, +]; + +run(tests); From 0ada725bac82637ac4dcdbf03ddbf3fa09d393ac Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 05:59:24 +0100 Subject: [PATCH 106/126] Add Tdarr_Plugin_vdka_Remove_DataStreams test --- .../Tdarr_Plugin_vdka_Remove_DataStreams.js | 1 - .../Tdarr_Plugin_vdka_Remove_DataStreams.js | 46 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js diff --git a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js index 64e71ef..634c9d3 100644 --- a/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js +++ b/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_vdka_Remove_DataStreams", diff --git a/tests/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js b/tests/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js new file mode 100644 index 0000000..74a9319 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_vdka_Remove_DataStreams.js @@ -0,0 +1,46 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File has no data streams! \n☑File meets conditions! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[1].codec_type = 'data'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c copy -dn -map_chapters -1', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has data streams \n', + }, + }, +]; + +run(tests); From 74c0b90c6033a233ab7338c393b454d65966e454 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 06:09:56 +0100 Subject: [PATCH 107/126] Add Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable test --- ..._vdka_Tiered_CPU_CRF_Based_Configurable.js | 1 - ..._vdka_Tiered_CPU_CRF_Based_Configurable.js | 244 ++++++++++++++++++ 2 files changed, 244 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js diff --git a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js index f5614f8..e1d5aee 100644 --- a/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js +++ b/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js b/tests/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js new file mode 100644 index 0000000..a916de0 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_vdka_Tiered_CPU_CRF_Based_Configurable.js @@ -0,0 +1,244 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -map 0 -dn -c:v libx265 -preset slow -x265-params crf=22:bframes=8:rc-lookahead=32:ref=6:b-intra=1:aq-mode=3 -a53cc 0 -c:a copy -c:s copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☒File is not hevc!\n' + + '☑Preset set as slow\n' + + '☑File is 720p, using CRF value of 22!\n' + + 'File is being transcoded!\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + sdCRF: '21', + hdCRF: '23', + fullhdCRF: '24', + uhdCRF: '29', + bframe: '10', + ffmpegPreset: 'medium', + sdDisabled: 'false', + uhdDisabled: 'false', + force10bit: 'force10bit', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -map 0 -dn -c:v libx265 -preset medium -x265-params crf=23:bframes=10:rc-lookahead=32:ref=6:b-intra=1:aq-mode=3 -a53cc 0 -c:a copy -c:s copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☒File is not hevc!\n' + + '☑Preset set as medium\n' + + '☑File is 720p, using CRF value of 23!\n' + + 'File is being transcoded!\n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '480p'; + return file; + })(), + librarySettings: {}, + inputs: { + sdCRF: '21', + hdCRF: '23', + fullhdCRF: '24', + uhdCRF: '29', + bframe: '10', + ffmpegPreset: 'medium', + sdDisabled: 'false', + uhdDisabled: 'false', + force10bit: 'force10bit', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -map 0 -dn -c:v libx265 -preset medium -x265-params crf=21:bframes=10:rc-lookahead=32:ref=6:b-intra=1:aq-mode=3 -a53cc 0 -c:a copy -c:s copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☒File is not hevc!\n' + + '☑Preset set as medium\n' + + '☑File is 480p, using CRF value of 21!\n' + + 'File is being transcoded!\n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '480p'; + return file; + })(), + librarySettings: {}, + inputs: { + sdCRF: '21', + hdCRF: '23', + fullhdCRF: '24', + uhdCRF: '29', + bframe: '10', + ffmpegPreset: 'medium', + sdDisabled: 'true', + uhdDisabled: 'false', + force10bit: 'force10bit', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☒File is SD and disabled, not processing\n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '4KUHD'; + return file; + })(), + librarySettings: {}, + inputs: { + sdCRF: '21', + hdCRF: '23', + fullhdCRF: '24', + uhdCRF: '29', + bframe: '10', + ffmpegPreset: 'medium', + sdDisabled: 'false', + uhdDisabled: 'false', + force10bit: 'force10bit', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -map 0 -dn -c:v libx265 -preset medium -x265-params crf=29:bframes=10:rc-lookahead=32:ref=6:b-intra=1:aq-mode=3 -a53cc 0 -c:a copy -c:s copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☒File is not hevc!\n' + + '☑Preset set as medium\n' + + '☑File is 4KUHD, using CRF value of 29!\n' + + 'File is being transcoded!\n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '4KUHD'; + return file; + })(), + librarySettings: {}, + inputs: { + sdCRF: '21', + hdCRF: '23', + fullhdCRF: '24', + uhdCRF: '29', + bframe: '10', + ffmpegPreset: 'medium', + sdDisabled: 'false', + uhdDisabled: 'true', + force10bit: 'force10bit', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n☒File is 4k/UHD and disabled, not processing\n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '1080p'; + return file; + })(), + librarySettings: {}, + inputs: { + sdCRF: '21', + hdCRF: '23', + fullhdCRF: '24', + uhdCRF: '29', + bframe: '10', + ffmpegPreset: 'medium', + sdDisabled: 'false', + uhdDisabled: 'false', + force10bit: 'force10bit', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -map 0 -dn -c:v libx265 -preset medium -x265-params crf=24:bframes=10:rc-lookahead=32:ref=6:b-intra=1:aq-mode=3 -a53cc 0 -c:a copy -c:s copy -max_muxing_queue_size 9999', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☒File is not hevc!\n' + + '☑Preset set as medium\n' + + '☑File is 1080p, using CRF value of 24!\n' + + 'File is being transcoded!\n', + }, + }, +]; + +run(tests); From 53f225b6cdab2c1908f8cdd7d9af2bd61faa915c Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 06:15:16 +0100 Subject: [PATCH 108/126] Add Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE test --- ...dka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js | 1 - ...dka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js | 170 ++++++++++++++++++ 2 files changed, 170 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js diff --git a/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js b/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js index e0ca948..4afd5f3 100644 --- a/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js +++ b/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: 'Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE', diff --git a/tests/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js b/tests/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js new file mode 100644 index 0000000..fa423cf --- /dev/null +++ b/tests/Community/Tdarr_Plugin_vdka_Tiered_NVENC_CQV_BASED_CONFIGURABLE.js @@ -0,0 +1,170 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v h264_cuvid,-map 0 -dn -c:v hevc_nvenc -b:v 0 -preset slow -cq 23 -rc-lookahead 32 -bf 0 -a53cc 0 -c:a copy -c:s copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☑Preset set as slow\n' + + '☑File is 720p, using CQ:V value of 23!\n' + + '☒File is not hevc!\n' + + 'File is being transcoded!\n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: true, + infoLog: '☑File is a video! \n☑File is already in hevc! \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + sdCQV: '22', + hdCQV: '24', + fullhdCQV: '26', + uhdCQV: '29', + bframe: '5', + ffmpeg_preset: 'medium', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v h264_cuvid,-map 0 -dn -c:v hevc_nvenc -b:v 0 -preset medium -cq 24 -rc-lookahead 32 -bf 5 -a53cc 0 -c:a copy -c:s copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☑Preset set as medium\n' + + '☑File is 720p, using CQ:V value of 24!\n' + + '☒File is not hevc!\n' + + 'File is being transcoded!\n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '480p'; + return file; + })(), + librarySettings: {}, + inputs: { + sdCQV: '22', + hdCQV: '24', + fullhdCQV: '26', + uhdCQV: '29', + bframe: '5', + ffmpeg_preset: 'medium', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v h264_cuvid,-map 0 -dn -c:v hevc_nvenc -b:v 0 -preset medium -cq 22 -rc-lookahead 32 -bf 5 -a53cc 0 -c:a copy -c:s copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☑Preset set as medium\n' + + '☑File is 480p, using CQ:V value of 22!\n' + + '☒File is not hevc!\n' + + 'File is being transcoded!\n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '1080p'; + return file; + })(), + librarySettings: {}, + inputs: { + sdCQV: '22', + hdCQV: '24', + fullhdCQV: '26', + uhdCQV: '29', + bframe: '5', + ffmpeg_preset: 'medium', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v h264_cuvid,-map 0 -dn -c:v hevc_nvenc -b:v 0 -preset medium -cq 26 -rc-lookahead 32 -bf 5 -a53cc 0 -c:a copy -c:s copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☑Preset set as medium\n' + + '☑File is 1080p, using CQ:V value of 26!\n' + + '☒File is not hevc!\n' + + 'File is being transcoded!\n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '4KUHD'; + return file; + })(), + librarySettings: {}, + inputs: { + sdCQV: '22', + hdCQV: '24', + fullhdCQV: '26', + uhdCQV: '29', + bframe: '5', + ffmpeg_preset: 'medium', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: '-c:v h264_cuvid,-map 0 -dn -c:v hevc_nvenc -b:v 0 -preset medium -cq 29 -rc-lookahead 32 -bf 5 -a53cc 0 -c:a copy -c:s copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is a video! \n' + + '☑Preset set as medium\n' + + '☑File is 4KUHD, using CQ:V value of 29!\n' + + '☒File is not hevc!\n' + + 'File is being transcoded!\n', + }, + }, +]; + +run(tests); From 5acd312788d79392a9dd17a5e3463a8a468670c1 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 06:45:21 +0100 Subject: [PATCH 109/126] Add Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass test --- ..._Plugin_VP92_VP9_Match_Bitrate_One_Pass.js | 4 +- ..._Plugin_VP92_VP9_Match_Bitrate_One_Pass.js | 505 ++++++++++++++++++ 2 files changed, 508 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js diff --git a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js index e5bf1af..a364d81 100644 --- a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js +++ b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js @@ -1,5 +1,4 @@ /* eslint max-classes-per-file: ["error", 2] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass', Stage: 'Pre-processing', @@ -256,6 +255,7 @@ class Configurator { function loopOverStreamsOfType(file, type, method) { let id = 0; for (let i = 0; i < file.ffProbeData.streams.length; i += 1) { + console.log(file.ffProbeData.streams[i].codec_type); if (file.ffProbeData.streams[i].codec_type.toLowerCase() === type) { method(file.ffProbeData.streams[i], id); id += 1; @@ -329,6 +329,7 @@ function buildAudioConfiguration(inputs, file, logger) { if ('tags' in stream) { // Remove unwanted languages if ('language' in stream.tags) { + console.log(stream.tags.language.toLowerCase()); if (languages.indexOf(stream.tags.language.toLowerCase()) === -1) { configuration.AddOutputSetting(`-map -0:a:${id}`); streams_removing += 1; @@ -340,6 +341,7 @@ function buildAudioConfiguration(inputs, file, logger) { } }); + console.log(stream_count, streams_removing); if (stream_count === streams_removing) { logger.AddError( '*** All audio tracks would have been removed, removing all delete entries', diff --git a/tests/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js b/tests/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js new file mode 100644 index 0000000..228ff5c --- /dev/null +++ b/tests/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js @@ -0,0 +1,505 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Audio is not in proper codec, will format\n' + + '☒ Transcoding file to VP9\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -pix_fmt yuv420p10le -c:v libvpx-vp9 -b:v 0 -crf 27 -threads 64 -speed 2 \n' + + ' -quality good -static-thresh 0 -tile-columns 2 -tile-rows 0 -frame-parallel 0 -row-mt 1 \n' + + ' -aq-mode 0 -g 240 \n' + + ' -c:a libopus -c:s copy', + reQueueAfter: true, + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Audio is not in proper codec, will format\n' + + '☒ Transcoding file to VP9\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -pix_fmt yuv420p10le -c:v libvpx-vp9 -b:v 0 -crf 26 -threads 64 -speed 2 \n' + + ' -quality good -static-thresh 0 -tile-columns 2 -tile-rows 0 -frame-parallel 0 -row-mt 1 \n' + + ' -aq-mode 0 -g 240 \n' + + ' -c:a libopus -c:s copy', + reQueueAfter: true, + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.container = 'webm'; + file.ffProbeData.streams[0].codec_name = 'vp9'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Audio is not in proper codec, will format\n' + + '☑ File is in proper video format\n' + + '☑ No video processing necessary\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -c:v copy \n -c:a libopus -c:s copy', + reQueueAfter: true, + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.container = 'webm'; + file.ffProbeData.streams[0].codec_name = 'vp9'; + file.ffProbeData.streams[1].codec_name = 'opus'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☑ No audio processing necessary\n' + + '☑ File is in proper video format\n' + + '☑ No video processing necessary\n' + + '☑ No subtitle processing necessary\n' + + '☑ No need to process file', + processFile: false, + preset: ',-map 0 -map -0:d -c:v copy \n -c:a copy -c:s copy', + reQueueAfter: true, + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + CQ_240p: '33', + CQ_360p: '32', + CQ_480p: '29', + CQ_720p: '28', + CQ_1080p: '27', + CQ_4KUHD: '16', + CQ_8KUHD: '16', + audio_language: 'eng,und,fre', + audio_commentary: 'true', + subtitle_language: 'eng', + subtitle_commentary: 'true', + remove_mjpeg: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Audio is not in proper codec, will format\n' + + '☒ Transcoding file to VP9\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -pix_fmt yuv420p10le -c:v libvpx-vp9 -b:v 0 -crf 28 -threads 64 -speed 2 \n' + + ' -quality good -static-thresh 0 -tile-columns 2 -tile-rows 0 -frame-parallel 0 -row-mt 1 \n' + + ' -aq-mode 0 -g 240 \n' + + ' -c:a libopus -c:s copy', + reQueueAfter: true, + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '240p'; + return file; + })(), + librarySettings: {}, + inputs: { + CQ_240p: '33', + CQ_360p: '32', + CQ_480p: '29', + CQ_720p: '28', + CQ_1080p: '27', + CQ_4KUHD: '16', + CQ_8KUHD: '16', + audio_language: 'eng,und,fre', + audio_commentary: 'true', + subtitle_language: 'eng', + subtitle_commentary: 'true', + remove_mjpeg: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Audio is not in proper codec, will format\n' + + '☒ Transcoding file to VP9\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -pix_fmt yuv420p10le -c:v libvpx-vp9 -b:v 0 -crf 33 -threads 64 -speed 1 \n' + + ' -quality good -static-thresh 0 -tile-columns 0 -tile-rows 0 -frame-parallel 0 -row-mt 1 \n' + + ' -aq-mode 0 -g 240 \n' + + ' -c:a libopus -c:s copy', + reQueueAfter: true, + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '360p'; + return file; + })(), + librarySettings: {}, + inputs: { + CQ_240p: '33', + CQ_360p: '32', + CQ_480p: '29', + CQ_720p: '28', + CQ_1080p: '27', + CQ_4KUHD: '16', + CQ_8KUHD: '16', + audio_language: 'eng,und,fre', + audio_commentary: 'true', + subtitle_language: 'eng', + subtitle_commentary: 'true', + remove_mjpeg: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Audio is not in proper codec, will format\n' + + '☒ Transcoding file to VP9\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -pix_fmt yuv420p10le -c:v libvpx-vp9 -b:v 0 -crf 32 -threads 64 -speed 1 \n' + + ' -quality good -static-thresh 0 -tile-columns 1 -tile-rows 0 -frame-parallel 0 -row-mt 1 \n' + + ' -aq-mode 0 -g 240 \n' + + ' -c:a libopus -c:s copy', + reQueueAfter: true, + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '480p'; + return file; + })(), + librarySettings: {}, + inputs: { + CQ_240p: '33', + CQ_360p: '32', + CQ_480p: '29', + CQ_720p: '28', + CQ_1080p: '27', + CQ_4KUHD: '16', + CQ_8KUHD: '16', + audio_language: 'eng,und,fre', + audio_commentary: 'true', + subtitle_language: 'eng', + subtitle_commentary: 'true', + remove_mjpeg: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Audio is not in proper codec, will format\n' + + '☒ Transcoding file to VP9\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -pix_fmt yuv420p10le -c:v libvpx-vp9 -b:v 0 -crf 29 -threads 64 -speed 1 \n' + + ' -quality good -static-thresh 0 -tile-columns 1 -tile-rows 0 -frame-parallel 0 -row-mt 1 \n' + + ' -aq-mode 0 -g 240 \n' + + ' -c:a libopus -c:s copy', + reQueueAfter: true, + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '1080p'; + return file; + })(), + librarySettings: {}, + inputs: { + CQ_240p: '33', + CQ_360p: '32', + CQ_480p: '29', + CQ_720p: '28', + CQ_1080p: '27', + CQ_4KUHD: '16', + CQ_8KUHD: '16', + audio_language: 'eng,und,fre', + audio_commentary: 'true', + subtitle_language: 'eng', + subtitle_commentary: 'true', + remove_mjpeg: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Audio is not in proper codec, will format\n' + + '☒ Transcoding file to VP9\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -pix_fmt yuv420p10le -c:v libvpx-vp9 -b:v 0 -crf 27 -threads 64 -speed 2 \n' + + ' -quality good -static-thresh 0 -tile-columns 2 -tile-rows 0 -frame-parallel 0 -row-mt 1 \n' + + ' -aq-mode 0 -g 240 \n' + + ' -c:a libopus -c:s copy', + reQueueAfter: true, + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '4KUHD'; + return file; + })(), + librarySettings: {}, + inputs: { + CQ_240p: '33', + CQ_360p: '32', + CQ_480p: '29', + CQ_720p: '28', + CQ_1080p: '27', + CQ_4KUHD: '16', + CQ_8KUHD: '17', + audio_language: 'eng,und,fre', + audio_commentary: 'true', + subtitle_language: 'eng', + subtitle_commentary: 'true', + remove_mjpeg: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Audio is not in proper codec, will format\n' + + '☒ Transcoding file to VP9\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -pix_fmt yuv420p10le -c:v libvpx-vp9 -b:v 0 -crf 16 -threads 64 -speed 2 \n' + + ' -quality good -static-thresh 0 -tile-columns 3 -tile-rows 0 -frame-parallel 0 -row-mt 1 \n' + + ' -aq-mode 0 -g 240 \n' + + ' -c:a libopus -c:s copy', + reQueueAfter: true, + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.video_resolution = '8KUHD'; + return file; + })(), + librarySettings: {}, + inputs: { + CQ_240p: '33', + CQ_360p: '32', + CQ_480p: '29', + CQ_720p: '28', + CQ_1080p: '27', + CQ_4KUHD: '16', + CQ_8KUHD: '17', + audio_language: 'eng,und,fre', + audio_commentary: 'true', + subtitle_language: 'eng', + subtitle_commentary: 'true', + remove_mjpeg: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Audio is not in proper codec, will format\n' + + '☒ Transcoding file to VP9\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -pix_fmt yuv420p10le -c:v libvpx-vp9 -b:v 0 -crf 17 -threads 64 -speed 2 \n' + + ' -quality good -static-thresh 0 -tile-columns 3 -tile-rows 0 -frame-parallel 0 -row-mt 1 \n' + + ' -aq-mode 0 -g 240 \n' + + ' -c:a libopus -c:s copy', + reQueueAfter: true, + }, + }, + + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.container = 'webm'; + file.ffProbeData.streams[0].codec_name = 'vp9'; + file.ffProbeData.streams[1].codec_name = 'opus'; + file.ffProbeData.streams[1].tags.language = 'eng'; + + file.ffProbeData.streams[2] = _.cloneDeep(file.ffProbeData.streams[1]); + file.ffProbeData.streams[2].codec_type = 'subtitle'; + file.ffProbeData.streams[2].tags.title = 'commentary'; + return file; + })(), + librarySettings: {}, + inputs: { + CQ_240p: '33', + CQ_360p: '32', + CQ_480p: '29', + CQ_720p: '28', + CQ_1080p: '27', + CQ_4KUHD: '16', + CQ_8KUHD: '17', + audio_language: 'eng,und,fre', + audio_commentary: 'true', + subtitle_language: 'eng,und', + subtitle_commentary: 'true', + remove_mjpeg: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☑ No audio processing necessary\n' + + '☑ File is in proper video format\n' + + '☑ No video processing necessary\n' + + '☒ Removing Commentary or Description subtitle: commentary', + processFile: true, + preset: ',-map 0 -map -0:d -c:v copy \n -c:a copy -c:s copy -map -0:s:0', + reQueueAfter: true, + }, + }, + + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.container = 'webm'; + file.ffProbeData.streams[0].codec_name = 'vp9'; + file.ffProbeData.streams[1].codec_name = 'opus'; + file.ffProbeData.streams[1].tags.language = 'eng'; + + file.ffProbeData.streams[2] = _.cloneDeep(file.ffProbeData.streams[0]); + file.ffProbeData.streams[2].codec_name = 'mjpeg'; + return file; + })(), + librarySettings: {}, + inputs: { + CQ_240p: '33', + CQ_360p: '32', + CQ_480p: '29', + CQ_720p: '28', + CQ_1080p: '27', + CQ_4KUHD: '16', + CQ_8KUHD: '17', + audio_language: 'eng,und,fre', + audio_commentary: 'true', + subtitle_language: 'eng,und', + subtitle_commentary: 'true', + remove_mjpeg: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☑ No audio processing necessary\n' + + '☑ File is in proper video format\n' + + '☒ Removing mjpeg\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -c:v copy -map -0:v:1 \n -c:a copy -c:s copy', + reQueueAfter: true, + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.container = 'webm'; + file.ffProbeData.streams[0].codec_name = 'vp9'; + file.ffProbeData.streams[1].codec_name = 'opus'; + file.ffProbeData.streams[1].tags.language = 'eng'; + + file.ffProbeData.streams[2] = _.cloneDeep(file.ffProbeData.streams[1]); + file.ffProbeData.streams[2].tags.language = 'fre'; + return file; + })(), + librarySettings: {}, + inputs: { + CQ_240p: '33', + CQ_360p: '32', + CQ_480p: '29', + CQ_720p: '28', + CQ_1080p: '27', + CQ_4KUHD: '16', + CQ_8KUHD: '17', + audio_language: 'eng,und', + audio_commentary: 'true', + subtitle_language: 'eng,und', + subtitle_commentary: 'true', + remove_mjpeg: 'true', + }, + otherArguments: {}, + }, + output: { + container: '.webm', + FFmpegMode: true, + handBrakeMode: false, + infoLog: '☒ Removing audio track in language fre\n' + + '☑ File is in proper video format\n' + + '☑ No video processing necessary\n' + + '☑ No subtitle processing necessary', + processFile: true, + preset: ',-map 0 -map -0:d -c:v copy \n -c:a copy -map -0:a:1 -c:s copy', + reQueueAfter: true, + }, + }, +]; + +run(tests); From 6d6cedea0453f94946eeb5bf79a1c6ad59f1f87b Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 06:46:43 +0100 Subject: [PATCH 110/126] Add Tdarr_Plugin_x7ab_Remove_Subs test --- Community/Tdarr_Plugin_x7ab_Remove_Subs.js | 1 - .../Tdarr_Plugin_x7ab_Remove_Subs.js | 42 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_x7ab_Remove_Subs.js diff --git a/Community/Tdarr_Plugin_x7ab_Remove_Subs.js b/Community/Tdarr_Plugin_x7ab_Remove_Subs.js index 3bf03de..7bd12ff 100644 --- a/Community/Tdarr_Plugin_x7ab_Remove_Subs.js +++ b/Community/Tdarr_Plugin_x7ab_Remove_Subs.js @@ -1,5 +1,4 @@ /* eslint-disable */ -// tdarrSkipTest const details = () => { return { id: "Tdarr_Plugin_x7ab_Remove_Subs", diff --git a/tests/Community/Tdarr_Plugin_x7ab_Remove_Subs.js b/tests/Community/Tdarr_Plugin_x7ab_Remove_Subs.js new file mode 100644 index 0000000..9eca971 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_x7ab_Remove_Subs.js @@ -0,0 +1,42 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File has no subs \n☑File meets conditions! \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-sn -map 0 -c copy', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File has subs \n', + }, + }, +]; + +run(tests); From 46db3be6685b53a1a977028391561ddb34fad6b1 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 06:51:41 +0100 Subject: [PATCH 111/126] Add Tdarr_Plugin_x7ac_Remove_Closed_Captions test --- ...darr_Plugin_x7ac_Remove_Closed_Captions.js | 1 - ...darr_Plugin_x7ac_Remove_Closed_Captions.js | 67 +++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js diff --git a/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js b/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js index 26afd05..f5fe57a 100644 --- a/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js +++ b/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_x7ac_Remove_Closed_Captions', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js b/tests/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js new file mode 100644 index 0000000..01df48b --- /dev/null +++ b/tests/Community/Tdarr_Plugin_x7ac_Remove_Closed_Captions.js @@ -0,0 +1,67 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: ',-map 0 -codec copy -bsf:v "filter_units=remove_types=6"', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑Closed captions have not been detected on this file \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.hasClosedCaptions = true; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -codec copy -bsf:v "filter_units=remove_types=6"', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒This file has closed captions \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.ffProbeData.streams[0].closed_captions = 1; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -codec copy -bsf:v "filter_units=remove_types=6"', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒This file has burnt closed captions \n', + }, + }, +]; + +run(tests); From a3e63ed696bd22c2827d16479d1a9c51cbc08ad1 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 06:56:12 +0100 Subject: [PATCH 112/126] Add Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium test --- ..._Plugin_VP92_VP9_Match_Bitrate_One_Pass.js | 3 - ...b_TheRealShadoh_FFmpeg_Subs_H264_Medium.js | 1 - ...b_TheRealShadoh_FFmpeg_Subs_H264_Medium.js | 111 ++++++++++++++++++ 3 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js diff --git a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js index a364d81..1412281 100644 --- a/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js +++ b/Community/Tdarr_Plugin_VP92_VP9_Match_Bitrate_One_Pass.js @@ -255,7 +255,6 @@ class Configurator { function loopOverStreamsOfType(file, type, method) { let id = 0; for (let i = 0; i < file.ffProbeData.streams.length; i += 1) { - console.log(file.ffProbeData.streams[i].codec_type); if (file.ffProbeData.streams[i].codec_type.toLowerCase() === type) { method(file.ffProbeData.streams[i], id); id += 1; @@ -329,7 +328,6 @@ function buildAudioConfiguration(inputs, file, logger) { if ('tags' in stream) { // Remove unwanted languages if ('language' in stream.tags) { - console.log(stream.tags.language.toLowerCase()); if (languages.indexOf(stream.tags.language.toLowerCase()) === -1) { configuration.AddOutputSetting(`-map -0:a:${id}`); streams_removing += 1; @@ -341,7 +339,6 @@ function buildAudioConfiguration(inputs, file, logger) { } }); - console.log(stream_count, streams_removing); if (stream_count === streams_removing) { logger.AddError( '*** All audio tracks would have been removed, removing all delete entries', diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js index 716e730..88fc14e 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/tests/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js new file mode 100644 index 0000000..7f04b00 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -0,0 +1,111 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v libx264 -preset medium -c:a aac -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File is not in h264! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☑File has aac track \n' + + '☑File has no/compatible subs \n' + + '☑File meets conditions! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + file.ffProbeData.streams[1].codec_name = 'ac3'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☒File has no aac track \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: false, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☑File has aac track \n' + + '☒File has incompatible subs \n', + }, + }, +]; + +run(tests); From 305769c13bdfa2ae0ca79165c0073218fcce59ee Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 06:59:32 +0100 Subject: [PATCH 113/126] Add Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast test --- ...1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js | 1 - ...1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js | 111 ++++++++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js diff --git a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js index ad301d8..fbc9de3 100644 --- a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js +++ b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/tests/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js new file mode 100644 index 0000000..56e03e7 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -0,0 +1,111 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v libx264 -preset fast -c:a aac -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File is not in h264! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☑File has aac track \n' + + '☑File has no/compatible subs \n' + + '☑File meets conditions! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + file.ffProbeData.streams[1].codec_name = 'ac3'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☒File has no aac track \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☑File has aac track \n' + + '☒File has incompatible subs \n', + }, + }, +]; + +run(tests); From 10e86da66f420d7103f1d63f5e1fc6e2e1d8b4ff Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 07:00:42 +0100 Subject: [PATCH 114/126] Add Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow test --- ...2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js | 1 - ...2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js | 111 ++++++++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js diff --git a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js index dc863a4..28ee579 100644 --- a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js +++ b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js b/tests/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js new file mode 100644 index 0000000..3d37593 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -0,0 +1,111 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v libx264 -preset slow -c:a aac -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File is not in h264! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☑File has aac track \n' + + '☑File has no/compatible subs \n' + + '☑File meets conditions! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + file.ffProbeData.streams[1].codec_name = 'ac3'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☒File has no aac track \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☑File has aac track \n' + + '☒File has incompatible subs \n', + }, + }, +]; + +run(tests); From c74b7678b47dbfde25c35356e33654bc3f1e6d40 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 07:02:14 +0100 Subject: [PATCH 115/126] Add Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast test --- ...TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js | 1 - ...TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js | 111 ++++++++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js diff --git a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js index be10d89..597003f 100644 --- a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js +++ b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -1,4 +1,3 @@ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js b/tests/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js new file mode 100644 index 0000000..8216fb3 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -0,0 +1,111 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n☒File has title metadata \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map_metadata -1 -map 0:v -map 0:s? -map 0:a -c:v libx264 -preset veryfast -c:a aac -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☒File is not in h264! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☑File has aac track \n' + + '☑File has no/compatible subs \n' + + '☑File meets conditions! \n', + }, + }, + { + input: { + file: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.meta.Title = undefined; + file.ffProbeData.streams[1].codec_name = 'ac3'; + return file; + })(), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a aac -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☒File has no aac track \n', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑File is already in h264! \n' + + '☑File has no title metadata \n' + + '☑File has aac track \n' + + '☒File has incompatible subs \n', + }, + }, +]; + +run(tests); From ad646d04b5f74c99580b63370f532f6388dd518d Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 07:17:18 +0100 Subject: [PATCH 116/126] Add Tdarr_Plugin_a9hf_New_file_duration_check test --- .../Tdarr_Plugin_a9he_New_file_size_check.js | 1 + ...arr_Plugin_a9hf_New_file_duration_check.js | 1 - .../Tdarr_Plugin_a9he_New_file_size_check.js | 8 +-- ...arr_Plugin_a9hf_New_file_duration_check.js | 68 +++++++++++++++++++ 4 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js diff --git a/Community/Tdarr_Plugin_a9he_New_file_size_check.js b/Community/Tdarr_Plugin_a9he_New_file_size_check.js index 32e99d6..c352eba 100644 --- a/Community/Tdarr_Plugin_a9he_New_file_size_check.js +++ b/Community/Tdarr_Plugin_a9he_New_file_size_check.js @@ -52,6 +52,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { const ratio = parseInt((newSize / oldSize) * 100, 10); + console.log(newSize, oldSize); const sizeText = `New file has size ${newSize.toFixed(3)} MB which is ${ratio}% ` + `of original file size: ${oldSize.toFixed(3)} MB`; diff --git a/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js b/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js index 6f1fcc5..4cda5ca 100644 --- a/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js +++ b/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js @@ -1,6 +1,5 @@ // eslint-disable-next-line import/no-unresolved -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_a9hf_New_file_duration_check', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js b/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js index 7e1de0d..e990b36 100644 --- a/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js +++ b/tests/Community/Tdarr_Plugin_a9he_New_file_size_check.js @@ -5,11 +5,11 @@ const run = require('../helpers/run'); const tests = [ { input: { - file: require('../sampleData/media/sampleH264_1.json'), + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), librarySettings: {}, inputs: {}, otherArguments: { - originalLibraryFile: require('../sampleData/media/sampleH264_1.json'), + originalLibraryFile: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), }, }, output: { @@ -23,7 +23,7 @@ const tests = [ }, { input: { - file: require('../sampleData/media/sampleH264_1.json'), + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), librarySettings: {}, inputs: { upperBound: '110', @@ -44,7 +44,7 @@ const tests = [ }, { input: { - file: require('../sampleData/media/sampleH264_1.json'), + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), librarySettings: {}, inputs: { upperBound: '120', diff --git a/tests/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js b/tests/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js new file mode 100644 index 0000000..9497714 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_a9hf_New_file_duration_check.js @@ -0,0 +1,68 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: { + originalLibraryFile: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + }, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'New file has duration 5.312 s which is 100.000% of original file duration: 5.312 s', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + upperBound: '110', + lowerBound: '35', + }, + otherArguments: { + originalLibraryFile: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.mediaInfo.track.filter((row) => row['@type'] === 'General')[0].Duration = 20; + return file; + })(), + }, + }, + output: 'New file duration not within limits. New file has duration 5.312 s which is 26.560% of original file duration: 20 s. lowerBound is 35%', + error: { + shouldThrow: true, + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + upperBound: '110', + lowerBound: '35', + }, + otherArguments: { + originalLibraryFile: (() => { + const file = _.cloneDeep(require('../sampleData/media/sampleH264_1.json')); + file.mediaInfo.track.filter((row) => row['@type'] === 'General')[0].Duration = 1; + return file; + })(), + }, + }, + output: 'New file duration not within limits. New file has duration 5.312 s which is 531.200% of original file duration: 1 s. upperBound is 110%', + error: { + shouldThrow: true, + }, + }, +]; + +run(tests); From b1815667d65d0012ab62d6ca499be9ef988e10fa Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 07:34:19 +0100 Subject: [PATCH 117/126] Add os based tests --- ...de audio and video with HW (PC and Mac).js | 50 +++++---- ...Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js | 101 ++++++++++++------ tests/helpers/run.js | 66 +++++++----- 3 files changed, 138 insertions(+), 79 deletions(-) diff --git a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js index c725079..e31024c 100644 --- a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js +++ b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js @@ -11,17 +11,20 @@ const tests = [ otherArguments: {}, }, output: { - container: '.mkv', - processFile: true, - preset: ', -sn -map 0:v -c:v copy -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -map 0:a -c:a copy ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Converting video, NOT resizing. 720p, h264 --> 720p, hevc. bitrate = 1517 --> 758, multiplier 0.5. \n' - + 'Not converting audio. \n' - + '2 channels - \n' - + '6 channels - und aac \n' - + '8 channels - ', + win32: { + container: '.mkv', + processFile: true, + preset: ', -sn -map 0:v -c:v hevc_qsv -load_plugin hevc_hw -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -map 0:a -c:a copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Converting video, NOT resizing. 720p, h264 --> 720p, hevc. bitrate = 1517 --> 758, multiplier 0.5. \n' + + 'Not converting audio. \n' + + '2 channels - \n' + + '6 channels - und aac \n' + + '8 channels - ', + }, + linux: undefined, }, }, { @@ -70,17 +73,20 @@ const tests = [ otherArguments: {}, }, output: { - container: '.mkv', - processFile: true, - preset: ', -sn -map 0:v -c:v copy -b:v 3933k -minrate 2753k -maxrate 5112k -bufsize 7866k -map 0:a -c:a copy ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: 'Converting video, NOT resizing. 1080p, h264 --> 1080p, hevc. bitrate = 7866 --> 3933, multiplier 0.5. \n' - + 'Not converting audio. \n' - + '2 channels - eng flac \n' - + '6 channels - \n' - + '8 channels - ', + win32: { + container: '.mkv', + processFile: true, + preset: ', -sn -map 0:v -c:v hevc_qsv -load_plugin hevc_hw -b:v 3933k -minrate 2753k -maxrate 5112k -bufsize 7866k -map 0:a -c:a copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Converting video, NOT resizing. 1080p, h264 --> 1080p, hevc. bitrate = 7866 --> 3933, multiplier 0.5. \n' + + 'Not converting audio. \n' + + '2 channels - eng flac \n' + + '6 channels - \n' + + '8 channels - ', + }, + linux: undefined, }, }, { diff --git a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js index 336f2f0..9f3498d 100644 --- a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js +++ b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -11,21 +11,40 @@ const tests = [ otherArguments: {}, }, output: { - processFile: true, - preset: '-fflags +genpts -hwaccel qsv -c:v h264_qsv -map 0 -c:v hevc_qsv -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset slow \n' - + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑ It looks like the current bitrate is 1517k. \n' - + '\n' - + 'Container for output selected as mkv. \n' - + 'Encode variable bitrate settings: \n' - + 'Target = 759k \n' - + 'Minimum = 569k \n' - + 'Maximum = 949k \n' - + 'File Transcoding... \n', - container: '.mkv', + linux: { + processFile: true, + preset: '-fflags +genpts -hwaccel qsv -c:v h264_qsv -map 0 -c:v hevc_qsv -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset slow \n' + + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ It looks like the current bitrate is 1517k. \n' + + '\n' + + 'Container for output selected as mkv. \n' + + 'Encode variable bitrate settings: \n' + + 'Target = 759k \n' + + 'Minimum = 569k \n' + + 'Maximum = 949k \n' + + 'File Transcoding... \n', + container: '.mkv', + }, + win32: { + processFile: true, + preset: '-fflags +genpts -hwaccel qsv -c:v h264_qsv -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset slow \n' + + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ It looks like the current bitrate is 1517k. \n' + + '\n' + + 'Container for output selected as mkv. \n' + + 'Encode variable bitrate settings: \n' + + 'Target = 759k \n' + + 'Minimum = 569k \n' + + 'Maximum = 949k \n' + + 'File Transcoding... \n', + container: '.mkv', + }, }, }, { @@ -40,22 +59,42 @@ const tests = [ otherArguments: {}, }, output: { - processFile: true, - preset: '-fflags +genpts -hwaccel qsv -map 0 -c:v hevc_qsv -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset fast \n' - + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -pix_fmt p010le ', - handBrakeMode: false, - FFmpegMode: true, - reQueueAfter: true, - infoLog: '☑ It looks like the current bitrate is 1517k. \n' - + '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n' - + '\n' - + 'Container for output selected as mp4. \n' - + 'Encode variable bitrate settings: \n' - + 'Target = 759k \n' - + 'Minimum = 569k \n' - + 'Maximum = 949k \n' - + 'File Transcoding... \n', - container: '.mp4', + linux: { + processFile: true, + preset: '-fflags +genpts -hwaccel qsv -map 0 -c:v hevc_qsv -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset fast \n' + + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ It looks like the current bitrate is 1517k. \n' + + '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n' + + '\n' + + 'Container for output selected as mp4. \n' + + 'Encode variable bitrate settings: \n' + + 'Target = 759k \n' + + 'Minimum = 569k \n' + + 'Maximum = 949k \n' + + 'File Transcoding... \n', + container: '.mp4', + }, + win32: { + processFile: true, + preset: '-fflags +genpts -hwaccel qsv -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset fast \n' + + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ It looks like the current bitrate is 1517k. \n' + + '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n' + + '\n' + + 'Container for output selected as mp4. \n' + + 'Encode variable bitrate settings: \n' + + 'Target = 759k \n' + + 'Minimum = 569k \n' + + 'Maximum = 949k \n' + + 'File Transcoding... \n', + container: '.mp4', + }, }, }, { diff --git a/tests/helpers/run.js b/tests/helpers/run.js index 58b6e05..70a61bb 100644 --- a/tests/helpers/run.js +++ b/tests/helpers/run.js @@ -2,6 +2,7 @@ const path = require('path'); const chai = require('chai'); const _ = require('lodash'); const importFresh = require('import-fresh'); +const os = require('os'); const scriptName = path.basename(process.mainModule.filename); @@ -12,37 +13,50 @@ const run = async (tests) => { console.log(`${scriptName}: test ${i}`); const test = tests[i]; - let testOutput; - let errorEncountered = false; - // eslint-disable-next-line import/no-dynamic-require - const { plugin } = importFresh(`../../Community/${scriptName}`); - - try { - // eslint-disable-next-line no-await-in-loop - testOutput = await plugin( - _.cloneDeep(test.input.file), - _.cloneDeep(test.input.librarySettings), - _.cloneDeep(test.input.inputs), - _.cloneDeep(test.input.otherArguments), - ); - } catch (err1) { - errorEncountered = err1; + let expectedOutput; + if (test.output[os.platform()]) { + expectedOutput = test.output[os.platform()]; + } else { + expectedOutput = test.output; } - if (test.outputModify) { - testOutput = test.outputModify(test.output); - } + if (expectedOutput === undefined) { + // skip test due to OS + // eslint-disable-next-line no-console + console.log(`Test not meant to run on ${os.platform()}, skipping`); + } else { + let testOutput; + let errorEncountered = false; + // eslint-disable-next-line import/no-dynamic-require + const { plugin } = importFresh(`../../Community/${scriptName}`); + + try { + // eslint-disable-next-line no-await-in-loop + testOutput = await plugin( + _.cloneDeep(test.input.file), + _.cloneDeep(test.input.librarySettings), + _.cloneDeep(test.input.inputs), + _.cloneDeep(test.input.otherArguments), + ); + } catch (err1) { + errorEncountered = err1; + } + + if (test.outputModify) { + testOutput = test.outputModify(testOutput); + } - if (test.error && test.error.shouldThrow) { - if (errorEncountered !== false) { - // eslint-disable-next-line no-console - console.log(errorEncountered); - chai.assert.deepEqual(errorEncountered.message, test.output); + if (test.error && test.error.shouldThrow) { + if (errorEncountered !== false) { + // eslint-disable-next-line no-console + console.log(errorEncountered); + chai.assert.deepEqual(errorEncountered.message, expectedOutput); + } else { + throw new Error('Expected plugin error but none was thrown!'); + } } else { - throw new Error('Expected plugin error but none was thrown!'); + chai.assert.deepEqual(testOutput, expectedOutput); } - } else { - chai.assert.deepEqual(testOutput, test.output); } } } catch (err) { From af8c30429c4093893a66451c88fd591fc37054da Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 07:40:24 +0100 Subject: [PATCH 118/126] Run on all --- .github/workflows/{lint.yml => lint_and_test.yml} | 6 ++++++ ...n_ER01_Transcode audio and video with HW (PC and Mac).js | 4 ++-- tests/helpers/run.js | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) rename .github/workflows/{lint.yml => lint_and_test.yml} (77%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint_and_test.yml similarity index 77% rename from .github/workflows/lint.yml rename to .github/workflows/lint_and_test.yml index 042233b..5cbff21 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint_and_test.yml @@ -12,6 +12,12 @@ jobs: strategy: matrix: node-version: [16.x] + os: + [ + ["ubuntu-20.04"], + ["windows-2019"], + ["macos-11.0"], + ] steps: - uses: actions/checkout@v2 diff --git a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js index e31024c..95dd855 100644 --- a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js +++ b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js @@ -24,7 +24,7 @@ const tests = [ + '6 channels - und aac \n' + '8 channels - ', }, - linux: undefined, + linux: false, }, }, { @@ -86,7 +86,7 @@ const tests = [ + '6 channels - \n' + '8 channels - ', }, - linux: undefined, + linux: false, }, }, { diff --git a/tests/helpers/run.js b/tests/helpers/run.js index 70a61bb..a11c6e0 100644 --- a/tests/helpers/run.js +++ b/tests/helpers/run.js @@ -20,7 +20,7 @@ const run = async (tests) => { expectedOutput = test.output; } - if (expectedOutput === undefined) { + if (expectedOutput === false) { // skip test due to OS // eslint-disable-next-line no-console console.log(`Test not meant to run on ${os.platform()}, skipping`); From ea892dd1c310aa40beacac0910c96887671cb136 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 07:46:37 +0100 Subject: [PATCH 119/126] Log os --- tests/helpers/run.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/helpers/run.js b/tests/helpers/run.js index a11c6e0..ec69634 100644 --- a/tests/helpers/run.js +++ b/tests/helpers/run.js @@ -10,7 +10,7 @@ const run = async (tests) => { try { for (let i = 0; i < tests.length; i += 1) { // eslint-disable-next-line no-console - console.log(`${scriptName}: test ${i}`); + console.log(`[${os.platform()}] ${scriptName}: test ${i}`); const test = tests[i]; let expectedOutput; From 8e0a8954b479932792a8ade1c303dfff50bac6aa Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 07:51:02 +0100 Subject: [PATCH 120/126] Fix os --- .github/workflows/lint_and_test.yml | 8 ++++---- Community/Tdarr_Plugin_a9he_New_file_size_check.js | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml index 5cbff21..f30452d 100644 --- a/.github/workflows/lint_and_test.yml +++ b/.github/workflows/lint_and_test.yml @@ -6,9 +6,6 @@ on: jobs: build: - - runs-on: ubuntu-latest - strategy: matrix: node-version: [16.x] @@ -18,6 +15,7 @@ jobs: ["windows-2019"], ["macos-11.0"], ] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -26,4 +24,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm i - - run: npm run checkPlugins && npm run lint && npm run test + - run: npm run checkPlugins + - run: npm run lint + - run: npm run test diff --git a/Community/Tdarr_Plugin_a9he_New_file_size_check.js b/Community/Tdarr_Plugin_a9he_New_file_size_check.js index c352eba..32e99d6 100644 --- a/Community/Tdarr_Plugin_a9he_New_file_size_check.js +++ b/Community/Tdarr_Plugin_a9he_New_file_size_check.js @@ -52,7 +52,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { const ratio = parseInt((newSize / oldSize) * 100, 10); - console.log(newSize, oldSize); const sizeText = `New file has size ${newSize.toFixed(3)} MB which is ${ratio}% ` + `of original file size: ${oldSize.toFixed(3)} MB`; From 33318486f4295af055d47bede71ab8d0a7de4781 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 07:52:58 +0100 Subject: [PATCH 121/126] Fix OS test logic --- tests/helpers/run.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/helpers/run.js b/tests/helpers/run.js index ec69634..ff1dabf 100644 --- a/tests/helpers/run.js +++ b/tests/helpers/run.js @@ -14,7 +14,7 @@ const run = async (tests) => { const test = tests[i]; let expectedOutput; - if (test.output[os.platform()]) { + if (test.output[os.platform()] !== undefined) { expectedOutput = test.output[os.platform()]; } else { expectedOutput = test.output; From 011392c860486c93124893c3f9df1f2ccaca192f Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 07:57:04 +0100 Subject: [PATCH 122/126] Add darwin tests --- ...Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js index 9f3498d..6d0dd96 100644 --- a/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js +++ b/tests/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -45,6 +45,23 @@ const tests = [ + 'File Transcoding... \n', container: '.mkv', }, + darwin: { + processFile: true, + preset: '-fflags +genpts -hwaccel qsv -c:v h264_qsv -map 0 -c:v hevc_videotoolbox -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset slow \n' + + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ It looks like the current bitrate is 1517k. \n' + + '\n' + + 'Container for output selected as mkv. \n' + + 'Encode variable bitrate settings: \n' + + 'Target = 759k \n' + + 'Minimum = 569k \n' + + 'Maximum = 949k \n' + + 'File Transcoding... \n', + container: '.mkv', + }, }, }, { @@ -95,6 +112,24 @@ const tests = [ + 'File Transcoding... \n', container: '.mp4', }, + darwin: { + processFile: true, + preset: '-fflags +genpts -hwaccel qsv -map 0 -c:v hevc_videotoolbox -b:v 759k -minrate 569k -maxrate 949k -bufsize 1517k -preset fast \n' + + ' -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: '☑ It looks like the current bitrate is 1517k. \n' + + '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n' + + '\n' + + 'Container for output selected as mp4. \n' + + 'Encode variable bitrate settings: \n' + + 'Target = 759k \n' + + 'Minimum = 569k \n' + + 'Maximum = 949k \n' + + 'File Transcoding... \n', + container: '.mp4', + }, }, }, { From 3edf27313a261ff8231a6ba4147735f60f00d00c Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 08:00:27 +0100 Subject: [PATCH 123/126] Add darwin tests --- ...de audio and video with HW (PC and Mac).js | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js index 95dd855..93e847c 100644 --- a/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js +++ b/tests/Community/Tdarr_Plugin_ER01_Transcode audio and video with HW (PC and Mac).js @@ -25,6 +25,19 @@ const tests = [ + '8 channels - ', }, linux: false, + darwin: { + container: '.mkv', + processFile: true, + preset: ', -sn -map 0:v -c:v hevc_videotoolbox -profile main -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -map 0:a -c:a copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Converting video, NOT resizing. 720p, h264 --> 720p, hevc. bitrate = 1517 --> 758, multiplier 0.5. \n' + + 'Not converting audio. \n' + + '2 channels - \n' + + '6 channels - und aac \n' + + '8 channels - ', + }, }, }, { @@ -87,6 +100,19 @@ const tests = [ + '8 channels - ', }, linux: false, + darwin: { + container: '.mkv', + processFile: true, + preset: ', -sn -map 0:v -c:v hevc_videotoolbox -profile main -b:v 3933k -minrate 2753k -maxrate 5112k -bufsize 7866k -map 0:a -c:a copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Converting video, NOT resizing. 1080p, h264 --> 1080p, hevc. bitrate = 7866 --> 3933, multiplier 0.5. \n' + + 'Not converting audio. \n' + + '2 channels - eng flac \n' + + '6 channels - \n' + + '8 channels - ', + }, }, }, { From 0ecf11e42cc67858c33d85360baf78ed765d6c9d Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 08:05:08 +0100 Subject: [PATCH 124/126] Use lf --- .github/workflows/lint_and_test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml index f30452d..c85eb73 100644 --- a/.github/workflows/lint_and_test.yml +++ b/.github/workflows/lint_and_test.yml @@ -18,6 +18,11 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 From b52587222bb4d341ebf77fe55cf04d8e163af2e9 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 08:30:59 +0100 Subject: [PATCH 125/126] Run tests in parallel --- tests/runTests.js | 76 +++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 26 deletions(-) diff --git a/tests/runTests.js b/tests/runTests.js index d5d7285..7ac2cb7 100644 --- a/tests/runTests.js +++ b/tests/runTests.js @@ -6,45 +6,69 @@ const childProcess = require('child_process'); const filenames = fs.readdirSync(`${process.cwd()}/Community`).reverse(); +const errorsEncountered = []; const run = async () => { + const pluginsToRun = []; for (let i = 0; i < filenames.length; i += 1) { - const pluginPath = `${process.cwd()}/Community/${filenames[i]}`; + const filename = filenames[i]; + const pluginPath = `${process.cwd()}/Community/${filename}`; const text = fs.readFileSync(pluginPath); - const pluginTestpath = `${__dirname}/Community/${filenames[i]}`; + const pluginTestpath = `${__dirname}/Community/${filename}`; - let shouldRunTest = true; if (!text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) { - console.log(chalk.red(`${filenames[i]} does not have a test but should do.`)); + console.log(chalk.red(`${filename} does not have a test but should do.`)); process.exit(1); } else if (!text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) { - console.log(chalk.white(`${filenames[i]} running test`)); + pluginsToRun.push({ + filename, + pluginTestpath, + }); } else if (text.includes('// tdarrSkipTest') && fs.existsSync(pluginTestpath)) { - console.log(chalk.red(`${filenames[i]} should have // tdarrSkipTest removed`)); + console.log(chalk.red(`${filename} should have // tdarrSkipTest removed`)); process.exit(1); } else if (text.includes('// tdarrSkipTest') && !fs.existsSync(pluginTestpath)) { - console.log(chalk.yellow(`${filenames[i]} skipping tests`)); - shouldRunTest = false; + console.log(chalk.yellow(`${filename} skipping tests`)); } + } + + let pluginsFinished = 0; + for (let i = 0; i < pluginsToRun.length; i += 1) { + const { filename } = pluginsToRun[i]; + const { pluginTestpath } = pluginsToRun[i]; + console.log(chalk.white(`${filename} running test`)); - if (shouldRunTest) { - // eslint-disable-next-line no-await-in-loop - await new Promise((resolve) => { - childProcess.exec(`node "${pluginTestpath}"`, (err, stdout, stderr) => { - if (err) { - console.log(err); - } - console.log(stdout); - console.log(chalk.red(stderr)); - }).on('exit', async (code) => { - if (code !== 0) { - await new Promise((resolve2) => setTimeout(resolve2, 1000)); - process.exit(1); - } else { - resolve(); - } + const output = {}; + childProcess.exec(`node "${pluginTestpath}"`, (err, stdout, stderr) => { + if (err) { + output.err = err; + } + output.stdout = stdout; + output.stderr = stderr; + }).on('exit', async (code) => { + if (code !== 0) { + await new Promise((resolve2) => setTimeout(resolve2, 1000)); + errorsEncountered.push({ + id: filenames[i], + ...output, }); - }); - } + } + pluginsFinished += 1; + + if (pluginsFinished === pluginsToRun.length) { + if (errorsEncountered.length > 0) { + errorsEncountered.forEach((plugin) => { + console.log(plugin.id); + console.log(chalk.red(plugin.err)); + console.log(plugin.stdout); + console.log(chalk.red(plugin.stderr)); + }); + process.exit(1); + } else { + console.log(chalk.green('No errors encountered!')); + process.exit(0); + } + } + }); } }; From 15cb89bf7833a5d2982e4e58af79814f8a49c034 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 23 May 2022 08:32:30 +0100 Subject: [PATCH 126/126] Fix lint --- tests/runTests.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/runTests.js b/tests/runTests.js index 7ac2cb7..c96915d 100644 --- a/tests/runTests.js +++ b/tests/runTests.js @@ -44,6 +44,7 @@ const run = async () => { } output.stdout = stdout; output.stderr = stderr; + // eslint-disable-next-line no-loop-func }).on('exit', async (code) => { if (code !== 0) { await new Promise((resolve2) => setTimeout(resolve2, 1000)); @@ -52,6 +53,7 @@ const run = async () => { ...output, }); } + pluginsFinished += 1; if (pluginsFinished === pluginsToRun.length) {