如何将包含 RTP 流的 pcap 转换为 .raw [英] How to convert pcap that contains a RTP stream to .raw

查看:154
本文介绍了如何将包含 RTP 流的 pcap 转换为 .raw的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个 python 脚本,它将采用 pcap,保存单个 RTP 流,然后使用 sox 将该 RTP 流转换为 wav 文件.现在,我可以使用 tshark 创建每个包含一个 rtp 流的 pcap 文件,但我无法将这些 pcap 转换为 .raw 文件,以便我可以使用 sox 创建 wav 文件..raw 文件可以通过在wireshark Telephony -> RTP -> 流分析 -> 保存(文件同步转发流音频)中打开文件来创建.

I am working on a python script that will take a pcap, will save the individual RTP Streams and will then use sox to convert that RTP stream into a wav file. Now, I am able to use tshark to create pcap files that each contain one rtp stream but i am not able to convert those pcaps into .raw files so that I can use sox to create wav files. The .raw files can be created by opening the file in wireshark Telephony -> RTP -> stream analysis -> save (File Synchronized forward stream audio).

有没有一种方法可以使用 tshark 或任何其他 python 库(最好)将 pcap(包含一个流)转换为 raw.

Is there a way to either use tshark or any other python library (preferably) to convert the pcap (that contains one stream) to raw.

请参阅包含一个流的附加 pcap 文件,我想将其转换为原始数据.

See attached pcap file that contains one stream, I want to convert it to raw.

推荐答案

如果你只需要 PCAP 的十六进制转储

if u just need hex dump of PCAP

tshark -x -r mydata.pcap | sed -n 's/^[0-9a-f]*\s\(\(\s[0-9a-f][0-9a-f]\)\{1,16\}\).*$/\1/p'

这篇关于如何将包含 RTP 流的 pcap 转换为 .raw的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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