Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"author": "Josh.5",
"author": "DeRoelO",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not taking ownership as the maintainer of the official plugin. You are still more than welcome to fork and maintain your own version and change the author this info.json file there, but I would recommend keeping the original author cited in it also.

"compatibility": [
2
],
Expand Down
13 changes: 6 additions & 7 deletions lib/encoders/qsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
plugins.qsv.py

Written by: Josh.5 <jsunnex@gmail.com>
Written by: DeRoelO (Based on Josh.5)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure you are the author of this file 🤔. I thought I was?

Date: 08 Jun 2022, (8:14 AM)

Copyright:
Expand Down Expand Up @@ -254,9 +254,8 @@ def generate_filtergraphs(self, current_filter_args, smart_filters, encoder_name
end_filter_args.append(",".join(end_chain))
else:
# Pure HW path - frames stay in QSV memory
chain = [f"format={target_fmt}|qsv",
"hwupload=extra_hw_frames=64",
"format=qsv", f"vpp_qsv=format={target_fmt}"]
# We skip hwupload as it would attempt to upload hardware frames as software frames, causing corruption.
chain = ["format=qsv", f"vpp_qsv=format={target_fmt}"]
end_filter_args.append(",".join(chain))

# Add the smart filters to the end
Expand Down Expand Up @@ -318,7 +317,7 @@ def stream_args(self, stream_info, stream_id, encoder_name, filter_state=None):
# Use default LA_ICQ mode
encoder_args += [
'-global_quality', str(defaults.get('qsv_constant_quality_scale')),
'-look_ahead_depth', '100', '-extbrc', '1',
'-look_ahead_depth', '40', '-extbrc', '1',
]
if encoder_name in ["h264_qsv"]:
encoder_args += ['-look_ahead', '1']
Expand Down Expand Up @@ -352,7 +351,7 @@ def stream_args(self, stream_info, stream_id, encoder_name, filter_state=None):
# They enable lookahead via "-look_ahead_depth <N>" and "-extbrc 1" instead.
if encoder_name in ["h264_qsv"]:
encoder_args += ['-look_ahead', '1']
encoder_args += ['-look_ahead_depth', '100', '-extbrc', '1']
encoder_args += ['-look_ahead_depth', '40', '-extbrc', '1']
else:
# Configure the QSV encoder with a bitrate-based mode
# Set the max and average bitrate (used by all bitrate-based modes)
Expand All @@ -361,7 +360,7 @@ def stream_args(self, stream_info, stream_id, encoder_name, filter_state=None):
# Add lookahead
if encoder_name in ["h264_qsv"]:
encoder_args += ['-look_ahead', '1']
encoder_args += ['-look_ahead_depth', '100', '-extbrc', '1']
encoder_args += ['-look_ahead_depth', '40', '-extbrc', '1']
elif self.settings.get_setting('qsv_encoder_ratecontrol_method') == 'CBR':
# Add 'maxrate' with the same value to make CBR mode
encoder_args += ['-maxrate', f"{self.settings.get_setting('qsv_average_bitrate')}M"]
Expand Down
5 changes: 3 additions & 2 deletions lib/encoders/vaapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""
plugins.vaapi.py

Written by: Josh.5 <jsunnex@gmail.com>
Written by: DeRoelO (Based on Josh.5)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not the author of this file.

Date: 08 Jun 2022, (8:15 AM)

Copyright:
Expand Down Expand Up @@ -219,7 +219,8 @@ def generate_filtergraphs(self, current_filter_args, smart_filters, encoder_name
end_filter_args.append(",".join(end_chain))
else:
# Pure HW path - frames stay in VAAPI memory
chain = [f"format={target_fmt}|vaapi", "hwupload"]
# We skip hwupload as it would attempt to upload hardware frames as software frames.
chain = ["format=vaapi"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change drops the target pixel-format handling from the pure hardware path. I don't think it is correct to drop the target_fmt constraint entirely. From what I know, doing this means that 10-bit/HDR-oriented paths that depend on p010le vs nv12 can stop being enforced.

end_filter_args.append(",".join(chain))

# Add the smart filters to the end
Expand Down
2 changes: 1 addition & 1 deletion plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
plugins.plugin.py

Written by: Josh.5 <jsunnex@gmail.com>
Written by: DeRoelO (Based on Josh.5)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not the author of this file.

Date: 4 June 2022, (6:08 PM)

Copyright:
Expand Down