firsttris / plugin.video.sendtokodi

:tv: plays various stream sites on kodi using youtube-dl
MIT License
121 stars 27 forks source link

Youtube with adpative streaming enabled fails with "Unsupported codec in stream ID:" #93

Closed onitake closed 11 months ago

onitake commented 1 year ago

Description of the bug

When playing a Youtube video with SendToKodi (via Newpipe/Kore), it fails in almost all cases. Older videos seem to work better, and occasionally even newer videos work.

Steps to reproduce

Expected behavior

Video plays in Kodi

Version and plattform:

Kodi log

``` 2023-06-27 23:57:31.638 T:8211 info : plugin.video.sendtokodi: found original manifest: https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1687924651/ei/S1ubZL7WC5Gx1gLw36nIDw/ip/%3A%3A/id/750c38c3d5a05dc4/source/youtube/requiressl/yes/playback_host/rr2---sn-ph2gvf5gx-haie.googlevideo.com/mh/7c/mm/31%2C29/mn/sn-ph2gvf5gx-haie%2Csn-1gi7znek/ms/au%2Crdu/mv/u/mvi/2/pcm2cms/yes/pl/37/hfr/1/demuxed/1/tts_caps/1/maudio/1/vprv/1/go/1/mt/1687902104/fvip/5/nvgoi/1/short_key/1/ncsapi/1/keepalive/yes/fexp/24007246%2C24363391/beids/24350018/dover/13/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cdemuxed%2Ctts_caps%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRgIhAJqsU7QHH6DlFa7yfZqD1S4GG3IidzMGurnFjbaZlCfxAiEA4dBB1WWFPVXceGhgfsHpu1Nxty1wNSGTWxEFksYCO8c%3D/lsparams/playback_host%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl/lsig/AG3C_xAwRQIgesSpTszjBDqxMyYofGRr4Nkh9iV5QFHcVEC8ed5DbHACIQD2oVkPowQiv7iRfWLvuOv5pLyYuoS8xlkBFx0vYsKhMQ%3D%3D/file/index.m3u8 2023-06-27 23:57:31.642 T:8211 info : plugin.video.sendtokodi: creating list item for url https://manifest.googlevideo.com/api/manifest/hls_variant/expire/1687924651/ei/S1ubZL7WC5Gx1gLw36nIDw/ip/%3A%3A/id/750c38c3d5a05dc4/source/youtube/requiressl/yes/playback_host/rr2---sn-ph2gvf5gx-haie.googlevideo.com/mh/7c/mm/31%2C29/mn/sn-ph2gvf5gx-haie%2Csn-1gi7znek/ms/au%2Crdu/mv/u/mvi/2/pcm2cms/yes/pl/37/hfr/1/demuxed/1/tts_caps/1/maudio/1/vprv/1/go/1/mt/1687902104/fvip/5/nvgoi/1/short_key/1/ncsapi/1/keepalive/yes/fexp/24007246%2C24363391/beids/24350018/dover/13/itag/0/playlist_type/DVR/sparams/expire%2Cei%2Cip%2Cid%2Csource%2Crequiressl%2Chfr%2Cdemuxed%2Ctts_caps%2Cmaudio%2Cvprv%2Cgo%2Citag%2Cplaylist_type/sig/AOq0QJ8wRgIhAJqsU7QHH6DlFa7yfZqD1S4GG3IidzMGurnFjbaZlCfxAiEA4dBB1WWFPVXceGhgfsHpu1Nxty1wNSGTWxEFksYCO8c%3D/lsparams/playback_host%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl/lsig/AG3C_xAwRQIgesSpTszjBDqxMyYofGRr4Nkh9iV5QFHcVEC8ed5DbHACIQD2oVkPowQiv7iRfWLvuOv5pLyYuoS8xlkBFx0vYsKhMQ%3D%3D/file/index.m3u8 2023-06-27 23:57:31.654 T:8211 warning : Setting most video properties through ListItem.setInfo() is deprecated and might be removed in future Kodi versions. Please use the respective setter in InfoTagVideo. 2023-06-27 23:57:31.672 T:1018 info : VideoPlayer::OpenFile: plugin://plugin.video.sendtokodi/?https://www.youtube.com/watch?v=dQw4w9WgXcQ 2023-06-27 23:57:31.853 T:8214 info : Creating InputStream 2023-06-27 23:57:31.855 T:8214 info : AddOnLog: inputstream.adaptive: [Repr. chooser] Resolution set: 3840x2160, max allowed: 3840x2160, Adjust refresh rate: 0 2023-06-27 23:57:32.036 T:8214 info : AddOnLog: inputstream.adaptive: Successfully parsed manifest file (Periods: 1, Streams in first period: 2, Type: live) 2023-06-27 23:57:32.036 T:8214 warning : AddOnLog: inputstream.adaptive: Unsupported codec in stream ID: 2023-06-27 23:57:32.036 T:8214 info : Creating Demuxer 2023-06-27 23:57:32.036 T:8214 info : Opening stream: 1002 source: 256 2023-06-27 23:57:32.373 T:8214 info : Finding audio codec for: 86018 2023-06-27 23:57:32.374 T:8214 info : CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac 2023-06-27 23:57:32.374 T:8214 info : OpenStream: Allowing max Out-Of-Sync Value of 10 ms 2023-06-27 23:57:32.374 T:8214 info : Creating audio thread 2023-06-27 23:57:32.374 T:8219 info : running thread: CVideoPlayerAudio::Process() 2023-06-27 23:57:32.374 T:8214 info : Process - eof reading from demuxer 2023-06-27 23:57:32.374 T:8214 info : CVideoPlayer::OnExit() 2023-06-27 23:57:32.374 T:8214 info : VideoPlayer: eof, waiting for queues to empty 2023-06-27 23:57:32.374 T:8214 info : Closing stream player 1 2023-06-27 23:57:32.374 T:8214 info : Waiting for audio thread to exit 2023-06-27 23:57:32.384 T:8219 info : thread end: CVideoPlayerAudio::OnExit() 2023-06-27 23:57:32.384 T:8214 info : Closing audio device 2023-06-27 23:57:32.384 T:8214 info : Deleting audio codec 2023-06-27 23:57:32.384 T:8214 info : ADDON: Dll Destroyed - InputStream Adaptive 2023-06-27 23:57:32.387 T:1018 info : CVideoPlayer::CloseFile() 2023-06-27 23:57:32.402 T:1018 info : VideoPlayer: waiting for threads to exit 2023-06-27 23:57:32.402 T:1018 info : VideoPlayer: finished waiting 2023-06-27 23:57:32.402 T:1018 info : CVideoPlayer::CloseFile() 2023-06-27 23:57:32.402 T:1018 info : VideoPlayer: waiting for threads to exit 2023-06-27 23:57:32.402 T:1018 info : VideoPlayer: finished waiting ``` **In case a certain website does not work for you** yt-dlp manages to fetch the video both with default settings and with `-f best`, so a merged version is definitely available. **Screenshots** **Additional context** This may be related to other issues about problems with Youtube videos (and adaptive streaming), but I haven't seen the "Unsupported codec in stream ID:" error message in any of the bug reports, so I'm not sure. I tried forcing a specific quality in the inpustream.adaptive plugin, but only had success with "Ask quality". However, the plugin will only produce video without audio in this case.
nullket commented 1 year ago

Nice example URL :laughing: you really got me :)

So the issue is that out of heaven we are able to get official manifest files for youtube (in the past those were hidden). Sendtokodi provides this manifest file just fine to the kodi player which should then be able to play the video using the input stream adaptive plugin (more on that e.g. here or here).

But kodi/inputstream adaptive seems to not support the manifest a certain codec (the manifest provides only avc1 and vp09 which should bot be supported in kodi 20).

The manifest/m3u8 file opens just fine in other players (e.g. vlc), thus I do not think the issue comes from sendtokodi. Maybe open an issue in inputstream adaptive (and provide them a uncomplicated way to get the url to a manifest as the urls are only valid for a couple of hours)

Anyway as a workaround you can simply disable adaptive stream in the sendtokodi settings (which will break other websites).

nullket commented 11 months ago

With the 20.3.10-Nexus release of input stream adaptive it should now work - I am currently not at home so I cannot test it. @onitake does it work for you (make sure to update input stream adaptive)

pejobo commented 11 months ago

I can confirm, had the same issue and with the update you mentioned it's fixed now

nullket commented 11 months ago

Thank you very much for the confirmation, I will close the issue then.