问题描述
平台:Windows
应用程序:WinForm应用程序
语言:C#
解码器:ffmpeg
嗨
我们正在使用ffmpeg来解码通过网络发送给我们的帧。该程序是用C#编写的,并使用FFmpegInvoke以及avcodec-56.dll和avutil-54.dll等所需的DLL来解码帧。为此,我们需要使用GPU而不是CPU。现在使用CPU并且解码完成没有任何问题。
我的问题是如何告诉ffmpeg使用GPU而不是CPU进行解码?
是否有任何示例代码为此目的?
谢谢
我尝试过:
我认为这个问题并没有发现任何线索。
platform: Windows
application: WinForm application
language: C#
decoder: ffmpeg
Hi
We're using ffmpeg to decode frames sent via network to us. The program is written in C# and uses FFmpegInvoke as well as the required DLL's like avcodec-56.dll and avutil-54.dll for decoding the frames. We need to use GPU instead of CPU for this purpose. Now CPU is used and decoding is done without any problem.
My question is that how can I tell ffmpeg use GPU instead of CPU for decoding?
Is there any sample code for this purpose?
Thanks
What I have tried:
I googlized this problem and found no clue.
推荐答案
// C/C++ example to use the DXVA2 decoder
AVCodec* decoder = avcodec_find_decoder_by_name ("h264_dxva2");
avcodec_open2 (decoder_ctx, decoder, NULL);
这篇关于970530 - 如何在ffmpeg中通过GPU解码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!