immich icon indicating copy to clipboard operation
immich copied to clipboard

[Android] Client OOM when viewing specific video

Open thefirstofthe300 opened this issue 10 months ago • 7 comments

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

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

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

thefirstofthe300 avatar Apr 13 '24 17:04 thefirstofthe300

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>

SandiyosDev avatar Apr 14 '24 17:04 SandiyosDev

Is it possible to share the problematic video?

alextran1502 avatar Apr 15 '24 06:04 alextran1502

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

I'll DM you the password on Discord.

thefirstofthe300 avatar Apr 15 '24 06:04 thefirstofthe300

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?

mertalev avatar Apr 18 '24 03:04 mertalev

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.

SandiyosDev avatar Apr 18 '24 09:04 SandiyosDev

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?

mertalev avatar Apr 18 '24 15:04 mertalev

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.

thefirstofthe300 avatar Apr 22 '24 16:04 thefirstofthe300