使用 FFMPEG 从 RTP 流解码 G.729 (PCAP)
我有包含 RTP 数据的 pcap 文件,而 RTP 数据又是 G.729 编解码器的音频。有没有办法通过将其推入 FFMPEG 来解码该流?这可能意味着我必须从 PCAP 文件中提取 RTP 有效负载数据,然后以某种方式将其传递给 FFMPEG。
任何指导方针和指示都将受到高度赞赏!
I have pcap file that contains RTP data which in turn is audio for G.729 codec. Is there a way to decode this stream by pushing it into FFMPEG? This would probably mean I have to extract the RTP payload data from the PCAP file and then somehow pass it to FFMPEG.
Any guidelines and pointers are highly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这个答案不需要
ffmpeg
,但我假设您并不真正关心如何提取音频......查看 如何解码 G729 在 Wireshark wiki...在 Wireshark 中,使用菜单“统计 -> RTP -> 显示所有流”。选择所需的流并按“分析”。
在下一个对话框屏幕中,按“保存有效负载...”。保存选项有
Format = .raw
和Channel =forward
。命名文件my_input.raw
。使用
Open G.729
解码器将.raw
文件转换为.pcm
格式。语法:va_g729_decoder.exe my_input.raw my_output.pcm
。或者对于 Linux:wine va_g729_decoder.exe my_input.raw my_output.pcm
。.pcm
文件包含 8000 Hz 的 16 位线性 PCM 样本。请注意,每个示例均采用 Little-Endian 格式。要转换为.au
格式,您所需要做的就是在前面添加 24 字节 au 标头,并将每个 PCM 样本转换为网络字节顺序(或 Big-Endian)。以下perl
脚本即可实现此目的。用法:
perl pcm2au.pl [my_inputFile] [my_outputFile]
This answer doesn't require
ffmpeg
, but I assume you dont really care how the audio is extracted... check out How to Decode G729 on the wireshark wiki...In Wireshark, use menu "Statistics -> RTP -> Show All Streams". Select the desired stream and press "Analyze".
In the next dialog screen, press "Save Payload...". Save options are
Format = .raw
andChannel = forward
. Name filemy_input.raw
.Convert the
.raw
file to.pcm
format using theOpen G.729
decoder. Syntax:va_g729_decoder.exe my_input.raw my_output.pcm
. Or for Linux:wine va_g729_decoder.exe my_input.raw my_output.pcm
.The
.pcm
file contains 16-bit linear PCM samples at 8000 Hz. Note that each sample is in Little-Endian format. To convert to.au
format, all you need to do is prepend the 24-byte au header, and convert each PCM sample to network byte order (or Big-Endian). The followingperl
script will do the trick.USAGE:
perl pcm2au.pl [my_inputFile] [my_outputFile]
您可以使用的步骤是:
但是,如果您的目标“仅”是 pcap 音频解码(使用 RTP G729 编解码器),那么您可以使用 videosnaf 或普利科
The steps that you can use are:
But if your goal is "only" the pcap-audio decoding (with RTP G729 codec) then you can use videosnaf or xplico
va_g729_decoder.exe 仅适用于 win32。64 位 Windows 怎么样?
va_g729_decoder.exe only works for win32.What about 64bit windows ?