Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Detect hardware accelerated codec and use the correct scale filter #1121

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TheoLeCalvar
Copy link

@TheoLeCalvar TheoLeCalvar commented Apr 3, 2021

Hardware accelerated codec use specific scale filters thus size() does not generate working video filters.

This PR detects some hardware accelerated video codecs and uses the correct scale filter.

Closes #1120

@@ -6,17 +6,35 @@
*/


function getScaleFilter(output) {
if (output.video.get('-vcodec').length > 1) {
let codec = output.video.get('-vcodec')[1];
Copy link

Choose a reason for hiding this comment

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

Such condition would not work in case of the video codec option is not the first one in the list.

The following approach works correct:

if (!!output.video.find('-vcodec', 1)) {
    let codec = output.video.find('-vcodec', 1)[0];

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter generated by size() do not work with h264_vaapi codec
2 participants