-
Notifications
You must be signed in to change notification settings - Fork 72
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
Conversation
@@ -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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
…`AV_HWDEVICE_TYPE_VAAPI` and subsequent check would always be false
Some notes, mostly to myself as I'm testing this:
|
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]/ |
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. |
Ok, is there any other way to participate with an AMD RX 5700 XT right now? |
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. |
Closing the PR for now, can revisit in the future if we decide to prioritise supporting this |
No description provided.