import tkinter as tk
import tkinter.filedialog as tk_fd
import subprocess
ffmpeg_path = "C:\\Users\\username\\Downloads\\ffmpeg-20160428-git-78baa45-win64-static\\bin\\ffmpeg.exe"
class Application
(tk.
Frame): """Application class docstring"""
def __init__(self, master=None):
"""init method docstring"""
super().__init__(master)
self.pack()
self.mp3_path = ''
self.pic_path = ''
self.output_path = ''
self.create_widgets()
def create_widgets(self):
self.
Source1 = tk.
Button(self, text
= "mp3", command
= lambda
: self.
open_mp3()).
pack() self.
Sourse2 = tk.
Button(self, text
= "pic", command
= lambda
: self.
open_pic()).
pack() self.
Start = tk.
Button(self, text
="Start", fg
="red",command
= lambda
: self.
start()).
pack()
def open_mp3(self):
"""mp3 method docstring"""
op = tk_fd.askopenfile(mode='rb',title='Choose a mp3', filetypes = [("music", "*.mp3")])
path = r''.replace('',(str(op.name).replace("""/""","""\\""")))
print("Path to mp3 is - " + path)
self.mp3_path = path
def open_pic(self):
op = tk_fd.askopenfile(mode='rb',title='Choose a picture', filetypes = [("picture", "*.jpeg; *.bmp; *.jpg; *.png")])
path = r''.replace('',(str(op.name).replace("""/""","""\\""")))
print("Path to pic is - " + path)
self.pic_path = path
def start(self):
op = tk_fd.asksaveasfilename(title = "Choose where to save", filetypes = [("webm", "*.webm;")])
path = r''.replace('',(str(op).replace("""/""","""\\""")+(".webm")))
print("Path to webm is - " + path)
self.output_path = path
subprocess.call(ffmpeg_path + self.parse_setting())
def parse_setting(self):
#there must be smth to parse when settings will be done
settings = u" -r 1 -loop 1 -i {} -i {} -c:v vp8 -c:a opus -b:a 128k -b:v 0 -crf 16 -g 360 -shortest {} ".format((self.pic_path), (self.mp3_path), (self.output_path))
print((ffmpeg_path + settings))
return(settings)
root = tk.Tk()
root.geometry("800x600")
root.title("mp3 + pic = webm GUI")
app = Application(master=root)
app.mainloop()
aW1wb3J0IHRraW50ZXIgYXMgdGsKaW1wb3J0IHRraW50ZXIuZmlsZWRpYWxvZyBhcyB0a19mZAppbXBvcnQgc3VicHJvY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iAgICAgICAgCiAgICAgICAgc3VicHJvY2Vzcy5jYWxsKGZmbXBlZ19wYXRoICsgc2VsZi5wYXJzZV9zZXR0aW5nKCkpCiAgICAgICAgCiAgICBkZWYgcGFyc2Vfc2V0dGluZyhzZWxmKToKICAgICAgICAjdGhlcmUgbXVzdCBiZSBzbXRoIHRvIHBhcnNlIHdoZW4gc2V0dGluZ3Mgd2lsbCBiZSBkb25lCiAgICAgICAgc2V0dGluZ3MgPSB1IiAtciAxIC1sb29wIDEgLWkge30gLWkge30gLWM6diB2cDggLWM6YSBvcHVzIC1iOmEgMTI4ayAtYjp2IDAgLWNyZiAxNiAtZyAzNjAgLXNob3J0ZXN0IHt9ICIuZm9ybWF0KChzZWxmLnBpY19wYXRoKSwgKHNlbGYubXAzX3BhdGgpLCAoc2VsZi5vdXRwdXRfcGF0aCkpCiAgICAgICAgcHJpbnQoKGZmbXBlZ19wYXRoICsgc2V0dGluZ3MpKQogICAgICAgIHJldHVybihzZXR0aW5ncykKCgpyb290ID0gdGsuVGsoKQpyb290Lmdlb21ldHJ5KCI4MDB4NjAwIikKcm9vdC50aXRsZSgibXAzICsgcGljID0gd2VibSBHVUkiKQphcHAgPSBBcHBsaWNhdGlvbihtYXN0ZXI9cm9vdCkKYXBwLm1haW5sb29wKCk=
Main.java:1: error: '.' expected
import tkinter as tk
^
Main.java:1: error: ';' expected
import tkinter as tk
^
Main.java:2: error: ';' expected
import tkinter.filedialog as tk_fd
^
Main.java:3: error: '.' expected
import subprocess
^
Main.java:5: error: ';' expected
ffmpeg_path = "C:\\Users\\username\\Downloads\\ffmpeg-20160428-git-78baa45-win64-static\\bin\\ffmpeg.exe"
^
Main.java:7: error: '{' expected
class Application(tk.Frame):
^
Main.java:15: error: empty character literal
self.mp3_path = ''
^
Main.java:15: error: illegal line end in character literal
self.mp3_path = ''
^
Main.java:16: error: empty character literal
self.pic_path = ''
^
Main.java:16: error: illegal line end in character literal
self.pic_path = ''
^
Main.java:17: error: empty character literal
self.output_path = ''
^
Main.java:17: error: illegal line end in character literal
self.output_path = ''
^
Main.java:28: error: unclosed character literal
op = tk_fd.askopenfile(mode='rb',title='Choose a mp3', filetypes = [("music", "*.mp3")])
^
Main.java:28: error: unclosed character literal
op = tk_fd.askopenfile(mode='rb',title='Choose a mp3', filetypes = [("music", "*.mp3")])
^
Main.java:28: error: unclosed character literal
op = tk_fd.askopenfile(mode='rb',title='Choose a mp3', filetypes = [("music", "*.mp3")])
^
Main.java:28: error: unclosed character literal
op = tk_fd.askopenfile(mode='rb',title='Choose a mp3', filetypes = [("music", "*.mp3")])
^
Main.java:29: error: empty character literal
path = r''.replace('',(str(op.name).replace("""/""","""\\""")))
^
Main.java:29: error: unclosed character literal
path = r''.replace('',(str(op.name).replace("""/""","""\\""")))
^
Main.java:29: error: empty character literal
path = r''.replace('',(str(op.name).replace("""/""","""\\""")))
^
Main.java:29: error: unclosed character literal
path = r''.replace('',(str(op.name).replace("""/""","""\\""")))
^
Main.java:34: error: unclosed character literal
op = tk_fd.askopenfile(mode='rb',title='Choose a picture', filetypes = [("picture", "*.jpeg; *.bmp; *.jpg; *.png")])
^
Main.java:34: error: unclosed character literal
op = tk_fd.askopenfile(mode='rb',title='Choose a picture', filetypes = [("picture", "*.jpeg; *.bmp; *.jpg; *.png")])
^
Main.java:34: error: unclosed character literal
op = tk_fd.askopenfile(mode='rb',title='Choose a picture', filetypes = [("picture", "*.jpeg; *.bmp; *.jpg; *.png")])
^
Main.java:34: error: unclosed character literal
op = tk_fd.askopenfile(mode='rb',title='Choose a picture', filetypes = [("picture", "*.jpeg; *.bmp; *.jpg; *.png")])
^
Main.java:35: error: empty character literal
path = r''.replace('',(str(op.name).replace("""/""","""\\""")))
^
Main.java:35: error: unclosed character literal
path = r''.replace('',(str(op.name).replace("""/""","""\\""")))
^
Main.java:35: error: empty character literal
path = r''.replace('',(str(op.name).replace("""/""","""\\""")))
^
Main.java:35: error: unclosed character literal
path = r''.replace('',(str(op.name).replace("""/""","""\\""")))
^
Main.java:41: error: empty character literal
path = r''.replace('',(str(op).replace("""/""","""\\""")+(".webm")))
^
Main.java:41: error: unclosed character literal
path = r''.replace('',(str(op).replace("""/""","""\\""")+(".webm")))
^
Main.java:41: error: empty character literal
path = r''.replace('',(str(op).replace("""/""","""\\""")+(".webm")))
^
Main.java:41: error: unclosed character literal
path = r''.replace('',(str(op).replace("""/""","""\\""")+(".webm")))
^
Main.java:48: error: illegal character: '#'
#there must be smth to parse when settings will be done
^
Main.java:58: error: reached end of file while parsing
app.mainloop()
^
34 errors