def get_changed_video_codec_settings(self): video_codec_text = self.get_video_codec_value() if video_codec_text == "H264": video_settings = X264() self._change_to_x264_state() elif video_codec_text == "H265": video_settings = X265() self._change_to_x265_state() elif 'NVENC' in video_codec_text: if self.is_widgets_setting_up: video_settings = None else: if video_codec_text == 'NVENC H264': video_settings = H264Nvenc() self.nvenc_handlers.set_h264_state() else: video_settings = HevcNvenc() self.nvenc_handlers.set_hevc_state() self._reset_settings_for_nvenc_handlers() self._change_to_nvenc_state() elif video_codec_text == 'VP9': video_settings = VP9() self._change_to_vp9_state() else: video_settings = None self._change_to_video_copy_state() return video_settings
def test_instantiation(self): """Tests the initial values of the VP9 object.""" vp9 = VP9() self.assertEqual(vp9.quality, 0) self.assertEqual(vp9.speed, 0) self.assertEqual(vp9.bitrate, 2500) self.assertIsNone(vp9.crf) self.assertIsNone(vp9.maxrate) self.assertIsNone(vp9.minrate) self.assertIsNone(vp9.encode_pass) self.assertIsNone(vp9.stats) self.assertFalse(vp9.row_multithreading) self.assertIsNone(vp9.get_ffmpeg_advanced_args()[''])
def apply_settings(self, ffmpeg): """ Applies settings from the vp9 widgets to ffmpeg settings. """ video_settings = VP9() video_settings.quality = self.vp9_quality_combobox.get_active() video_settings.speed = self.vp9_speed_combobox.get_active() video_settings.row_multithreading = self.vp9_row_multithreading_checkbox.get_active( ) self._apply_rate_control_settings(video_settings) self._apply_encode_pass_settings(video_settings, ffmpeg.temp_file_name) ffmpeg.video_settings = video_settings
def test_advanced_args(self): """Tests Advanced Args option values for VP9 object.""" vp9 = VP9() self.assertIsNone(vp9.get_ffmpeg_advanced_args()[''])
def test_row_multithreading(self): """Tests Row Multithreading option values for VP9 object.""" vp9 = VP9() self._test_row_multithreading_normal_values(vp9) self._test_row_multithreading_abnormal_values(vp9)
def test_encode_pass(self): """Tests Encode Pass option values for VP9 object.""" vp9 = VP9() self._test_encode_pass_normal_values(vp9) self._test_encode_pass_abnormal_values(vp9)
def test_speed(self): """Tests Speed option values of VP9 object.""" vp9 = VP9() self._test_speed_normal_values(vp9) self._test_speed_abnormal_values(vp9)
def test_quality(self): """Test Quality option values of VP9 object.""" vp9 = VP9() self._test_quality_normal_values(vp9) self._test_quality_abnormal_values(vp9)
def test_crf(self): """Tests CRF option values of VP9 object.""" vp9 = VP9() self._test_crf_normal_values(vp9) self._test_crf_abnormal_values(vp9)
def test_minrate(self): """Tests Minrate option values for VP9 object.""" vp9 = VP9() self._test_minrate_normal_values(vp9) self._test_minrate_abnormal_values(vp9)
def test_bitrate(self): """Tests Bitrate option values of VP9 object.""" vp9 = VP9() self._test_bitrate_normal_values(vp9) self._test_bitrate_abnormal_values(vp9)