Ant-Media-Server
Ant-Media-Server copied to clipboard
Timing is not correct in HLS recording of RTSP cameras
Short description
Suppose there is a timer captured in a video frame via different IP cameras from same location and recording the HLS on the server side. Now, when the recording is finalized after 10 minutes, the timing is beyond or ahead of the actual time.
For example, the clock is at 12:00 in the start of the recording. Now, after 10 minutes, the timing in recording should be 12:10 but there are differences in timing in recording files.
Environment
- Ant Media Server version: v2.7.0 and above
Steps to reproduce
- Change the HLS settings in application settings to store them
- Add IP camera streams to the server, capturing the timer
- Stop the stream after 10 minutes
Expected behavior
The timing should be correct in the recording after 10 minutes, as explained in the description above
Actual behavior
The timing is not correct in the recording.
After collaborating with Burak, we investigated this issue further. Interestingly, we found that the problem persists when recording RTSP streams with FFmpeg. It's surprising that no reports about this issue have surfaced online, considering its presence in FFmpeg as well. We've posted inquiries about this matter on various platforms, including Super User, Video Stack Exchange, and Reddit. With luck, we anticipate gathering more information soon.
I have tested with my Axis Camera. This is the setup:
I opened time.is web site in the tablet and added the RTSP URL to Ant Media Server as stream source. I recorded the stream for nearly one hour. When I play I didn't see any time drift.
You can ger the recording here: https://drive.google.com/file/d/13HXwVGztcDtu1e-YGau_Jy5TFWr2rleS/view?usp=sharing
Then I'll close the issue for the inactivity. Please feel free to re-open if you think there is still a problem