FFMPEG的SDP(IP地址) [英] SDP for FFMPEG (IP addresses)

查看:65
本文介绍了FFMPEG的SDP(IP地址)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过RTP接收音频,所以我正在从生成的SDP中打开输入.媒体来自 Port_sender IP_sender .用于侦听的服务器的IP和端口: IP_server Port_server .这是我的SDP模板.我应该将 {Port_sender,IP_sender,IP_server,Port_server} 的内容用于我送给ffmpeg的SDP的 {%1%,%2%,%3%} 以及我还给发件人的SDP?

I'm receiving audio via RTP, so I'm opening input from the SDP I generate. Media is coming from Port_sender, IP_sender. IP and port of the server for listening: IP_server, Port_server. Here is my SDP template. What of {Port_sender, IP_sender, IP_server, Port_server} should I put in {%1%, %2%, %3%} for the SDP that I feed to ffmpeg and for the SDP that I give back to the sender?

\n\nv=0\n
o=- 0 0 IN IP4 %1%\n
s=name\n
c=IN IP4 %2%\n
t=0 0\n
a=tool:libavformat 57.3.100\n
m=audio %3% RTP/AVP 97\n
b=AS:705\n
a=rtpmap:97 PCMU/44100/2\n"

现在对我来说,很难从不同的IP对其进行调试.但是从一台计算机上它可以完美运行.

Debugging it from different IPs is hard for me now. But from one computer it works perfectly.

推荐答案

我建议您阅读

I encourage you to read the RFC 4566, it explains everything you are wondering.

  • o = 代表来源
  • c = 代表连接数据
  • m = 代表媒体描述
  • o= stands for Origin
  • c= stands for Connection data
  • m= stands for Media descriptions

对于眼前的问题,我假设您收到带有 SDP 报价的 SIP INVITE ,并且您必须以 SIP 200 OK进行回复 SDP 答复的code>.

For the question at hand, I assume you receive a SIP INVITE with a SDP offer, and you have to reply with a SIP 200 OK containing the SDP reply.

在这种情况下,您应该回复:

In that scenario you should reply with:

  • %1%-> IP服务器
  • %2%-> IP_server ,假设是单播会话连接地址包含预期数据源的单播IP地址"
  • %3%-> Port_sender ,因为 m = 是媒体流要发送到的传输端口(已定义的端口由发件人在报价中提供.
  • %1% -> IP_server
  • %2% -> IP_server, assuming a uni-cast session "the connection address contains the uni-cast IP address of the expected data source"
  • %3% -> Port_sender, since m= is the transport port to which the media stream is sent (Port that was defined by the sender in his offer).

这篇关于FFMPEG的SDP(IP地址)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆