immich-app / immich

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

Video Playback Failure on Older Devices #11689

Open RaulGw4 opened 1 month ago

RaulGw4 commented 1 month ago

The bug

I installed the Immich app on an older Android phone (Samsung A40), and after viewing a few videos, it refuses to load. I tried to replicate the issue on other phones, but I couldn't; it only happens on this particular device. I assume it might be related to the phone's RAM or other hardware limitations.

The OS that Immich Server is running on

Truenas Scale

Version of Immich Server

v1.111.0

Version of Immich Mobile App

v1.111.0 build.152

Platform with the issue

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

This issue can only be replicated on very slow phones with a low amount of RAM (4GB or less).

Steps to Reproduce:
1. Open an album containing videos stored in the server that are in 4K quality or higher.
2. Scroll through the videos, rotate the phone between vertical and horizontal orientations, and continue scrolling through the pictures for a bit.
3. After some time, you'll notice that the videos stop loading, as seen in the picture below.

Note: The videos were filmed with a Nothing Phone 2 at 4K 30fps using the original camera app. They were uploaded and are being viewed at the original quality.

Relevant log output

2024-08-10 21:54:48.089362 | SEVERE   | ImmichErrorLogger    | FlutterError - Catch all | Instance of 'FlutterErrorDetails'
Exception: PlatformException(VideoError, Video player had error y2.r: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.640033, -1, null, [3840, 2160, 28.851288], [-1, -1]), format_supported=YES, null, null)
Library: widgets library
Context: Instance of 'ErrorDescription' |
#1      AsyncError.value (package:riverpod/src/common.dart:494:0)
#2      VideoViewerPage.build (package:immich_mobile/pages/common/video_viewer.page.dart:36:0)
#3      _ConsumerState.build (package:flutter_riverpod/src/consumer.dart:476:0)
#4      StatefulElement.build (package:flutter/src/widgets/framework.dart:5599:0)
#5      ConsumerStatefulElement.build (package:flutter_riverpod/src/consumer.dart:539:0)
#6      HookElement.build (package:flutter_hooks/src/framework.dart:438:0)
#7      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5487:0)
#8      StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5650:0)
#9      Element.rebuild (package:flutter/src/widgets/framework.dart:5203:0)
#10     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2905:0)
#11     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1136:0)
#12     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:443:0)
#13     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1392:0)
#14     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1313:0)
#15     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1171:0)
#16     _invoke (dart:ui/hooks.dart:312:0)
#17     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:419:0)
#18     _drawFrame (dart:ui/hooks.dart:283:0)

2024-08-10 21:54:27.044753 | SEVERE   | ImmichErrorLogger    | FlutterError - Catch all | Instance of 'FlutterErrorDetails'
Exception: PlatformException(VideoError, Video player had error y2.r: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.640033, -1, null, [3840, 2160, 28.851288], [-1, -1]), format_supported=YES, null, null)
Library: widgets library
Context: Instance of 'ErrorDescription' |
#1      AsyncError.value (package:riverpod/src/common.dart:494:0)
#2      VideoViewerPage.build (package:immich_mobile/pages/common/video_viewer.page.dart:36:0)
#3      _ConsumerState.build (package:flutter_riverpod/src/consumer.dart:476:0)
#4      StatefulElement.build (package:flutter/src/widgets/framework.dart:5599:0)
#5      ConsumerStatefulElement.build (package:flutter_riverpod/src/consumer.dart:539:0)
#6      HookElement.build (package:flutter_hooks/src/framework.dart:438:0)
#7      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5487:0)
#8      StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5650:0)
#9      Element.rebuild (package:flutter/src/widgets/framework.dart:5203:0)
#10     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2905:0)
#11     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1136:0)
#12     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:443:0)
#13     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1392:0)
#14     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1313:0)
#15     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1171:0)
#16     _invoke (dart:ui/hooks.dart:312:0)
#17     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:419:0)
#18     _drawFrame (dart:ui/hooks.dart:283:0)

Additional information

WhatsApp Image 2024-08-10 at 21 56 45

DeltaTango69 commented 4 weeks ago

For me videos with Resolution higher or equal 4K are also not played. It comes a greyished picture. Ok- I have no transformation added - this is ok. but the problem is, that after this no video will bot more played, also smaller videos which worked before!

phajduk commented 2 weeks ago

I face the same behavior. Happy to help debug this @alextran1502 . I think this is related to https://www.reddit.com/r/immich/comments/1e31v52/screen_going_gray_when_playing_some_videos_in_app/