Skip to content

Commit

Permalink
Merge pull request #62 from lawrencecurtis/fix-dovi-widows
Browse files Browse the repository at this point in the history
Fix dovi widows
  • Loading branch information
revenz authored Sep 28, 2024
2 parents d7e1c29 + 3cb6965 commit 04f006c
Showing 1 changed file with 17 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand All @@ -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) => {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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({
Expand All @@ -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",
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 04f006c

Please sign in to comment.