【问题标题】:ffmpeg capture RTSP stream to hourly fileffmpeg 将 RTSP 流捕获到每小时文件
【发布时间】:2017-09-20 02:34:31
【问题描述】:

我正在使用 ffmpeg 使用以下命令将 RTSP 流捕获到文件中:

ffmpeg -i rtsp://[IP Address]:[port]/[URL] -vcodec copy -r 60 -t 2600 -y /[outputfile].mp4

这工作正常,可以拍摄 60 分钟。我想做的是:

  1. 输出每小时文件,例如capture1.mp4 capture2.mp4
  2. 将当前时间戳作为覆盖在当前文件中(当前 VLC 说类似LIVE555...)。我想将其更改为 source + timestamp
  3. 删除超过 x 天的旧 mp4 文件,例如将文件保留 1 或 2 天

这在 ffmpeg 中是否可行,还是我需要在 ffmpeg 命令周围放置一个脚本包装器?如果是这样,我可以重复使用的任何例子吗? 这是在 Ubuntu linux 上使用最新的 ffmpeg 包并使用 apt-get install ffmpeg 安装的,因此它是从源代码构建的。

谢谢

【问题讨论】:

    标签: ffmpeg rtsp


    【解决方案1】:

    每小时输出视频文件

    您可以每小时通过 crontab 启动 ffmpeg Ubuntu Crontab

    0 * * * * ffmpeg -i rtsp://[IP Address]:[port]/[URL] -vcodec copy -r 60 -t 3540 -y $(date +\%Y\%m\%d\%H).mp4
    

    添加文字叠加层

    您可以在此处找到更多信息->https://stackoverflow.com/questions/17623676/text-on-video-ffmpeg

    清理旧文件

    删除旧视频 -> Delete files older than 10 days using shell script in Unix

    【讨论】:

      猜你喜欢
      • 2016-12-17
      • 1970-01-01
      • 1970-01-01
      • 2015-08-24
      • 2011-12-17
      • 2018-04-18
      • 2017-02-24
      • 2019-07-14
      • 2018-08-06
      相关资源
      最近更新 更多