如何将原始RTSP流转储到文件? [英] How to dump raw RTSP stream to file?

查看:221
本文介绍了如何将原始RTSP流转储到文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将原始RTSP流转储到文件中,然后将文件解码为可播放的东西?

Is it possible to dump a raw RTSP stream to file and then later decode the file to something playable?

目前,我正在使用FFmpeg来接收和解码流,将其保存到mp4文件。这样做完美,但是CPU密集,并将严重限制我可以在我的服务器上同时接收的RTSP数量。

Currently I'm using FFmpeg to receive and decode the stream, saving it to an mp4 file. This works perfectly, but is CPU intensive, and will severely limit the number of RTSP streams I can receive simultaneously on my server.

我想将流保存到文件不解码,并将解码部分延迟到文件需要打开时。

I would like to save the stream to file without decoding it, and delay the decoding part to when the file needs to be opened.

这是可能吗?

我尝试过VLC,这比FFmpeg更加CPU密集。我还查看了这个问题,答案是将RTSP转储到文件没有用,这个问题,问题所在的评论里面的评论是原始RTSP内容不好适合保存和重播...,这似乎表明有办法。

I have tried VLC, which is even more CPU intensive than FFmpeg. I've also looked at this question where the answer says dumping RTSP to file is not useful, and this question, where the comment below the question says "Raw RTSP content is not well suited for save and replay...", which seems to indicate that there is way.

提前感谢!

编辑
这是FFmpeg使用的命令:

EDIT Here is the command I'm using for FFmpeg:

ffmpeg -i rtsp://@192.168.241.1:62159 -r 15 C:/ DB_Videos / 2013-04-30 17_18_34.703.mp4

推荐答案

如果您在ffmpeg命令行中重新编码,这可能是为什么它是CPU密集型的原因。您只需将流复制到单个容器。由于我没有你的命令行,我不能在这里提出具体的改进。您的acodec和vcodec应该设置为复制是我可以说的。

If you are reencoding in your ffmpeg command line, that may be the reason why it is CPU intensive. You need to simply copy the streams to the single container. Since I do not have your command line I cannot suggest a specific improvement here. Your acodec and vcodec should be set to copy is all I can say.

编辑:看到您的命令行并给予您已经尝试过,这是有益的遇到同样问题的其他人。命令:

On seeing your command line and given you have already tried it, this is for the benefit of others who come across the same question. The command:

ffmpeg -i rtsp://@192.168.241.1:62156 -acodec copy -vcodec copy c:/abc.mp4

不会在mp4中为您转码并转储文件。当然,这是假定流式内容与mp4兼容(在所有可能的情况下)。

will not do transcoding and dump the file for you in an mp4. Of course this is assuming the streamed contents are compatible with an mp4 (which in all probability they are).

这篇关于如何将原始RTSP流转储到文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆