360 video is flattened #1708

Open
opened 2026-02-20 00:14:00 -05:00 by deekerman · 7 comments
Owner

Originally created by @JesseWebDotCom on GitHub (Nov 30, 2023).

Originally assigned to: @mertalev on GitHub.

The bug

When re-encoding 360 video, immich flattens the video.

To confirm:

  • take a 360 degree mp4 video, open in VLC, and confirm you can properly rotate the video in 360 degrees
  • now have immich re-encode that video (HEVC in my case) and do the same test in VLC - you will not be able to rotate the video

My theory is immich loses the 360 side data when using FFmpeg to re-encode. For example, here is some ffprobe side data for a 360 video that I believe immich loses:

  Stream #0:0[0x1](und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709), 4096x2048 [SAR 1:1 DAR 2:1], 28334 kb/s, 29.97 fps, 29.97 tbr, 90k tbn (default)
    Metadata:
      creation_time   : 2022-07-27T13:27:56.000000Z
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
    Side data:
      spherical: equirectangular (0.000000/0.000000/0.000000) 

When re-encoding, immich needs to add -strict unofficial flag to the ffmpeg command line in order to copy the video projection metadata. See here for more detail: https://stackoverflow.com/questions/44760588/preserving-side-data-information-for-360-video-transcoding-using-ffmpeg/48147865#48147865

The OS that Immich Server is running on

Ubuntu 22.10

Version of Immich Server

v1.89.0

Version of Immich Mobile App

v1.89.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

n/a

Your .env content

n/a

Reproduction steps

see above

Additional information

No response

Originally created by @JesseWebDotCom on GitHub (Nov 30, 2023). Originally assigned to: @mertalev on GitHub. ### The bug When re-encoding 360 video, immich flattens the video. To confirm: - take a 360 degree mp4 video, open in VLC, and confirm you can properly rotate the video in 360 degrees - now have immich re-encode that video (HEVC in my case) and do the same test in VLC - you will not be able to rotate the video My theory is immich loses the 360 side data when using FFmpeg to re-encode. For example, here is some ffprobe side data for a 360 video that I believe immich loses: ``` Stream #0:0[0x1](und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709), 4096x2048 [SAR 1:1 DAR 2:1], 28334 kb/s, 29.97 fps, 29.97 tbr, 90k tbn (default) Metadata: creation_time : 2022-07-27T13:27:56.000000Z handler_name : VideoHandler vendor_id : [0][0][0][0] Side data: spherical: equirectangular (0.000000/0.000000/0.000000) ``` When re-encoding, immich needs to add -strict unofficial flag to the ffmpeg command line in order to copy the video projection metadata. See here for more detail: https://stackoverflow.com/questions/44760588/preserving-side-data-information-for-360-video-transcoding-using-ffmpeg/48147865#48147865 ### The OS that Immich Server is running on Ubuntu 22.10 ### Version of Immich Server v1.89.0 ### Version of Immich Mobile App v1.89.0 ### Platform with the issue - [X] Server - [X] Web - [X] Mobile ### Your docker-compose.yml content ```YAML n/a ``` ### Your .env content ```Shell n/a ``` ### Reproduction steps ```bash see above ``` ### Additional information _No response_
Author
Owner

@johmicrot commented on GitHub (Aug 1, 2024):

I'm on the latest release (v.1.111.0) and this is still a persisting issue

@johmicrot commented on GitHub (Aug 1, 2024): I'm on the latest release (v.1.111.0) and this is still a persisting issue
Author
Owner

@mertalev commented on GitHub (Oct 19, 2024):

Sorry, we have to revert the PR for this for now. It had the side effect of breaking playback when the source video uses Dolby Vision. The transcode ends up having incompatible DOVI metadata that players try and fail to use. It's surprisingly difficult to remove this and just this metadata, but will be easier in FFmpeg 7.1.

@mertalev commented on GitHub (Oct 19, 2024): Sorry, we have to revert the PR for this for now. It had the side effect of breaking playback when the source video uses Dolby Vision. The transcode ends up having incompatible DOVI metadata that players try and fail to use. It's surprisingly difficult to remove this and *just* this metadata, but will be easier in FFmpeg 7.1.
Author
Owner

@Dunky13 commented on GitHub (Jan 14, 2025):

I have a whole batch of Garmin 360 video & photos. This would be a great feature for me 🙏

@Dunky13 commented on GitHub (Jan 14, 2025): I have a whole batch of Garmin 360 video & photos. This would be a great feature for me 🙏
Author
Owner

@Rambomst commented on GitHub (Feb 6, 2025):

I recently purchased an Insta360 x4 and came across this issue, at least I can view the front camera view but it would be great if this was implemented.

@Rambomst commented on GitHub (Feb 6, 2025): I recently purchased an Insta360 x4 and came across this issue, at least I can view the front camera view but it would be great if this was implemented.
Author
Owner

@jarrah31 commented on GitHub (Aug 1, 2025):

I too would like this feature so that I can watch 360 videos from my Insta360 X5 on the Immich mobile app and web views.

@jarrah31 commented on GitHub (Aug 1, 2025): I too would like this feature so that I can watch 360 videos from my Insta360 X5 on the Immich mobile app and web views.
Author
Owner

@tienli commented on GitHub (Aug 27, 2025):

This probably is something need to be fixed (or implemented) from photo side up.
Use a 360 picture and save it in either Google photo or Immich server. I can see 360 degree photo in browser both in Google and Immich, while doing the same in apps will only see 360 degree photo in Google's app; not in Immich's mobile app (I used iPhone, yet tried Android). It makes me thinking that rendering is without a problem. Since browser can do it, there must be something missing or wrong where app implemented. Hopefully I'd remember to upload a 360-degree picture here later so anyone can try it out.
Should I open a new issue?

@tienli commented on GitHub (Aug 27, 2025): This probably is something need to be fixed (or implemented) from photo side up. Use a 360 picture and save it in either Google photo or Immich server. I can see 360 degree photo in browser both in Google and Immich, while doing the same in apps will only see 360 degree photo in Google's app; not in Immich's mobile app (I used iPhone, yet tried Android). It makes me thinking that rendering is without a problem. Since browser can do it, there must be something missing or wrong where app implemented. Hopefully I'd remember to upload a 360-degree picture here later so anyone can try it out. Should I open a new issue?
Author
Owner

@danieldietzler commented on GitHub (Sep 11, 2025):

Should I open a new issue?

No, why should you? There's no need to duplicate an existing issue lol

@danieldietzler commented on GitHub (Sep 11, 2025): > Should I open a new issue? No, why should you? There's no need to duplicate an existing issue lol
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/immich#1708
No description provided.