10
10
global fin ,fn ,ext ,filename
11
11
global fin2 ,filename2
12
12
def SelectButton ():
13
+ global filesize1
13
14
global fps
14
15
global height
15
16
global width
@@ -19,12 +20,14 @@ def SelectButton():
19
20
fin = '"' + filename + '"'
20
21
fin2 = fin
21
22
filename2 = filename
23
+ filesize1 = str (round (os .path .getsize (filename ) / (1024 * 1024 ),2 ))
24
+ fs1 .config (text = 'Size(Mb): ' + filesize1 )
22
25
os .system ('ffmpeg_vvceasy.exe -y -i ' + fin + ' -vf thumbnail -frames:v 1 ' + fin + '.jpg' )
23
26
imgone = Image .open (filename + '.jpg' )
24
27
if imgone .size [0 ] >= imgone .size [1 ]:
25
- wpercent = (160 / float (imgone .size [0 ]))
28
+ wpercent = (180 / float (imgone .size [0 ]))
26
29
hsize = int ((float (imgone .size [1 ])* float (wpercent )))
27
- i = ImageTk .PhotoImage (imgone .resize ((160 ,hsize )))
30
+ i = ImageTk .PhotoImage (imgone .resize ((180 ,hsize )))
28
31
else :
29
32
wpercent = (200 / float (imgone .size [1 ]))
30
33
wsize = int ((float (imgone .size [0 ])* float (wpercent )))
@@ -39,7 +42,7 @@ def SelectButton():
39
42
height = int (cv2 .VideoCapture (filename ).get (cv2 .CAP_PROP_FRAME_HEIGHT ))
40
43
width = int (cv2 .VideoCapture (filename ).get (cv2 .CAP_PROP_FRAME_WIDTH ))
41
44
def EncodeButton ():
42
- global ii ,fin2 ,filename2
45
+ global ii ,fin2 ,filename2 , filesize2
43
46
prst = preset .get ()
44
47
pss = passes .get ()
45
48
filename2 = saveto .get ()
@@ -58,17 +61,19 @@ def EncodeButton():
58
61
os .system ("mp4box.exe -add " + fin2 + " -add " + fin2 + "_266.jpg -new " + fin2 )
59
62
imgtwo = Image .open (filename2 + '_266.jpg' )
60
63
if imgtwo .size [0 ] >= imgtwo .size [1 ]:
61
- wpercent = (160 / float (imgtwo .size [0 ]))
64
+ wpercent = (180 / float (imgtwo .size [0 ]))
62
65
hsize = int ((float (imgtwo .size [1 ])* float (wpercent )))
63
- ii = ImageTk .PhotoImage (imgtwo .resize ((160 ,hsize )))
66
+ ii = ImageTk .PhotoImage (imgtwo .resize ((180 ,hsize )))
64
67
else :
65
68
wpercent = (200 / float (imgtwo .size [1 ]))
66
69
wsize = int ((float (imgtwo .size [0 ])* float (wpercent )))
67
70
ii = ImageTk .PhotoImage (imgtwo .resize ((wsize ,200 )))
68
- canvas .create_image (170 , 0 , anchor = 'nw' , image = ii )
69
- os .remove (filename2 + "_266.jpg" )
71
+ canvas .create_image (180 , 0 , anchor = 'nw' , image = ii )
70
72
os .remove (filename2 + ".Y4M" )
71
73
os .remove (fn + "." + ext + ".m4a" )
74
+ os .remove (filename2 + "_266.jpg" )
75
+ filesize2 = str (round (os .path .getsize (filename2 ) / (1024 * 1024 ),2 ))
76
+ fs2 .config (text = 'Size(Mb): ' + filesize2 )
72
77
def btnClickFunctiontwo ():
73
78
global fin2 , filename2
74
79
data = [("mp4" ,"*.mp4" )]
@@ -90,33 +95,39 @@ def btnClickFunctiontwo():
90
95
Label (root ,text = '1 pass / 2 pass' , bg = '#F0F8FF' , font = ('arial' , 12 , 'normal' )).place (x = 9 , y = 188 )
91
96
Label (root ,text = '1 Pass' , bg = '#F0F8FF' , font = ('arial' , 12 , 'normal' )).place (x = 169 , y = 8 )
92
97
Label (root ,text = '2 Pass' , bg = '#F0F8FF' , font = ('arial' , 12 , 'normal' )).place (x = 329 , y = 8 )
93
- Label (root ,text = 'Quality (1-63)' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' )).place (x = 169 , y = 38 )
94
- Label (root ,text = 'Quality (kb)' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' )).place (x = 329 , y = 38 )
98
+ Label (root ,text = 'Quality (1-63)' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' )).place (x = 169 , y = 28 )
99
+ Label (root ,text = 'Quality (kb)' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' )).place (x = 329 , y = 28 )
100
+
95
101
Label (root ,text = 'Save as:' , bg = '#F0F8FF' , font = ('arial' , 12 , 'normal' )).place (x = 39 , y = 248 )
96
102
103
+ fs1 = Label (root ,text = 'Size(Mb):' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' ))
104
+ fs1 .place (x = 129 , y = 288 )
105
+ fs2 = Label (root ,text = 'Size(Mb):' , bg = '#F0F8FF' , font = ('arial' , 10 , 'italic' ))
106
+ fs2 .place (x = 310 , y = 288 )
107
+
97
108
videoselect = Entry (root )
98
109
videoselect .place (x = 9 ,y = 38 )
99
110
100
111
saveto = Entry (root ,width = 65 )
101
112
saveto .place (x = 9 ,y = 318 )
102
113
103
- preset = ttk .Combobox (root , values = ['faster' ,'fast' ,'medium' ,'slow' ,'slower' ],font = ('arial' ,12 ,'normal' ),width = 10 ,state = "readonly" )
114
+ preset = ttk .Combobox (root , values = ['faster' ,'fast' ,'medium' ,'slow' ,'slower' ],font = ('arial' ,12 ,'normal' ),width = 6 ,state = "readonly" )
104
115
preset .place (x = 9 ,y = 148 )
105
116
preset .current (1 )
106
117
107
- passes = ttk .Combobox (root ,values = ['1 pass' , '2 pass' ],font = ('arial' ,12 ,'normal' ),width = 10 ,state = "readonly" )
118
+ passes = ttk .Combobox (root ,values = ['1 pass' , '2 pass' ],font = ('arial' ,12 ,'normal' ),width = 6 ,state = "readonly" )
108
119
passes .place (x = 9 ,y = 218 )
109
120
passes .current (0 )
110
121
111
122
quality = Spinbox (root ,from_ = 1 ,to = 63 ,font = ('arial' ,10 ,'italic' ),bg = '#F0F8FF' ,width = 10 )
112
- quality .place (x = 169 ,y = 58 )
123
+ quality .place (x = 169 ,y = 48 )
113
124
quality .insert (0 ,3 )
114
125
115
126
qualitytwo = Entry (root )
116
- qualitytwo .place (x = 329 ,y = 58 )
127
+ qualitytwo .place (x = 329 ,y = 48 )
117
128
qualitytwo .insert (0 ,500 )
118
129
119
- canvas = tk .Canvas (root ,width = 330 ,height = 200 )
120
- canvas .place (x = 159 ,y = 88 )
130
+ canvas = tk .Canvas (root ,width = 360 ,height = 200 )
131
+ canvas .place (x = 129 ,y = 78 )
121
132
122
133
root .mainloop ()
0 commit comments