【问题标题】:Set rtsp_flags to listen ffmpeg in c code在c代码中设置rtsp_flags来监听ffmpeg
【发布时间】:2014-09-07 21:02:07
【问题描述】:

我正在尝试创建一个客户端客户端服务器应用程序来流式传输,然后使用 rtsp 使用 ffmpeg 库接收视频。我已经完成了正在流式传输视频的客户端部分,我可以使用以下命令在 ffplay 上接收视频

ffplay -rtsp_flags listen rtsp://127.0.0.1:8556/live.sdp

我的问题是我想以 c 代码接收视频,我需要在其中设置 rtsp_flags 选项。有人可以帮忙吗? 附言我不能使用 ffserver,因为我在 windows 上工作,据我所知,ffserver 不适用于 windows

【问题讨论】:

    标签: c++ c ffmpeg video-streaming rtsp


    【解决方案1】:

    打开流时需要添加选项:

    AVDictionary *d = NULL;           // "create" an empty dictionary
    av_dict_set(&d, "rtsp_flags", "listen", 0); // add an entry
    
    //open rtsp
    if ( avformat_open_input( &ifcx, sFileInput, NULL, &d) != 0 ) {
       printf( "ERROR: Cannot open input file\n" );
    return EXIT_FAILURE;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-20
      • 1970-01-01
      • 2020-06-10
      • 2015-09-02
      • 1970-01-01
      • 1970-01-01
      • 2023-03-10
      • 2012-10-07
      相关资源
      最近更新 更多