diff --git a/Scripts/Flow/Video/Video - Dolby Vision - Fix crop and compatibility.js b/Scripts/Flow/Video/Video - Dolby Vision - Fix crop and compatibility.js index 61ce40b..4c41256 100644 --- a/Scripts/Flow/Video/Video - Dolby Vision - Fix crop and compatibility.js +++ b/Scripts/Flow/Video/Video - Dolby Vision - Fix crop and compatibility.js @@ -5,7 +5,7 @@ Run between encode and move/replace. Output is always an MKV. dovi_tool only supports HEVC when AV1 support is added I will updated this script. * @author Lawrence Curtis - * @revision 2 + * @revision 3 * @uid f5eebc75-e22d-4181-af02-5e7263e68acd * @param {bool} RemoveHDRTenPlus Remove HDR10+, this fixes the black screen issues on FireStick * @output Fixed @@ -68,11 +68,7 @@ function Script(RemoveHDRTenPlus) { original, "-c:v", "copy", - "-bsf:v", - "hevc_mp4toannexb", - "-f", - "hevc", - Flow.TempPath + "/original.hevc", + System.IO.Path.Combine(Flow.TempPath, "original.hevc") ]; executeArgs.add_Error((line) => { @@ -101,8 +97,8 @@ function Script(RemoveHDRTenPlus) { "2", "extract-rpu", "-o", - `${Flow.TempPath}/original.rpu`, - `${Flow.TempPath}/original.hevc`, + System.IO.Path.Combine(Flow.TempPath, "original.rpu"), + System.IO.Path.Combine(Flow.TempPath, "original.hevc") ]; if (RemoveHDRTenPlus) { @@ -134,7 +130,7 @@ function Script(RemoveHDRTenPlus) { } // Remove temp files - System.IO.File.Delete(Flow.TempPath + "/original.hevc"); + System.IO.File.Delete(System.IO.Path.Combine(Flow.TempPath, "original.hevc")); Flow.PartPercentageUpdate(0); Flow.AdditionalInfoRecorder("DoVi", "Extracting converted video", 1); @@ -150,11 +146,8 @@ function Script(RemoveHDRTenPlus) { working, "-c:v", "copy", - "-bsf:v", - "hevc_mp4toannexb", - "-f", - "hevc", - Flow.TempPath + "/converted_video.hevc", + System.IO.Path.Combine(Flow.TempPath, "converted_video.hevc") + ]; executeArgs.add_Error((line) => { @@ -183,11 +176,11 @@ function Script(RemoveHDRTenPlus) { "2", "inject-rpu", "--rpu-in", - Flow.TempPath + "/original.rpu", + System.IO.Path.Combine(Flow.TempPath, "original.rpu"), "--input", - Flow.TempPath + "/converted_video.hevc", + System.IO.Path.Combine(Flow.TempPath, "converted_video.hevc"), "--output", - Flow.TempPath + "/fixed.hevc", + System.IO.Path.Combine(Flow.TempPath, "fixed.hevc") ]; if (RemoveHDRTenPlus) { @@ -219,8 +212,8 @@ function Script(RemoveHDRTenPlus) { return -1; } - System.IO.File.Delete(Flow.TempPath + "/converted_video.hevc"); - System.IO.File.Delete(Flow.TempPath + "/original.rpu"); + System.IO.File.Delete(System.IO.Path.Combine(Flow.TempPath, "converted_video.hevc")); + System.IO.File.Delete(System.IO.Path.Combine(Flow.TempPath, "original.rpu")); // Check framerate of video process = Flow.Execute({ @@ -235,8 +228,8 @@ function Script(RemoveHDRTenPlus) { executeArgs.command = mkvmerge; executeArgs.argumentList = [ "-o", - Flow.TempPath + "/converted.mkv", - Flow.TempPath + "/fixed.hevc", + System.IO.Path.Combine(Flow.TempPath, "converted.mkv"), + System.IO.Path.Combine(Flow.TempPath, "fixed.hevc"), "-D", working, "--track-order", @@ -268,8 +261,9 @@ function Script(RemoveHDRTenPlus) { return -1; } - System.IO.File.Delete(Flow.TempPath + "/fixed.hevc"); - Flow.SetWorkingFile(Flow.TempPath + "/converted.mkv"); + System.IO.File.Delete(System.IO.Path.Combine(Flow.TempPath, "fixed.hevc")); + Flow.SetWorkingFile(System.IO.Path.Combine(Flow.TempPath,"converted.mkv")); + return 1; }