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
5
3
from 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
7
5
def SelectButton ():
8
- global fps , height , width , i ,filename
6
+ global i ,filename
9
7
filename = str (fd .askopenfilename (title = "Select file" ,filetypes = (("Video" ,"*.mp4 .ts .webm .mkv" ),("All files" ,"*.*" ))))
10
8
fs1 .config (text = 'Size(Mb): ' + str (round (os .path .getsize (filename )/ 1048576 ,2 )))
11
9
os .system ('ffmpeg_vvceasy.exe -y -i "' + filename + '" -vf thumbnail -frames:v 1 temp.jpg' )
@@ -52,10 +50,8 @@ def btnClickFunctiontwo():
52
50
def audioQ (event ):
53
51
audn = '{: .0f}' .format (audioquality .get ())
54
52
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 ())
59
55
audv = ['a' ,'b' ,'1' ,'c' ,'2' ,'d' ,'3' ,'e' ,'f' ,'4' ,'g' ,'5' ,'6' ,'7' ,'8' ,'9' ]
60
56
audvn = ['50' ,'62' ,'64' ,'74' ,'80' ,'86' ,'96' ,'98' ,'110' ,'112' ,'122' ,'128' ,'144' ,'160' ,'176' ,'192' ]
61
57
root = Tk ()
@@ -79,9 +75,9 @@ def btnOpenVid2():
79
75
Label (root ,text = 'Quality (kb)' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' )).place (x = 289 , y = 28 )
80
76
Label (root ,text = 'Save as:' , bg = '#F0F8FF' , font = ('arial' , 12 , 'normal' )).place (x = 39 , y = 248 )
81
77
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' ))
83
79
fs1 .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' ))
85
81
fs2 .place (x = 310 , y = 288 )
86
82
87
83
audqual = Label (root ,text = 'Quality (kb): 96' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' ))
@@ -113,7 +109,7 @@ def btnOpenVid2():
113
109
qualitytwo .place (x = 289 ,y = 48 )
114
110
qualitytwo .insert (0 ,500 )
115
111
116
- canvas = tk . Canvas (root ,width = 360 ,height = 200 )
112
+ canvas = Canvas (root ,width = 360 ,height = 200 )
117
113
canvas .place (x = 129 ,y = 78 )
118
114
119
115
root .mainloop ()
0 commit comments