RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
238 stars 29 forks source link

[2.2.2] Incorrect date returned on HLS live streaming's #EXT-X-PROGRAM-DATE-TIME through mediaPlayer.Control.GetProgramDateTime() API. #991

Closed kodai100 closed 3 years ago

kodai100 commented 3 years ago

Describe the issue Cannot get value of HLS live streaming's #EXT-X-PROGRAM-DATE-TIME through mediaPlayer.Control.GetProgramDateTime() API.

https://www.renderheads.com/content/docs/AVProVideo/articles/feature-streaming.html In the document, clearly we can get a #EXT-X-PROGRAM-DATE-TIME tag value through mediaPlayer.Control.GetProgramDateTime() API.

Your Setup (please complete the following information):

To Reproduce

  1. Setup AWS IVS live stream and go live (AWS IVS can have #EXT-X-PROGRAM-DATE-TIME tags every segment)
  2. Enter a m3u8 address to MediaPlayer
  3. call mediaPlayer.Control.GetProgramDateTime(); and always returns initial value of DateTime type (0001/01/01 0:00:00).

Logs

void Update() {
    Debug.Log(mediaPlayer.Control.GetProgramDateTime());
    // always 0001/01/01 0:00:00
}

Screenshots Here is get a video stream of AWS IVS on AVProVideo MediaPlayer (logging 0001/01/01 0:00:00) 2021-10-31_153802

And here is AWS IVS's m3u8 index file (clearly included #EXT-X-PROGRAM-DATE-TIME tags) 2021-10-31_154113

Videos it will be reproduce any live streaming video.

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Instead email the link to us unitysupport@renderheads.com

AndrewRH commented 3 years ago

Can you try switching the Video API to WinRT instead of the default Media Foundation?

Thanks,

kodai100 commented 3 years ago

Thank you for your reply.

I switched the video API to WinRT and it seems to work!

However, the year parsing seems to be wrong like as follows. (2021 is expected, but displayed 2390)

this is unity's log

2021-11-01_001058

and this is AWS's m3u8 file detail

2021-11-01_001420

Thanks,

AndrewRH commented 3 years ago

OH that's interesting...we'll take a look

AndrewRH commented 3 years ago

Our date-time conversion calculate was off by 11644473600 seconds (approx 369 days) due to using the Windows NT epoch date 1601 instead of Unix epoch 1970.

This has now been fixed and will be in the next release.

Thanks for submitting this issue report.

kodai100 commented 3 years ago

Thank you for your quick support !

AndrewRH commented 3 years ago

@kodai100 AVPro Video 2.2.4 has just been released and should resolve the issue you reported. Thanks,

guerwan commented 2 years ago

@AndrewRH we have the same issue on macOS/iOS with the latest version (2.6.3): Issue