@@ -668,23 +668,23 @@ def convert_to_bytes(self, BitRateString):
668
668
raw_number = locale .atof (raw_number_string )
669
669
670
670
if "kb" in raw_measurement :
671
- measurement = "kb"
671
+ # Kbit to bytes
672
672
bit_rate_bytes = raw_number * 1000.0
673
673
674
674
elif "mb" in raw_measurement :
675
- measurement = "mb"
675
+ # Mbit to bytes
676
676
bit_rate_bytes = raw_number * 1000.0 * 1000.0
677
677
678
- elif "crf" in raw_measurement :
679
- measurement = "crf"
678
+ elif ( "crf" in raw_measurement ) or ( "cqp" in raw_measurement ) :
679
+ # Just a number
680
680
if raw_number > 63 :
681
681
raw_number = 63
682
682
if raw_number < 0 :
683
683
raw_number = 0
684
684
bit_rate_bytes = raw_number
685
685
686
686
elif "qp" in raw_measurement :
687
- measurement = "qp"
687
+ # Just a number
688
688
if raw_number > 255 :
689
689
raw_number = 255
690
690
if raw_number < 0 :
@@ -886,11 +886,12 @@ def accept(self):
886
886
else :
887
887
# Muxing options for mp4/mov
888
888
w .SetOption (openshot .VIDEO_STREAM , "muxing_preset" , "mp4_faststart" )
889
- # Set the quality in case crf was selected
889
+ # Set the quality in case crf, cqp or qp was selected
890
890
if "crf" in self .txtVideoBitRate .text ():
891
891
w .SetOption (openshot .VIDEO_STREAM , "crf" , str (int (video_settings .get ("video_bitrate" ))) )
892
- # Set the quality in case qp was selected
893
- if "qp" in self .txtVideoBitRate .text ():
892
+ elif "cqp" in self .txtVideoBitRate .text ():
893
+ w .SetOption (openshot .VIDEO_STREAM , "cqp" , str (int (video_settings .get ("video_bitrate" ))) )
894
+ elif "qp" in self .txtVideoBitRate .text ():
894
895
w .SetOption (openshot .VIDEO_STREAM , "qp" , str (int (video_settings .get ("video_bitrate" ))) )
895
896
896
897
0 commit comments