Skip to content

Standardized m3u8 formatting#229

Merged
ikatson merged 1 commit into
ikatson:mainfrom
artrixdotdev:main
Aug 29, 2024
Merged

Standardized m3u8 formatting#229
ikatson merged 1 commit into
ikatson:mainfrom
artrixdotdev:main

Conversation

@artrixdotdev

Copy link
Copy Markdown
Contributor

Currently you're breaking the m3u8 standard and it breaks some media players. Adding the #EXTM3U tag should fix it.

There is more information that would be best practice to add but I don't know how to add it. Please read the m3u8 spec or the wiki for more information.

@artrixdotdev

Copy link
Copy Markdown
Contributor Author

Is there any way I can get the file size for each torrent?

@ikatson ikatson merged commit 0b248a9 into ikatson:main Aug 29, 2024
@ikatson

ikatson commented Aug 29, 2024

Copy link
Copy Markdown
Owner

What do you mean? Through http API? Must be in one of the stats endpoints, /torrents/id/stats/v1 if I remember correctly (on phone)

@artrixdotdev

artrixdotdev commented Aug 29, 2024

Copy link
Copy Markdown
Contributor Author

the #EXTINF: tag requires the file size for each uri in the playlist. Is there any way to get that inside the playlist response?

@artrixdotdev

Copy link
Copy Markdown
Contributor Author

@ikatson

ikatson commented Aug 29, 2024

Copy link
Copy Markdown
Owner

Build playlist content is called from the iterator iter_filenames_and_lengths, the second item there is length in bytes

@ikatson

ikatson commented Aug 29, 2024

Copy link
Copy Markdown
Owner

See https://datatracker.ietf.org/doc/html/rfc8216#section-4.3.2.1

That's not what it is though, it's not HTTP live streaming streaming, just a playlist with links .

See https://en.m.wikipedia.org/wiki/M3U

So at best you can add #EXTBYT

There's no length in seconds, rqbit doesn't understand video/audio formats and their details.

Streaming is done through range header (bytes) and a lot of clients are fine with this.

So not sure what is it breaking, it's just probably not what you think it is?

@artrixdotdev

Copy link
Copy Markdown
Contributor Author

My bad! I got the file size and video length mixed up. Currently it still breaks Hls.js which is a fairly popular HLS player on the web.

@ikatson

ikatson commented Aug 30, 2024

Copy link
Copy Markdown
Owner

Got it. It's not HLS though which afaik needs specially crafted input, full files aren't enough

@artrixdotdev

Copy link
Copy Markdown
Contributor Author

It is possible to split each file into segments relatively easily. Segments consist of .ts files which afaik are quite literally just chunked mpeg files (would be basically the same as what you're already doing just with a different file extension). I'll try to implement this in another PR if I can get some help

@artrixdotdev

Copy link
Copy Markdown
Contributor Author

Actually this is might be more complicated and require FFmpeg. Which might add extra bloat. Probably should make this a feature flag called "pure-hls" or something

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

Successfully merging this pull request may close these issues.

2 participants