immich icon indicating copy to clipboard operation
immich copied to clipboard

[BUG] Exif metadata 'Rotation: 180' ignored for videos on mobile app

Open andresbono opened this issue 1 year ago • 15 comments

The bug

Videos recorded in horizontal by turning the phone 90 degrees clockwise (how a left-handed would typically record the video with one hand) are reproduced upside down in the mobile app.

At least with my phone, the raw data of the videos is the same no matter the orientation of recording, except for the exif metadata Rotation, that would be 0, 90 or 180 depending on the case.

Videos with 0, 90 (even 270) values are reproduced correctly, only 180 is buggy.

The thumbnail (web browser and mobile app), reproduction in the web browser and preview in the web browser are all displayed correctly for all videos.

The OS that Immich Server is running on

Host is Debian amd64 (container images ghcr.io/immich-app/*)

Version of Immich Server

v1.52.1

Version of Immich Mobile App

v1.52.0

Platform with the issue

  • [ ] Server
  • [ ] Web
  • [X] Mobile

Your docker-compose.yml content

https://github.com/immich-app/immich/releases/download/v1.52.1/docker-compose.yml

Your .env content

https://github.com/immich-app/immich/releases/download/v1.52.1/example.env

Reproduction steps

  1. Prepare videos with different rotations. For example, download test video and set Rotation values with exiftool:
$ wget -O 0.mp4 https://freetestdata.com/wp-content/uploads/2022/02/Free_Test_Data_1MB_MP4.mp4
$ cp 0.mp4 90.mp4 
$ cp 0.mp4 180.mp4
$ cp 0.mp4 270.mp4
$ exiftool -Rotation=90 90.mp4
$ exiftool -Rotation=180 180.mp4
$ exiftool -Rotation=270 270.mp4
$ exiftool -Rotation *.mp4
======== 0.mp4
Rotation                        : 0
======== 180.mp4
Rotation                        : 180
======== 270.mp4
Rotation                        : 270
======== 90.mp4
Rotation                        : 90
    4 image files read
  1. Play the videos in the mobile app (Android), after uploading them to the server or before backing-up, makes no difference.

Additional information

No response

andresbono avatar Mar 30 '23 20:03 andresbono

@jrasm91 I think this is more of a https://github.com/immich-app/immich/labels/%F0%9F%93%B1mobile related issue.

Actually, it seems to be derived from flutter and the video_player package: https://github.com/flutter/flutter/issues/122276. Is pinning video_player to version 2.3.4 an option? At least until https://github.com/flutter/flutter/issues/122276 is resolved.

andresbono avatar Jun 08 '23 05:06 andresbono

Possibly resolved by #2908? Might need some adjustment to the transcoder too.

uhthomas avatar Jul 09 '23 20:07 uhthomas

Noticed that problem too, seems like player problem. Immich Web and other web/mobile players play such videos correctly.

waclaw66 avatar Jul 26 '23 09:07 waclaw66

I also have this problem on the Android mobile app. Rotation 0 and 90 play correctly but 180 is upside down. When viewing on a web browser it plays correctly.

nguypaul avatar Aug 01 '23 03:08 nguypaul

Issue still exists on latest version. @uhthomas yes, it's specific to android app. Videos are rotated upside down only on mobile app, look normal on web page. I'm left handed and all my videos recorded using phone are upside down in Immich android app.

kkmaslowski avatar Feb 04 '24 18:02 kkmaslowski

Since it seems dead at the Flutter's end; can it be fixed at the Immich side of things?

sbkg0002 avatar Mar 22 '24 19:03 sbkg0002

Same here - it's wrong only in the Android mobile app; iOS is fine, so is the web version.

dgtal1 avatar May 13 '24 08:05 dgtal1

I experience the same bug on a Pixel 7. The web version displays the video in the correct rotation.

Tywele avatar May 18 '24 09:05 Tywele

I'm also having this issue on a Samsung S22+ with the android immich client app

m-GDEV avatar Jun 23 '24 04:06 m-GDEV

Same here, S20FE.

ec0li82 avatar Jun 24 '24 12:06 ec0li82

I'm having this issue as well on the Fold 4.

WizenThorne avatar Jul 28 '24 22:07 WizenThorne

Can confirm this on 1.111.0 with MiMix 2s with lineage 21 (android 14) onboard.

illmouse avatar Aug 03 '24 04:08 illmouse