将连续的RTSP流保存到5-10分钟的mp4文件 [英] Save continuous RTSP stream to 5-10 minute long mp4 files

查看:1151
本文介绍了将连续的RTSP流保存到5-10分钟的mp4文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何保持流程(协议rtsp,编解码器h264)在文件(容器mp4)?也就是说,输入无限流(带有CCTV摄像机),输出文件的mp4格式大小为5-10分钟录音时间。

How can I keep the flow (protocol rtsp, codec h264) in file (container mp4)? That is, on inputting an endless stream (with CCTV camera), and the output files in mp4 format size of 5-10 minutes of recording time.

操作系统:debian, ubuntu
软件:vlc,ffmpeg(avconv)

OS: debian, ubuntu Software: vlc, ffmpeg (avconv)

目前使用此方案:

cvlc rtsp://admin:admin@10.1.1.1:554/ch1-s1 --sout=file/ts:stream.ts
ffmpeg -i stream.ts -vcodec copy -f mp4 stream.mp4

但是它不能连续记录视频(重新启动vlc之间输入大约10秒钟的实时视频)

But it can not record video continuously (between restarts vlc loses about 10 seconds of live video).

推荐答案

请参阅这个问题,并回答服务器故障。总之,开关工具。 avconv会做你想要的(ffmpeg已成为avconv。)

See this question and answer on Server Fault. In short, switch tools. avconv will do what you want. (ffmpeg has become avconv.)

您要查找的功能称为细分。您的命令行将如下所示:

The feature you are looking for is called segmentation. Your command line would look something like this:

avconv -i rtsp://10.2.2.19/live/ch01_0 -c copy -map 0 -f段-segment_time 300 -segment_format mp4capture-%03d.mp4

这篇关于将连续的RTSP流保存到5-10分钟的mp4文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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