MerlinVR / USharpVideo

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

VideoPlayer Cannot Play Url #87

Open MrRekrow opened 1 month ago

MrRekrow commented 1 month ago

I'm getting these errors.

[USharpVideo] Video player error when trying to load https://youtu.be/dQw4w9WgXcQ?si=kcgxZQ2VaH8iDnU2 UnityEngine.Debug:LogError (object,UnityEngine.Object) VRC.Udon.Wrapper.Modules.ExternUnityEngineDebug:LogErrorSystemObject_UnityEngineObjectSystemVoid (VRC.Udon.Common.Interfaces.IUdonHeap,System.Span`1) VRC.Udon.VM.UdonVM:Interpret () VRC.Udon.UdonBehaviour:RunProgram (uint) (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1035) VRC.Udon.UdonBehaviour:RunProgram (string) (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1010) VRC.Udon.UdonBehaviour:SendCustomEvent (string) (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1675) VRC.Udon.Wrapper.Modules.ExternVRCUdonCommonInterfacesIUdonEventReceiver:SendCustomEventSystemStringSystemVoid (VRC.Udon.Common.Interfaces.IUdonHeap,System.Span1<uint>) VRC.Udon.VM.UdonVM:Interpret () VRC.Udon.UdonBehaviour:RunProgram (uint) (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1035) VRC.Udon.UdonBehaviour:RunEvent<VRC.SDK3.Components.Video.VideoError> (string,System.ValueTuple2<string, VRC.SDK3.Components.Video.VideoError>) (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1280) VRC.SDK3.Video.Components.Base.BaseVRCVideoPlayer:OnVideoError (VRC.SDK3.Components.Video.VideoError) VRC.SDK3.Video.Components.VRCUnityVideoPlayer:OnError (UnityEngine.Video.VideoPlayer,string) UnityEngine.Video.VideoPlayer:InvokeErrorReceivedCallback_Internal (UnityEngine.Video.VideoPlayer,string)

VideoPlayer cannot play url : https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1721905861/ei/Zd6hZsPWMcSMybgPg52VmA4/ip/70.51.152.187/id/8273ca61590afe20/itag/95/source/youtube/requiressl/yes/ratebypass/yes/pfa/1/sgoap/clen%3D3086839%3Bdur%3D190.682%3Bgir%3Dyes%3Bitag%3D140%3Blmt%3D1714378145267934/sgovp/clen%3D20210135%3Bdur%3D190.600%3Bgir%3Dyes%3Bitag%3D136%3Blmt%3D1714378974403920/rqh/1/hls_chunk_host/rr3---sn-cxaaj5o5q5-tt1e6.googlevideo.com/xpc/EgVo2aDSNQ%3D%3D/mh/4z/mm/31,26/mn/sn-cxaaj5o5q5-tt1e6,sn-vgqskns7/ms/au,onr/mv/m/mvi/3/pcm2cms/yes/pl/24/force_finished/1/gcr/ca/initcwndbps/2361250/spc/NO7bAUxFAkcOg1NgwQ6ldjrPAHJE_ojACZUEBgwY39kiZC34Ct86R2YWg9ziUfg/vprv/1/playlist_type/CLEAN/dover/11/txp/4532434/mt/1721883900/fvip/5/keepalive/yes/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,pfa,sgoap,sgovp,rqh,xpc,force_finished,gcr,spc,vprv,playlist_type/sig/AJfQdSswRAIgTaqTug2UWRe6ELOj1BeOQDXRicwOwwxLjUtkDvhnbOsCIGa1huvqRdosVX8SONY4bmwQiKmArTQDZDV7wfeQL3ud/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pcm2cms,pl,initcwndbps/lsig/AGtxev0wRQIhAN2V5DHZSjSJ3kzw3jqh1GYCaAxXvcQEK9nZXF0tPDhnAiAJ7IPqQN30oX3jENO5nabTuSrQwAVmbV9w0tnyQDi7ZA%3D%3D/playlist/index.m3u8

Cannot read file.

WindowsVideoMedia error 0xc00d36c4 while reading https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1721905861/ei/Zd6hZsPWMcSMybgPg52VmA4/ip/70.51.152.187/id/8273ca61590afe20/itag/95/source/youtube/requiressl/yes/ratebypass/yes/pfa/1/sgoap/clen%3D3086839%3Bdur%3D190.682%3Bgir%3Dyes%3Bitag%3D140%3Blmt%3D1714378145267934/sgovp/clen%3D20210135%3Bdur%3D190.600%3Bgir%3Dyes%3Bitag%3D136%3Blmt%3D1714378974403920/rqh/1/hls_chunk_host/rr3---sn-cxaaj5o5q5-tt1e6.googlevideo.com/xpc/EgVo2aDSNQ%3D%3D/mh/4z/mm/31,26/mn/sn-cxaaj5o5q5-tt1e6,sn-vgqskns7/ms/au,onr/mv/m/mvi/3/pcm2cms/yes/pl/24/force_finished/1/gcr/ca/initcwndbps/2361250/spc/NO7bAUxFAkcOg1NgwQ6ldjrPAHJE_ojACZUEBgwY39kiZC34Ct86R2YWg9ziUfg/vprv/1/playlist_type/CLEAN/dover/11/txp/4532434/mt/1721883900/fvip/5/keepalive/yes/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,pfa,sgoap,sgovp,rqh,xpc,force_finished,gcr,spc,vprv,playlist_type/sig/AJfQdSswRAIgTaqTug2UWRe6ELOj1BeOQDXRicwOwwxLjUtkDvhnbOsCIGa1huvqRdosVX8SONY4bmwQiKmArTQDZDV7wfeQL3ud/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pcm2cms,pl,initcwndbps/lsig/AGtxev0wRQIhAN2V5DHZSjSJ3kzw3jqh1GYCaAxXvcQEK9nZXF0tPDhnAiAJ7IPqQN30oX3jENO5nabTuSrQwAVmbV9w0tnyQDi7ZA%3D%3D/playlist/index.m3u8

Context: MFCreateSourceReaderFromURL Error details: The byte stream type of the given URL is unsupported. Track types:

MerlinVR commented 1 month ago

YouTube currently isn't providing the format that Unity video players use to play video so they won't load on the regular video player. For now you can switch it to stream mode and it should function fine. If youtube just killed the format permanently I'll switch the video player to use the stream player by default.

MrRekrow commented 1 month ago

Alright, do you mean just switching from video to stream on the player. For YouTube videos for me it still doesn't appear to be playing them.

Physics-Dude commented 1 month ago

I can confirm switching the player to Stream mode, then importing a standard (not live) YouTube URL works fine with every video I tried. Live streams also work as expected.

I might see about making Stream mode the default option in my project.

Physics-Dude commented 1 month ago

Indeed an acceptable fix (until the next surprise change) for world creators is to set default mode to Stream. image

Video mode might want to be retained for other forms and sources of video. Though an auto-switch function may be thoughtful in a future revision to reduce confusion.

Currently using latest stable release v1.0.1.

MrRekrow commented 1 month ago

Alright thanks for the insight. My issue was just due to stream mode not working in unity play mode.

MerlinVR commented 1 month ago

Thanks for verifying! I'll look at making the stream player the default for the main package.

Physics-Dude commented 1 month ago

A couple updates; It seems youtube is still making changes. as of yesterday(?) the Video button works for normal youtube videos again. and the Live button works for normal youtube videos AND live youtube streams.

Additionally, with the default usharpvideo prefab, stereo separation in live stream mode didn't seem to work (im unsure if this is also a new Youtube quirk). i.e. Audio had no stereo separation, aka mono. It was only when setting the AVPro Video Speaker to StereoMix for both StreamAudioSourceR/L, and then setting the Audio Source components to fully pan to the left or right for the left and right audio sources respectively, did proper stereo separation return.

Hopefully the screenshot below will help any that are curiously trying to chase a similar issue In this seemingly rapidly changing environment. (StreamAudioSourceL is the same as shown, but with Stereo Pan set to -1)

image