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 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘