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

feat: resolution selection and default preview playback for 360° panorama videos #15747

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

pastleo
Copy link
Contributor

@pastleo pastleo commented Jan 28, 2025

Hello team, thanks for building this amazing app! I am surprised that it already includes photo-sphere-viewer and is even able to play 360° panorama videos.

However I discover that immich is playing original file 360° panorama videos. My 360° panorama videos are 5.6K and suitable formats (HEVC, AV1) are not fully supported. For example linux firefox can't play HEVC: Mozilla will not support HEVC while it is encumbered by patents.

Hope we can play transcoded video files in 360° panorama video mode by default and provide option for user to upgrade to full resolution, this is the PR that address this issue:

  1. Resolution Selection for Panorama Viewer:

    • Integrated @photo-sphere-viewer/resolution-plugin and added the ability to switch to the original, full-resolution video for users who want the highest fidelity.
  2. Default Preview Playback:

    • Panorama videos now load the transcoded preview file (getAssetPlaybackUrl) by default to reduce network usage and better compatibility.
    • The original file (getAssetOriginalUrl) is loaded only when the user selects the "Original" resolution or zooms in past a threshold (≥75% zoom).
  3. Navbar and Settings Enhancements:

    • Enhanced the viewer with the SettingsPlugin for a more intuitive interface, allowing users to easily access the resolution options.

Changes Made

  • Dependencies:
    • Added @photo-sphere-viewer/resolution-plugin and @photo-sphere-viewer/settings-plugin to both package.json and package-lock.json.
  • Code Modifications:
    • Updated photo-sphere-viewer-adapter.svelte:
      • Integrated the ResolutionPlugin with preview (labeled as default) and original resolutions.
      • Update logic to handle resolution switching on zoom.
    • Updated image-panorama-viewer.svelte and video-panorama-viewer.svelte to use originalPanorama for original resolution.
    • Ensured backward compatibility by defaulting to existing behavior if original files are unavailable.
  • Styling:
    • Included required CSS files for the new plugins.

Screenshots

Screenshot_20250128_171559

1. default to preview in photo-sphere-viewer video mode
2. install and integrate @photo-sphere-viewer/settings-plugin & @photo-sphere-viewer/resolution-plugin
@bo0tzz bo0tzz changed the title Enable Resolution Selection and Default Preview Playback for 360° Panorama Videos feat: resolution selection and default preview playback for 360° panorama videos Jan 28, 2025
@pastleo pastleo force-pushed the photo-sphere-resolutions branch from fbf4b1f to 123c09c Compare January 28, 2025 11:49
@pastleo pastleo force-pushed the photo-sphere-resolutions branch from 123c09c to 6b12334 Compare January 28, 2025 12:40
@pastleo
Copy link
Contributor Author

pastleo commented Jan 28, 2025

I fixed errors reported by eslint, please take a look, thank you!

@alextran1502 alextran1502 merged commit 08db77d into immich-app:main Jan 28, 2025
33 checks passed
@pastleo pastleo deleted the photo-sphere-resolutions branch January 28, 2025 15:13
@w00tlarr
Copy link

This is such a game changer for me! Thanks @pastleo!
Playback (2GB MP4 360 files from Insta360 X2) is smooth streaming now and I can share these videos with my fam!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants