ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.23k stars 618 forks source link

Timing is not correct in HLS recording of RTSP cameras #6277

Closed yashtandon113 closed 1 week ago

yashtandon113 commented 5 months ago

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

Steps to reproduce

  1. Change the HLS settings in application settings to store them
  2. Add IP camera streams to the server, capturing the timer
  3. 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.

lastpeony commented 4 months ago

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.

burak-58 commented 3 months ago

I have tested with my Axis Camera. This is the setup:

Image

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

mekya commented 2 months ago

Then I'll close the issue for the inactivity. Please feel free to re-open if you think there is still a problem