mirror of
				https://github.com/k4yt3x/video2x.git
				synced 2025-11-04 06:31:00 +01:00 
			
		
		
		
	GUI 2.4.0: added H264/265 tune option
This commit is contained in:
		
							parent
							
								
									de841a4636
								
							
						
					
					
						commit
						082c6d44fa
					
				@ -1,7 +1,7 @@
 | 
				
			|||||||
# Name: Video2X Configuration File
 | 
					# Name: Video2X Configuration File
 | 
				
			||||||
# Creator: K4YT3X
 | 
					# Creator: K4YT3X
 | 
				
			||||||
# Date Created: October 23, 2018
 | 
					# Date Created: October 23, 2018
 | 
				
			||||||
# Last Modified: May 17, 2020
 | 
					# Last Modified: May 23, 2020
 | 
				
			||||||
# Values here are the default values. Change the value here to
 | 
					# Values here are the default values. Change the value here to
 | 
				
			||||||
#   save the default value permanently.
 | 
					#   save the default value permanently.
 | 
				
			||||||
# Items commented out are parameters irrelevant to this context
 | 
					# Items commented out are parameters irrelevant to this context
 | 
				
			||||||
@ -123,6 +123,7 @@ ffmpeg:
 | 
				
			|||||||
      '-crf': 17 # H.264 Constant Rate Factor
 | 
					      '-crf': 17 # H.264 Constant Rate Factor
 | 
				
			||||||
      '-b:v': null # target average bitrate
 | 
					      '-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
 | 
					      '-vf': 'pad=ceil(iw/2)*2:ceil(ih/2)*2' # ensure output is divisible by 2, recommended for libx264
 | 
				
			||||||
 | 
					      '-tune': 'animation' # encoding tuning film/animation/grain/stillimage/fastdecode/zerolatency/psnr/ssim
 | 
				
			||||||
  # Step 3: Streams Migration
 | 
					  # Step 3: Streams Migration
 | 
				
			||||||
  # migrate audio and subtitle streams from original
 | 
					  # migrate audio and subtitle streams from original
 | 
				
			||||||
  #   video into the upscaled video
 | 
					  #   video into the upscaled video
 | 
				
			||||||
 | 
				
			|||||||
@ -4,7 +4,7 @@
 | 
				
			|||||||
Creator: Video2X GUI
 | 
					Creator: Video2X GUI
 | 
				
			||||||
Author: K4YT3X
 | 
					Author: K4YT3X
 | 
				
			||||||
Date Created: May 5, 2020
 | 
					Date Created: May 5, 2020
 | 
				
			||||||
Last Modified: May 22, 2020
 | 
					Last Modified: May 23, 2020
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# local imports
 | 
					# local imports
 | 
				
			||||||
@ -32,7 +32,7 @@ from PyQt5.QtGui import *
 | 
				
			|||||||
from PyQt5.QtWidgets import *
 | 
					from PyQt5.QtWidgets import *
 | 
				
			||||||
import magic
 | 
					import magic
 | 
				
			||||||
 | 
					
 | 
				
			||||||
GUI_VERSION = '2.3.1'
 | 
					GUI_VERSION = '2.4.0'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LEGAL_INFO = f'''Video2X GUI Version: {GUI_VERSION}\\
 | 
					LEGAL_INFO = f'''Video2X GUI Version: {GUI_VERSION}\\
 | 
				
			||||||
Upscaler Version: {UPSCALER_VERSION}\\
 | 
					Upscaler Version: {UPSCALER_VERSION}\\
 | 
				
			||||||
@ -383,6 +383,7 @@ class Video2XMainWindow(QMainWindow):
 | 
				
			|||||||
        self.ffmpeg_assemble_video_output_options_video_codec_line_edit = self.findChild(QLineEdit, 'ffmpegAssembleVideoOutputOptionsVideoCodecLineEdit')
 | 
					        self.ffmpeg_assemble_video_output_options_video_codec_line_edit = self.findChild(QLineEdit, 'ffmpegAssembleVideoOutputOptionsVideoCodecLineEdit')
 | 
				
			||||||
        self.ffmpeg_assemble_video_output_options_pixel_format_line_edit = self.findChild(QLineEdit, 'ffmpegAssembleVideoOutputOptionsPixelFormatLineEdit')
 | 
					        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_crf_spin_box = self.findChild(QSpinBox, 'ffmpegAssembleVideoOutputOptionsCrfSpinBox')
 | 
				
			||||||
 | 
					        self.ffmpeg_assemble_video_output_options_tune_combo_box = self.findChild(QComboBox, 'ffmpegAssembleVideoOutputOptionsTuneComboBox')
 | 
				
			||||||
        self.ffmpeg_assemble_video_output_options_bitrate_line_edit = self.findChild(QLineEdit, 'ffmpegAssembleVideoOutputOptionsBitrateLineEdit')
 | 
					        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_output_options_ensure_divisible_check_box = self.findChild(QCheckBox, 'ffmpegAssembleVideoOutputOptionsEnsureDivisibleCheckBox')
 | 
				
			||||||
        self.ffmpeg_assemble_video_hardware_acceleration_check_box = self.findChild(QCheckBox, 'ffmpegAssembleVideoHardwareAccelerationCheckBox')
 | 
					        self.ffmpeg_assemble_video_hardware_acceleration_check_box = self.findChild(QCheckBox, 'ffmpegAssembleVideoHardwareAccelerationCheckBox')
 | 
				
			||||||
@ -530,6 +531,7 @@ class Video2XMainWindow(QMainWindow):
 | 
				
			|||||||
        self.ffmpeg_assemble_video_output_options_video_codec_line_edit.setText(settings['output_options']['-vcodec'])
 | 
					        self.ffmpeg_assemble_video_output_options_video_codec_line_edit.setText(settings['output_options']['-vcodec'])
 | 
				
			||||||
        self.ffmpeg_assemble_video_output_options_pixel_format_line_edit.setText(settings['output_options']['-pix_fmt'])
 | 
					        self.ffmpeg_assemble_video_output_options_pixel_format_line_edit.setText(settings['output_options']['-pix_fmt'])
 | 
				
			||||||
        self.ffmpeg_assemble_video_output_options_crf_spin_box.setValue(settings['output_options']['-crf'])
 | 
					        self.ffmpeg_assemble_video_output_options_crf_spin_box.setValue(settings['output_options']['-crf'])
 | 
				
			||||||
 | 
					        self.ffmpeg_assemble_video_output_options_tune_combo_box.setCurrentText(settings['output_options']['-tune'])
 | 
				
			||||||
        self.ffmpeg_assemble_video_output_options_bitrate_line_edit.setText(settings['output_options']['-b:v'])
 | 
					        self.ffmpeg_assemble_video_output_options_bitrate_line_edit.setText(settings['output_options']['-b:v'])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # migrate streams
 | 
					        # migrate streams
 | 
				
			||||||
@ -629,6 +631,7 @@ class Video2XMainWindow(QMainWindow):
 | 
				
			|||||||
        self.config['ffmpeg']['assemble_video']['output_options']['-vcodec'] = self.ffmpeg_assemble_video_output_options_video_codec_line_edit.text()
 | 
					        self.config['ffmpeg']['assemble_video']['output_options']['-vcodec'] = self.ffmpeg_assemble_video_output_options_video_codec_line_edit.text()
 | 
				
			||||||
        self.config['ffmpeg']['assemble_video']['output_options']['-pix_fmt'] = self.ffmpeg_assemble_video_output_options_pixel_format_line_edit.text()
 | 
					        self.config['ffmpeg']['assemble_video']['output_options']['-pix_fmt'] = self.ffmpeg_assemble_video_output_options_pixel_format_line_edit.text()
 | 
				
			||||||
        self.config['ffmpeg']['assemble_video']['output_options']['-crf'] = self.ffmpeg_assemble_video_output_options_crf_spin_box.value()
 | 
					        self.config['ffmpeg']['assemble_video']['output_options']['-crf'] = self.ffmpeg_assemble_video_output_options_crf_spin_box.value()
 | 
				
			||||||
 | 
					        self.config['ffmpeg']['assemble_video']['output_options']['-tune'] = self.ffmpeg_assemble_video_output_options_tune_combo_box.currentText()
 | 
				
			||||||
        if self.ffmpeg_assemble_video_output_options_bitrate_line_edit.text() != '':
 | 
					        if self.ffmpeg_assemble_video_output_options_bitrate_line_edit.text() != '':
 | 
				
			||||||
            self.config['ffmpeg']['assemble_video']['output_options']['-b:v'] = self.ffmpeg_assemble_video_output_options_bitrate_line_edit.text()
 | 
					            self.config['ffmpeg']['assemble_video']['output_options']['-b:v'] = self.ffmpeg_assemble_video_output_options_bitrate_line_edit.text()
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
<!DOCTYPE QtCreatorProject>
 | 
					<!DOCTYPE QtCreatorProject>
 | 
				
			||||||
<!-- Written by QtCreator 4.12.0, 2020-05-22T17:48:55. -->
 | 
					<!-- Written by QtCreator 4.12.0, 2020-05-23T08:51:47. -->
 | 
				
			||||||
<qtcreator>
 | 
					<qtcreator>
 | 
				
			||||||
 <data>
 | 
					 <data>
 | 
				
			||||||
  <variable>EnvironmentId</variable>
 | 
					  <variable>EnvironmentId</variable>
 | 
				
			||||||
 | 
				
			|||||||
@ -1707,7 +1707,7 @@
 | 
				
			|||||||
        <item>
 | 
					        <item>
 | 
				
			||||||
         <widget class="QTabWidget" name="ffmpegSettingsTabWidget">
 | 
					         <widget class="QTabWidget" name="ffmpegSettingsTabWidget">
 | 
				
			||||||
          <property name="currentIndex">
 | 
					          <property name="currentIndex">
 | 
				
			||||||
           <number>0</number>
 | 
					           <number>2</number>
 | 
				
			||||||
          </property>
 | 
					          </property>
 | 
				
			||||||
          <widget class="QWidget" name="ffmpegGlobalOptionsTab">
 | 
					          <widget class="QWidget" name="ffmpegGlobalOptionsTab">
 | 
				
			||||||
           <attribute name="title">
 | 
					           <attribute name="title">
 | 
				
			||||||
@ -1929,7 +1929,7 @@
 | 
				
			|||||||
                    </sizepolicy>
 | 
					                    </sizepolicy>
 | 
				
			||||||
                   </property>
 | 
					                   </property>
 | 
				
			||||||
                   <property name="text">
 | 
					                   <property name="text">
 | 
				
			||||||
                    <string>yuv444p10le</string>
 | 
					                    <string>yuv420p</string>
 | 
				
			||||||
                   </property>
 | 
					                   </property>
 | 
				
			||||||
                  </widget>
 | 
					                  </widget>
 | 
				
			||||||
                 </item>
 | 
					                 </item>
 | 
				
			||||||
@ -1956,6 +1956,64 @@
 | 
				
			|||||||
                 </item>
 | 
					                 </item>
 | 
				
			||||||
                </layout>
 | 
					                </layout>
 | 
				
			||||||
               </item>
 | 
					               </item>
 | 
				
			||||||
 | 
					               <item>
 | 
				
			||||||
 | 
					                <layout class="QHBoxLayout" name="ffmpegAssembleVideoOutputOptionsTuneHorizontalLayout">
 | 
				
			||||||
 | 
					                 <item>
 | 
				
			||||||
 | 
					                  <widget class="QLabel" name="ffmpegAssembleVideoOutputOptionsTuneLabel">
 | 
				
			||||||
 | 
					                   <property name="text">
 | 
				
			||||||
 | 
					                    <string>H.264/H.265 Tune (-tune)</string>
 | 
				
			||||||
 | 
					                   </property>
 | 
				
			||||||
 | 
					                  </widget>
 | 
				
			||||||
 | 
					                 </item>
 | 
				
			||||||
 | 
					                 <item>
 | 
				
			||||||
 | 
					                  <widget class="QComboBox" name="ffmpegAssembleVideoOutputOptionsTuneComboBox">
 | 
				
			||||||
 | 
					                   <property name="toolTip">
 | 
				
			||||||
 | 
					                    <string><html><head/><body><p>- film (x264 only): use for high quality movie content; lowers deblocking</p><p>- animation (x264 only): good for cartoons; uses higher deblocking and more reference frames</p><p>- grain: preserves the grain structure in old, grainy film material</p><p>- stillimage: (x264 only) good for slideshow-like content</p><p>- fastdecode: allows faster decoding by disabling certain filters</p><p>- zerolatency: good for fast encoding and low-latency streaming</p><p>- psnr: ignore this as it is only used for codec development</p><p>- ssim: ignore this as it is only used for codec development </p></body></html></string>
 | 
				
			||||||
 | 
					                   </property>
 | 
				
			||||||
 | 
					                   <item>
 | 
				
			||||||
 | 
					                    <property name="text">
 | 
				
			||||||
 | 
					                     <string>animation</string>
 | 
				
			||||||
 | 
					                    </property>
 | 
				
			||||||
 | 
					                   </item>
 | 
				
			||||||
 | 
					                   <item>
 | 
				
			||||||
 | 
					                    <property name="text">
 | 
				
			||||||
 | 
					                     <string>film</string>
 | 
				
			||||||
 | 
					                    </property>
 | 
				
			||||||
 | 
					                   </item>
 | 
				
			||||||
 | 
					                   <item>
 | 
				
			||||||
 | 
					                    <property name="text">
 | 
				
			||||||
 | 
					                     <string>grain</string>
 | 
				
			||||||
 | 
					                    </property>
 | 
				
			||||||
 | 
					                   </item>
 | 
				
			||||||
 | 
					                   <item>
 | 
				
			||||||
 | 
					                    <property name="text">
 | 
				
			||||||
 | 
					                     <string>stillimage</string>
 | 
				
			||||||
 | 
					                    </property>
 | 
				
			||||||
 | 
					                   </item>
 | 
				
			||||||
 | 
					                   <item>
 | 
				
			||||||
 | 
					                    <property name="text">
 | 
				
			||||||
 | 
					                     <string>fastdecode</string>
 | 
				
			||||||
 | 
					                    </property>
 | 
				
			||||||
 | 
					                   </item>
 | 
				
			||||||
 | 
					                   <item>
 | 
				
			||||||
 | 
					                    <property name="text">
 | 
				
			||||||
 | 
					                     <string>zerolatency</string>
 | 
				
			||||||
 | 
					                    </property>
 | 
				
			||||||
 | 
					                   </item>
 | 
				
			||||||
 | 
					                   <item>
 | 
				
			||||||
 | 
					                    <property name="text">
 | 
				
			||||||
 | 
					                     <string>psnr</string>
 | 
				
			||||||
 | 
					                    </property>
 | 
				
			||||||
 | 
					                   </item>
 | 
				
			||||||
 | 
					                   <item>
 | 
				
			||||||
 | 
					                    <property name="text">
 | 
				
			||||||
 | 
					                     <string>ssim</string>
 | 
				
			||||||
 | 
					                    </property>
 | 
				
			||||||
 | 
					                   </item>
 | 
				
			||||||
 | 
					                  </widget>
 | 
				
			||||||
 | 
					                 </item>
 | 
				
			||||||
 | 
					                </layout>
 | 
				
			||||||
 | 
					               </item>
 | 
				
			||||||
               <item>
 | 
					               <item>
 | 
				
			||||||
                <layout class="QHBoxLayout" name="ffmpegAssembleVideoOutputOptionsBitrateHorizontalLayout">
 | 
					                <layout class="QHBoxLayout" name="ffmpegAssembleVideoOutputOptionsBitrateHorizontalLayout">
 | 
				
			||||||
                 <item>
 | 
					                 <item>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user