LMZ_YAO 2017-07-11 01:07 采纳率: 0%
浏览 3996

FFMPEG中调用avformat_open_input报错

调用avformat_open_input报错:Protocol not found。请大神指点一下,谢谢了。


    AVFormatContext *pAudioCtx = NULL;
    AVCodecContext  *pCodecCtx = NULL;
    AVCodec         *pCodec = NULL;
    AVPacket        *packet = NULL;
    uint8_t         *out_buffer;
    AVFrame         *pFrame;

    SDL_AudioSpec   wanted_spec;

    int audioStream;
    int i;
    int ret;
    int getpicture;

    int64_t in_channel_layout;
    struct SwrContext *au_convert_ctx;

    FILE *pFile = fopen("lmzoutput.pcm", "wb");
    char url[] = "16.opus";


    av_register_all();

    avformat_network_init();

    //pAudioCtx = avformat_alloc_context();   //新版本不需要  加了会出错?


    int err_code;
    char buf[1024];
    memset(buf,0x00,sizeof(buf));

    err_code = avformat_open_input(&pAudioCtx, url, NULL, NULL);
    if (err_code != 0)
    {
        av_strerror(err_code, buf, 1024);
        _TRACE("Couldn't open file %s: %d(%s)", url, err_code, buf);
        _TRACE("Couldn't open input stream.\n");
        return 0;
    }
  • 写回答

2条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办