H264 RTP 数据包转储并生成 Quicktime 文件

发布于 2024-08-26 19:44:34 字数 85 浏览 13 评论 0原文

我有一个使用 libpcap 捕获的流式 H264 视频的 RTP 数据包转储。我想知道是否有人知道可以从中生成可播放视频文件的工具。

谢谢

I have a dump of RTP packets of streaming H264 videos that i captured using libpcap. I was wondering if anyone knows of a tool that can generate a playable video file from that.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绝不服输 2024-09-02 19:44:34

尝试将 RTP 文件流导出到转储文件中(在 Wireshark 中,右键单击 RTP 数据包 → 跟踪 UDP 流 → 另存为),然后通过 gst-launch 发送文件以进行解复用。您需要稍微尝试一下,但这应该是正确的想法:

$ gst-launch-0.10 filesrc location=dump.rtp ! rtpmp2tdepay ! filesink location=dump.ts

上面假设 RTP 是 MPEG TS 流。如果是其他内容(即原始 Vorbis、G.729、PCM、MP3 或其他内容),那么您需要使用不同的“depayloader”。您可以使用 gst-inspect 来找出这一点:

$ gst-inspect-0.10 | egrep 'rtp.*depay'
quicktime:  rtpxqtdepay: RTP packet depayloader
dtmf:  rtpdtmfdepay: RTP DTMF packet depayloader
rtp:  rtpdepay: Dummy RTP session manager
rtp:  rtpac3depay: RTP AC3 depayloader
rtp:  rtpbvdepay: RTP BroadcomVoice depayloader
rtp:  rtpceltdepay: RTP CELT depayloader
[...]

GStreamer(包括 gst-launch 和 gst-inspect 工具)应随所有默认情况下现代 Linux 发行版。如果没有,安装应该相当容易。显然,我的示例非常通用,因此您需要使用我的建议来自己找到确切的答案。希望我已经为你提供了足够的支持,让你能够做到这一点。 :)

Try exporting the RTP file stream into a dump file (in Wireshark, right-click an RTP packet → Follow UDP Stream → Save As), and then send the file via gst-launch to be demuxed. You’ll need to play around with this a bit, but this should be the right idea:

$ gst-launch-0.10 filesrc location=dump.rtp ! rtpmp2tdepay ! filesink location=dump.ts

The above is assuming the RTP is an MPEG TS stream. If it’s something else (i.e. raw Vorbis, G.729, PCM, MP3, or something), then you’ll need to use a different ‘depayloader’. You can use gst-inspect to find this out:

$ gst-inspect-0.10 | egrep 'rtp.*depay'
quicktime:  rtpxqtdepay: RTP packet depayloader
dtmf:  rtpdtmfdepay: RTP DTMF packet depayloader
rtp:  rtpdepay: Dummy RTP session manager
rtp:  rtpac3depay: RTP AC3 depayloader
rtp:  rtpbvdepay: RTP BroadcomVoice depayloader
rtp:  rtpceltdepay: RTP CELT depayloader
[...]

GStreamer (including the gst-launch and gst-inspect tools) should be shipped with all modern Linux distributions by default. If not, it should be fairly easy to install. Obviously my example is very generic, so you will need to use my suggestions to find the exact answer yourself. Hopefully I’ve given you enough of a leg-up for you to do that. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文