这是什么呀 2019-03-05 10:33 采纳率: 0%
浏览 3411
已结题

ffmpeg avcodec_receive_frame 解码效率慢

if (pPacket->stream_index == videoIndex)
{
                Uint32 pretimer = SDL_GetTicks();
                /*
                ret = avcodec_decode_video2(pCodecCtx, pFrame, &got_picture, pPacket);
                if (ret < 0)
                {
                    printf("解帧失败!\n");
                    return -1;
                }
                */
                ret = avcodec_send_packet(pCodecCtx, pPacket);
                if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
                    return -1;

                ret = avcodec_receive_frame(pCodecCtx, pFrame);
                if (ret < 0 && ret != AVERROR_EOF) {
                    //fprintf(stderr, "Could not open audio codec: %s\n", av_err2str(ret));
                    continue;
                }

                Uint32  a = SDL_GetTicks() - pretimer;
                cout << "avcodec_receive_frame" << a << endl;
}

ffmpeg 我是用3.4版本 解码时,使用函数avcodec_send_packet avcodec_receive_frame 获取一帧4K高清视频,30ms左右
使用2.8老版本时 avcodec_decode_video2 获取一帧4K高清视频 10ms左右,请问这种情况如何解决。为什么新版本的解码速度反倒是变慢了。

  • 写回答

1条回答 默认 最新

  • 关注

    是不是你解码器的速度设置不同

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog