Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPTV/HLS/M3U: Failing to parse EXT-X-VERSION 7 #936

Open
angelaschmid opened this issue Aug 10, 2024 · 5 comments
Open

IPTV/HLS/M3U: Failing to parse EXT-X-VERSION 7 #936

angelaschmid opened this issue Aug 10, 2024 · 5 comments
Assignees

Comments

@angelaschmid
Copy link
Contributor

Running latest master.

Streams from Zattoo, Teleboy, famous IPTV providers in Germany/Switzerland, are failing to play in MythTV. They play fine in VLC.
MythTV does not have version 7 M3U implemented.

The stream contains the following M3U data:

#EXTM3U
#EXT-X-VERSION:7
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="deutsch",DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="deu",URI="https://zba6-0-hls7-live.zahs.tv/telebielingue/t_track_audio_bw_128000000_num_0_tid_2_p_10_l_de_nd_1600_mbr_2999.m3u8?z32=MF2......"
#EXT-X-STREAM-INF:BANDWIDTH=2999000,CODECS="avc1.4d4020,mp4a.40.2",RESOLUTION=1024x576,FRAME-RATE=50,AUDIO="audio",CLOSED-CAPTIONS=NONE
https://zba6-0-hls7-live.zahs.tv/telebielingue/t_track_video_bw_2799000_num_0_tid_1_nd_1600_mbr_2999.m3u8?z32=MF2......

  • MythTV version:
    Latest master

  • Component:
    mythbackend

What do you see instead?

Logfile mythbackend:
StreamHandler m3u.cpp:106 (ParseVersion) - #EXT-X-VERSION is 7, but we only understand 0 through 3

Changing the source to also allow version 7, gives the following failures, and the stream does not play:

2024-08-05 10:41:19.523190 I [344463/352425] StreamHandler m3u.cpp:120 (ParseStreamInformation) - Parsing stream from https://zba6-1-hls7-live.zahs.tv/HD_s1/t_track_video_bw_7800000_num_0_tid_1_nd_1600_mbr_8000.m3u8?z32=MF2WI2L
2024-08-05 10:41:19.523196 I [344463/352425] StreamHandler m3u.cpp:132 (ParseStreamInformation) - #EXT-X-STREAM-INF: expected PROGRAM-ID=, using -1
2024-08-05 10:41:19.523200 I [344463/352425] StreamHandler m3u.cpp:157 (ParseStreamInformation) - bandwidth adaptation detected (program-id=-1, bandwidth=8000000
2024-08-05 10:41:20.590946 D [344463/352428] HLSPlaylist m3u.cpp:367 (ParseProgramDateTime) - https://zba6-1-hls7-live.zahs.tv/HD_s1/t_track_video_bw_7800000_num_0_tid_1_nd_1600_mbr_8000.m3u8?z32=MF2WI2L tag not supported: #EXT-X-PROGRAM-DATE-TIME #EXT-X-PROGRAM-DATE-TIME:2024-08-05T08:39:56.800+00:00
2024-08-05 10:41:21.603634 D [344463/352428] HLSPlaylist m3u.cpp:367 (ParseProgramDateTime) - https://zba6-1-hls7-live.zahs.tv/HD_s1/t_track_video_bw_7800000_num_0_tid_1_nd_1600_mbr_8000.m3u8?z32=MF2WI2L tag not supported: #EXT-X-PROGRAM-DATE-TIME #EXT-X-PROGRAM-DATE-TIME:2024-08-05T08:39:56.800+00:00
2024-08-05 10:41:22.615515 D [344463/352428] HLSPlaylist m3u.cpp:367 (ParseProgramDateTime) - https://zba6-1-hls7-live.zahs.tv/HD_s1/t_track_video_bw_7800000_num_0_tid_1_nd_1600_mbr_8000.m3u8?z32=MF2WI2L tag not supported: #EXT-X-PROGRAM-DATE-TIME #EXT-X-PROGRAM-DATE-TIME:2024-08-05T08:39:58.400+00:00
2024-08-05 10:44:24.025961 I [344463/358923] StreamHandler m3u.cpp:120 (ParseStreamInformation) - Parsing stream from https://zh4-11-hls7-live.zahs.tv/HD_s1/t_track_video_bw_7800000_num_0_tid_1_nd_1600_mbr_8000.m3u8?z32=MF2W
2024-08-05 10:44:24.025965 I [344463/358923] StreamHandler m3u.cpp:132 (ParseStreamInformation) - #EXT-X-STREAM-INF: expected PROGRAM-ID=, using -1
2024-08-05 10:44:24.025969 I [344463/358923] StreamHandler m3u.cpp:157 (ParseStreamInformation) - bandwidth adaptation detected (program-id=-1, bandwidth=8000000
2024-08-05 10:44:25.103642 D [344463/358926] HLSPlaylist m3u.cpp:367 (ParseProgramDateTime) - https://zh4-11-hls7-live.zahs.tv/HD_s1/t_track_video_bw_7800000_num_0_tid_1_nd_1600_mbr_8000.m3u8?z32=MF2Wtag not supported: #EXT-X-PROGRAM-DATE-TIME #EXT-X-PROGRAM-DATE-TIME:2024-08-05T08:43:00.800+00:00
2024-08-05 10:44:26.117132 D [344463/358926] HLSPlaylist m3u.cpp:367 (ParseProgramDateTime) - https://zh4-11-hls7-live.zahs.tv/HD_s1/t_track_video_bw_7800000_num_0_tid_1_nd_1600_mbr_8000.m3u8?z32=MF2Wtag not supported: #EXT-X-PROGRAM-DATE-TIME #EXT-X-PROGRAM-DATE-TIME:2024-08-05T08:43:02.400+00:00

@kmdewaal
Copy link
Contributor

Can you please provide a complete version 7 m3u file?
Actually playing something from Zattoo might be difficult in The Netherlands because of geofencing but a fix for the parser can be tested.

@kmdewaal
Copy link
Contributor

HLS version 7 is described here https://datatracker.ietf.org/doc/html/rfc8216 and it looks to be non-trivial undertaking...

@angelaschmid
Copy link
Contributor Author

Hi Klaas

Please find attached mythtv_936_m3u.zip

  • hls_init7_list.m3u, program list of my local internet provider, only available on their network
  • hls_init7_ext6_stream.m3u, EXT6 stream
  • hls_zattoo_list.m3u, program list of Zattoo Switzerland, GEO-blocked
  • hls_zattoo_ext7_stream.m3u, EXT7 stream

Zattoo is offered only in Germany, Switzerland and Austria. Each having their own account and GEO-blocking.
To use it, I use "telerising", a daemon who acts in the middle to login to Zattoo (cookie handling) and produces a program.m3u and stream.m3u:

  • Use a VPN to one of the countries
  • Create a free account, allows 30 hours of streaming/month.
  • download, https://github.com/sunsettrack4/telerising-api: telerising-v0.13.4_x86-64_linux.zip
  • unpack
  • exec ./api, shows the available web server ports
  • browser, e.g. http://192.168.1.11:5000
  • configure: choose admin password, choose e.g. Zattoo CH (Smart TV), press SELECT, add account details, press "Add TV Setup", use M3U playlist URL

https://www.kodinerds.net/thread/72127-telerising-api-zattoo-blue-tv-sky-ch-f%C3%BCr-tvheadend-und-vlc-web-app/
https://github.com/applesh00ter/telerising-api

Currently I am stuck on master of ~August, due to #955, but will be available to test.

Cheers, Angela

@kmdewaal kmdewaal self-assigned this Nov 18, 2024
@kmdewaal
Copy link
Contributor

kmdewaal commented Nov 21, 2024

Testing with a local IPTV stream for channel EWTN Europe did show up one bug.

The tag EXT-X-DISCONTINUITY-SEQUENCE is parsed and executed as EXT-X-DISCONTINUITY which is another tag, and this leads to a total reset every time the tag is encountered. This then causes downloading at maximum bandwidth and in my case this then downloads 60Mbyte per second. Playback however is OK.

I vaguely recall that this problem has been reported by somebody long ago.

Adding parsing of EXT-X-DISCONTINUITY-SEQUENCE does fix this even when not yet doing anything with the value.
I intend to add a fix for this in the near future.

To be continued.

kmdewaal added a commit that referenced this issue Nov 23, 2024
Add parsing of tag EXT-X-DISCONTINUITY-SEQUENCE.
Previously, this tag was erroneously parsed and
executed as EXT-X-DISCONTINUITY. This then caused
continuous downloading at maximum bandwidth.

Add parsing of tags EXT-X-INDEPENDENT-SEGMENTS.
There is no implementation added but this does
prevent parsing failure.

Allow EXT-X-VERSION tag values from 1 to 7.
There is no implementation added but this does
prevent parsing failure.

Refs #936
@kmdewaal
Copy link
Contributor

@angelaschmid I have committed a fix to master. With this fix many channels that previously could not be received are now playing good. I have not yet tested with your channels as I could produce already many problems with the readily available IPTV channels. It is possible that your issue is now resolved. Testing is appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants