Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video rotation wrong when played back. #9252

Open
2 of 3 tasks
kaaku3 opened this issue May 4, 2024 · 7 comments
Open
2 of 3 tasks

Video rotation wrong when played back. #9252

kaaku3 opened this issue May 4, 2024 · 7 comments
Labels
bug Something isn't working 🗄️server

Comments

@kaaku3
Copy link

kaaku3 commented May 4, 2024

The bug

Videos recorded in portrait mode are played back in landscape mode in both web and app.
Preview image is the correct rotation.

Downloading the video then playing locally is played back correctly.

The OS that Immich Server is running on

Armbian

Version of Immich Server

1.103.1

Version of Immich Mobile App

1.103.1

Platform with the issue

  • Server
  • Web
  • Mobile

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
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
#   network_mode: "host"
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding
      file: hwaccel.transcoding.yml
      service: rkmpp # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
#   network_mode: "host"
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    extends:
      file: hwaccel.ml.yml
      service: armnn # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - .env
#   network_mode: "host"
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:afb290a0a0d0b2bd7537b62ebff1eb84d045c757c1c31ca2ca48c79536c0de82
#   network_mode: "host"
    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:
      - pgdata:/var/lib/postgresql/data
#   network_mode: "host"
    restart: always

volumes:
  pgdata:
  model-cache:

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=./library

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

# Connection secret for postgres. You should change it to a random password
DB_PASSWORD=

# 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. record video on phone in portrait mode
2. play back in app or web and its the wrong orientation.
3.
...

Relevant log output

No response

Additional information

No response

@opbod
Copy link
Contributor

opbod commented May 4, 2024

Maybe good to provide a sample video file as I cannot reproduce.
Tried on mobile and on web, with videos shot in landscape and in portrait (using Android). Both play back fine in the expected orientation.

@kaaku3
Copy link
Author

kaaku3 commented May 5, 2024

I'm away right now so cannot provide a video easily, but I just did some testing after seeing your message.
If I disable hardware transcoding (rkmpp). Then orientation is correct.
I'll upload my settings file.
Software transcoding is too slow on this soc (rk3588s) to be usable
immich-config.txt

@jrasm91
Copy link
Contributor

jrasm91 commented May 5, 2024

cc: @fyfrey have you had any issues with rotation?

@fyfrey
Copy link
Contributor

fyfrey commented May 5, 2024

Yeah, I also got some videos that are played upside down (only in immich, fine in other players)

@kaaku3
Copy link
Author

kaaku3 commented May 5, 2024

I've disabled transcoding for the time being and orientation is correct.
Only downside is on slow mobile data videos are slow to load in the app.

@sbkg0002
Copy link

sbkg0002 commented May 6, 2024

Do you need to reload all videos for it to play correct?

@kaaku3
Copy link
Author

kaaku3 commented May 6, 2024

I don't know if I did it the correct way, but I just removed the encoded videos folder, changed the settings then reran the transcoding job on all.
I currently have gone back to software transcoding again as without transcoding to a lower resolution playback on mobile data is not very usable on my network, but at its current speed it will take a month to transcode all my videos, where as hardware transcoding finishes in a few hours.
I can confirm in my case the video orientation is only wrong on videos encoded using rkmpp with hevc, i have not tried other hardware transcoding codecs, but my soc only supports x265 and x264 hardware encoding.
I did need to delete the browser cache to playback correctly in web gui.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🗄️server
Projects
None yet
Development

No branches or pull requests

6 participants