【问题标题】:Convert RTP packets to WAV or AU using ffmpeg使用 ffmpeg 将 RTP 数据包转换为 WAV 或 AU
【发布时间】:2012-12-24 05:50:39
【问题描述】:

我有一个文件,其中包含包装在 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

【问题讨论】:

  • 您必须确保您的文件包含正确的 RTP 数据包。如此处所示en.wikipedia.org/wiki/… 每个数据包必须以标头开头。前两位表示 RTP 版本(当前版本为 2)。 ffmpeg 检查第一个字节:if ((recvbuf[0] & 0xc0) != 0x80) { //Your message: Unsupported RTP version }

标签: ffmpeg rtp audio-converter


【解决方案1】:

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

安装 Wireshark:

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

  2. 分析 -> 解码为

    从列表中选择 RTP 然后点击应用

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

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

  5. 启用为每个文件显示的复选框并播放

  6. 现在您可以在此处播放流了。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-10-02
    • 1970-01-01
    • 2019-06-26
    • 1970-01-01
    • 2016-04-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多