作者: | 来源:互联网 | 2023-09-10 21:44
IhavebeenusedffmpegtodecodeeverysingleframethatIreceivedfrommyipcam.Thebriefcode
I have been used ffmpeg to decode every single frame that I received from my ip cam. The brief code looks like this:
我已经使用ffmpeg解码我从我的ip cam收到的每一个帧。简短的代码如下:
-(void) decodeFrame:(unsigned char *)frameData frameSize:(int)frameSize{
AVFrame frame;
AVPicture picture;
AVPacket pkt;
AVCodecContext *context;
pkt.data = frameData;
pat.size = frameSize;
avcodec_get_frame_defaults(&frame);
avpicture_alloc(&picture, PIX_FMT_RGB24, targetWidth, targetHeight);
avcodec_decode_video2(&context, &frame, &got_picture, &pkt);
}
The code woks fine, but it's software decoding. I want to enhance the decoding performance by hardware decoding. After lots of research, I know it may be achieved by AVFoundation framework. The AVAssetReader class may help, but I can't figure out what's the next.Could anyone points out the following steps for me? Any help would be appreciated.
代码运行良好,但它是软件解码。我想通过硬件解码来提高解码性能。经过大量的研究,我知道这可以通过AVFoundation框架来实现。AVAssetReader类可能会有帮助,但是我不知道下一个是什么。谁能给我指出以下步骤吗?如有任何帮助,我们将不胜感激。
2 个解决方案