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

Inconsistent programmingDateTime and duration in HLS m3u8 file #6506

Open oleul05 opened 1 month ago

oleul05 commented 1 month ago

Thank you for your continued support. We are saving programDateTime and duration by parsing m3u8 playlist. For one camera we observed we got some future date and abnormal duration. For few .ts files I observed date is 30th June 2024 which is a future date. The files duration was 72,30 28 seconds which is strange to us. I have attached a screenshot from MongoDB where we saved the information. Note: In AMS setting, duration is set to 2 seconds, and most cameras are working fine.

Steps to reproduce

  1. Start RTMP stream from LTE camera into Ant Media RTMP server
  2. Check HLS m3h8 file for that stream.
  3. In m3u8 file the programDateTime is future date and duration is inconsistent.

Expected behavior

programDateTime is current date and duration is 2 seconds.

Actual behavior

programDateTime is future date and duration is inconsistent.

attachment

oleul05 commented 1 month ago

@mekya, @burak-58 , In the LTE camera settings, setting the Frame Rate (FPS) to 20 and GOP (100ms) to 20 provides the expected results. Also ts file size was not same. Any other Frame Rate and GOP values lead to incorrect duration and program date time in the .m3u8 file. image

burak-58 commented 1 month ago

Hi @oleul05 Could you please do a test with ffmpeg like that:

Then check HLS files.

mekya commented 1 month ago

I've encountered the same problem and it causes the server to return wrong internal when asking m3u8 with start and end query parameters. I mean it causes that issue https://github.com/ant-media/Ant-Media-Server/issues/6308

This issue may be the same with that one mentioned above

lastpeony commented 4 weeks ago

Hello @oleul05,

How long into the streaming do you encounter this issue? Is it reproducible after a few minutes?

Have you tested the problematic camera with non-integer GOP and frame rate values, such as 36/30? What were the GOP and FPS settings when you experienced the problem?

When using integer GOP FPS ratio, like GOP: 30 FPS: 30 or GOP: 60 FPS: 30, do you still encounter this issue?

We suspect that a non-integer GOP/ FPS ratio might be causing this problem. I am attempting to reproduce the issue with ffmpeg but haven't had success so far.

oleul05 commented 3 weeks ago

@lastpeony We get this issue immediately after starting the stream. When using the GOP FPS ration 20/20 in this case it was working fine. On the all other ration like 30/20 we got unexpected results.