Detecting codec used in RTP stream (for dynamic PT

2019-08-05 05:15发布

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条回答
该账号已被封号
2楼-- · 2019-08-05 05:52

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.

查看更多
登录 后发表回答