1- import tkinter as tk
2- import os
3- from PIL import Image , ImageTk
4- from tkinter import ttk
1+ import os ,tkinter
2+ from PIL import Image , ImageTk
53from tkinter import filedialog as fd
6- from tkinter import Tk , Button , Canvas , Label , Entry , Spinbox , PhotoImage , NE , END
4+ from tkinter import Tk , Button , Canvas , Label , Entry , Spinbox , PhotoImage , NE , END , ttk
75def SelectButton ():
8- global fps , height , width , i ,filename
6+ global i ,filename
97 filename = str (fd .askopenfilename (title = "Select file" ,filetypes = (("Video" ,"*.mp4 .ts .webm .mkv" ),("All files" ,"*.*" ))))
108 fs1 .config (text = 'Size(Mb): ' + str (round (os .path .getsize (filename )/ 1048576 ,2 )))
119 os .system ('ffmpeg_vvceasy.exe -y -i "' + filename + '" -vf thumbnail -frames:v 1 temp.jpg' )
@@ -52,10 +50,8 @@ def btnClickFunctiontwo():
5250def audioQ (event ):
5351 audn = '{: .0f}' .format (audioquality .get ())
5452 audqual .configure (text = 'Quality (kb): ' + audvn [int (audn )- 1 ])
55- def btnOpenVid ():
56- os .popen (videoselect .get ())
57- def btnOpenVid2 ():
58- os .popen (saveto .get ())
53+ def btnOpenVid (): os .popen (videoselect .get ())
54+ def btnOpenVid2 (): os .popen (saveto .get ())
5955audv = ['a' ,'b' ,'1' ,'c' ,'2' ,'d' ,'3' ,'e' ,'f' ,'4' ,'g' ,'5' ,'6' ,'7' ,'8' ,'9' ]
6056audvn = ['50' ,'62' ,'64' ,'74' ,'80' ,'86' ,'96' ,'98' ,'110' ,'112' ,'122' ,'128' ,'144' ,'160' ,'176' ,'192' ]
6157root = Tk ()
@@ -79,9 +75,9 @@ def btnOpenVid2():
7975Label (root ,text = 'Quality (kb)' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' )).place (x = 289 , y = 28 )
8076Label (root ,text = 'Save as:' , bg = '#F0F8FF' , font = ('arial' , 12 , 'normal' )).place (x = 39 , y = 248 )
8177
82- fs1 = Label (root ,text = 'Size(Mb):' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' ))
78+ fs1 = Label (root ,text = 'Size(Mb): 0 ' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' ))
8379fs1 .place (x = 129 , y = 288 )
84- fs2 = Label (root ,text = 'Size(Mb):' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' ))
80+ fs2 = Label (root ,text = 'Size(Mb): 0 ' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' ))
8581fs2 .place (x = 310 , y = 288 )
8682
8783audqual = Label (root ,text = 'Quality (kb): 96' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' ))
@@ -113,7 +109,7 @@ def btnOpenVid2():
113109qualitytwo .place (x = 289 ,y = 48 )
114110qualitytwo .insert (0 ,500 )
115111
116- canvas = tk . Canvas (root ,width = 360 ,height = 200 )
112+ canvas = Canvas (root ,width = 360 ,height = 200 )
117113canvas .place (x = 129 ,y = 78 )
118114
119115root .mainloop ()
0 commit comments