Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
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