Skip to content

Commit

Permalink
* Adding #422 Add ICQ and LA-ICQ for rigayas QSV (thanks to @Bender1984)
Browse files Browse the repository at this point in the history
* Fixing QSV AV1 setting panel issues
  • Loading branch information
cdgriffith committed Mar 5, 2023
1 parent c956a44 commit 253ade0
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
* Adding #367 safer font defaults (thanks to Archer Allstars)
* Adding #242 and #400 resolution saves to the profile (thanks to x9sim9)
* Adding #409 Copy video track title information from input file (thanks to Don Gafford)
* Adding #422 Add ICQ and LA-ICQ for rigayas QSV (thanks to @bender1984)
* Fixing #398 audio and subtitles disabled when editing queue item (thanks to philblue1 and Don Gafford)
* Fixing #350 Unable to burn in subtitles (thanks to Maddie Davis)
* Fixing QSV AV1 setting panel issues

## Version 5.1.0

Expand Down
2 changes: 1 addition & 1 deletion fastflix/encoders/qsvencc_av1/command_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def build(fastflix: FastFlix):
("--chapter-copy" if video.video_settings.copy_chapters else ""),
"-c",
"av1",
(f"--vbr {settings.bitrate.rstrip('k')}" if settings.bitrate else f"--cqp {settings.cqp}"),
(f"--vbr {settings.bitrate.rstrip('k')}" if settings.bitrate else f"--{settings.qp_mode} {settings.cqp}"),
vbv,
(f"--qp-min {min_q}" if min_q and settings.bitrate else ""),
(f"--qp-max {max_q}" if max_q and settings.bitrate else ""),
Expand Down
2 changes: 1 addition & 1 deletion fastflix/encoders/qsvencc_av1/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@
]

from fastflix.encoders.qsvencc_av1.command_builder import build
from fastflix.encoders.qsvencc_av1.settings_panel import QSVEnc as settings_panel
from fastflix.encoders.qsvencc_av1.settings_panel import QSVAV1Enc as settings_panel
21 changes: 16 additions & 5 deletions fastflix/encoders/qsvencc_av1/settings_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def get_breaker():
return breaker_line


class QSVEnc(SettingPanel):
profile_name = "qsvencc_hevc"
class QSVAV1Enc(SettingPanel):
profile_name = "qsvencc_av1"
hdr10plus_signal = QtCore.Signal(str)
hdr10plus_ffmpeg_signal = QtCore.Signal(str)

Expand All @@ -86,8 +86,8 @@ def __init__(self, parent, main, app: FastFlixApp):
grid.addLayout(self._add_custom(title="Custom QSVEncC options", disable_both_passes=True), 10, 0, 1, 6)

grid.addLayout(self.init_preset(), 0, 0, 1, 2)
# grid.addLayout(self.init_profile(), 1, 0, 1, 2)
grid.addLayout(self.init_lookahead(), 1, 0, 1, 2)
grid.addLayout(self.init_qp_mode(), 2, 0, 1, 2)

breaker = QtWidgets.QHBoxLayout()
breaker_label = QtWidgets.QLabel(t("Advanced"))
Expand Down Expand Up @@ -166,6 +166,16 @@ def init_tune(self):
opt="tune",
)

def init_qp_mode(self):
return self._add_combo_box(
label="QP Mode",
widget_name="qp_mode",
tooltip="Constant Quality, Intelligent Constant Quality, Intelligent + Lookahead Constant Quality",
options=["cqp", "icq", "la-icq"],
opt="qp_mode",
default="cqp",
)

# def init_profile(self):
# # TODO auto
# return self._add_combo_box(
Expand Down Expand Up @@ -336,6 +346,7 @@ def update_video_encoder_settings(self):
level=self.widgets.level.currentText() if self.widgets.level.currentIndex() != 0 else None,
b_frames=self.widgets.b_frames.currentText() if self.widgets.b_frames.currentIndex() != 0 else None,
ref=self.widgets.ref.currentText() if self.widgets.ref.currentIndex() != 0 else None,
qp_mode=self.widgets.qp_mode.currentText(),
)

encode_type, q_value = self.get_mode_settings()
Expand All @@ -345,10 +356,10 @@ def update_video_encoder_settings(self):

def set_mode(self, x):
self.mode = x.text()
for group in ("init", "max", "min"):
for group in ("max", "min"):
for frame_type in ("i", "p", "b"):
self.widgets[f"{group}_q_{frame_type}"].setEnabled(self.mode.lower() == "bitrate")
self.widgets.vbr_target.setEnabled(self.mode.lower() == "bitrate")
# self.widgets.vbr_target.setEnabled(self.mode.lower() == "bitrate")
self.main.build_commands()

def new_source(self):
Expand Down
2 changes: 1 addition & 1 deletion fastflix/encoders/qsvencc_avc/command_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def build(fastflix: FastFlix):
("--chapter-copy" if video.video_settings.copy_chapters else ""),
"-c",
"h264",
(f"--vbr {settings.bitrate.rstrip('k')}" if settings.bitrate else f"--cqp {settings.cqp}"),
(f"--vbr {settings.bitrate.rstrip('k')}" if settings.bitrate else f"--{settings.qp_mode} {settings.cqp}"),
vbv,
(f"--qp-min {min_q}" if min_q and settings.bitrate else ""),
(f"--qp-max {max_q}" if max_q and settings.bitrate else ""),
Expand Down
15 changes: 13 additions & 2 deletions fastflix/encoders/qsvencc_avc/settings_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def __init__(self, parent, main, app: FastFlixApp):
grid.addLayout(self.init_preset(), 0, 0, 1, 2)
grid.addLayout(self.init_profile(), 1, 0, 1, 2)
grid.addLayout(self.init_lookahead(), 2, 0, 1, 2)
grid.addLayout(self.init_qp_mode(), 3, 0, 1, 2)

breaker = QtWidgets.QHBoxLayout()
breaker_label = QtWidgets.QLabel(t("Advanced"))
Expand Down Expand Up @@ -160,6 +161,16 @@ def init_tune(self):
opt="tune",
)

def init_qp_mode(self):
return self._add_combo_box(
label="QP Mode",
widget_name="qp_mode",
tooltip="Constant Quality, Intelligent Constant Quality, Intelligent + Lookahead Constant Quality",
options=["cqp", "icq", "la-icq"],
opt="qp_mode",
default="cqp",
)

def init_profile(self):
return self._add_combo_box(
label="Profile_encoderopt",
Expand Down Expand Up @@ -321,10 +332,10 @@ def update_video_encoder_settings(self):

def set_mode(self, x):
self.mode = x.text()
for group in ("init", "max", "min"):
for group in ("max", "min"):
for frame_type in ("i", "p", "b"):
self.widgets[f"{group}_q_{frame_type}"].setEnabled(self.mode.lower() == "bitrate")
self.widgets.vbr_target.setEnabled(self.mode.lower() == "bitrate")
# self.widgets.vbr_target.setEnabled(self.mode.lower() == "bitrate")
self.main.build_commands()

def new_source(self):
Expand Down
2 changes: 1 addition & 1 deletion fastflix/encoders/qsvencc_hevc/command_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def build(fastflix: FastFlix):
("--chapter-copy" if video.video_settings.copy_chapters else ""),
"-c",
"hevc",
(f"--vbr {settings.bitrate.rstrip('k')}" if settings.bitrate else f"--cqp {settings.cqp}"),
(f"--vbr {settings.bitrate.rstrip('k')}" if settings.bitrate else f"--{settings.qp_mode} {settings.cqp}"),
vbv,
(f"--qp-min {min_q}" if min_q and settings.bitrate else ""),
(f"--qp-max {max_q}" if max_q and settings.bitrate else ""),
Expand Down
16 changes: 13 additions & 3 deletions fastflix/encoders/qsvencc_hevc/settings_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(self, parent, main, app: FastFlixApp):
grid.addLayout(self._add_custom(title="Custom QSVEncC options", disable_both_passes=True), 10, 0, 1, 6)

grid.addLayout(self.init_preset(), 0, 0, 1, 2)
# grid.addLayout(self.init_profile(), 1, 0, 1, 2)
grid.addLayout(self.init_qp_mode(), 2, 0, 1, 2)
grid.addLayout(self.init_lookahead(), 1, 0, 1, 2)

breaker = QtWidgets.QHBoxLayout()
Expand Down Expand Up @@ -185,6 +185,16 @@ def init_lookahead(self):
options=["off"] + [str(x) for x in range(10, 100)],
)

def init_qp_mode(self):
return self._add_combo_box(
label="QP Mode",
widget_name="qp_mode",
tooltip="Constant Quality, Intelligent Constant Quality, Intelligent + Lookahead Constant Quality",
options=["cqp", "icq", "la-icq"],
opt="qp_mode",
default="cqp",
)

def init_level(self):
layout = self._add_combo_box(
label="Level",
Expand Down Expand Up @@ -345,10 +355,10 @@ def update_video_encoder_settings(self):

def set_mode(self, x):
self.mode = x.text()
for group in ("init", "max", "min"):
for group in ("max", "min"):
for frame_type in ("i", "p", "b"):
self.widgets[f"{group}_q_{frame_type}"].setEnabled(self.mode.lower() == "bitrate")
self.widgets.vbr_target.setEnabled(self.mode.lower() == "bitrate")
# self.widgets.vbr_target.setEnabled(self.mode.lower() == "bitrate")
self.main.build_commands()

def new_source(self):
Expand Down
3 changes: 3 additions & 0 deletions fastflix/models/encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ class QSVEncCSettings(EncoderSettings):
ref: Optional[str] = None
metrics: bool = False
force_ten_bit: bool = False
qp_mode: str = "cqp"


class QSVEncCAV1Settings(EncoderSettings):
Expand All @@ -211,6 +212,7 @@ class QSVEncCAV1Settings(EncoderSettings):
ref: Optional[str] = None
metrics: bool = False
force_ten_bit: bool = False
qp_mode: str = "cqp"


class QSVEncCH264Settings(EncoderSettings):
Expand All @@ -231,6 +233,7 @@ class QSVEncCH264Settings(EncoderSettings):
ref: Optional[str] = None
metrics: bool = False
force_ten_bit: bool = False
qp_mode: str = "cqp"


class NVEncCAVCSettings(EncoderSettings):
Expand Down
2 changes: 1 addition & 1 deletion fastflix/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = "5.2.0b3"
__version__ = "5.2.0b4"
__author__ = "Chris Griffith"

0 comments on commit 253ade0

Please sign in to comment.