mirror of
https://github.com/k4yt3x/video2x.git
synced 2024-12-29 16:09:10 +00:00
added checkbox to ensure width and height are divisible by 2
This commit is contained in:
parent
0882f44e1f
commit
c384bb91c4
@ -1,7 +1,7 @@
|
||||
# Name: Video2X Configuration File
|
||||
# Creator: K4YT3X
|
||||
# Date Created: October 23, 2018
|
||||
# Last Modified: May 12, 2020
|
||||
# Last Modified: May 14, 2020
|
||||
# Values here are the default values. Change the value here to
|
||||
# save the default value permanently.
|
||||
# Items commented out are parameters irrelevant to this context
|
||||
@ -122,6 +122,7 @@ ffmpeg:
|
||||
'-pix_fmt': 'yuv444p10le' # overwrite default pixel format
|
||||
'-crf': 17 # H.264 Constant Rate Factor
|
||||
'-b:v': null # target average bitrate
|
||||
'-vf': 'pad=ceil(iw/2)*2:ceil(ih/2)*2' # ensure output is divisible by 2, recommended for libx264
|
||||
# Step 3: Streams Migration
|
||||
# migrate audio and subtitle streams from original
|
||||
# video into the upscaled video
|
||||
|
@ -362,6 +362,7 @@ class Video2XMainWindow(QMainWindow):
|
||||
self.ffmpeg_assemble_video_output_options_pixel_format_line_edit = self.findChild(QLineEdit, 'ffmpegAssembleVideoOutputOptionsPixelFormatLineEdit')
|
||||
self.ffmpeg_assemble_video_output_options_crf_spin_box = self.findChild(QSpinBox, 'ffmpegAssembleVideoOutputOptionsCrfSpinBox')
|
||||
self.ffmpeg_assemble_video_output_options_bitrate_line_edit = self.findChild(QLineEdit, 'ffmpegAssembleVideoOutputOptionsBitrateLineEdit')
|
||||
self.ffmpeg_assemble_video_output_options_ensure_divisible_check_box = self.findChild(QCheckBox, 'ffmpegAssembleVideoOutputOptionsEnsureDivisibleCheckBox')
|
||||
self.ffmpeg_assemble_video_hardware_acceleration_check_box = self.findChild(QCheckBox, 'ffmpegAssembleVideoHardwareAccelerationCheckBox')
|
||||
|
||||
# migrate_streams
|
||||
@ -649,6 +650,19 @@ class Video2XMainWindow(QMainWindow):
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-b:v'] = self.ffmpeg_assemble_video_output_options_bitrate_line_edit.text()
|
||||
else:
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-b:v'] = None
|
||||
|
||||
if self.ffmpeg_assemble_video_output_options_ensure_divisible_check_box.isChecked():
|
||||
# if video filter is enabled and is not empty and is not equal to divisible by two filter
|
||||
# append divisible by two filter to the end of existing filter
|
||||
if ('-vf' in self.config['ffmpeg']['assemble_video']['output_options'] and
|
||||
len(self.config['ffmpeg']['assemble_video']['output_options']['-vf']) > 0 and
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-vf'] != 'pad=ceil(iw/2)*2:ceil(ih/2)*2'):
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-vf'] += ',pad=ceil(iw/2)*2:ceil(ih/2)*2'
|
||||
else:
|
||||
self.config['ffmpeg']['assemble_video']['output_options']['-vf'] = 'pad=ceil(iw/2)*2:ceil(ih/2)*2'
|
||||
else:
|
||||
self.config['ffmpeg']['assemble_video']['output_options'].pop('-vf', None)
|
||||
|
||||
if self.ffmpeg_assemble_video_hardware_acceleration_check_box.isChecked():
|
||||
self.config['ffmpeg']['assemble_video']['-hwaccel'] = 'auto'
|
||||
else:
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.12.0, 2020-05-14T20:16:43. -->
|
||||
<!-- Written by QtCreator 4.12.0, 2020-05-14T22:33:50. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
@ -1930,6 +1930,16 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ffmpegAssembleVideoOutputOptionsEnsureDivisibleCheckBox">
|
||||
<property name="text">
|
||||
<string>Ensure output width and height are divisible by 2</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user