bpatrik / pigallery2

A fast directory-first photo gallery website, with rich UI, optimized for running on low resource servers (especially on raspberry pi)
http://bpatrik.github.io/pigallery2/
MIT License
1.76k stars 202 forks source link

DASH adaptive streaming for video #720

Open mblythe86 opened 1 year ago

mblythe86 commented 1 year ago

Is your feature request related to a problem? Please describe.

Internet speeds can vary greatly. While I'm personally on a 1Gb fiber, I may be browsing my photo site at a friend's house who's on DSL, or in an area with limited cell reception.

Without knowing what internet conditions will be like in the future, I can't pick a single video transcoding bitrate to suit all needs. I'd want a low bitrate for some situations, but then that sacrifices resolution and quality when I do have good internet bandwidth.

Describe the solution you'd like

Modern browsers have native support for Dynamic Adaptive Streaming over HTTP (DASH). This would allow us to transcode videos at multiple quality/resolution/bitrate settings, and the browser would dynamically select the appropriate video to stream, based on current network conditions. The downside is higher APU usage at indexing time (to transcode multiple copies of each video), and higher disk usage (to store the copies).

Describe alternatives you've considered (optional) Other potential solutions could include any of the other dynamic-adaptive streaming protocols, but DASH is included in the HTML5 spec, so it should have broad native browser support without having to pull in additional JavaScript libraries.

Or, I'm sure there's a way to transcode videos on-the-fly, and dynamically adjust settings for network conditions. But that has high CPU overhead, which is undesirable.

bpatrik commented 1 year ago

Thank you for the suggestion. I don't see myself implementing this in the near future. Let me know if you want to give it a try.