av_dict_set(&optionsDict, "rtsp_transport", "udp", 0);
    av_dict_set(&optionsDict, "stimeout", "200000", 0);
    av_dict_set(&optionsDict, "fflags", "nobuffer", 0);

    if (avformat_open_input(&pFormatCtx, filepath, 0, &optionsDict) != 0) {
        printf("Couldn't open input stream.\n");
        return -1;
    }

我最近还发现可以把avformat_find_stream_info()去掉,然后再补充pFormatCtx的参数加上,比如宽高等。

相关文章:

  • 2021-12-31
  • 2021-09-22
  • 2021-11-17
  • 2022-01-13
  • 2021-05-26
  • 2022-03-04
  • 2021-08-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-19
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
相关资源
相似解决方案