Skip to content

Commit b862be4

Browse files
committed
Include new codecs
1 parent e247a9b commit b862be4

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

src/presets/format_mp4_librav1e.xml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<!DOCTYPE openshot-export-option>
3+
<export-option>
4+
<type translatable="True">All Formats</type>
5+
<title translatable="True">MP4 (rav1e)</title>
6+
<videoformat>mp4</videoformat>
7+
<videocodec>librav1e</videocodec>
8+
<audiocodec>libvorbis</audiocodec>
9+
<audiochannels>2</audiochannels>
10+
<audiochannellayout>3</audiochannellayout>
11+
<videobitrate
12+
low="200 qp"
13+
med="100 qp"
14+
high="50 qp"></videobitrate>
15+
<audiobitrate
16+
low="96 kb/s"
17+
med="128 kb/s"
18+
high="192 kb/s"></audiobitrate>
19+
<samplerate>48000</samplerate>
20+
</export-option>

src/presets/format_mp4_libsvtav1.xml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<!DOCTYPE openshot-export-option>
3+
<export-option>
4+
<type translatable="True">All Formats</type>
5+
<title translatable="True">MP4 (SVT-AV1)</title>
6+
<videoformat>mp4</videoformat>
7+
<videocodec>libsvt_av1</videocodec>
8+
<audiocodec>libvorbis</audiocodec>
9+
<audiochannels>2</audiochannels>
10+
<audiochannellayout>3</audiochannellayout>
11+
<videobitrate
12+
low="60 qp"
13+
med="50 qp"
14+
high="30 qp"></videobitrate>
15+
<audiobitrate
16+
low="96 kb/s"
17+
med="128 kb/s"
18+
high="192 kb/s"></audiobitrate>
19+
<samplerate>48000</samplerate>
20+
</export-option>

src/windows/export.py

+12
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,14 @@ def convert_to_bytes(self, BitRateString):
639639
raw_number = 0
640640
bit_rate_bytes = raw_number
641641

642+
elif "qp" in raw_measurement:
643+
measurement = "qp"
644+
if raw_number > 255:
645+
raw_number = 255
646+
if raw_number < 0:
647+
raw_number = 0
648+
bit_rate_bytes = raw_number
649+
642650
except:
643651
pass
644652

@@ -837,6 +845,10 @@ def accept(self):
837845
# Set the quality in case crf was selected
838846
if "crf" in self.txtVideoBitRate.text():
839847
w.SetOption(openshot.VIDEO_STREAM, "crf", str(int(video_settings.get("video_bitrate"))) )
848+
# Set the quality in case qp was selected
849+
if "qp" in self.txtVideoBitRate.text():
850+
w.SetOption(openshot.VIDEO_STREAM, "qp", str(int(video_settings.get("video_bitrate"))) )
851+
840852

841853
# Open the writer
842854
w.Open()

0 commit comments

Comments
 (0)