mirror of
				https://github.com/k4yt3x/video2x.git
				synced 2025-10-31 04:40:59 +01:00 
			
		
		
		
	added Gifski settings, added config filter for ffmpeg
This commit is contained in:
		
							parent
							
								
									99abb4f6df
								
							
						
					
					
						commit
						0882f44e1f
					
				| @ -377,6 +377,14 @@ class Video2XMainWindow(QMainWindow): | |||||||
|         self.ffmpeg_migrate_streams_hardware_acceleration_check_box = self.findChild(QCheckBox, 'ffmpegMigrateStreamsHardwareAccelerationCheckBox') |         self.ffmpeg_migrate_streams_hardware_acceleration_check_box = self.findChild(QCheckBox, 'ffmpegMigrateStreamsHardwareAccelerationCheckBox') | ||||||
| 
 | 
 | ||||||
|         # Gifski settings |         # Gifski settings | ||||||
|  |         self.gifski_path_line_edit = self.findChild(QLineEdit, 'gifskiPathLineEdit') | ||||||
|  |         self.enable_line_edit_file_drop(self.gifski_path_line_edit) | ||||||
|  |         self.gifski_quality_spin_box = self.findChild(QSpinBox, 'gifskiQualitySpinBox') | ||||||
|  |         self.gifski_width_spin_box = self.findChild(QSpinBox, 'gifskiWidthSpinBox') | ||||||
|  |         self.gifski_height_spin_box = self.findChild(QSpinBox, 'gifskiHeightSpinBox') | ||||||
|  |         self.gifski_fast_check_box = self.findChild(QCheckBox, 'gifskiFastCheckBox') | ||||||
|  |         self.gifski_once_check_box = self.findChild(QCheckBox, 'gifskiOnceCheckBox') | ||||||
|  |         self.gifski_quiet_check_box = self.findChild(QCheckBox, 'gifskiQuietCheckBox') | ||||||
| 
 | 
 | ||||||
|         # Tools |         # Tools | ||||||
|         self.ffprobe_plain_text_edit = self.findChild(QPlainTextEdit, 'ffprobePlainTextEdit') |         self.ffprobe_plain_text_edit = self.findChild(QPlainTextEdit, 'ffprobePlainTextEdit') | ||||||
| @ -544,6 +552,17 @@ class Video2XMainWindow(QMainWindow): | |||||||
|         settings = self.config['ffmpeg']['migrate_streams'] |         settings = self.config['ffmpeg']['migrate_streams'] | ||||||
|         self.ffmpeg_migrate_streams_output_options_pixel_format_line_edit.setText(settings['output_options']['-pix_fmt']) |         self.ffmpeg_migrate_streams_output_options_pixel_format_line_edit.setText(settings['output_options']['-pix_fmt']) | ||||||
| 
 | 
 | ||||||
|  |         # Gifski | ||||||
|  |         settings = self.config['gifski'] | ||||||
|  |         self.gifski_path_line_edit.setText(str(pathlib.Path(os.path.expandvars(settings['gifski_path'])).absolute())) | ||||||
|  |         self.gifski_quality_spin_box.setValue(settings['quality']) | ||||||
|  |         if isinstance(settings['width'], int) and isinstance(settings['height'], int): | ||||||
|  |             self.gifski_width_spin_box.setValue(settings['width']) | ||||||
|  |             self.gifski_height_spin_box.setValue(settings['height']) | ||||||
|  |         self.gifski_fast_check_box.setChecked(settings['fast']) | ||||||
|  |         self.gifski_once_check_box.setChecked(settings['once']) | ||||||
|  |         self.gifski_quiet_check_box.setChecked(settings['quiet']) | ||||||
|  | 
 | ||||||
|     def resolve_driver_settings(self): |     def resolve_driver_settings(self): | ||||||
| 
 | 
 | ||||||
|         # waifu2x-caffe |         # waifu2x-caffe | ||||||
| @ -680,6 +699,19 @@ class Video2XMainWindow(QMainWindow): | |||||||
|         else: |         else: | ||||||
|             self.config['ffmpeg']['migrate_streams'].pop('-hwaccel', None) |             self.config['ffmpeg']['migrate_streams'].pop('-hwaccel', None) | ||||||
| 
 | 
 | ||||||
|  |         # Gifski | ||||||
|  |         self.config['gifski']['gifski_path'] = os.path.expandvars(self.gifski_path_line_edit.text()) | ||||||
|  |         self.config['gifski']['quality'] = self.gifski_quality_spin_box.value() | ||||||
|  |         if self.gifski_width_spin_box.value() > 0 and self.gifski_height_spin_box.value() > 0: | ||||||
|  |             self.config['gifski']['width'] = self.gifski_width_spin_box.value() | ||||||
|  |             self.config['gifski']['height'] = self.gifski_height_spin_box.value() | ||||||
|  |         else: | ||||||
|  |             self.config['gifski']['width'] = None | ||||||
|  |             self.config['gifski']['height'] = None | ||||||
|  |         self.config['gifski']['fast'] = self.gifski_fast_check_box.isChecked() | ||||||
|  |         self.config['gifski']['once'] = self.gifski_once_check_box.isChecked() | ||||||
|  |         self.config['gifski']['quiet'] = self.gifski_quiet_check_box.isChecked() | ||||||
|  | 
 | ||||||
|     def update_gui_for_driver(self): |     def update_gui_for_driver(self): | ||||||
|         current_driver = AVAILABLE_DRIVERS[self.driver_combo_box.currentText()] |         current_driver = AVAILABLE_DRIVERS[self.driver_combo_box.currentText()] | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -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-14T14:57:32. --> | <!-- Written by QtCreator 4.12.0, 2020-05-14T20:16:43. --> | ||||||
| <qtcreator> | <qtcreator> | ||||||
|  <data> |  <data> | ||||||
|   <variable>EnvironmentId</variable> |   <variable>EnvironmentId</variable> | ||||||
|  | |||||||
| @ -2213,7 +2213,11 @@ | |||||||
|            </widget> |            </widget> | ||||||
|           </item> |           </item> | ||||||
|           <item> |           <item> | ||||||
|            <widget class="QSpinBox" name="gifskiWidthSpinBox"/> |            <widget class="QSpinBox" name="gifskiWidthSpinBox"> | ||||||
|  |             <property name="maximum"> | ||||||
|  |              <number>99999</number> | ||||||
|  |             </property> | ||||||
|  |            </widget> | ||||||
|           </item> |           </item> | ||||||
|          </layout> |          </layout> | ||||||
|         </item> |         </item> | ||||||
| @ -2227,7 +2231,11 @@ | |||||||
|            </widget> |            </widget> | ||||||
|           </item> |           </item> | ||||||
|           <item> |           <item> | ||||||
|            <widget class="QSpinBox" name="gifskiHeightSpinBox"/> |            <widget class="QSpinBox" name="gifskiHeightSpinBox"> | ||||||
|  |             <property name="maximum"> | ||||||
|  |              <number>99999</number> | ||||||
|  |             </property> | ||||||
|  |            </widget> | ||||||
|           </item> |           </item> | ||||||
|          </layout> |          </layout> | ||||||
|         </item> |         </item> | ||||||
|  | |||||||
| @ -257,7 +257,7 @@ class Ffmpeg: | |||||||
|                 value = self.ffmpeg_settings[phase][key] |                 value = self.ffmpeg_settings[phase][key] | ||||||
| 
 | 
 | ||||||
|             # null or None means that leave this option out (keep default) |             # null or None means that leave this option out (keep default) | ||||||
|             if value is None or value is False or isinstance(value, dict): |             if value is None or value is False or isinstance(value, dict) or value == '': | ||||||
|                 continue |                 continue | ||||||
| 
 | 
 | ||||||
|             # if the value is a list, append the same argument and all values |             # if the value is a list, append the same argument and all values | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user