简体   繁体   English

使用openRTSP和ffmpeg录制视频

[英]Record Video using openRTSP and ffmpeg

I am trying to record the rtsp stream using openRTSP and ffmpeg using below command, and which works fine. 我正在尝试使用以下命令使用openRTSP和ffmpeg记录rtsp流,并且工作正常。 But there are some issue in the duration of the video. 但是视频持续时间有些问题。 I am always getting output video file with duration less than the actual record period. 我总是得到的输出视频文件的持续时间小于实际录制时间。

For example, if I record the live for 10 minutes, I am getting video file with only 6-7 minutes of duration. 例如,如果我录制了10分钟的现场直播,那么我得到的视频文件的时长只有6-7分钟。 I have checked the fps of both input and output and it is same(fps=10). 我已经检查了输入和输出的fps,它是相同的(fps = 10)。 What could be the issue? 可能是什么问题?

openRTSP -D 10 -v -t -c -B 10000000 -b 10000000 rtsp://192.168.1.5:554/media/live/1/1 | ffmpeg -i - -codec copy  out.mp4

The problem was with ffmpeg version,the HLS segment duration in m3u8 file was integer value with old ffmpeg. 问题在于ffmpeg版本,m3u8文件中的HLS段持续时间是旧ffmpeg的整数值。 But When I use latest ffmpeg it's changed to float and I am getting full duration video. 但是,当我使用最新的ffmpeg时,它变为浮动状态,并且我将获得完整的视频。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM