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

Config: Add option to stream videos over the specified CDN #2875

Closed
shivanshs9 opened this issue Nov 9, 2022 · 7 comments
Closed

Config: Add option to stream videos over the specified CDN #2875

shivanshs9 opened this issue Nov 9, 2022 · 7 comments
Assignees
Labels
idea Feedback wanted / feature request performance Performance Optimization released Available in the stable release video Video Formats, Transcoding, FFmpeg, Streaming & Co

Comments

@shivanshs9
Copy link

Describe what problem this solves and why this would be valuable to many users

Right now, the PHOTOPRISM_CDN_URL envvar only enables static assets, thumbnails and compressed library images to be delivered via CDN. Not for video files.

Describe the solution you'd like

CDN could be enabled for videos too.

@shivanshs9 shivanshs9 added the idea Feedback wanted / feature request label Nov 9, 2022
@lastzero
Copy link
Member

lastzero commented Nov 9, 2022

Videos are complicated in that these are streamed, the supported formats must be detected and the video must be transcoded on demand if the format is not supported or the bitrate is too high. We found this not to work well with (at least) our provider and that's why it's not supported. If you have a lot of practical experience and know how to build it so that it always works and is compatible with any CDN provider, please let us know! 👍

@lastzero
Copy link
Member

@shivanshs9 This issue is related to what I've been working on this week:

If I remember correctly, KeyCDN had problems with video streaming. I can't remember any details though. It will definitely cause a lot of extra traffic that you have to pay for. Not all users might want to do that!?

Cloudflare doesn't support video by default either, only for an additional fee (because of the traffic it causes).

Note that we had to switch our website and demo.photoprism.app from KeyCDN to Bunny CDN last weekend, which might work better for videos based on the settings I've seen in their admin UI.

I've also started working on a CDN setup guide (contributions and feedback welcome):

@lastzero lastzero self-assigned this Mar 21, 2023
@lastzero lastzero added performance Performance Optimization help wanted Well suited for external contributors! labels Mar 21, 2023
@lastzero lastzero changed the title Support for video delivery over CDN Config: Add an option to enable video streaming through the specified CDN Mar 21, 2023
@lastzero lastzero added help wanted Well suited for external contributors! and removed help wanted Well suited for external contributors! labels Mar 21, 2023
@lastzero lastzero changed the title Config: Add an option to enable video streaming through the specified CDN Config: Add option to stream videos over the specified CDN Mar 21, 2023
@lastzero lastzero added the video Video Formats, Transcoding, FFmpeg, Streaming & Co label Mar 21, 2023
lastzero added a commit that referenced this issue Apr 14, 2023
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero lastzero added the please-test Ready for acceptance test label Apr 14, 2023
@lastzero
Copy link
Member

lastzero commented Apr 14, 2023

An updated preview build will be available for testing soon. As always, help with testing is much appreciated! Thank you ❤️

lastzero added a commit that referenced this issue Apr 14, 2023
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero
Copy link
Member

Had to add more cache headers for this to work. CDN caching can then be enabled by adding the following variable to your docker-compose.yml file:

PHOTOPRISM_CDN_VIDEO: "true"

lastzero added a commit that referenced this issue Apr 14, 2023
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero
Copy link
Member

The last change prevents token headers from being sent in public mode (like on our demo), so that the default tokens are used for viewing and downloading. Changing tokens each time the instance is restarted would otherwise prevent caching because these are part of the URL.

@lastzero
Copy link
Member

A new development preview will be available for testing soon!

@lastzero
Copy link
Member

Our demo works great with this. Let us know if you require any further changes. We'll otherwise release it like it is and close this issue.

@graciousgrey graciousgrey added tested Changes have been tested successfully and removed please-test Ready for acceptance test labels Apr 24, 2023
@graciousgrey graciousgrey added released Available in the stable release and removed help wanted Well suited for external contributors! tested Changes have been tested successfully labels May 3, 2023
@lastzero lastzero moved this to Released 🌈 in Roadmap 🚀✨ Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Feedback wanted / feature request performance Performance Optimization released Available in the stable release video Video Formats, Transcoding, FFmpeg, Streaming & Co
Projects
Status: Release 🌈
Development

No branches or pull requests

3 participants