Added Bitrate Selection
This commit is contained in:
parent
fed9481d9a
commit
02795503d0
|
@ -109,7 +109,7 @@
|
|||
],
|
||||
"video-codecs":{
|
||||
"H264": ["libx264"],
|
||||
"H264 (nvenc)": ["nvenc_264"],
|
||||
"H264 (nvenc)": ["h264_nvenc", "nvenc_h264"],
|
||||
"MPEG4": ["mpeg4"],
|
||||
"VP9": ["libvpx-vp9"],
|
||||
"VP8": ["libvpx"],
|
||||
|
@ -120,7 +120,7 @@
|
|||
"WMV": ["wmv2"]
|
||||
},
|
||||
"audio-codecs": {
|
||||
"AAC": ["libfdk_aac","aac"],
|
||||
"AAC": ["libfdk_aac", "aac"],
|
||||
"AC3": ["ac3"],
|
||||
"MP3": ["libmp3lame"],
|
||||
"PCM s16 LE": ["pcm_s16le"],
|
||||
|
|
3
main.py
3
main.py
|
@ -26,8 +26,9 @@ def LoadDefaultSettings(self):
|
|||
"outputHeight": 720,
|
||||
"outputFrameRate": 30,
|
||||
"outputAudioCodec": "AAC",
|
||||
"outputAudioBitrate": "192k",
|
||||
"outputAudioBitrate": "192",
|
||||
"outputVideoCodec": "H264",
|
||||
"outputVideoBitrate": "2500",
|
||||
"outputVideoFormat": "yuv420p",
|
||||
"outputPreset": "medium",
|
||||
"outputFormat": "mp4",
|
||||
|
|
|
@ -132,6 +132,16 @@ class MainWindow(QtCore.QObject):
|
|||
self.updateCodecSettings
|
||||
)
|
||||
|
||||
vBitrate = int(self.settings.value('outputVideoBitrate'))
|
||||
aBitrate = int(self.settings.value('outputAudioBitrate'))
|
||||
|
||||
window.spinBox_vBitrate.setValue(vBitrate)
|
||||
window.spinBox_aBitrate.setValue(aBitrate)
|
||||
|
||||
window.spinBox_vBitrate.valueChanged.connect(self.updateCodecSettings)
|
||||
window.spinBox_aBitrate.valueChanged.connect(self.updateCodecSettings)
|
||||
|
||||
|
||||
self.previewWindow = PreviewWindow(self, os.path.join(
|
||||
os.path.dirname(os.path.realpath(__file__)), "background.png"))
|
||||
window.verticalLayout_previewWrapper.addWidget(self.previewWindow)
|
||||
|
@ -159,6 +169,8 @@ class MainWindow(QtCore.QObject):
|
|||
window.comboBox_resolution.setCurrentIndex(currentRes)
|
||||
window.comboBox_resolution.currentIndexChanged.connect(
|
||||
self.updateResolution)
|
||||
|
||||
|
||||
|
||||
self.window.pushButton_listMoveUp.clicked.connect(
|
||||
self.moveComponentUp)
|
||||
|
@ -222,13 +234,19 @@ class MainWindow(QtCore.QObject):
|
|||
|
||||
def updateCodecSettings(self):
|
||||
vCodecWidget = self.window.comboBox_videoCodec
|
||||
vBitrateWidget = self.window.spinBox_vBitrate
|
||||
aBitrateWidget = self.window.spinBox_aBitrate
|
||||
aCodecWidget = self.window.comboBox_audioCodec
|
||||
currentVideoCodec = vCodecWidget.currentIndex()
|
||||
currentVideoCodec = vCodecWidget.itemText(currentVideoCodec)
|
||||
currentVideoBitrate = vBitrateWidget.value()
|
||||
currentAudioCodec = aCodecWidget.currentIndex()
|
||||
currentAudioCodec = aCodecWidget.itemText(currentAudioCodec)
|
||||
currentAudioBitrate = aBitrateWidget.value()
|
||||
self.settings.setValue('outputVideoCodec', currentVideoCodec)
|
||||
self.settings.setValue('outputAudioCodec', currentAudioCodec)
|
||||
self.settings.setValue('outputVideoBitrate', currentVideoBitrate)
|
||||
self.settings.setValue('outputAudioBitrate', currentAudioBitrate)
|
||||
|
||||
def autosave(self):
|
||||
if time.time() - self.lastAutosave >= 1.0:
|
||||
|
|
|
@ -697,12 +697,16 @@
|
|||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Video Bitrate</string>
|
||||
<string>Video Bitrate (Kbps)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox_vBitrate"/>
|
||||
<widget class="QSpinBox" name="spinBox_vBitrate">
|
||||
<property name="maximum">
|
||||
<number>99999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
@ -762,12 +766,16 @@
|
|||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Audio Bitrate</string>
|
||||
<string>Audio Bitrate (Kbps)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox_aBitrate"/>
|
||||
<widget class="QSpinBox" name="spinBox_aBitrate">
|
||||
<property name="maximum">
|
||||
<number>9999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
|
|
@ -109,7 +109,9 @@ class Worker(QtCore.QObject):
|
|||
options = self.core.encoder_options
|
||||
containerName = self.core.settings.value('outputContainer')
|
||||
vcodec = self.core.settings.value('outputVideoCodec')
|
||||
vbitrate = str(self.core.settings.value('outputVideoBitrate'))+'k'
|
||||
acodec = self.core.settings.value('outputAudioCodec')
|
||||
abitrate = str(self.core.settings.value('outputAudioBitrate'))+'k'
|
||||
|
||||
for cont in options['containers']:
|
||||
if cont['name'] == containerName:
|
||||
|
@ -147,7 +149,8 @@ class Worker(QtCore.QObject):
|
|||
'-i', inputFile,
|
||||
'-vcodec', vencoder,
|
||||
'-acodec', aencoder, # output audio codec
|
||||
'-b:a', self.core.settings.value('outputAudioBitrate'),
|
||||
'-b:v', vbitrate,
|
||||
'-b:a', abitrate,
|
||||
'-pix_fmt', self.core.settings.value('outputVideoFormat'),
|
||||
'-preset', self.core.settings.value('outputPreset'),
|
||||
'-f', container
|
||||
|
|
Reference in New Issue