MerlinVR / USharpVideo

A basic video player made for VRChat using Udon and UdonSharp
MIT License
326 stars 43 forks source link

Person who pastes Live Streaming HSL stream link - Streem freezes after loading first frame untill they rejoin world, works for everyone else #55

Closed kroung closed 2 years ago

kroung commented 2 years ago

When I paste a HLS link from my own RTMP server, it loads the video, but then freezes on the first frame and the image remains still untill I leave the world and come back.

If my friend in VRC pasted the link into USharp, the video loaded and work for me immediatly, but for him it was frozen still, untill he came back. This happend in several worlds we tested with USharp.

In worlds with players other than USharp, the link played back for everyone including the one who pastes the link just fine.

When I paste this link and load it works fine however without needing to rejoin the world: http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 I assume however, this link is a 30 minute recording, so thats why it works?

I've spent quite a bit of time narrowing down this issue. I thought I had some weird firewall or ISP issue (I have multiple ISP's) going on feeding the video back to myself, but I can see the video fine when I play it in VLC, also If I leave and re-join the VRC world it will stream fine.

MerlinVR commented 2 years ago

Do you have any errors printed to the log?

MerlinVR commented 2 years ago

Also what are you putting for the protocol in the URL?

kroung commented 2 years ago

Do you have any errors printed to the log?

No, there are no errors printed to the log, just older errors from days ago about me not having a favicon set up.

Also what are you putting for the protocol in the URL?

I am using protocol "live" on the player, and pasting

http://{Myserverip}/hls/test.m3u8

MerlinVR commented 2 years ago

If you go to https://vrchat.com/home/world/wrld_862f1f03-456d-47c8-a76c-7186c684be48 and put the stream link in, what does the output log print after Duration: ?

kroung commented 2 years ago

`2022.09.27 22:00:31 Log - [USharpVideo] Started video load for URL: http://{MYserverIP}/hls/test.m3u8, requested by {ME}

2022.09.27 22:00:31 Log - [Video Playback] Attempting to resolve URL 'http://{MYserverIP}/hls/test.m3u8'

2022.09.27 22:00:31 Log - NativeProcess.Start: started process id [6784]: C:/Users/{ME}/AppData/LocalLow/VRChat/VRChat\Tools/yt-dlp.exe (...)

2022.09.27 22:00:32 Log - NativeProcess.HasExited: process exited with code 0, took 1098 ms. Command line: C:/Users/{ME}/AppData/LocalLow/VRChat/VRChat\Tools/yt-dlp.exe (...)

2022.09.27 22:00:32 Log - [Video Playback] URL 'http://{MYserverIP}/hls/test.m3u8' resolved to 'http://{MYserverIP}/hls/test.m3u8'

2022.09.27 22:00:32 Log - [AVProVideo] Opening http://{MYserverIP}/hls/test.m3u8 (offset 0) with API MediaFoundation

2022.09.27 22:00:32 Log - [USharpVideo] Duration: Infinity

2022.09.27 22:00:32 Log - [USharpVideo] Started video: http://{MYserverIP}/hls/test.m3u8`

MerlinVR commented 2 years ago

Thanks, that's not what I expected unfortunately so I'm not sure what'd be wrong. Does it play in the world I linked for the person that puts in the URL? This was an issue prior to 1.0, but as far as I know it was fixed, if you're using old worlds for testing then it'd make sense they break.

kroung commented 2 years ago

Thanks, that's not what I expected unfortunately so I'm not sure what'd be wrong. Does it play in the world I linked for the person that puts in the URL? This was an issue prior to 1.0, but as far as I know it was fixed, if you're using old worlds for testing then it'd make sense they break.

In the test world (https://vrchat.com/home/world/wrld_862f1f03-456d-47c8-a76c-7186c684be48) I pasted link, froze for me, loaded for friend, I re-joined world, and then it was playing for both of us.

Thanks

MerlinVR commented 2 years ago

Do you have a stream I could test with or what server/config you're using? I've done RTMP and RTSP streams without issues, but never tested doing them over HLS.

MerlinVR commented 2 years ago

Thanks!

MerlinVR commented 2 years ago

Okay I believe I have it fixed, it looks like the video player was setting the playback time on the stream and it only causes issues in this case. I've updated the world could you verify it works for you as well? https://vrchat.com/home/world/wrld_862f1f03-456d-47c8-a76c-7186c684be48

kroung commented 2 years ago

Okay I believe I have it fixed, it looks like the video player was setting the playback time on the stream and it only causes issues in this case. I've updated the world could you verify it works for you as well? https://vrchat.com/home/world/wrld_862f1f03-456d-47c8-a76c-7186c684be48

it works!! nice

MerlinVR commented 2 years ago

Great thank you for all the help!

MerlinVR commented 2 years ago

(deleted the link since it has history on it)