immich-app / immich

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

[BUG] iOS app always loads non-compressed videos #1025

Closed raisinbear closed 1 year ago

raisinbear commented 1 year ago

Describe the bug Immich reencodes videos into small files for previews. The web interface uses / plays those reencoded files. The iOS app, however, always loads the - usually much larger - original file. I do not know, but assume this is not the intended behavior. For instance, the creators left a note in the iOS app settings panel that an optional three-stage loading process significantly increases data usage. So I conclude that data usage optimization is indeed a factor that attention is being paid to. I only noticed this after wondering why the Immich app had used quite a lot of data recently.

Task List

Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.

docker-compose.yml.txt env.txt

To Reproduce Steps to reproduce the behavior:

  1. Make sure a video exists in the library.
  2. Start a file handle monitoring software like e.g. fatrace on the server.
  3. Compare which files are being read while playing back the video through either web interface or iOS app.
  4. Note that when playing back through iOS app, only the non-reencoded original file is accessed.

Expected behavior iOS app accesses reencoded video file to reduce data usage and only requests the original, if the user downloads the video to their library.

Screenshots n/a

System

Additional context Add any other context about the problem here.

alextran1502 commented 1 year ago

It was the original behavior of the app, and we haven't circled back to implement playing the encoded file. Thank you for reporting

alextran1502 commented 1 year ago

Digging into this issue and found out that mp4 transcoded from the MOV file can play on iOS but doesn't have sound 🤔. The same file is played on the web and has sound. Not sure where the issue is.

raisinbear commented 1 year ago

Just did some research and this led me on the right track: https://stackoverflow.com/questions/57383307/no-audio-when-playing-html5-video-on-ios/57396013#57396013 At least I believe so, since I don't know what playback engine is used in immich and cannot debug the iOS version. For my test I did the next best thing and linked the encoded videos folder into a filebrowser instance (a web file browser atop an arbitrary base folder on the server) and tried to playback the video. As you said - no sound. I then changed the encoding preference for audio from mp3 to aac and at least it works in that scenario.

In case mp3 really is the issue the solution would probably be to either use a non-native playback engine in the app, which I guess is a lot of work, or reencode the videos with compatible aac audio stream. I guess the latter makes more sense but would require at least a cli trigger to reencode videos with the current ffmpeg settings..

bo0tzz commented 1 year ago

Is this still happening in the latest version of Immich?

raisinbear commented 1 year ago

Didn’t have a chance to test with the latest version yet, but it worked as expected in 1.52. Apologies, I somehow was of the opinion this was already closed with some PR.