vargalex / plugin.video.mediaklikk

Mediaklikk Kodi plugin
1 stars 0 forks source link

Audio stream none on all channels except M3 #1

Closed Fredrik-Smartoptics closed 1 year ago

Fredrik-Smartoptics commented 1 year ago

I have been working on this for a while but I now think it must be something in the plugin code. I get no sound from kodi (No audiostream at all) for all channels except M3 which works as intended. All channels display perfect video. I tested on 3 devices, a windows pc, an android TV and a google TV. They all show the same behaviour. I changed back and fourth with audio settings but as there is no audio stream at all I think it is impossible to solve via settings. I also tried upgrading from Kodi Matrix to Nexus (Beta 1) and they also behave the same.

Checking the log in Kodi when playing a channel that has no sound: 2022-12-02 00:27:02.861 T:9288 debug : CPlayerSelectionRule::GetPlayers: considering rule: aacp/sdp 2022-12-02 00:27:02.861 T:9288 debug : CPlayerSelectionRule::GetPlayers: considering rule: mp2 2022-12-02 00:27:02.861 T:9288 debug : CPlayerSelectionRule::GetPlayers: considering rule: dvd 2022-12-02 00:27:02.861 T:9288 debug : CPlayerSelectionRule::GetPlayers: considering rule: discimage 2022-12-02 00:27:02.861 T:9288 debug : CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf 2022-12-02 00:27:02.861 T:9288 debug : CPlayerSelectionRule::GetPlayers: considering rule: nsv 2022-12-02 00:27:02.861 T:9288 debug : CPlayerSelectionRule::GetPlayers: considering rule: radio 2022-12-02 00:27:02.861 T:9288 debug : CPlayerCoreFactory::GetPlayers: matched 0 rules with players 2022-12-02 00:27:02.861 T:9288 debug : CPlayerCoreFactory::GetPlayers: adding videodefaultplayer (VideoPlayer) 2022-12-02 00:27:02.861 T:9288 debug : CPlayerCoreFactory::GetPlayers: for video=true, audio=false 2022-12-02 00:27:02.861 T:9288 debug : CPlayerCoreFactory::GetPlayers: for video=true, audio=true 2022-12-02 00:27:02.861 T:9288 debug : CPlayerCoreFactory::GetPlayers: added 1 players 2022-12-02 00:27:02.863 T:9288 debug : Radio UECP (RDS) Processor - new CDVDRadioRDSData::CDVDRadioRDSData 2022-12-02 00:27:02.864 T:9288 debug : Audio ID3 tag processor - new CVideoPlayerAudioID3::CVideoPlayerAudioID3

It cant match any rule so it reverts to playing video player for audio which seems to fail for the said channels. When using the official mediaklikk link like "https://mediaklikk.hu/m2-elo/" and put into VLC mediaplayer it plays video plus sound and it says "AACL-141 Magyar" as audio stream. So the audio is there. It is just that Kodi tries with the wrong player. Added the complete log aswell.

Tudz Angol?

Fredrik-Smartoptics commented 1 year ago

Error log kodierror log.log

I think that if the code is changed so that soundparameter is hardcoded to say mp2 it will choose the audioplayer instead and problem should be solved.

Fredrik-Smartoptics commented 1 year ago

I examined some more. I checked with http tracker on the mediaklikk website while playing the channel. It seems video and audio are separate stream urls. If I check the kodi log while running the plugin it only refers to url with tag "avc1": :13696 debug : CPlayerCoreFactory::GetPlayers(https://c402-node61-cdn.connectmedia.hu/110302/af221a9ac0c29839053391fa4117b289/638fc201/302-M2_NOGEO-**avc1**_3200000=10005.m3u8) 2022-12-06 23:28:17.322 T:13696 debug : CPlayerSelectionRule::GetPlayers: considering rule: system rules

It seems it also checks the audio towards this url. And then fails to match. From mediaklikks website I get 2 type of url streams one similar to the one above but also one with tag mp4a, same structure in the rest:

https://c201-node61-cdn.connectmedia.hu/110306/c43b45c35bd309f812e3e918f61d2db7/638fc320/306-DunaWorld_NOGEO-**mp4a**_140800_hun=20000.m3u8

When I play the avc1 url in VLC mediaplayer I only get video and no sound. When I play the mp4a url I only get sound and no video. Could it be that the sound and video are separate streams? I would have a go at it myself but I have not coded in 15 years and only in school so I am quite novice.

Video stream Mp4 stream
krisek commented 1 year ago

Yes, mediaklikk uses HLS and MPEG-TS; where it is completely valid to define one audio stream and multiple video streams (eg. in various qualities).

ffplay can render such HLS streams without any issue (just tested with an index.m3u8 link extracted from mediaklikk.hu).

I see Kodi uses ffmpeg (https://kodi.wiki/view/VideoPlayer#:~:text=FFmpeg%20%2D%20all%20audio%20and%20video%20decoders%20supported%20by%20FFmpeg%20(avcodec/avformat)%20open%20source%20codec%20suite), so this case is not lost at all.

Fredrik-Smartoptics commented 1 year ago

Ok thanks. What can be the reason then? The weird thing is that M3 works with sound for me on all devices. But no other channel. Is there any difference you know of between M3 and the others? It is a different streaming source but other than that?

krisek commented 1 year ago

the key is here: https://github.com/vargalex/plugin.video.mediaklikk/blob/master/default.py#L145-L149

Gábor takes the m3u8 playlist, analyses it, and feeds back (parts of it?) to Kodi. As far as I remember Kodi could take directly the m3u8 playlist --- at least a few years ago I used this to generate dynamic playlist for Kodi and that worked.

I'll fork it and give a try, it seems to be trivial... or maybe Gábor picks it up.

As for M3, you can see on default.py#L128, it is distributed in different format: maybe as it is an archive channel the licencing is different or there are no multiple resolutions for the stream so HLS is not required.

vargalex commented 1 year ago

That was so implemented, because with this parsing the user could choose the right resolution for playing. Fixet with merged pull request from krisek.