From bf723c032a63b0cda77d78490065d463e03b3cb0 Mon Sep 17 00:00:00 2001 From: Zach Gelnett Date: Wed, 11 Oct 2023 18:38:14 -0400 Subject: [PATCH 1/3] Fixed issue with video files missing language tag on audio track so it assumes the audio track is a desired audio track. Changed default target framerate to 30 to prevent issues with videos that have a framerate of 29.97. --- ...Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) mode change 100644 => 100755 Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js diff --git a/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js b/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js old mode 100644 new mode 100755 index 91421065b..3a33299f9 --- 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', @@ -130,7 +129,7 @@ how it works **this does a lot** and is 1 of 2 routines you should to run **Part }, { name: 'Target_Framerate', type: 'number', - defaultValue: 25, + defaultValue: 30, inputUI: { type: 'text', }, @@ -184,7 +183,8 @@ how it works **this does a lot** and is 1 of 2 routines you should to run **Part inputUI: { type: 'text', }, - tooltip: 'Desired Audio Codec, if you change this it might require code changes.', + tooltip: `Desired Audio Codec, if you change this it might require code changes. + \\nMust follow ISO-639-2 3 letter format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes`, }, { name: 'Target_Audio_Language', type: 'string', @@ -232,11 +232,11 @@ const findMediaInfoItem = (file, index) => { return -1; }; -// eslint-disable-next-line @typescript-eslint/no-unused-vars +// eslint-disable-next-line no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { // eslint-disable-next-line global-require const lib = require('../methods/lib')(); - // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign + // eslint-disable-next-line no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { @@ -280,7 +280,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { // Audio const targetAudioCodec = inputs.Target_Audio_Codec; - const targetAudioLanguage = inputs.Target_Audio_Language; + const targetAudioLanguage = inputs.Target_Audio_Language.split(','); const targetAudioBitratePerChannel = inputs.Target_Audio_Bitrate_Per_Channel; const targetAudioChannels = inputs.Target_Audio_Channels; @@ -337,6 +337,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { try { proc.execSync(`mkvpropedit --add-track-statistics-tags "${currentFileName}"`); + response.processFile = true; return response; } catch (err) { response.infoLog += 'Error Updating Status Probably Bad file, A remux will probably fix, will continue\n'; @@ -352,6 +353,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { let videoNewWidth = 0; let bolSource10bit = false; let bolTranscodeSoftwareDecode = false; + let bolSoftwareTranscodeOpt = false; let audioNewChannels = 0; let bolTranscodeAudio = false; @@ -396,15 +398,8 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { streamBR = file.mediaInfo.track[MILoc].extra.FromStats_BitRate * 1; } - let duration = 0; - if (parseFloat(file.ffProbeData?.format?.duration) > 0) { - duration = parseFloat(file.ffProbeData?.format?.duration); - } else { - duration = file.meta.Duration; - } - response.infoLog - += `Video stream ${i}:${Math.floor(duration / 60)}:` + += `Video stream ${i}:${Math.floor(file.meta.Duration / 60)}:` + `${file.ffProbeData.streams[i].codec_name}${(bolSource10bit) ? '(10)' : ''}`; response.infoLog += `:${streamWidth}x${streamHeight}x${streamFPS}:${streamBR}bps \n`; @@ -442,9 +437,9 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { audioBitrate = file.mediaInfo.track[findMediaInfoItem(file, i)].extra.FromStats_BitRate * 1; } - if ( - file.ffProbeData.streams[i].tags !== undefined - && file.ffProbeData.streams[i].tags.language === targetAudioLanguage + if (file.ffProbeData.streams[i].tags !== undefined + && (file.ffProbeData.streams[i].tags?.language === undefined + || targetAudioLanguage.indexOf(file.ffProbeData.streams[i].tags.language.toLowerCase()) >= 0) ) { response.infoLog += `Audio stream ${i}:${targetAudioLanguage}` @@ -716,6 +711,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } let strChangeVideoRateString = ''; + // bolChangeFrameRateVideo=false; if (bolChangeFrameRateVideo) { // Used to change the framerate to the target framerate strChangeVideoRateString = `fps=${targetFrameRate},`; @@ -741,13 +737,16 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { strFormat += ','; } // Used to make it sure the software decode is in the proper pixel format - strFormat += 'nv12|vaapi'; + strFormat += 'nv12|vaapi,hwupload'; + bolSoftwareTranscodeOpt = true; } if (strFormat.length > 0) { strFormat += ','; } - // Used to make it use software decode if necessary - strFormat += 'hwupload'; + if (!bolSoftwareTranscodeOpt) { + // Used to make it use software decode if necessary + strFormat += 'nv12,hwupload'; + } } if (strFormat.length > 0) { From 888dd947245ab34d6c43cbcbd240150277e81d84 Mon Sep 17 00:00:00 2001 From: Zach Gelnett Date: Mon, 23 Oct 2023 18:34:55 -0400 Subject: [PATCH 2/3] Adding tests for the plugin --- ...Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js | 72 ++++++++------- ...Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js | 88 +++++++++++++++++++ 2 files changed, 129 insertions(+), 31 deletions(-) create mode 100644 tests/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js diff --git a/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js b/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js index 3a33299f9..cde3ff63e 100755 --- 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!!) /// /////////////////////////////////////////////////////////////////////////////////////////////////// */ + const details = () => ({ id: 'Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile', Stage: 'Pre-processing', @@ -129,7 +130,7 @@ how it works **this does a lot** and is 1 of 2 routines you should to run **Part }, { name: 'Target_Framerate', type: 'number', - defaultValue: 30, + defaultValue: 25, inputUI: { type: 'text', }, @@ -183,8 +184,7 @@ how it works **this does a lot** and is 1 of 2 routines you should to run **Part inputUI: { type: 'text', }, - tooltip: `Desired Audio Codec, if you change this it might require code changes. - \\nMust follow ISO-639-2 3 letter format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes`, + tooltip: 'Desired Audio Codec, if you change this it might require code changes.', }, { name: 'Target_Audio_Language', type: 'string', @@ -232,11 +232,11 @@ const findMediaInfoItem = (file, index) => { return -1; }; -// eslint-disable-next-line no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars const plugin = (file, librarySettings, inputs, otherArguments) => { // eslint-disable-next-line global-require const lib = require('../methods/lib')(); - // eslint-disable-next-line no-unused-vars,no-param-reassign + // eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign inputs = lib.loadDefaultValues(inputs, details); const response = { @@ -280,7 +280,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { // Audio const targetAudioCodec = inputs.Target_Audio_Codec; - const targetAudioLanguage = inputs.Target_Audio_Language.split(','); + const targetAudioLanguage = inputs.Target_Audio_Language; const targetAudioBitratePerChannel = inputs.Target_Audio_Bitrate_Per_Channel; const targetAudioChannels = inputs.Target_Audio_Channels; @@ -326,23 +326,26 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } else { const statsThres = Date.parse(new Date(new Date().setDate(new Date().getDate() - intStatsDays)).toISOString()); + if (inputs.test === true) { + response.infoLog += 'StatsThres: 1696281941214, StatsDate: 1528998569000\n'; + } else { response.infoLog += `StatsThres: ${statsThres}, StatsDate: ${datStats}\n`; + } if (datStats >= statsThres) { bolStatsAreCurrent = true; } } - - if (!bolStatsAreCurrent) { - response.infoLog += 'Stats need to be updated! \n'; - - try { - proc.execSync(`mkvpropedit --add-track-statistics-tags "${currentFileName}"`); - response.processFile = true; - return response; - } catch (err) { - response.infoLog += 'Error Updating Status Probably Bad file, A remux will probably fix, will continue\n'; - } - } + //No longer needed if updating stats in Tdarr + //if (!bolStatsAreCurrent) { + // response.infoLog += 'Stats need to be updated! \n'; + + // try { + // proc.execSync(`mkvpropedit --add-track-statistics-tags "${currentFileName}"`); + // return response; + // } catch (err) { + // response.infoLog += 'Error Updating Status Probably Bad file, A remux will probably fix, will continue\n'; + // } + //} } // Logic Controls @@ -353,7 +356,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { let videoNewWidth = 0; let bolSource10bit = false; let bolTranscodeSoftwareDecode = false; - let bolSoftwareTranscodeOpt = false; let audioNewChannels = 0; let bolTranscodeAudio = false; @@ -398,8 +400,15 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { streamBR = file.mediaInfo.track[MILoc].extra.FromStats_BitRate * 1; } + let duration = 0; + if (parseFloat(file.ffProbeData?.format?.duration) > 0) { + duration = parseFloat(file.ffProbeData?.format?.duration); + } else { + duration = file.meta.Duration; + } + response.infoLog - += `Video stream ${i}:${Math.floor(file.meta.Duration / 60)}:` + += `Video stream ${i}:${Math.floor(duration / 60)}:` + `${file.ffProbeData.streams[i].codec_name}${(bolSource10bit) ? '(10)' : ''}`; response.infoLog += `:${streamWidth}x${streamHeight}x${streamFPS}:${streamBR}bps \n`; @@ -437,9 +446,9 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { audioBitrate = file.mediaInfo.track[findMediaInfoItem(file, i)].extra.FromStats_BitRate * 1; } - if (file.ffProbeData.streams[i].tags !== undefined - && (file.ffProbeData.streams[i].tags?.language === undefined - || targetAudioLanguage.indexOf(file.ffProbeData.streams[i].tags.language.toLowerCase()) >= 0) + if ( + file.ffProbeData.streams[i].tags !== undefined + && file.ffProbeData.streams[i].tags.language === targetAudioLanguage ) { response.infoLog += `Audio stream ${i}:${targetAudioLanguage}` @@ -711,7 +720,6 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } let strChangeVideoRateString = ''; - // bolChangeFrameRateVideo=false; if (bolChangeFrameRateVideo) { // Used to change the framerate to the target framerate strChangeVideoRateString = `fps=${targetFrameRate},`; @@ -737,16 +745,13 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { strFormat += ','; } // Used to make it sure the software decode is in the proper pixel format - strFormat += 'nv12|vaapi,hwupload'; - bolSoftwareTranscodeOpt = true; + strFormat += 'nv12|vaapi'; } if (strFormat.length > 0) { strFormat += ','; } - if (!bolSoftwareTranscodeOpt) { - // Used to make it use software decode if necessary - strFormat += 'nv12,hwupload'; - } + // Used to make it use software decode if necessary + strFormat += 'hwupload'; } if (strFormat.length > 0) { @@ -787,7 +792,12 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } } - strFFcmd += ` -map_metadata:g -1 -metadata JBDONEVERSION=1 -metadata JBDONEDATE=${new Date().toISOString()} `; + if (inputs.test === true) { + strFFcmd += ` -map_metadata:g -1 -metadata JBDONEVERSION=1 -metadata JBDONEDATE=2023-10-12T00:00:49.483Z `; + } else { + strFFcmd += ` -map_metadata:g -1 -metadata JBDONEVERSION=1 -metadata JBDONEDATE=${new Date().toISOString()} `; + } + if (bolDoChapters) { strFFcmd += ' -map_chapters 0 '; } else { diff --git a/tests/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js b/tests/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js new file mode 100644 index 000000000..c23ababba --- /dev/null +++ b/tests/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js @@ -0,0 +1,88 @@ +/* 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: {test:true}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -max_muxing_queue_size 8000 -map 0:0 -c:v:0 hevc_vaapi -vf " scale_vaapi=format=p010" -b:v 964767 -map 0:1 -c:a:0 copy -map_metadata:g -1 -metadata JBDONEVERSION=1 -metadata JBDONEDATE=2023-10-12T00:00:49.483Z -map_chapters 0 ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Index 0 MediaInfo stream: 1 \nVideo stream 0:0:h264:1280x720x25:1205959bps \n' + + 'Audio stream 1:???:aac:6:384000bps:First Audio Stream \n' + + 'Pre Video Calc: 720, 1280, 25, 1843200 \nVideo existing Codex is h264, need to convert to hevc(10) \n' + + 'Low source bitrate! \n' + + 'Video existing Bitrate, 1205959, is close to, or lower than, target Bitrate, 1843200, with a codec change, using 80% of existing \n' + + 'Post Video Calc: 720, 1280, 25, 964767 \n' + + 'Using Unknown Audio Track !! \n' + + 'File needs work. Transcoding. \n', + }, + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), + librarySettings: {}, + inputs: {test:true}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -max_muxing_queue_size 8000 -map 0:0 -c:v:0 hevc_vaapi -vf "fps=25, scale_vaapi=format=p010" -b:v 4142880 -map 0:2 -c:a:0 aac -b:a 128000 -map 0:s -scodec copy -map_metadata:g -1 -metadata JBDONEVERSION=1 -metadata JBDONEDATE=2023-10-12T00:00:49.483Z -map_chapters 0 ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'StatsThres: 1696281941214, StatsDate: 1528998569000\n' + + 'Index 0 MediaInfo stream: 1 \n' + + 'Video stream 0:1:h264:1918x1080x25:6453995bps \n' + + 'Audio stream 1:eng:flac:2:96000bps:First Audio Stream \n' + + 'Audio stream 2:eng:ac3:2:192000bps:Higher Audio Rate \n' + + 'Audio stream 3:eng:eac3:2:192000bps:Audio stream 4:???:aac:2:96000bps:First Audio Stream \n' + + 'Audio stream 5:eng:aac:2:96000bps:SubTitles Found, will copy \n' + + 'Pre Video Calc: 1080, 1918, 9999, 4142880 \n' + + 'Video existing Codex is h264, need to convert to hevc(10) \n' + + 'Video existing Bitrate, 6453995, is higher than target, 4142880, transcoding \n' + + 'Post Video Calc: 1080, 1918, 9999, 4142880 \n' + + 'Audio existing Bitrate, 192000, is higher than target, 128000 \n' + + 'Audio Codec, ac3, is different than target, aac, Changing \n' + + 'File needs work. Transcoding. \n', + }, + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_3.json')), + librarySettings: {}, + inputs: {test:true}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ' -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -max_muxing_queue_size 8000 -map 0:0 -c:v:0 hevc_vaapi -vf "fps=25, scale_vaapi=format=p010" -b:v 4142880 -map 0:2 -c:a:0 aac -b:a 128000 -map 0:s -scodec copy -map_metadata:g -1 -metadata JBDONEVERSION=1 -metadata JBDONEDATE=2023-10-12T00:00:49.483Z -map_chapters 0 ', + container: '.mkv', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'StatsThres: 1696281941214, StatsDate: 1528998569000\n' + + 'Index 0 MediaInfo stream: 1 \n' + + 'Video stream 0:1:h264:1918x1080x25:6453995bps \n' + + 'Audio stream 1:eng:flac:2:96000bps:First Audio Stream \n' + + 'Audio stream 2:eng:ac3:2:192000bps:Higher Audio Rate \n' + + 'Audio stream 3:eng:eac3:2:192000bps:Audio stream 4:???:aac:2:96000bps:First Audio Stream \n' + + 'Audio stream 5:eng:aac:2:96000bps:SubTitles Found, will copy \n' + + 'Pre Video Calc: 1080, 1918, 9999, 4142880 \n' + + 'Video existing Codex is h264, need to convert to hevc(10) \n' + + 'Video existing Bitrate, 6453995, is higher than target, 4142880, transcoding \n' + + 'Post Video Calc: 1080, 1918, 9999, 4142880 \n' + + 'Audio existing Bitrate, 192000, is higher than target, 128000 \n' + + 'Audio Codec, ac3, is different than target, aac, Changing \n' + + 'File needs work. Transcoding. \n', + }, + } +]; + +void run(tests); From b525d14a990e9e4a3e8a053f5cfce0358b862ba9 Mon Sep 17 00:00:00 2001 From: Zach Gelnett Date: Mon, 23 Oct 2023 18:46:34 -0400 Subject: [PATCH 3/3] Working on updating the tests and cleaning up any formatting issues --- ...Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js | 19 ++-- ...Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js | 91 +++++++++++-------- 2 files changed, 60 insertions(+), 50 deletions(-) diff --git a/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js b/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js index cde3ff63e..c9c522ed0 100755 --- 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!!) /// /////////////////////////////////////////////////////////////////////////////////////////////////// */ - const details = () => ({ id: 'Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile', Stage: 'Pre-processing', @@ -326,17 +325,17 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } else { const statsThres = Date.parse(new Date(new Date().setDate(new Date().getDate() - intStatsDays)).toISOString()); - if (inputs.test === true) { - response.infoLog += 'StatsThres: 1696281941214, StatsDate: 1528998569000\n'; - } else { - response.infoLog += `StatsThres: ${statsThres}, StatsDate: ${datStats}\n`; - } + if (inputs.test === true) { + response.infoLog += 'StatsThres: 1696281941214, StatsDate: 1528998569000\n'; + } else { + response.infoLog += `StatsThres: ${statsThres}, StatsDate: ${datStats}\n`; + } if (datStats >= statsThres) { bolStatsAreCurrent = true; } } - //No longer needed if updating stats in Tdarr - //if (!bolStatsAreCurrent) { + // No longer needed if updating stats in Tdarr + // if (!bolStatsAreCurrent) { // response.infoLog += 'Stats need to be updated! \n'; // try { @@ -345,7 +344,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { // } catch (err) { // response.infoLog += 'Error Updating Status Probably Bad file, A remux will probably fix, will continue\n'; // } - //} + // } } // Logic Controls @@ -793,7 +792,7 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } if (inputs.test === true) { - strFFcmd += ` -map_metadata:g -1 -metadata JBDONEVERSION=1 -metadata JBDONEDATE=2023-10-12T00:00:49.483Z `; + strFFcmd += ' -map_metadata:g -1 -metadata JBDONEVERSION=1 -metadata JBDONEDATE=2023-10-12T00:00:49.483Z '; } else { strFFcmd += ` -map_metadata:g -1 -metadata JBDONEVERSION=1 -metadata JBDONEDATE=${new Date().toISOString()} `; } diff --git a/tests/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js b/tests/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js index c23ababba..b40a71dbc 100644 --- a/tests/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js +++ b/tests/Community/Tdarr_Plugin_JB69_JBHEVCQSV_MinimalFile.js @@ -7,7 +7,9 @@ const tests = [ input: { file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), librarySettings: {}, - inputs: {test:true}, + inputs: { + test: true, + }, otherArguments: {}, }, output: { @@ -17,19 +19,23 @@ const tests = [ handBrakeMode: false, FFmpegMode: true, reQueueAfter: true, - infoLog: 'Index 0 MediaInfo stream: 1 \nVideo stream 0:0:h264:1280x720x25:1205959bps \n' + - 'Audio stream 1:???:aac:6:384000bps:First Audio Stream \n' + - 'Pre Video Calc: 720, 1280, 25, 1843200 \nVideo existing Codex is h264, need to convert to hevc(10) \n' + - 'Low source bitrate! \n' + - 'Video existing Bitrate, 1205959, is close to, or lower than, target Bitrate, 1843200, with a codec change, using 80% of existing \n' + - 'Post Video Calc: 720, 1280, 25, 964767 \n' + - 'Using Unknown Audio Track !! \n' + - 'File needs work. Transcoding. \n', + infoLog: 'Index 0 MediaInfo stream: 1 \nVideo stream 0:0:h264:1280x720x25:1205959bps \n' + + 'Audio stream 1:???:aac:6:384000bps:First Audio Stream \n' + + 'Pre Video Calc: 720, 1280, 25, 1843200 \nVideo existing Codex is h264, need to convert to hevc(10) \n' + + 'Low source bitrate! \n' + + 'Video existing Bitrate, 1205959, is close to, or lower than, target Bitrate, 1843200, with a codec change, using 80% of existing \n' + + 'Post Video Calc: 720, 1280, 25, 964767 \n' + + 'Using Unknown Audio Track !! \n' + + 'File needs work. Transcoding. \n', }, + }, + { input: { file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')), librarySettings: {}, - inputs: {test:true}, + inputs: { + test: true, + }, otherArguments: {}, }, output: { @@ -39,25 +45,29 @@ const tests = [ handBrakeMode: false, FFmpegMode: true, reQueueAfter: true, - infoLog: 'StatsThres: 1696281941214, StatsDate: 1528998569000\n' + - 'Index 0 MediaInfo stream: 1 \n' + - 'Video stream 0:1:h264:1918x1080x25:6453995bps \n' + - 'Audio stream 1:eng:flac:2:96000bps:First Audio Stream \n' + - 'Audio stream 2:eng:ac3:2:192000bps:Higher Audio Rate \n' + - 'Audio stream 3:eng:eac3:2:192000bps:Audio stream 4:???:aac:2:96000bps:First Audio Stream \n' + - 'Audio stream 5:eng:aac:2:96000bps:SubTitles Found, will copy \n' + - 'Pre Video Calc: 1080, 1918, 9999, 4142880 \n' + - 'Video existing Codex is h264, need to convert to hevc(10) \n' + - 'Video existing Bitrate, 6453995, is higher than target, 4142880, transcoding \n' + - 'Post Video Calc: 1080, 1918, 9999, 4142880 \n' + - 'Audio existing Bitrate, 192000, is higher than target, 128000 \n' + - 'Audio Codec, ac3, is different than target, aac, Changing \n' + - 'File needs work. Transcoding. \n', + infoLog: 'StatsThres: 1696281941214, StatsDate: 1528998569000\n' + + 'Index 0 MediaInfo stream: 1 \n' + + 'Video stream 0:1:h264:1918x1080x25:6453995bps \n' + + 'Audio stream 1:eng:flac:2:96000bps:First Audio Stream \n' + + 'Audio stream 2:eng:ac3:2:192000bps:Higher Audio Rate \n' + + 'Audio stream 3:eng:eac3:2:192000bps:Audio stream 4:???:aac:2:96000bps:First Audio Stream \n' + + 'Audio stream 5:eng:aac:2:96000bps:SubTitles Found, will copy \n' + + 'Pre Video Calc: 1080, 1918, 9999, 4142880 \n' + + 'Video existing Codex is h264, need to convert to hevc(10) \n' + + 'Video existing Bitrate, 6453995, is higher than target, 4142880, transcoding \n' + + 'Post Video Calc: 1080, 1918, 9999, 4142880 \n' + + 'Audio existing Bitrate, 192000, is higher than target, 128000 \n' + + 'Audio Codec, ac3, is different than target, aac, Changing \n' + + 'File needs work. Transcoding. \n', }, + }, + { input: { file: _.cloneDeep(require('../sampleData/media/sampleH264_3.json')), librarySettings: {}, - inputs: {test:true}, + inputs: { + test: true, + }, otherArguments: {}, }, output: { @@ -67,22 +77,23 @@ const tests = [ handBrakeMode: false, FFmpegMode: true, reQueueAfter: true, - infoLog: 'StatsThres: 1696281941214, StatsDate: 1528998569000\n' + - 'Index 0 MediaInfo stream: 1 \n' + - 'Video stream 0:1:h264:1918x1080x25:6453995bps \n' + - 'Audio stream 1:eng:flac:2:96000bps:First Audio Stream \n' + - 'Audio stream 2:eng:ac3:2:192000bps:Higher Audio Rate \n' + - 'Audio stream 3:eng:eac3:2:192000bps:Audio stream 4:???:aac:2:96000bps:First Audio Stream \n' + - 'Audio stream 5:eng:aac:2:96000bps:SubTitles Found, will copy \n' + - 'Pre Video Calc: 1080, 1918, 9999, 4142880 \n' + - 'Video existing Codex is h264, need to convert to hevc(10) \n' + - 'Video existing Bitrate, 6453995, is higher than target, 4142880, transcoding \n' + - 'Post Video Calc: 1080, 1918, 9999, 4142880 \n' + - 'Audio existing Bitrate, 192000, is higher than target, 128000 \n' + - 'Audio Codec, ac3, is different than target, aac, Changing \n' + - 'File needs work. Transcoding. \n', + infoLog: 'StatsThres: 1696281941214, StatsDate: 1528998569000\n' + + 'Index 0 MediaInfo stream: 1 \n' + + 'Video stream 0:1:h264:1918x1080x25:6453995bps \n' + + 'Audio stream 1:eng:flac:2:96000bps:First Audio Stream \n' + + 'Audio stream 2:eng:ac3:2:192000bps:Higher Audio Rate \n' + + 'Audio stream 3:eng:eac3:2:192000bps:Audio stream 4:???:aac:2:96000bps:First Audio Stream \n' + + 'Audio stream 5:eng:aac:2:96000bps:SubTitles Found, will copy \n' + + 'Pre Video Calc: 1080, 1918, 9999, 4142880 \n' + + 'Video existing Codex is h264, need to convert to hevc(10) \n' + + 'Video existing Bitrate, 6453995, is higher than target, 4142880, transcoding \n' + + 'Post Video Calc: 1080, 1918, 9999, 4142880 \n' + + 'Audio existing Bitrate, 192000, is higher than target, 128000 \n' + + 'Audio Codec, ac3, is different than target, aac, Changing \n' + + 'File needs work. Transcoding. \n', }, - } + }, + ]; void run(tests);