净坛使者\(^o^)/~ 2019-09-06 14:45 采纳率: 25%
浏览 1507

初学ffmpeg,打开rtsp流后,avformat_find_stream_info函数执行出现问题,应该如何解决啊?

执行程序后控制台输出如下:

图片说明
图片说明

程序代码如下:

int main()
{
    AVFormatContext *input_ctx = NULL;
    int video_stream, ret;
    AVStream *video = NULL;
    AVCodecContext *decoder_ctx = NULL;
    AVCodec *decoder = NULL;
    AVPacket packet;
    enum AVHWDeviceType type;
    int i;

    const char *name = "d3d11va";
    type = av_hwdevice_find_type_by_name(name);
    if (type == AV_HWDEVICE_TYPE_NONE) {
        fprintf(stderr, "Device type %s is not supported.\n", name);
        return -1;
    }

    // 打开输入文件
    const char *url = "rtsp://root:vbox_12306@10.108.6.19:3097/55Ogq4fZ14875442466";

    input_ctx = avformat_alloc_context();
    AVDictionary* options = NULL;
    av_dict_set(&options, "rtsp_transport", "tcp", 0);//采用tcp传输(默认udp)
    av_dict_set(&options, "stimeout", "2000000", 0);
    av_dict_set(&options, "probesize", "5000000000", 0);
    av_dict_set(&options, "analyzeduration", "100000000", 0);

    if (avformat_open_input(&input_ctx,url, NULL, &options) != 0) {
        fprintf(stderr, "Cannot open input file '%s'\n", url);
        return -1;
    }
    if (avformat_find_stream_info(input_ctx, NULL) < 0) {
        fprintf(stderr, "Cannot find input stream information.\n");
        return -1;
    }

rtsp流来自服务器上的一个网络摄像头,没有声音,只有图像。

希望大神能够帮忙看一下应该如何解决啊

  • 写回答

1条回答 默认 最新

  • zqbnqsdsmd 2019-09-07 23:29
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛