使用ffmpeg将RTP数据包转换为WAV或AU

问题描述 投票:0回答:2

我有一个文件,其中包含一系列封装在 UDP/IP 数据包中的 RTP 数据包。我想将此文件转换为 WAV 或 AU 文件,并被告知 ffmpeg 可以完成这项工作。然而,该工具的行为并不符合我的预期。由于某种原因,它需要一个 SDP 文件,但我没有这样的文件,我想知道为什么需要它,因为 RTP 数据包似乎包含足够的信息来进行转换。它还报告错误的有效负载类型。

有什么想法吗?以下是我尝试过的。输入文件 alaw.rtp 中的 RTP 数据包只有有效负载类型 8(A-law)和 72(RTCP 相关),因此我不知道有效负载类型 105 来自哪里。

$ ffmpeg -f rtp -i alaw.rtp alaw.au
...
[rtp @ 0x9dbdfe0] Unsupported RTP version packet received
    Last message repeated 89 times
[rtp @ 0x9dbdfe0] Unable to receive RTP payload type 105 without an SDP file describing it
[rtp @ 0x9dbdfe0] Estimating duration from bitrate, this may be inaccurate
Input #0, rtp, from 'alaw.rtp':
  Duration: N/A, bitrate: N/A
File 'alaw.au' already exists. Overwrite ? [y/N] y
Output #0, au, to 'alaw.au':
Output file #0 does not contain any stream

这是我用过的ffmpeg版本

ffmpeg version 0.10.6-6:0.10.6-0ubuntu0jon1~lucid2
built on Nov 12 2012 15:20:22 with gcc 4.4.3
ffmpeg rtp audio-converter
2个回答
1
投票

如果您的目的是听到 .pcap 文件中的声音,您可以按照以下步骤操作。

安装Wireshark:

  1. 文件 -> 打开文件名.pcap

  2. 分析 -> 解码为

    从列表中选择 RTP,然后单击“应用”

  3. 电话 -> RTP -> 显示所有流 -> 分析

  4. 然后点击播放器->解码

  5. 启用每个文件出现的复选框并播放

  6. 现在您可以在这里观看流了。

注意:确保您安装了最新版本的 Wireshark。


0
投票

是否可以从 .rtpdump 文件解码音频?

© www.soinside.com 2019 - 2024. All rights reserved.