FFmpeg片段
0
SDP输入
const AVInputFormat* iformat = av_find_input_format("sdp");
AVDictionary* format_opts = NULL;
av_dict_set(&format_opts, "sdp_flags", "custom_io", 0);
avformat_open_input(&inputFormatCtxPtr, "video.sdp", iformat, &format_opts);
RTP配置
AVDictionary *options = NULL;
// av_dict_set(&options, "pkt_size", "1400", 0);
// av_dict_set(&options, "buffer_size", "102400", 0);
// av_dict_set(&options, "send_buffer_size", "102400", 0);
av_opt_set_int(outputFormatCtxPtr->priv_data, "payload_type", 96, 0);
avio_open2(&outputFormatCtxPtr->pb, ("rtp://" + host + ":" + std::to_string(port)).c_str(), AVIO_FLAG_WRITE, NULL, &options);
av_dict_free(&options);