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

Videos: Support for HTTP Live Streaming (HLS) with M3U8 #4179

Open
tezza1971 opened this issue Apr 16, 2024 · 1 comment
Open

Videos: Support for HTTP Live Streaming (HLS) with M3U8 #4179

tezza1971 opened this issue Apr 16, 2024 · 1 comment
Labels
help wanted Well suited for external contributors! idea Feedback wanted / feature request live Hybrid photo/video file format support video Video Formats, Transcoding, FFmpeg, Streaming & Co

Comments

@tezza1971
Copy link

tezza1971 commented Apr 16, 2024

I did a search, and I haven't seen this yet, but I think HLS support would be idea. I understand that photoprism is not meant to be a video hosting platform but even short clips take a long time to start playing because it seems the whole thing needs to download before playback begins. It makes photoprism look like it's slow when it is far from slow for everything else.

I've been using HLS with my PeerTube instance and it really makes the platform feel snappy and a joy to use. Thats the way things are with PhotoPrism on photos so it makes sense to use HLS because it's the low hanging fruit to get the video playback experience up to speed.

I did a quick and dirty inquiry using AI and HLS doesn't look overly difficult to implement using Video.js

https://www.perplexity.ai/search/How-hard-is-rBxuRFIOREGSJMae.6euSA

I'm not sure but I think even without multiple bitrate versions of the video clip, the chunking down of the big video blob makes it scrubbable before total download - which I think is a big deal.

What do you think?

@tezza1971 tezza1971 added the idea Feedback wanted / feature request label Apr 16, 2024
@lastzero
Copy link
Member

It seems the whole thing needs to download before playback begins

This is not true. Browsers usually perform so-called "range requests" for this and PhotoPrism supports that. However, streaming only starts after the entire video has been transcoded (if needed), as the required metadata is gathered during transcoding and then (in the last step!) placed at the beginning of the transcoded video file:

Note that in some cases, e.g. with files created by other software, this required metadata MAY be at the end of the file and not at the beginning, so - as described in the documentation linked above - the video must be downloaded completely before it can be played by the browser.

I understand that we could split long videos into smaller files and assemble them into a full length video with an M3U8 playlist, so playback can start while some files are still being transcoded (and possibly different bitrates could be offered).

However, the videos would still need to be transcoded and users might then not have a single regular AVC video file (with Faststart) in their library, but a bunch of files that they don't know how to play e.g. with Windows Explorer:

There are pros and cons, but we'd be happy to look at it and also accept well-tested pull requests (there are actually quite a few Go libraries on GitHub that we might be able to integrate or use as inspiration if their license permits):

@lastzero lastzero changed the title Category: video playback - HLS (HTTP Live Streaming) support for playback Videos: Support for HTTP Live Streaming (HLS) with M3U8 Apr 16, 2024
@lastzero lastzero added help wanted Well suited for external contributors! video Video Formats, Transcoding, FFmpeg, Streaming & Co live Hybrid photo/video file format support labels Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Well suited for external contributors! idea Feedback wanted / feature request live Hybrid photo/video file format support video Video Formats, Transcoding, FFmpeg, Streaming & Co
Projects
None yet
Development

No branches or pull requests

2 participants