Skip to content

Commit 11ac354

Browse files
committed
Update to v1.35
* Optimized imports * Pushed version to 1.35 * Dolby Vision: 1) Renamed Profile 8 to Profile 8.1 (still works the same way) 2) Added Profile 8.4 extraction 3) Added a new menu, "HEVC NALU Start Code" 4) Added the code for the new start menu in the command line block * Fixed #3 * Program now properly resets the info panel/program when a non DV/HDR10+ file is dropped after it previously had a DV/HDR10+ file loaded
1 parent 16c9afa commit 11ac354

File tree

1 file changed

+65
-10
lines changed

1 file changed

+65
-10
lines changed

HDR-Multi-Tool-Gui.py

Lines changed: 65 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
# Imports--------------------------------------------------------------------
2+
import pathlib
3+
import shutil
4+
import subprocess
5+
import threading
6+
import tkinter as tk
7+
import webbrowser
8+
from configparser import ConfigParser
9+
from ctypes import windll
10+
from idlelib.tooltip import Hovertip
211
from tkinter import *
312
from tkinter import filedialog, StringVar, messagebox, ttk
4-
import tkinter as tk
5-
import pathlib, subprocess, shutil, threading, webbrowser
13+
614
from TkinterDnD2 import *
7-
from idlelib.tooltip import Hovertip
815
from pymediainfo import MediaInfo
16+
917
from Packages.about import openaboutwindow
10-
from configparser import ConfigParser
11-
from ctypes import windll
1218

1319

1420
# Main Gui & Windows --------------------------------------------------------
@@ -26,7 +32,7 @@ def root_exit_function(): # Asks if user wants to close main GUI + close all ta
2632

2733

2834
root = TkinterDnD.Tk() # Main GUI with TkinterDnD function (for drag and drop)
29-
root.title("HDR-Multi-Tool-Gui v1.34")
35+
root.title("HDR-Multi-Tool-Gui v1.35")
3036
root.iconphoto(True, PhotoImage(file="Runtime/Images/hdrgui.png"))
3137
root.configure(background="#434547")
3238
window_height = 400
@@ -422,20 +428,49 @@ def dobly_vision_mode_menu_hover_leave(e):
422428
dobly_vision_mode = StringVar()
423429
dobly_vision_mode_choices = {'Extract RPU: Untouched': '-m 0',
424430
'Extract RPU: MEL': '-m 1',
425-
'Extract RPU: Profile 8': '-m 2'}
431+
'Extract RPU: Profile 8.1': '-m 2',
432+
'Extract RPU: Profile 8.4': '-m 4'}
426433
dobly_vision_mode_menu_label = Label(dolby_frame, text="Parsing Mode :", background="#434547", foreground="white")
427434
dobly_vision_mode_menu_label.grid(row=1, column=0, columnspan=1, padx=10, pady=0, sticky=W + S)
428435
dobly_vision_mode_menu = OptionMenu(dolby_frame, dobly_vision_mode, *dobly_vision_mode_choices.keys())
429436
dobly_vision_mode_menu.config(background="#23272A", foreground="white", highlightthickness=1, width=18, anchor=W)
430437
dobly_vision_mode_menu.grid(row=2, column=0, columnspan=1, padx=10, pady=(5, 5), sticky=W + N)
431-
dobly_vision_mode.set('Extract RPU: Profile 8')
438+
dobly_vision_mode.set('Extract RPU: Profile 8.1')
432439
dobly_vision_mode_menu["menu"].configure(activebackground="dim grey")
433440
dobly_vision_mode_menu.bind("<Enter>", dobly_vision_mode_menu_hover)
434441
dobly_vision_mode_menu.bind("<Leave>", dobly_vision_mode_menu_hover_leave)
435442

436443

437444
# ---------------------------------------------------------------------------------------------- Dolby Vision Mode Menu
438445

446+
# start code menu -----------------------------------------------------------------------------------------------------
447+
def start_code_menu_hover_enter(e):
448+
start_code_menu["bg"] = "grey"
449+
start_code_menu["activebackground"] = "grey"
450+
451+
452+
def start_code_menu_hover_leave(e):
453+
start_code_menu["bg"] = "#23272A"
454+
455+
456+
start_code_mode = StringVar()
457+
start_code_mode_choices = {'Default': '',
458+
'Four': '--start-code four',
459+
'Annex-b': '--start-code annex-b'}
460+
start_code_menu_label = Label(dolby_frame, text=" HEVC NALU Start Code :", background="#434547",
461+
foreground="white")
462+
start_code_menu_label.grid(row=1, column=1, columnspan=1, padx=10, pady=0, sticky=S)
463+
start_code_menu = OptionMenu(dolby_frame, start_code_mode, *start_code_mode_choices.keys())
464+
start_code_menu.config(background="#23272A", foreground="white", highlightthickness=1, width=18, anchor=W)
465+
start_code_menu.grid(row=2, column=1, columnspan=1, padx=10, pady=(5, 5), sticky=N + E)
466+
start_code_mode.set('Default')
467+
start_code_menu["menu"].configure(activebackground="dim grey")
468+
start_code_menu.bind("<Enter>", start_code_menu_hover_enter)
469+
start_code_menu.bind("<Leave>", start_code_menu_hover_leave)
470+
471+
472+
# ----------------------------------------------------------------------------------------------------- start code menu
473+
439474
# Input Button Functions ----------------------------------------------------------------------------------------------
440475
def check_for_hdr(): # Block of code to check for what type of HDR there is
441476
try:
@@ -473,6 +508,24 @@ def check_for_hdr(): # Block of code to check for what type of HDR there is
473508
start_button.configure(state=NORMAL)
474509
output_button.configure(state=NORMAL)
475510
Hovertip(link_input_label, hdr_format_string.rstrip("\n"), hover_delay=600)
511+
else: # if no dolby vision or HDR is detected
512+
messagebox.showinfo(title='Info', message='Input has no HDR10+ or Dolby Vision metadata, '
513+
'no parsing needed')
514+
link_input_label.config(text='Input has no HDR10+ or Dolby Vision metadata, '
515+
'no parsing needed', anchor=CENTER)
516+
hdr_tool_tabs.select(hdr_frame)
517+
hdr_parse.set('off')
518+
dolbyvision_parse.set('off')
519+
start_button.configure(state=DISABLED)
520+
input_entry.configure(state=NORMAL)
521+
input_entry.delete(0, END)
522+
input_entry.configure(state=DISABLED)
523+
output_entry.configure(state=NORMAL)
524+
output_entry.delete(0, END)
525+
output_entry.configure(state=DISABLED)
526+
output_button.configure(state=DISABLED)
527+
Hovertip(link_input_label, 'Input has no HDR10+ or Dolby Vision, '
528+
'no parsing needed', hover_delay=600)
476529
except TypeError: # If input file has no HDR metadata to parse
477530
hdr_format_string = track.other_hdr_format
478531
if hdr_format_string is None:
@@ -709,12 +762,14 @@ def close_window():
709762
+ ' -map 0:v:0 -c:v:0 copy -vbsf hevc_mp4toannexb ' \
710763
'-f hevc - -hide_banner -loglevel warning -stats|' \
711764
+ dolbyvision_tool + ' ' + dobly_vision_mode_choices[dobly_vision_mode.get()] \
712-
+ dolbyvision_crop.get() + ' extract-rpu - -o ' + str(VideoOutputQuoted) + '"'
765+
+ dolbyvision_crop.get() + start_code_mode_choices[start_code_mode.get()] \
766+
+ ' extract-rpu - -o ' + str(VideoOutputQuoted) + '"'
713767
elif shell_options.get() == "Debug":
714768
finalcommand = '"' + ffmpeg + ' -analyzeduration 100M -probesize 50M -i ' + VideoInputQuoted \
715769
+ ' -map 0:v:0 -c:v:0 copy -vbsf hevc_mp4toannexb -f hevc - |' \
716770
+ dolbyvision_tool + ' ' + dobly_vision_mode_choices[dobly_vision_mode.get()] \
717-
+ dolbyvision_crop.get() + ' extract-rpu - -o ' + str(VideoOutputQuoted) + '"'
771+
+ dolbyvision_crop.get() + start_code_mode_choices[start_code_mode.get()] \
772+
+ ' extract-rpu - -o ' + str(VideoOutputQuoted) + '"'
718773
if shell_options.get() == "Default":
719774
job = subprocess.Popen('cmd /c ' + finalcommand, universal_newlines=True,
720775
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.DEVNULL,

0 commit comments

Comments
 (0)