Merge pull request #216 from jmp909/fix-checkboxes
fix checkboxes and video fps probe parsing
This commit is contained in:
commit
032e1babbb
@ -23,7 +23,7 @@ def detect_fps(input_path):
|
||||
output = os.popen(f'ffprobe -v error -select_streams v -of default=noprint_wrappers=1:nokey=1 -show_entries stream=r_frame_rate "{input_path}"').read()
|
||||
if "/" in output:
|
||||
try:
|
||||
return int(output.split(os.sep)[0]) // int(output.split(os.sep)[1]), output.removesuffix('\n')
|
||||
return int(output.split("/")[0]) // int(output.split("/")[1]), output.removesuffix('\n')
|
||||
except:
|
||||
pass
|
||||
return 30, 30
|
||||
|
9
run.py
9
run.py
@ -145,11 +145,11 @@ def select_target():
|
||||
|
||||
|
||||
def toggle_fps_limit():
|
||||
args['keep_fps'] = limit_fps.get() != True
|
||||
args['keep_fps'] = int(limit_fps.get() != True)
|
||||
|
||||
|
||||
def toggle_keep_frames():
|
||||
args['keep_frames'] = keep_frames.get() != True
|
||||
args['keep_frames'] = int(keep_frames.get())
|
||||
|
||||
|
||||
def save_file():
|
||||
@ -252,13 +252,12 @@ if __name__ == "__main__":
|
||||
target_button.place(x=360,y=320,width=180,height=80)
|
||||
|
||||
# FPS limit checkbox
|
||||
limit_fps = tk.IntVar()
|
||||
limit_fps = tk.IntVar(None, not args['keep_fps'])
|
||||
fps_checkbox = tk.Checkbutton(window, relief="groove", activebackground="#2d3436", activeforeground="#74b9ff", selectcolor="black", text="Limit FPS to 30", fg="#dfe6e9", borderwidth=0, highlightthickness=0, bg="#2d3436", variable=limit_fps, command=toggle_fps_limit)
|
||||
fps_checkbox.place(x=30,y=500,width=240,height=31)
|
||||
fps_checkbox.select()
|
||||
|
||||
# Keep frames checkbox
|
||||
keep_frames = tk.IntVar()
|
||||
keep_frames = tk.IntVar(None, args['keep_frames'])
|
||||
frames_checkbox = tk.Checkbutton(window, relief="groove", activebackground="#2d3436", activeforeground="#74b9ff", selectcolor="black", text="Keep frames dir", fg="#dfe6e9", borderwidth=0, highlightthickness=0, bg="#2d3436", variable=keep_frames, command=toggle_keep_frames)
|
||||
frames_checkbox.place(x=37,y=450,width=240,height=31)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user