Extract Audio from VoIP PCAP

user-pic
Vote 0 Votes

環境是 Linux
工具準備 pcapsipdump, sox
pcapsipdump 可以將單一個 pcap 檔拆分成每通電話的 pcap
但是若封包裡面有 802.1Q VLAN header, 會造成 pcapsipdump 無法正常工作,
可以用 tcprewrite --enet-vlan=del 將 VLAN Tag 移除
(tcprewrite 在 tcpreplay 套件裡面)
pcap2mp3.sh 這支 script 我參考了 Converting RTP in pcap to Audio Wav files 再做一些修改.
原始的 script 沒有考慮到雙向, 一通完整的電話封包有雙向的音訊, 可以截取出兩個檔.
原理是用 tshark 讀出雙向的 rtp.ssrc, 再分別處理, 取出 rtp.payload 的 HEX code, 再變成 raw file,
用 sox 轉成 wav, 最後再用 sox remix 成一個 MP3

About this Entry

This page contains a single entry by Pank published on October 16, 2014 5:56 PM.

BIND 9.10 Support RRL was the previous entry in this blog.

Clear gReader Cache is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives