immich-app / immich

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

[BUG] Can't play MPEG-TS Video File (.MTS) #5576

Closed cttlee closed 2 months ago

cttlee commented 9 months ago

Log from immich_server

2023-12-09 08:03:11 [Nest] 8 - 12/09/2023, 12:03:11 AM ERROR [ErrorInterceptor] Failed to serve file 2023-12-09 08:03:11 [Nest] 8 - 12/09/2023, 12:03:11 AM ERROR [ErrorInterceptor] Error: Request aborted 2023-12-09 08:03:11 [Nest] 8 - 12/09/2023, 12:03:11 AM WARN [ExpressAdapter] Content-Type doesn't match Reply body, you might need a custom ExceptionFilter for non-JSON responses 2023-12-09 08:03:11 [Nest] 8 - 12/09/2023, 12:03:11 AM WARN [ExpressAdapter] Content-Type doesn't match Reply body, you might need a custom ExceptionFilter for non-JSON responses 2023-12-09 08:03:11 [Nest] 8 - 12/09/2023, 12:03:11 AM ERROR [ErrorInterceptor] Failed to serve file 2023-12-09 08:03:11 [Nest] 8 - 12/09/2023, 12:03:11 AM ERROR [ErrorInterceptor] Error: Request aborted 2023-12-09 08:03:15 [Nest] 8 - 12/09/2023, 12:03:15 AM ERROR [ErrorInterceptor] Failed to serve file 2023-12-09 08:03:15 [Nest] 8 - 12/09/2023, 12:03:15 AM ERROR [ErrorInterceptor] Error: Request aborted 2023-12-09 08:03:15 [Nest] 8 - 12/09/2023, 12:03:15 AM WARN [ExpressAdapter] Content-Type doesn't match Reply body, you might need a custom ExceptionFilter for non-JSON responses 2023-12-09 08:03:21 [Nest] 8 - 12/09/2023, 12:03:21 AM ERROR [ErrorInterceptor] Failed to serve file 2023-12-09 08:03:21 [Nest] 8 - 12/09/2023, 12:03:21 AM ERROR [ErrorInterceptor] Error: Request aborted 2023-12-09 08:03:21 [Nest] 8 - 12/09/2023, 12:03:21 AM WARN [ExpressAdapter] Content-Type doesn't match Reply body, you might need a custom ExceptionFilter for non-JSON responses 2023-12-09 08:03:22 [Nest] 8 - 12/09/2023, 12:03:22 AM ERROR [ErrorInterceptor] Failed to serve file 2023-12-09 08:03:22 [Nest] 8 - 12/09/2023, 12:03:22 AM ERROR [ErrorInterceptor] Error: Request aborted 2023-12-09 08:03:22 [Nest] 8 - 12/09/2023, 12:03:22 AM WARN [ExpressAdapter] Content-Type doesn't match Reply body, you might need a custom ExceptionFilter for non-JSON responses

The OS that Immich Server is running on

Window 10

Version of Immich Server

release-release

Version of Immich Mobile App

none

Platform with the issue

Your docker-compose.yml content

version: "3.8"

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

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
      - D:\Syncthing\test3:/usr/src/app/test3
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends:
      file: hwaccel.yml
      service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - D:\Syncthing\test3:/usr/src/app/test3
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

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

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
      # remove this to get debug messages
      - GLOG_minloglevel=1
      - TZ=Asia/Taipei
    volumes:
      - D:\docker\immich-app\volume\tsdata:/data
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:60e49e22fa5706cd8df7d5e0bc50ee9bab7c608039fa653c4d961014237cca46
    restart: always

  database:
    container_name: immich_postgres
    image: postgres:14-alpine@sha256:6a0e35296341e676fe6bd8d236c72afffe2dfe3d7eb9c2405c0f3fc04500cd07
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - immich_pgdata:/var/lib/postgresql/data
    restart: always

volumes:
  immich_pgdata:
  #model-cache:
  #tsdata:

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=D:\docker\immich-app\upload

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secrets for postgres and typesense. You should change these to random passwords
TYPESENSE_API_KEY=some-random-text
DB_PASSWORD=postgres

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

Reproduction steps

1. Scan external library contained 00000.MTS
2. Video can't be play by chrome

Additional information

00000.zip

telpce commented 7 months ago

Same problem. I uploaded videos via CLI.

The OS that Immich Server is running on

Windows 11 WSL2 v2.0.14 Ubuntu 22.04.3 LTS

Version of Immich Server

v1.94.1

Version of Immich Mobile App

v1.94.1 build.137

Platform with the issue

telpce commented 6 months ago

The bug remains in v1.97.0

drewfleury commented 6 months ago

This bug is also present in v1.98.1.

Will MTS files in theory be playable after being transcoded? (I have a long queue in the jobs tab)

telpce commented 6 months ago

Same error in v1.98.2.

telpce commented 5 months ago

In version 1.100.0, MTS files cannot be played.

andy-shin commented 3 months ago

In version 1.105.1, MTS files still cannot be played on android

telpce commented 3 months ago

I was able to play MTS files by re-encoding the videos.

administration > settings > video transcoding settings > Reset to default (this step might not be necessary) administration > jobs > transcode videos > all

The version I’m using is 1.105.1."

andy-shin commented 3 months ago

Thanks for the information.

I realized that I could play it through transcoding. However, transcoding uses twice as much space, so I'd like the MTS file to just play if possible.

Another thing I noticed is In my android app, if the audio codec is aac, it doesn't play. After converting the audio codec to mp3, it plays fine in android.

I am using sony camcoder and when i convert mts to mp4 and convert audio codec to mp3, it is available on both web and android without any transcoding.

But after converting, some videos are playing in 4:3 ratio on android when they are 16:9.

jrasm91 commented 2 months ago

I uploaded the video and it worked just fine for me. It does indeed need to be transcoded, so this is working as intended.