immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
44.58k stars 2.17k forks source link

[Android] Client OOM when viewing specific video #8772

Open thefirstofthe300 opened 5 months ago

thefirstofthe300 commented 5 months ago

The bug

I have a specific video on my server which triggers an OOM every time I attempt to view it.

Logs: https://cloud.seymour.family/s/xbrS23bk5nT345B

The OS that Immich Server is running on

Talos 1.6.7

Version of Immich Server

v1.101.0

Version of Immich Mobile App

v1.101.0

Platform with the issue

Your docker-compose.yml content

I use k8s

Your .env content

Again, use k8s

Reproduction steps

1. Attempt to view photo in app
2. App crashes

Additional information

No response

SandiyosDev commented 5 months ago

Added info - Flutter (Android) - API response conversion into application objects, deserialization causing out-of-memory Stack trace from logs:

2024-04-06 13:56:14.215212,LogLevel.SEVERE,"MemoryService","Cannot get memories","#0      MemoryLaneResponseDto.fromJson (package:openapi/model/memory_lane_response_dto.dart:61)
#1      ApiClient.fromJson (package:openapi/api_client.dart:342)
#2      ApiClient.fromJson.<anonymous closure> (package:openapi/api_client.dart:537)
#3      MappedListIterable.elementAt (dart:_internal/iterable.dart:425)
#4      ListIterator.moveNext (dart:_internal/iterable.dart:354)
#5      new _List._ofEfficientLengthIterable (dart:core-patch/array.dart:162)
#6      new _List.of (dart:core-patch/array.dart:127)
#7      new List.of (dart:core-patch/array_patch.dart:39)
#8      SetBase.toList (dart:collection/set.dart:119)
#9      ApiClient.fromJson (package:openapi/api_client.dart:538)
#10     ApiClient.deserialize (package:openapi/api_client.dart:158)
<asynchronous suspension>
#11     AssetApi.getMemoryLane (package:openapi/api/asset_api.dart:776)
<asynchronous suspension>
#12     MemoryService.getMemoryLane (package:immich_mobile/modules/memories/services/memory.service.dart:29)
<asynchronous suspension>
#13     memoryFutureProvider.<anonymous closure> (package:immich_mobile/modules/memories/providers/memory.provider.dart:9)
<asynchronous suspension>
#14     FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:348)
<asynchronous suspension>
alextran1502 commented 5 months ago

Is it possible to share the problematic video?

thefirstofthe300 commented 5 months ago

The video is available here: https://cloud.seymour.family/s/z5ffHqTbyqZfo3K

I'll DM you the password on Discord.

mertalev commented 4 months ago

There have been mentions that videos on mobile can take a while to start playing, suggesting that it's downloading the full video and not streaming it. Could that be causing this issue?

SandiyosDev commented 4 months ago

There have been mentions that videos on mobile can take a while to start playing, suggesting that it's downloading the full video and not streaming it. Could that be causing this issue?

That would not be possible had the video been transcoded in Immich, as that process would've included "faststart" in ffmpeg, where the moov atom is placed at the beginning of the file prior to the video stream, enabling immediate playback.

mertalev commented 4 months ago

That's a good point! Non-transcoded videos would have to download the full video to get the moov atom at the end.

@thefirstofthe300 Can you confirm if you have transcoding disabled or that this video isn't transcoded?

thefirstofthe300 commented 4 months ago

Based on my current settings, the video almost certainly wouldn't have been transcoded. It's difficult to tell though because videos don't get much EXIF data embedded by the Pixel camera.