Detecting codec used in RTP stream (for dynamic PTs)

余生长醉 提交于 2019-12-11 07:29:14

问题


Is it possible to detect the codec used in an RTP stream by analyzing the RTP stream alone? I know about the payload type (PT) field in the RTP header -- that can be used to identify codecs that have statically assigned PT numbers. What about the other codecs that use the dynamic PT number range? Are there any heuristics to detect the type of the payload? I'm interested in all kinds of solutions, even if the detection works for one codec only.


回答1:


Sure, you can sniff around the packet to see if it appears to be RFC XXX, or YYY, etc. Length checks (for fixed-length codecs, though watch out for multiple frames per packet); timestamp rate (tells you narrow/wide/ultra-wide band audio or video); and then you can see if the first N bytes matches the valid pattern for one of the possible matches.

Not a small amount of work unless you're only interested in a subset.



来源:https://stackoverflow.com/questions/4423214/detecting-codec-used-in-rtp-stream-for-dynamic-pts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!