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

Proposal: Standardize Stream Naming #1916

Closed
themak1985 opened this issue Jan 9, 2021 · 22 comments
Closed

Proposal: Standardize Stream Naming #1916

themak1985 opened this issue Jan 9, 2021 · 22 comments
Assignees

Comments

@themak1985
Copy link
Collaborator

themak1985 commented Jan 9, 2021

Is your feature request related to a problem? Please describe.
Sometimes we have numerous streams for one channel. The streams sometimes have adaptive or constant bitrates. Some are backups, some are part time broadcasts. What ends up happening is that we will have numerous streams for one channel with no differentiating factors.

Describe the solution you'd like
Using Example TV for channel name in scenarios.

Scenario 1: Two adaptive streams for same channel

Example TV
Example TV (Backup)

Scenario 2: Multiple Streams, main and backups are adaptive, others are constant bitrates.

Example TV
Example TV (Backup)
Example TV (Backup)
Example TV (480P)
Example TV (720P)
Example TV (1080P)
Example TV (2160P)

Scenario 3: Multiple streams, no adaptive links, multiple bitrates.

Example TV (480P)
Example TV (720P)
Example TV (1080P)
Example TV (1080P) (Backup)
Example TV (2160P)

(We could choose to simply place highest bitrate as main channel, in this example, 2160P would just be listed as Example TV)


Scenario 4: Part-time streams - I have three different options, we should pick one.

Example TV (Part-Time)
Example TV (Occasional)
Example TV (Not 24/7)

Scenario 5: Channels with time-shifts. (Not common here, but good to standardize.)

Example TV
Example TV +5
Example TV -4
Example TV -4 (Backup)

In example above, +5 and -4 represent hours difference from main stream.


Scenario 6: Single channel

Example TV

(Might be obvious, but no bitrate information should be added even if not adaptive)


Describe alternatives you've considered
I considered using terms like SD, HD, FHD, QHD, 2K, 4K, etc, but there are bitrates that do not adhere to these categories.

Additional context
I don't think we have to update all playlists if/when this is adopted, but we should add this information when finalized to contributing guide.

@themak1985
Copy link
Collaborator Author

@freearhey @Daniel15 what do you think? @link8k @lanesh4d0w thoughts?

@BellezaEmporium
Copy link
Collaborator

I had began doing the HD / SD options, but I agree that Example 3 would be more fitting. I'll have a look on the definitions and change them once I got them.

@BellezaEmporium
Copy link
Collaborator

BellezaEmporium commented Jan 9, 2021

Maybe @freearhey could make some magic on his IPTV checker, regarding the bitrate/definition of the stream.

Normally, bitrate is mentioned on stream data info, if it isn't then FFProbe can backup.
See https://superuser.com/questions/1106343/determine-video-bitrate-using-ffmpeg for more info about it.

@themak1985
Copy link
Collaborator Author

themak1985 commented Jan 9, 2021

I had began doing the HD / SD options, but I agree that Example 3 would be more fitting. I'll have a look on the definitions and change them once I got them.

Changed example to scenario, hope that makes things more clear.
Any opinion on what language we should use for part-time streams. I have seen all three used.

@themak1985
Copy link
Collaborator Author

An extreme case could look like this.

Example TV
Example TV (Backup)
Example TV (Backup)
Example TV (480P)
Example TV (720P)
Example TV (1080P)
Example TV +4 (1080P)
Example TV +4 (1080P) (Backup)
Example TV (2160P)
Example TV (Part-Time)

@themak1985 themak1985 self-assigned this Jan 9, 2021
@BellezaEmporium
Copy link
Collaborator

I had began doing the HD / SD options, but I agree that Example 3 would be more fitting. I'll have a look on the definitions and change them once I got them.

Changed example to scenario, hope that makes things more clear.
Any opinion on what language we should use for part-time streams. I have seen all three used.

Well, all three options are valid.

Occasional could be misleading, because we could take the scenario that some channels (in very rare cases) could stream on random dates (could also be linked to server issues).

Part-time could indicate more precisely that the mentioned channel has got a certain schedule, and does not stream 24/7.

@BellezaEmporium
Copy link
Collaborator

If possible, could this issue be pinned ? It's considered important IMO, because this will be an effective convention on channel naming.

@freearhey
Copy link
Collaborator

@themak1985 Good suggestion!

I also thought about this and the only thing I decided was to exclude "Backup/Backup1/etc" label from the channel name. The problem with it is that when you remove one link, you have to edit the name of all the other links to the same channel to keep the order and it slows down the process a lot especially when there are hundreds of links. For the rest, I agree with you.

As for automatic detection of broadcast quality, I will try to study this subject in the next couple of days and let you know.

@freearhey freearhey pinned this issue Jan 9, 2021
@BellezaEmporium
Copy link
Collaborator

@themak1985 Good suggestion!

I also thought about this and the only thing I decided was to exclude "Backup/Backup1/etc" label from the channel name. The problem with it is that when you remove one link, you have to edit the name of all the other links to the same channel to keep the order and it slows down the process a lot especially when there are hundreds of links. For the rest, I agree with you.

As for automatic detection of broadcast quality, I will try to study this subject in the next couple of days and let you know.

Cool :) I can take a look if needed, I got some JS skills up my sleeve.

@themak1985
Copy link
Collaborator Author

@themak1985 Good suggestion!

I also thought about this and the only thing I decided was to exclude "Backup/Backup1/etc" label from the channel name. The problem with it is that when you remove one link, you have to edit the name of all the other links to the same channel to keep the order and it slows down the process a lot especially when there are hundreds of links. For the rest, I agree with you.

As for automatic detection of broadcast quality, I will try to study this subject in the next couple of days and let you know.

Good point about the backup. Maybe we just adopt the time shift, constant bitrates, and part-time naming convention.

@freearhey
Copy link
Collaborator

Here's what I was able to find out.

Many streams do contain additional information including resolution, here's what it usually looks like:

#EXTM3U
#EXT-X-STREAM-INF:RESOLUTION=1280x720,FRAME-RATE=25.000,CODECS="avc1.4d001f,mp4a.40.2",AVERAGE-BANDWIDTH=1150026,BANDWIDTH=1437532
tracks-v1a1/mono.m3u8

If the stream is available in more than one resolution, the data looks like this:

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=792436,AVERAGE-BANDWIDTH=527904,RESOLUTION=416x234,CODECS="avc1.4d401e,mp4a.40.2"
http://ott-cdn.ucom.am/s46/01.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1508113,AVERAGE-BANDWIDTH=1004672,RESOLUTION=640x360,CODECS="avc1.4d401e,mp4a.40.2"
http://ott-cdn.ucom.am/s46/03.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2483419,AVERAGE-BANDWIDTH=1654400,RESOLUTION=854x480,CODECS="avc1.4d401e,mp4a.40.2"
http://ott-cdn.ucom.am/s46/04.m3u8

Based on that, I decided to add a parser to scripts/format.js, which loads each broadcast, looks for an attribute with resolution in it and adds it to the channel name. For cases where there are several quality options, the script chooses the highest one. If the stream does not contain the resolution attribute, for example:

#EXTM3U
#EXT-X-VERSION:2
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:293
#EXT-X-KEY:METHOD=NONE
#EXTINF:11,
stream2021_1_10_17_3_53-293.ts
#EXTINF:11,
stream2021_1_10_17_4_4-294.ts
...

the script just skips it. Here are the results: 234ab38

Also in the process it turned out that parentheses are often used to specify an alternative name, for example:

ABC 2 Baton Rouge LA (WBRZ-HD)
TV Qui (Modena)
Vera TV (Marche)
Русский Север (Вологда)

and it would be more convenient to put all extra notes in square brackets and at the very end, like so:

ABC 2 Baton Rouge LA (WBRZ-HD) [Part-Time]
TV Qui (Modena) (720p) [Occasional]
Vera TV +3 (Marche) [Not 24/7]
Русский Север (Вологда) (480p) [NO KODI]

The script already supports this syntax, but I can change it if needed.

@BellezaEmporium
Copy link
Collaborator

BellezaEmporium commented Jan 12, 2021

I also was thinking about something. We got radios on our IPTV streams. Could it be better to create a category that references all of them ?

I'll add something more. When we count the number of channels available, we should not count the backup ones, as it could falsify the final number.

@freearhey
Copy link
Collaborator

freearhey commented Jan 16, 2021

@themak1985 I propose the following scheme:

CHANNEL_NAME TIME_SHIFT (ALTERNATIVE_NAME) (RESOLUTION) [STATUS]
  • CHANNEL_NAME - Full name of the channel. It is recommended to use the name listed on lyngsat or wikipedia if possible. May contain any characters except plus sign, minus sign, round and square brackets.
  • TIME_SHIFT (optional) - Must be specified if the channel is broadcast with a shift in time relative to the main stream. Should only contain a number and a sign.
  • ALTERNATIVE_NAME (optional) - Can be used to specify a short name or name in another language. May contain any characters except round and square brackets.
  • RESOLUTION (optional) - The maximum height of the frame with a "p" at the end. In case of VLC Player this information can be found in Window > Media Information... > Codec Details.
  • STATUS (optional) - Specified if the broadcast for some reason is interrupted or does not work in a particular application. May contain any characters except round and square brackets.

The most complete example:

Example TV +3 (Пример ТВ) (720p) [not 24/7]

@BellezaEmporium
Copy link
Collaborator

@themak1985 I propose the following scheme:

CHANNEL_NAME TIME_SHIFT (ALTERNATIVE_NAME) (RESOLUTION) [STATUS]

- CHANNEL_NAME - may contain any characters except round and square brackets.
- TIME_SHIFT (optional) - can only contain a number and a sign.
- ALTERNATIVE_NAME (optional) - must be in parentheses and may contain any characters except round and square brackets.
- RESOLUTION (optional) - must be in parentheses and contain the maximum height of the frame with a "p" at the end.
- STATUS (optional) - may contain any characters except round and square brackets.

The most complete example:

Example TV +3 (Пример ТВ) (720p) [not 24/7]

If there are no objections, I can add this scheme to Contribution Guide and start updating channel names.

Maybe we could add a GitHub actions script that triggers the parser, to verify if data is correct.

As an example : someone adds a stream on PR.

Parser is triggered and could say : "Info OK" or "Warning : <Given resolution is 1920x1080, found 740x246>"

@trancer1994
Copy link
Contributor

About the sd/hd thing, here's what I propose:

Don't put SD in a channel name, but put (HD), (FHD), (UHD) etc in brackets if the channel's broadcast quality is anything above SD

Example:

Example TV
Example TV (HD)
Example TV (FHD)
Example TV (UHD)
etc

That way it wouldn't be so confusing for people when they look through the channels if they only wanted standard quality. If they were noobish they may mistake (SD) for high-definition or something, or might assume the channel doesn't broadcast in standard definition at all when it actually does.

The "example TV" would be for the standard quality, or the stream playlist file that lists all qualities. The rest is self-explanatory.

@freearhey
Copy link
Collaborator

@trancer1994 I like this idea.

As for broadcasts with adaptable quality, I think it would be better to specify the highest one.

@themak1985
Copy link
Collaborator Author

I think the ultimate goal here is not to have bitrate information for every stream but to differentiate multiple streams of the same channel. I also think bitrate is a better approach over naming. 1080P>FHD

@BellezaEmporium
Copy link
Collaborator

BellezaEmporium commented Jan 20, 2021

To be honest, there are also "fake HD" streams (bitrate going close to 1080p isn't a real HD stream)

@themak1985
Copy link
Collaborator Author

@freearhey I think this is safe to close now right?

@freearhey
Copy link
Collaborator

@themak1985 don't you want to discuss @trancer1994's suggestion to use HD, FHD? I know you've thought about this option before, but you were stopped by the fact that some channels are broadcast in non-standard resolution.

For example, we could do this:

less than 720p => Example TV
720p < 1080p => Example TV (HD)
1080p < 2160p => Example TV (FHD)
2160p or bigger => Example TV (UHD)

In the current version, whatever the resolution is, it will be written in the channel name and most of the time it's 1080p and 720p.

I'm really curious what you think about that.

@themak1985
Copy link
Collaborator Author

@freearhey Not a bad idea, but I would say

less than 480p => Example TV (SD)
480p or higher but less than 1080p => Example TV (HD)
1080p or higher, but less than 2160p => Example TV (FHD)
2160p or higher => Example TV (UHD)

Its less accurate than what we have now but to end user, might be nicer to see. Also we just leave adaptive as blank right or do we choose the highest possible stream?

@freearhey
Copy link
Collaborator

I studied the playlists more closely and noticed that the label "HD" is often part of the official name of the channels. So if we start adding to them more labels like SD, HD, FHD it can cause even more confusion. For example:

Example HD (SD)

So I think it would be better to keep the 480p/720p/1080p option for now. But if something changes in the future we will discuss this topic again.

@freearhey freearhey unpinned this issue Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants