DoubleLi

qq: 517712484 wx: ldbgliet

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

通过ffmpeg 读取摄像头数据, 当设备移除后, 读取数据不阻塞设置:

 

    infmtCtx->flags |= AVFMT_FLAG_NONBLOCK;  // 加上既可.
    if (avformat_open_input(&infmtCtx, dshow_name, fmt, &options) != 0) {
        avformat_free_context(infmtCtx);
        return -1;
    }

posted on 2023-03-17 10:24  DoubleLi  阅读(296)  评论(0)    收藏  举报