如何使用FFMPEG将MP4(H264,AAC)转换为质量损失为零的WebM?

时间:2018-09-09 10:53:11

标签: ubuntu ffmpeg command-line-interface

我尝试过建议的所有标志,以将 MP4 视频转换为 WebM ,而没有质量损失,但似乎无济于事。现在输出的视频质量已经接近原始质量。

import tkinter as tk

class GUI(tk.Frame):

    def __init__(self):
        super(GUI, self).__init__()
        self.config(width=700, height=500)
        self.pack()
        # self.bg()
        # self.immagine()
        self.testo()
        self.statistiche()
        self.inserimenti()

    def bg(self):
        load = Image.open("immagini\\background.png")
        render = ImageTk.PhotoImage(load)
        img = Label(self, image = render)
        img.image = render
        img.pack()

    def immagine(self):
        load = Image.open("immagini\\dn.png")
        render = ImageTk.PhotoImage(load)
        img = Label(self, image = render)
        img.image = render
        img.place( x = 10, y = 10 )

    def testo(self):
        self.testo = tk.Text(self, width = 110, height = 35, border = 5, bg = "black", fg ="white")
        self.testo.place( x = 400, y = 20 )

    def statistiche(self):
        screen_height = 400
        self.stats = tk.Text(self, width = 40, height = 10, border = 5, bg = "black", fg ="white")
        self.stats.place( x = 10, y = (screen_height - 200))

    def inserisci(self):
        fraseInserita = self.inserimento.get()
        self.scrivere(fraseInserita)
        self.inserimento.delete('0', 'end')

    def inserimenti(self):
        large_font = ('calibri', 12)
        screen_height = 400
        screen_width = 600
        self.inserimento = tk.Entry(self,font=large_font, width = 25, border = 5, bg = "black", fg ="white")
        self.inserimento.place( x = 400, y = (screen_height - 100))
        self.bottone = tk.Button(self, width = 30, height = 3, border = 5, text = "Inserisci", command = self.inserisci)
        self.bottone.place( x = (screen_width - 300), y = (screen_height - 100))

    def scrivere(self, frase):
        print(' you need to define this function when button is pressed')

class Livelli():

    def __init__(self):
        pass

    def cicloLivelli(self):
        self.presentazione()

    def presentazione(self):
        print("Salve avventuriero, qual e' il tuo nome?")


if __name__ == "__main__":
    a = GUI()
    l = Livelli()
    l.cicloLivelli()
    a.mainloop()

我正在寻找一个命令,以实现从mp4到webm的无损转换。

注意:我不关心输出文件的大小

1 个答案:

答案 0 :(得分:1)

WebM的默认编码器libvpx要求,如果使用CRF模式,则必须将比特率设置为0。因此,

ffmpeg -i lucy.mp4 -c:v libvpx-vp9 -crf 4 -b:v 0 lucy.webm