Beispiel #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
Beispiel #2
0
    def apply_settings(self, ffmpeg):
        """
        Applies settings from the x264 widgets to ffmpeg settings.
        """
        video_settings = X264()
        video_settings.preset = self.x264_preset_combobox.get_active()
        video_settings.profile = self.x264_profile_combobox.get_active()
        video_settings.level = self.x264_level_combobox.get_active()
        video_settings.tune = self.x264_tune_combobox.get_active()
        self._apply_rate_control_settings(video_settings)
        self._apply_advanced_settings(video_settings)

        ffmpeg.video_settings = video_settings
Beispiel #3
0
 def test_instantiation(self):
     """Tests the initial values of the X264 codec."""
     x264 = X264()
     self.assertEqual(x264.codec_name, 'libx264')
     self.assertEqual(x264.crf, 20.0)
     self.assertIsNone(x264.qp)
     self.assertIsNone(x264.bitrate)
     self.assertEqual(x264.profile, 0)
     self.assertEqual(x264.preset, 0)
     self.assertEqual(x264.level, 0)
     self.assertEqual(x264.tune, 0)
     self.assertFalse(x264.advanced_enabled)
     self.assertEqual(x264.keyint, 250)
     self.assertEqual(x264.min_keyint, 25)
     self.assertIsNone(x264.scenecut)
     self.assertEqual(x264.bframes, 3)
     self.assertEqual(x264.b_adapt, 0)
     self.assertEqual(x264.b_pyramid, 0)
     self.assertFalse(x264.no_cabac)
     self.assertEqual(x264.ref, 3)
     self.assertFalse(x264.no_deblock)
     self.assertTupleEqual(x264.deblock, (0, 0))
     self.assertEqual(x264.vbv_maxrate, 2500)
     self.assertEqual(x264.vbv_bufsize, 2500)
     self.assertEqual(x264.aq_mode, 0)
     self.assertEqual(x264.aq_strength, 1.0)
     self.assertIsNone(x264.encode_pass)
     self.assertIsNone(x264.stats)
     self.assertIsNone(x264.partitions)
     self.assertEqual(x264.direct, 0)
     self.assertFalse(x264.weightb)
     self.assertEqual(x264.me, 0)
     self.assertEqual(x264.me_range, 16)
     self.assertEqual(x264.subme, 0)
     self.assertTupleEqual(x264.psy_rd, (1.0, 0.0))
     self.assertFalse(x264.mixed_refs)
     self.assertFalse(x264.dct8x8)
     self.assertEqual(x264.trellis, 0)
     self.assertFalse(x264.no_fast_pskip)
     self.assertFalse(x264.no_dct_decimate)
     self.assertFalse(x264.constant_bitrate)
     self.assertEqual(x264.weightp, 0)
     self.assertIsNone(x264.get_ffmpeg_advanced_args()['-x264-params'])
Beispiel #4
0
 def test_something(self):
     """Tests the Mixed Refs option values for the x264 codec."""
     x264 = X264()
     self._test_mixed_refs_normal_values(x264)
     self._test_mixed_refs_abnormal_values(x264)
Beispiel #5
0
 def test_vbv_maxrate(self):
     """Tests the VBV Bufsize option values for the x264 codec."""
     x264 = X264()
     self._test_vbv_bufsize_normal_values(x264)
     self._test_vbv_bufsize_abnormal_values(x264)
 def test_bitrate(self):
     """Tests the Bitrate option values for the x264 codec."""
     x264 = X264()
     self._test_bitrate_normal_values(x264)
     self._test_bitrate_abnormal_values(x264)
Beispiel #7
0
 def test_level(self):
     """Tests the Level option values for the x264 codec."""
     x264 = X264()
     self._test_level_normal_values(x264)
     self._test_level_abnormal_values(x264)
 def test_no_deblock(self):
     """Tests the No Deblock option values for the x264 codec."""
     x264 = X264()
     self._test_no_deblock_normal_values(x264)
     self._test_no_deblock_abnormal_values(x264)
 def test_psy_rd(self):
     """Tests the PsyRD option values for the x264 codec."""
     x264 = X264()
     self._test_psy_rd_normal_values(x264)
     self._test_psy_rd_abnormal_values(x264)
Beispiel #10
0
 def test_tune(self):
     """Tests the Tune option values for the x264 codec."""
     x264 = X264()
     self._test_tune_normal_values(x264)
     self._test_tune_abnormal_values(x264)
Beispiel #11
0
 def test_me(self):
     """Tests the Motion Estimation option values for the x264 codec."""
     x264 = X264()
     self._test_me_normal_values(x264)
     self._test_me_abnormal_values(x264)
 def test_b_adapt(self):
     """Tests the B-Adapt option values for the x264 codec."""
     x264 = X264()
     self._test_b_adapt_normal_values(x264)
     self._test_b_adapt_abnormal_values(x264)
Beispiel #13
0
 def test_aq_mode(self):
     """Tests the AQ-Mode option values for the x264 codec."""
     x264 = X264()
     self._test_aq_mode_normal_values(x264)
     self._test_aq_mode_abnormal_values(x264)
 def test_ref(self):
     """Tests the Reference Frames option values for the x264 codec."""
     x264 = X264()
     self._test_ref_normal_values(x264)
     self._test_ref_abnormal_values(x264)
 def test_x264_dct8x8(self):
     """Tests the DCT8x8 option values for the x264 codec."""
     x264 = X264()
     self._test_dct8x8_normal_values(x264)
     self._test_dct8x8_abnormal_values(x264)
Beispiel #16
0
 def test_partitions(self):
     """Tests the Partitions option values for the x264 codec."""
     x264 = X264()
     self._test_partitions_normal_values(x264)
     self._test_partitions_abnormal_values(x264)
Beispiel #17
0
 def test_x264_no_dct_decimate(self):
     """Tests the No DCT Decimate option values for the x264 codec."""
     x264 = X264()
     self._test_no_dct_decimate_normal_values(x264)
     self._test_no_dct_decimate_abnormal_values(x264)
Beispiel #18
0
 def test_qp(self):
     """Tests the QP option values for the x264 codec."""
     x264 = X264()
     self._test_qp_normal_values(x264)
     self._test_qp_abnormal_values(x264)
Beispiel #19
0
 def test_encode_pass(self):
     """Tests the Encode Pass option values for the x264 codec."""
     x264 = X264()
     self._test_encode_pass_normal_values(x264)
     self._test_encode_pass_abnormal_values(x264)
 def test_bframes(self):
     """Tests the B-Frames option values for the x264 codec."""
     x264 = X264()
     self._test_bframes_normal_values(x264)
     self._test_bframes_abnormal_values(x264)
Beispiel #21
0
 def test_aq_strength(self):
     """Tests the AQ-Strength option values for the x264 codec."""
     x264 = X264()
     self._test_aq_strength_normal_values(x264)
     self._test_aq_strength_abnormal_values(x264)
Beispiel #22
0
 def test_keyint(self):
     """Tests the Keyint option values for the x264 codec."""
     x264 = X264()
     self._test_keyint_normal_values(x264)
     self._test_keyint_abnormal_values(x264)
 def test_profile(self):
     """Tests the Profile option values for the x264 codec."""
     x264 = X264()
     self._test_profile_normal_values(x264)
     self._test_profile_abnormal_values(x264)
 def test_trellis(self):
     """Tests the Trellis option values for the x264 codec."""
     x264 = X264()
     self._test_trellis_normal_values(x264)
     self._test_trellis_abnormal_values(x264)
Beispiel #25
0
 def test_crf(self):
     """Tests the CRF option values for the x264 codec."""
     x264 = X264()
     self._test_crf_normal_values(x264)
     self._test_crf_abnormal_values(x264)
Beispiel #26
0
 def test_preset(self):
     """Tests the Preset option values for the x264 codec."""
     x264 = X264()
     self._test_preset_normal_values(x264)
     self._test_preset_abnormal_values(x264)
Beispiel #27
0
 def test_x264_no_cabac(self):
     """Tests the No Fast PSkip option values for the x264 codec."""
     x264 = X264()
     self._test_no_fast_pskip_normal_values(x264)
     self._test_no_fast_pskip_abnormal_values(x264)
 def test_weightb(self):
     """Tests the Weight-B option values for the x264 codec."""
     x264 = X264()
     self._test_weightb_normal_values(x264)
     self._test_weightb_abnormal_values(x264)
Beispiel #29
0
 def test_x264_no_cabac(self):
     """Tests the No CABAC option values for the x264 codec."""
     x264 = X264()
     self._test_no_cabac_normal_values(x264)
     self._test_no_cabac_abnormal_values(x264)
Beispiel #30
0
 def test_direct(self):
     """Tests the Direct option values for the x264 codec."""
     x264 = X264()
     self._test_direct_normal_values(x264)
     self._test_direct_abnormal_values(x264)