├── video-compare_GUI_v1_screenshot_20210602.png ├── README.md ├── LICENSE └── video-compare_GUI.py /video-compare_GUI_v1_screenshot_20210602.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JJKylee/video-compare_GUI/HEAD/video-compare_GUI_v1_screenshot_20210602.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # video-compare_GUI 2 | 3 | A Very Simple GUI for _video-compare_ 4 | 5 | ![](https://github.com/JJKylee/video-compare_GUI/blob/main/video-compare_GUI_v1_screenshot_20210602.png) 6 | 7 | Source code is written in Python with _tkinter_. 8 | 9 | ## Requirement 10 | 11 | This GUI app runs on [_video-compare_](https://github.com/pixop/video-compare). 12 | 13 | ## Usage 14 | 15 | 1. Put `video-compare_GUI.exe` in the same folder as `video-compare.exe`. 16 | 2. Double-click `video-compare_GUI.exe`. 17 | 18 | ## Build 19 | 20 | ```bat 21 | pyinstaller -w -F .\video-compare_GUI.py 22 | ``` 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 JKyle 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /video-compare_GUI.py: -------------------------------------------------------------------------------- 1 | # A Very Simple GUI for video-compare by JKyle 2 | # v1.0 (2021-06-02) 3 | # Free to modify and redistribute 4 | 5 | # video-compare: https://github.com/pixop/video-compare 6 | # video-compare_GUI.exe should be put in the same folder as video-compare.exe. 7 | 8 | # To build an executable, run the following command line 9 | # pyinstaller -w -F .\video-compare_GUI.py 10 | 11 | from tkinter import * 12 | from tkinter import filedialog 13 | import tkinter.messagebox as msgbox 14 | import subprocess 15 | 16 | root = Tk() 17 | root.title("A Very Simple GUI for video-compare by JKyle") 18 | root.geometry("700x140") 19 | root.resizable(True, True) 20 | 21 | # function that centers the main window 22 | def center(win): 23 | """ 24 | centers a tkinter window 25 | :param win: the main window or Toplevel window to center 26 | """ 27 | win.update_idletasks() 28 | width = win.winfo_width() 29 | frm_width = win.winfo_rootx() - win.winfo_x() 30 | win_width = width + 2 * frm_width 31 | height = win.winfo_height() 32 | titlebar_height = win.winfo_rooty() - win.winfo_y() 33 | win_height = height + titlebar_height + frm_width 34 | x = win.winfo_screenwidth() // 2 - win_width // 2 35 | y = win.winfo_screenheight() // 2 - win_height // 2 36 | win.geometry('{}x{}+{}+{}'.format(width, height, x, y)) 37 | win.deiconify() 38 | 39 | center(root) 40 | 41 | chk_DPIvar = IntVar() # variable for "Allow high DPI mode" 42 | 43 | # File 1 path 44 | def file1_path(): 45 | path_selected = filedialog.askopenfilename(title="Select Video 1", filetypes=(("Video Files", "*.avi *.mkv *.mp4 *.mpg *.mpeg"), ("All Files", "*.*"))) 46 | if path_selected == '': # if selection is canceled 47 | msgbox.showwarning("Confirm", "You canceled the selection of Video 1") 48 | return 49 | entry_file1.delete(0, END) 50 | entry_file1.insert(END, path_selected) 51 | 52 | # File 2 path 53 | def file2_path(): 54 | path_selected = filedialog.askopenfilename(title="Select Video 2", filetypes=(("Video Files", "*.avi *.mkv *.mp4 *.mpg *.mpeg"), ("All Files", "*.*"))) 55 | if path_selected == '': # if selection is canceled 56 | msgbox.showwarning("Confirm", "You canceled the selection of Video 2") 57 | return 58 | entry_file2.delete(0, END) 59 | entry_file2.insert(END, path_selected) 60 | 61 | # Run video-compare 62 | def video_compare(): 63 | try: 64 | dpi_var = "-d" 65 | if chk_DPIvar ==0: 66 | dpi_var = "" 67 | # video-compare.exe should be in the same folder. 68 | subprocess.Popen(["video-compare.exe", dpi_var, str(entry_file1.get()), str(entry_file2.get())]) 69 | 70 | except Exception as err: #Exception 71 | msgbox.showerror("Error", err) 72 | 73 | # Start 74 | def start(): 75 | # Confirm file selections 76 | if len(entry_file1.get()) == 0: 77 | msgbox.showwarning("Warning", "Please select Video 1") 78 | return 79 | 80 | if len(entry_file2.get()) == 0: 81 | msgbox.showwarning("Warning", "Please select Video 2") 82 | return 83 | 84 | video_compare() 85 | 86 | # FIle 1 frame 87 | file1_frame = Frame(root) 88 | file1_frame.pack(fill="x", padx=5, pady=3) 89 | 90 | entry_file1 = Entry(file1_frame) 91 | entry_file1.pack(side="left", fill="x", expand=True, ipady=4, padx=5, pady=5) 92 | 93 | btn_file1 = Button(file1_frame, text="Video 1", width=10, command=file1_path) 94 | btn_file1.pack(side="right", padx=5, pady=5) 95 | 96 | # File 2 frame 97 | file2_frame = Frame(root) 98 | file2_frame.pack(fill="x", padx=5, pady=3) 99 | 100 | entry_file2 = Entry(file2_frame) 101 | entry_file2.pack(side="left", fill="x", expand=True, ipady=4, padx=5, pady=5) 102 | 103 | btn_file2 = Button(file2_frame, text="Video 2", width=10, command=file2_path) 104 | btn_file2.pack(side="right", padx=5, pady=5) 105 | 106 | # Run frame 107 | run_frame = Frame(root) 108 | run_frame.pack(fill="x", padx=5, pady=3) 109 | 110 | chk_DPI = Checkbutton(run_frame, text="Allow high DPI mode", variable=chk_DPIvar) 111 | chk_DPI.select() # high DPI selected by default 112 | chk_DPI.pack(side="left", padx=5, pady=3) 113 | 114 | btn_close = Button(run_frame, text="Quit", width=12, padx=5, pady=5, command=root.quit) 115 | btn_close.pack(side="right", padx=5, pady=3) 116 | 117 | btn_start = Button(run_frame, text="Start", width=12, padx=5, pady=5, command=start) 118 | btn_start.pack(side="right", padx=5, pady=3) 119 | 120 | root.mainloop() 121 | --------------------------------------------------------------------------------