Bug #3281
Use m3u-duration as channel number
100%
Description
With Freebox TV bouquet, the m3u is providing channel number using the m3u duration attribute:
#EXTINF:2,France 2 HD rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=201&flavour=hd
This is non-standard, but since m3u-duration is already parsed by the new misc/m3u.c, could it be used by iptv_auto.c when creating channels?
History
Updated by Jaroslav Kysela about 9 years ago
- Assignee changed from Andreas Smas to Jaroslav Kysela
Updated by Jaroslav Kysela about 9 years ago
The channel numbers ends with ? Is something else in the .m3u list which can identify this?
Updated by Jelly Frog about 9 years ago
This or some other way to specify channel number in m3u would be nice.
Without knowing any C, wouldn't it work to do something like:
diff --git a/src/input/mpegts/iptv/iptv_auto.c b/src/input/mpegts/iptv/iptv_auto.c index ff86d79..f289990 100644 --- a/src/input/mpegts/iptv/iptv_auto.c +++ b/src/input/mpegts/iptv/iptv_auto.c @@ -74,6 +74,8 @@ iptv_auto_network_process_m3u_item(iptv_network_t *in, chnum += *total; else chnum += (int64_t)*total * CHANNEL_SPLIT; + } else { + chnum = htsmsg_get_s64_or_default(item, "m3u-duration", 0); } name = htsmsg_get_str(item, "m3u-name");
Updated by Jaroslav Kysela about 9 years ago
The source for duration is correct, but the above patch isn't. It won't allow to add a custom offset to the channel numbers. Perhaps, adding a string match for mafreebox.freebox.fr in URL might solve this. I would like to add rather a custom attribute line 'tvh_chnum' to the m3u parser, so users might create own lists with the correct information.
Updated by Adrien CLERC about 9 years ago
Either a tvh_chnum, or an option in the IPTV auto network to parse m3u duration as channel number.
The second solution involves zero modification of the m3u. However, having a simple script that modifies the original m3u is not a real issue. This m3u is modified at most twice a year, so updating it is not an issue.
I think that having a special rule for some hosts (like mafreebox.freebox.fr) is not a good idea. Or at least, it shouldn't be hardcoded in C code.
Updated by Jaroslav Kysela about 9 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset commit:tvheadend|bafa61277c3a5ba7178bca05a2e2f702a013b246.
Updated by Jaroslav Kysela about 9 years ago
Added tvh-chnum m3u attribute parsing in v4.1-960-gbafa612 .
Example:
#EXTINF:3 tvg-id="ct1" tvh-chnum=10.1,CT 1 HD
Note: The number after dot is minor part of the number (ATSC notation is also supported!).
Updated by B C about 9 years ago
this is not working for me, with this syntax I don't even get the Service name into tvh.
and would it be possible to tag the channel based on another parameter?
Updated by B C about 9 years ago
ok, forgot putting tvh-chnum in "", so I have at least my names back. Still I cannot see any channel number
Updated by Jaroslav Kysela about 9 years ago
The parsing without "" is fixed in v4.1-964-g7173bba . I see the channel number in the mux settings.
Updated by Jaroslav Kysela about 9 years ago
Mapping works too. The IPTV channel numbers are not visible in the service grid.