簡體   English   中英

如何在 libavformat 中設置 RTP 負載類型?

[英]How to set RTP payload type in libavformat?

我正在嘗試使用 libavformat 編寫視頻流應用程序。 雖然 ffmpeg 和 libavformat 提供 96 和 97 作為默認負載類型,但我想指定自定義 RTP 負載類型。 正如我在這里回答的那樣,我已經知道如何在 ffmpeg 的命令行中設置它,但是我想在代碼中給出它。 我嘗試了以下內容:

AVFormatContext *ctx = avformat_alloc_context();
ctx->oformat = av_guess_format("rtp", NULL, NULL);
AVDictionary *options = NULL;
av_dict_set(&options, "payload_type", "128", 0);
//Assume url is set here
avio_open2(&ctx->pb, ctx->url, AVIO_FLAG_WRITE, NULL, &options);

但是它不起作用。 關於如何在 libavformat 中設置 RTP 負載類型有什么建議嗎?

rtp是 libavformat 中的多路復用器,而不是協議,因此選項被傳遞給avformat_write_header

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM