Esempio n. 1
0
    def __init__(self, parent, main):
        super(AV1, self).__init__(parent)
        self.main = main
        grid = QtWidgets.QGridLayout()

        self.widgets = Box(fps=None,
                           remove_hdr=None,
                           mode=None,
                           segment_size=None)

        self.mode = 'QP'

        grid.addLayout(self.init_remove_hdr(), 1, 0, 1, 2)
        grid.addLayout(self.init_speed(), 0, 0, 1, 2)

        grid.addLayout(self.init_modes(), 0, 2, 4, 4)
        grid.addLayout(self.init_segment_size(), 3, 0, 1, 2)

        grid.addWidget(QtWidgets.QWidget(), 5, 0)
        grid.setRowStretch(5, 1)
        guide_label = QtWidgets.QLabel(
            f"<a href='https://github.com/OpenVisualCloud/SVT-AV1'>SVT-AV1 Github</a>"
        )
        guide_label.setAlignment(QtCore.Qt.AlignBottom)
        guide_label.setOpenExternalLinks(True)
        grid.addWidget(guide_label, 9, 0, -1, 1)
        self.setLayout(grid)
        self.hide()
Esempio n. 2
0
    def __init__(self, parent, main):
        super(AV1, self).__init__(parent)
        self.main = main

        grid = QtWidgets.QGridLayout()

        # grid.addWidget(QtWidgets.QLabel("FFMPEG libaom-av1"), 0, 0)

        self.widgets = Box(fps=None, remove_hdr=None, mode=None)

        self.mode = 'CRF'

        grid.addLayout(self.init_remove_hdr(), 0, 0, 1, 2)
        grid.addLayout(self.init_modes(), 0, 2, 3, 3)

        grid.addWidget(QtWidgets.QWidget(), 5, 0)
        grid.setRowStretch(5, 1)
        guide_label = QtWidgets.QLabel(
            f"<a href='https://trac.ffmpeg.org/wiki/Encode/AV1'>FFMPEG AV1 Encoding Guide</a>"
        )
        guide_label.setAlignment(QtCore.Qt.AlignBottom)
        guide_label.setOpenExternalLinks(True)
        grid.addWidget(guide_label, 9, 0, -1, 1)

        self.setLayout(grid)
        self.hide()
Esempio n. 3
0
    def __init__(self, parent, main):
        super(VP9, self).__init__(parent)
        self.main = main

        grid = QtWidgets.QGridLayout()

        # grid.addWidget(QtWidgets.QLabel("VP9"), 0, 0)

        self.widgets = Box(
            fps=None,
            remove_hdr=None,
            mode=None)

        self.mode = 'CRF'

        grid.addLayout(self.init_remove_hdr(), 2, 0, 1, 2)
        grid.addLayout(self.init_modes(), 0, 2, 4, 4)
        grid.addLayout(self.init_quality(), 1, 0, 1, 2)
        grid.addLayout(self.init_speed(), 0, 0, 1, 2)

        grid.addLayout(self.init_row_mt(), 4, 0, 1, 2)
        grid.addLayout(self.init_force_420(), 5, 0, 1, 2)
        grid.addLayout(self.init_single_pass(), 6, 0, 1, 2)

        grid.addWidget(QtWidgets.QWidget(), 8, 0)
        grid.setRowStretch(8, 1)
        guide_label = QtWidgets.QLabel(f"<a href='https://trac.ffmpeg.org/wiki/Encode/VP9'>FFMPEG VP9 Encoding Guide</a>")
        guide_label.setAlignment(QtCore.Qt.AlignBottom)
        guide_label.setOpenExternalLinks(True)
        grid.addWidget(guide_label, 9, 0, -1, 1)
        self.setLayout(grid)
        self.hide()
Esempio n. 4
0
 def update_commands(self, commands):
     if not commands:
         return
     self.inner_widget = QtWidgets.QWidget()
     sp = QtWidgets.QSizePolicy()
     sp.setHorizontalPolicy(QtWidgets.QSizePolicy.Policy.Maximum)
     self.inner_widget.setSizePolicy(sp)
     layout = QtWidgets.QVBoxLayout()
     layout.setSpacing(5)
     for index, item in enumerate(commands, 1):
         if item.item == "command":
             new_item = Command(self.scroll_area,
                                item.command,
                                index,
                                name=item.name)
             layout.addWidget(new_item)
         elif item.item == "loop":
             new_item = Loop(self.scroll_area,
                             item.condition,
                             item.commands,
                             index,
                             name=item.name)
             layout.addWidget(new_item)
     layout.addStretch()
     self.inner_widget.setLayout(layout)
     self.scroll_area.setWidget(self.inner_widget)
     self.scroll_area.setHorizontalScrollBarPolicy(
         QtCore.Qt.ScrollBarAlwaysOff)
     self.inner_widget.setFixedWidth(self.scroll_area.width() - 3)
Esempio n. 5
0
    def __init__(self, parent):
        super(CommandList, self).__init__(parent)

        layout = QtWidgets.QGridLayout()
        layout.addWidget(QtWidgets.QLabel('Commands to execute'))

        self.inner_widget = QtWidgets.QWidget()

        self.scroll_area = QtWidgets.QScrollArea(self)
        self.scroll_area.setMinimumHeight(200)

        layout.addWidget(self.scroll_area)

        self.setLayout(layout)
Esempio n. 6
0
    def __init__(self, parent):
        super(SubtitleList, self).__init__(parent)

        layout = QtWidgets.QGridLayout()
        layout.addWidget(QtWidgets.QLabel('Subtitle Tracks'))

        self.inner_widget = QtWidgets.QWidget()

        self.scroll_area = QtWidgets.QScrollArea(self)
        self.scroll_area.setMinimumHeight(200)

        layout.addWidget(self.scroll_area)

        self.setLayout(layout)
Esempio n. 7
0
    def __init__(self, parent, main):
        super(GIF, self).__init__(parent)
        self.main = main

        grid = QtWidgets.QGridLayout()

        # grid.addWidget(QtWidgets.QLabel("GIF"), 0, 0)

        self.widgets = Box(fps=None, remove_hdr=None, dither=None)

        grid.addLayout(self.init_fps(), 1, 0)
        grid.addLayout(self.init_remove_hdr(), 2, 0)
        grid.addLayout(self.init_dither(), 0, 0)

        grid.addWidget(QtWidgets.QWidget(), 5, 0, 5, 2)
        self.setLayout(grid)
Esempio n. 8
0
 def update_audio(self, subtitles):
     self.inner_widget = QtWidgets.QWidget()
     sp = QtWidgets.QSizePolicy()
     sp.setHorizontalPolicy(QtWidgets.QSizePolicy.Policy.Maximum)
     self.inner_widget.setSizePolicy(sp)
     layout = QtWidgets.QVBoxLayout()
     layout.setSpacing(5)
     for index, track in enumerate(subtitles, 1):
         new_item = Subtitle(self.scroll_area, track, index)
         layout.addWidget(new_item)
     layout.addStretch()
     self.inner_widget.setLayout(layout)
     self.scroll_area.setWidget(self.inner_widget)
     self.scroll_area.setHorizontalScrollBarPolicy(
         QtCore.Qt.ScrollBarAlwaysOff)
     self.inner_widget.setFixedWidth(self.scroll_area.width() - 3)
Esempio n. 9
0
    def __init__(self, parent, available_audio_encoders):
        super(AudioList, self).__init__(parent)
        self.main = parent.main
        self.inner_layout = None
        self.available_audio_encoders = available_audio_encoders

        layout = QtWidgets.QGridLayout()
        layout.addWidget(QtWidgets.QLabel('Audio Tracks'))

        self.inner_widget = QtWidgets.QWidget()

        self.scroll_area = QtWidgets.QScrollArea(self)
        self.scroll_area.setMinimumHeight(200)

        layout.addWidget(self.scroll_area)

        self.tracks = []

        self.setLayout(layout)
Esempio n. 10
0
    def new_source(self, codecs):
        self.inner_widget = QtWidgets.QWidget()
        self.tracks = []
        layout = QtWidgets.QVBoxLayout()
        layout.setSpacing(5)

        for i, x in enumerate(self.main.streams.audio, 1):
            track_info = ""
            tags = x.get("tags")
            if tags:
                track_info += tags.get('title', '')
                if 'language' in tags:
                    track_info += f' {tags.language}'
            track_info += f' - {x.codec_name}'
            if 'profile' in x:
                track_info += f' ({x.profile})'
            track_info += f' - {x.channels} channels'

            new_item = Audio(
                self,
                track_info,
                original=True,
                first=True if i == 1 else False,
                index=x.index,
                codec=x.codec_name,
                codecs=codecs,
                channels=x.channels,
                available_audio_encoders=self.available_audio_encoders)
            layout.addWidget(new_item)
            self.tracks.append(new_item)

        if self.tracks:
            self.tracks[-1].set_last()

        layout.addStretch()
        # layout.

        self.inner_layout = layout
        self.inner_widget.setLayout(layout)
        self.init_inner()