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

Preliminary VAAPI support #170

Closed
wants to merge 3 commits into from
Closed

Preliminary VAAPI support #170

wants to merge 3 commits into from

Conversation

AbAb1l
Copy link
Contributor

@AbAb1l AbAb1l commented Jan 24, 2020

No description provided.

cmd/transcoding/transcoding.go Outdated Show resolved Hide resolved
cmd/transcoding/transcoding.go Outdated Show resolved Hide resolved
@@ -267,6 +268,36 @@ static enum AVPixelFormat hw2pixfmt(AVCodecContext *ctx)
return AV_PIX_FMT_NONE;
}

static int set_vaapi_hwframe_ctx(AVCodecContext *ctx, AVBufferRef *hw_device_ctx)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't we reuse get_hw_pixfmt here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No we can't. In case of VAAPI, AVHWFramesContext initialization doesn't occur in time for the filters as compared to CUDA. Hence it needs initialization at earliest as possible.

@@ -312,6 +343,19 @@ fprintf(stderr,"possible format: %s\n", av_get_pix_fmt_name(*p));
return frames->format;
}

static enum AVPixelFormat get_vaapi_format(AVCodecContext *ctx, const enum AVPixelFormat *pix_fmts)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should be able to reuse hw2pixfmt instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No we cannot, signature difference.
required
enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);

where as hw2pixfmt has
static enum AVPixelFormat hw2pixfmt(AVCodecContext *ctx)

ffmpeg/lpms_ffmpeg.c Outdated Show resolved Hide resolved
ffmpeg/lpms_ffmpeg.c Outdated Show resolved Hide resolved
ffmpeg/lpms_ffmpeg.c Outdated Show resolved Hide resolved
ffmpeg/lpms_ffmpeg.c Outdated Show resolved Hide resolved
@AbAb1l AbAb1l requested a review from j0sh February 4, 2020 20:51
@j0sh
Copy link
Collaborator

j0sh commented Apr 10, 2020

Some notes, mostly to myself as I'm testing this:

@j0sh
Copy link
Collaborator

j0sh commented May 20, 2020

Some more info on performance: there was a regression introduced as described in https://trac.ffmpeg.org/ticket/7706 . This probably doesn't account for all the poor performance we see, especially with AMD GPUs, but it explains some of it.

The regression is being worked on in this thread: https://patchwork.ffmpeg.org/project/ffmpeg/patch/[email protected]/

@agowa
Copy link

agowa commented Aug 16, 2021

any update on this one?

@yondonfu
Copy link
Member

any update on this one?

Hey @agowa338! This feature isn't actively being prioritized right now mainly because the last transcoding benchmarking results (maximum # of transcoding sessions while completing transcoding in faster than in real-time) produced using an AMD GPU using the ffmpeg CLI with VAAPI support were quite a bit worse than the results produced using other Nvidia GPUs. If information is shared indicating that better transcoding benchmarking results can be achieved using an AMD GPU while using VAAPI this feature could be re-visited.

@agowa
Copy link

agowa commented Aug 17, 2021

Ok, is there any other way to participate with an AMD RX 5700 XT right now?
Esp because of the current (and continuing) price situation with the newest GPUs.
Or am I out of luck?
And kinda related is there a table with the data that you referenced? E.g. one that shows which GPU has more "(average # transcoding sessions / second) / USD"?

@yondonfu
Copy link
Member

@agowa338

I created this forum post which should address your questions. Feel free to continue the conversation there! [1]

[1] Unless you have any technical points you want to raise in this PR of course.

@thomshutt
Copy link
Contributor

Closing the PR for now, can revisit in the future if we decide to prioritise supporting this

@thomshutt thomshutt closed this Apr 26, 2022
@hjpotter92 hjpotter92 deleted the fk/vaapi_support branch June 1, 2023 07:06
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.

5 participants