Пример #1
0
    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
Пример #2
0
    def get_settings(self, ffmpeg):
        """
        Applies settings from the nvenc widgets to ffmpeg settings.
        """
        if self._is_h264_state:
            video_settings = H264Nvenc()
        else:
            video_settings = HevcNvenc()

        video_settings.preset = self.nvenc_preset_combobox.get_active()
        video_settings.profile = self.nvenc_profile_combobox.get_active()
        video_settings.level = self.nvenc_level_combobox.get_active()
        video_settings.tune = self.nvenc_tune_combobox.get_active()
        self._apply_rate_control_settings(video_settings)
        self._apply_advanced_settings(video_settings)

        ffmpeg.video_settings = video_settings
Пример #3
0
 def test_tune(self):
     """Tests Tune option values for the H264 and HEVC NVENC object files."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_tune_normal_values(h264_nvenc, hevc_nvenc)
     self._test_tune_abnormal_values(h264_nvenc, hevc_nvenc)
Пример #4
0
 def test_rc(self):
     """Tests the RC option values for the H264 and HEVC NVENC codecs."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_rc_normal_values(h264_nvenc, hevc_nvenc)
     self._test_rc_abnormal_values(h264_nvenc, hevc_nvenc)
Пример #5
0
 def test_instantiation(self):
     """Tests the initial values of H264 and HEVC NVENC objects."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self.assertEqual(h264_nvenc.codec_name, 'h264_nvenc')
     self.assertEqual(hevc_nvenc.codec_name, 'hevc_nvenc')
     self.assertFalse(h264_nvenc.advanced_enabled)
     self.assertFalse(hevc_nvenc.advanced_enabled)
     self.assertFalse(h264_nvenc.qp_custom_enabled)
     self.assertFalse(hevc_nvenc.qp_custom_enabled)
     self.assertFalse(h264_nvenc.dual_pass_enabled)
     self.assertFalse(hevc_nvenc.dual_pass_enabled)
     self.assertEqual(h264_nvenc.qp, 20.0)
     self.assertEqual(hevc_nvenc.qp, 20.0)
     self.assertIsNone(h264_nvenc.bitrate)
     self.assertIsNone(hevc_nvenc.bitrate)
     self.assertEqual(h264_nvenc.profile, 0)
     self.assertEqual(hevc_nvenc.profile, 0)
     self.assertEqual(h264_nvenc.preset, 0)
     self.assertEqual(hevc_nvenc.preset, 0)
     self.assertEqual(h264_nvenc.level, 0)
     self.assertEqual(hevc_nvenc.level, 0)
     self.assertEqual(h264_nvenc.tune, 0)
     self.assertEqual(hevc_nvenc.tune, 0)
     self.assertEqual(h264_nvenc.multi_pass, 0)
     self.assertEqual(hevc_nvenc.multi_pass, 0)
     self.assertFalse(h264_nvenc.cbr)
     self.assertFalse(hevc_nvenc.cbr)
     self.assertEqual(h264_nvenc.qp_i, 20.0)
     self.assertEqual(hevc_nvenc.qp_i, 20.0)
     self.assertEqual(h264_nvenc.qp_p, 20.0)
     self.assertEqual(hevc_nvenc.qp_p, 20.0)
     self.assertEqual(h264_nvenc.qp_b, 20.0)
     self.assertEqual(hevc_nvenc.qp_b, 20.0)
     self.assertEqual(h264_nvenc.rc, 0)
     self.assertEqual(hevc_nvenc.rc, 0)
     self.assertEqual(h264_nvenc.rc_lookahead, 0)
     self.assertEqual(hevc_nvenc.rc_lookahead, 0)
     self.assertEqual(h264_nvenc.surfaces, 8)
     self.assertEqual(hevc_nvenc.surfaces, 8)
     self.assertFalse(h264_nvenc.no_scenecut)
     self.assertFalse(hevc_nvenc.no_scenecut)
     self.assertFalse(h264_nvenc.forced_idr)
     self.assertFalse(hevc_nvenc.forced_idr)
     self.assertFalse(h264_nvenc.b_adapt)
     self.assertFalse(h264_nvenc.spatial_aq)
     self.assertFalse(hevc_nvenc.spatial_aq)
     self.assertFalse(h264_nvenc.temporal_aq)
     self.assertFalse(hevc_nvenc.temporal_aq)
     self.assertFalse(h264_nvenc.non_ref_p)
     self.assertFalse(hevc_nvenc.non_ref_p)
     self.assertFalse(h264_nvenc.strict_gop)
     self.assertFalse(hevc_nvenc.strict_gop)
     self.assertEqual(h264_nvenc.aq_strength, 8)
     self.assertEqual(hevc_nvenc.aq_strength, 8)
     self.assertFalse(h264_nvenc.bluray_compat)
     self.assertFalse(hevc_nvenc.bluray_compat)
     self.assertFalse(h264_nvenc.weighted_pred)
     self.assertFalse(hevc_nvenc.weighted_pred)
     self.assertEqual(h264_nvenc.coder, 0)
     self.assertEqual(h264_nvenc.b_ref_mode, 0)
     self.assertEqual(hevc_nvenc.b_ref_mode, 0)
     self.assertFalse(hevc_nvenc.tier)
     self.assertIsNone(h264_nvenc.encode_pass)
     self.assertIsNone(hevc_nvenc.encode_pass)
     self.assertIsNone(h264_nvenc.get_ffmpeg_advanced_args()[None])
     self.assertIsNone(hevc_nvenc.get_ffmpeg_advanced_args()[None])
Пример #6
0
 def test_aq_strength(self):
     """Tests the AQ Strength option values for the H264 and HEVC NVENC codecs."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_aq_strength_normal_values(h264_nvenc, hevc_nvenc)
     self._test_aq_strength_abnormal_values(h264_nvenc, hevc_nvenc)
 def test_forced_idr(self):
     """Tests the Forced IDR option values for the H264 and HEVC NVENC codecs."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_forced_idr_normal_values(h264_nvenc, hevc_nvenc)
     self._test_forced_idr_abnormal_values(h264_nvenc, hevc_nvenc)
Пример #8
0
 def test_strict_gop(self):
     """Tests the Strict GOP option values for the H264 and HEVC NVENC codecs."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_strict_gop_normal_values(h264_nvenc, hevc_nvenc)
     self._test_strict_gop_abnormal_values(h264_nvenc, hevc_nvenc)
 def test_spatial_aq(self):
     """Tests the Spatial AQ option values for the H264 and HEVC NVENC codecs."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_spatial_aq_normal_values(h264_nvenc, hevc_nvenc)
     self._test_spatial_aq_abnormal_values(h264_nvenc, hevc_nvenc)
Пример #10
0
 def test_preset(self):
     """Tests Preset option values for the H264 and HEVC NVENC object files."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_preset_normal_values(h264_nvenc, hevc_nvenc)
     self._test_preset_abnormal_values(h264_nvenc, hevc_nvenc)
Пример #11
0
 def test_bitrate(self):
     """Tests Bitrate option values for H264 and HEVC NVENC objects."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_bitrate_normal_values(h264_nvenc, hevc_nvenc)
     self._test_bitrate_abnormal_values(h264_nvenc, hevc_nvenc)
 def test_weighted_pred(self):
     """Tests the Weighted Prediction option values for the H264 and HEVC NVENC codecs."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_weighted_pred_normal_values(h264_nvenc, hevc_nvenc)
     self._test_weighted_pred_abnormal_values(h264_nvenc, hevc_nvenc)
 def test_multi_pass(self):
     """Tests Multi-Pass option values for the H264 and HEVC NVENC codecs."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_multi_pass_normal_values(h264_nvenc, hevc_nvenc)
     self._test_multi_pass_abnormal_values(h264_nvenc, hevc_nvenc)
Пример #14
0
 def test_something(self):
     """Tests the Surfaces option values for the H264 and HEVC NVENC codecs."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_surfaces_normal_values(h264_nvenc, hevc_nvenc)
     self._test_surfaces_abnormal_values(h264_nvenc, hevc_nvenc)
Пример #15
0
 def test_bluray_compat(self):
     """Tests the Blu-Ray Compatibility option values for the H264 and HEVC NVENC codecs."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_bluray_compat_normal_values(h264_nvenc, hevc_nvenc)
     self._test_bluray_compat_abnormal_values(h264_nvenc, hevc_nvenc)
Пример #16
0
 def test_qp(self):
     """Test QP values option for H264 and HEVC NVENC objects."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_qp_normal_values(h264_nvenc, hevc_nvenc)
     self._test_qp_abnormal_values(h264_nvenc, hevc_nvenc)
 def test_b_ref_mode(self):
     """Tests B-Ref Mode option values for the H264 and HEVC NVENC object files."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_b_ref_mode_normal_values(h264_nvenc, hevc_nvenc)
     self._test_b_ref_mode_abnormal_values(h264_nvenc, hevc_nvenc)
 def test_rc_lookahead(self):
     """Tests RC Lookahead option values for the H264 and HEVC NVENC codecs."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_rc_lookahead_normal_values(h264_nvenc, hevc_nvenc)
     self._test_rc_lookahead_abnormal_values(h264_nvenc, hevc_nvenc)
 def test_non_ref_p(self):
     """Tests the Non Ref P option values for the H264 and HEVC NVENC codecs."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_non_ref_p_normal_values(h264_nvenc, hevc_nvenc)
     self._test_non_ref_p_abnormal_values(h264_nvenc, hevc_nvenc)
Пример #20
0
 def test_b_adapt(self):
     """Tests the B-Adapt option values for the H264 NVENC codec."""
     h264_nvenc = H264Nvenc()
     self._test_b_adapt_normal_values(h264_nvenc)
     self._test_b_adapt_abnormal_values(h264_nvenc)
 def test_something(self):
     """Tests the No Scenecut option values for the H264 and HEVC NVENC codecs."""
     h264_nvenc = H264Nvenc()
     hevc_nvenc = HevcNvenc()
     self._test_no_scenecut_normal_values(h264_nvenc, hevc_nvenc)
     self._test_no_scenecut_abnormal_values(h264_nvenc, hevc_nvenc)
Пример #22
0
 def test_coder(self):
     """Tests the Coder option values for the H264 NVENC codec."""
     h264_nvenc = H264Nvenc()
     self._test_coder_normal_values(h264_nvenc)
     self._test_coder_abnormal_values(h264_nvenc)