immich icon indicating copy to clipboard operation
immich copied to clipboard

Some videos (but not all) stutter when viewing from the web

Open pingcheunglai opened this issue 1 year ago • 7 comments

The bug

I'm running into an issue where some videos, but not all, stutter when viewing from the web. By stutter, I mean it looks like it freezes every half second for a moment and this lasts throughout the entire video, which makes for a very jerky watching experience. There's no indication the video is buffering, and the file size does not seem to matter (can happen with both large and small video files).

If a video is affected, the stutter happens whether I am hovering over the thumbnail or clicking into the video. The video file itself is fine - it plays back without issue when downloaded. Similarly, viewing the same video on the app does not have any stutter either.

Would appreciate any suggestions!

The OS that Immich Server is running on

Ubuntu 22.04 LTS

Version of Immich Server

v1.101.0

Version of Immich Mobile App

v1.101.0 build.131

Platform with the issue

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

Your docker-compose.yml content

# docker-compose.yml 
version: '3.8'

name: immich

networks:
  internal:
    driver: bridge

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "microservices" ]
    devices:
      - /dev/dri:/dev/dri  # If using Intel QuickSync or VAAPI
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
    restart: always

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - immichpgdata:/var/lib/postgresql/data
    restart: always

volumes:
  immichpgdata:
  model-cache:

Your .env content

DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=**********
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

UPLOAD_LOCATION=/mnt/photos/Immich

Reproduction steps

1. Take video on cell phone
2. Let it autoupload to Immich
3. Sometimes the video stutters when viewing from the web (after it has completed processing). Not all videos are affected - appears to be random.

Additional information

I'm running Immich on an Intel NUC with a Core i5-1135G7 and 32GB of RAM.

pingcheunglai avatar Apr 09 '24 13:04 pingcheunglai

Can you provide a bit more detail about your setup? Are you using a reverse proxy, what is your network speed like, have you changed any of the transcoding settings, etc?

bo0tzz avatar Apr 09 '24 13:04 bo0tzz

Hardware transcoding (via Quick sync, default transcoding settings) is enabled. No reverse proxy - assessing Immich directly via the local IP and port.

Even if I delete an affected video, clear the trash, and re-upload it manually, it still stutters. But other videos taken with the same phones (Samsung S23+ and Pixel 8) don't stutter. It's really odd.

pingcheunglai avatar Apr 09 '24 13:04 pingcheunglai

Can you right-click and save the stuttering video and share it? I'm guessing it's something to do with the frame rate.

mertalev avatar Apr 14 '24 20:04 mertalev

The original would also be helpful, which you can download just with the download button.

mertalev avatar Apr 14 '24 20:04 mertalev

Hello, any update on this issue? Does it stutter as well if you view the video on a local network?

alextran1502 avatar Apr 26 '24 20:04 alextran1502

This also happens to me with all the videos recorded with my phone. BUT it only happens if I use Firefox, with Edge the videos are played correctly. Both browsers on Windows 10, latest versions of both.

Could this be a problem of Firefox itself?

This is what ffmpeg gives about the file:

ffmpeg version 6.1-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-shared --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID_20240421_115520.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2024-04-21T09:55:30.000000Z
    location        :  [REDACTED]
    location-eng    : [REDACTED]
    com.android.version: 11
    com.android.manufacturer: Xiaomi
    com.android.model: MI 9
  Duration: 00:00:08.83, start: 0.000000, bitrate: 43301 kb/s
  Stream #0:0[0x1](eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuvj420p(pc, bt470bg/bt470bg/smpte170m, progressive), 3840x2160, 41847 kb/s, SAR 1:1 DAR 16:9, 29.79 fps, 30 tbr, 90k tbn (default)
    Metadata:
      creation_time   : 2024-04-21T09:55:30.000000Z
      handler_name    : VideoHandle
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      creation_time   : 2024-04-21T09:55:30.000000Z
      handler_name    : SoundHandle
      vendor_id       : [0][0][0][0]
At least one output file must be specified

arcepi avatar May 19 '24 18:05 arcepi

Can you test and see if this is still an issue?

jrasm91 avatar Sep 12 '24 19:09 jrasm91