Skip to content

immich transcoding videos already in the correct format #15402

Description

@Cereal916

The bug

Ive used handbreak to format my family videos using the h.265 10-bit (NVEnc) setting at 1080p. When I look at the codec information in VLC it says the videos are "MPEG-H Part2/HEVC (H.256) (hvc1)". Immich has the transcode policy set to "Only videos not in the accepted format" and the accepted video codec is "HEVC".

I'm new to video transcoding, what am I missing?

The OS that Immich Server is running on

Debian 12

Version of Immich Server

v1.124.2

Version of Immich Mobile App

na

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

name: immich

services:
  immich-server:
    container_name: immich-server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    devices:
      - /dev/dri:/dev/dri
    volumes:
      # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    ports:
      - '2283:2283'
    depends_on:
      - redis
      - database
    restart: always
    environment:
      - DB_PASSWORD=${DB_PASSWORD}
    networks:
      - nginx-network
      - immich-internal-network
    healthcheck:
      disable: false

  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: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    restart: always
    environment:
      - DB_PASSWORD=${DB_PASSWORD}
    networks:
      - immich-internal-network
    healthcheck:
      disable: false

  redis:
    container_name: immich-redis
    image: docker.io/redis:6.2-alpine@sha256:eaba718fecd1196d88533de7ba49bf903ad33664a92debb24660a922ecd9cac8
    networks:
      - immich-internal-network
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich-postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    networks:
      - immich-internal-network
    healthcheck:
      test: >-
        pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1;
        Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --tuples-only --no-align
        --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')";
        echo "checksum failure count is $$Chksum";
        [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command: >-
      postgres
      -c shared_preload_libraries=vectors.so
      -c 'search_path="$$user", public, vectors'
      -c logging_collector=on
      -c max_wal_size=2GB
      -c shared_buffers=512MB
      -c wal_compression=on
    restart: always

volumes:
  model-cache:

networks:
  nginx-network:
    name: nginx-network
  immich-internal-network:
    name: immich-internal-network

Your .env content

UPLOAD_LOCATION=*************
DB_DATA_LOCATION=*************
IMMICH_VERSION=release
DB_PASSWORD=************
DB_USERNAME=***********
DB_DATABASE_NAME=*************

Reproduction steps

  1. Settings > Video Transcoding settings > Transcode Policy > Transcode Policy >"Only videos not in an accepted format"
  2. Settings > Video Transcoding settings > Transcode Policy > Accepted video codecs > HEVC
  3. Settings > Video Transcoding settings > Transcode Policy > Accepted audio codecs > check all
  4. Settings > Video Transcoding settings > Transcode Policy > Accepted containers > select none
  5. Go to jobs and pause "transcoding videos"
  6. Upload provided video
  7. You will see a job get added.

Relevant log output

[Nest] 7  - 01/17/2025, 2:23:54 AM VERBOSE [Microservices:MetadataService] Exif Tags
[Nest] 7  - 01/17/2025, 2:23:54 AM VERBOSE [Microservices:MetadataService] Object:
{
  "SourceFile": "/usr/src/app/upload/upload/0fea26eb-0579-491c-aa04-bcf760ada932/31/79/317921bf-1472-4b56-9646-210901066bfa.mp4",
  "errors": [],
  "tz": "UTC",
  "tzSource": "defaultVideosToUTC",
  "PreviewDuration": 0,
  "SelectionDuration": 0,
  "TrackDuration": 1.001,
  "MediaDuration": 1.024,
  "ExifToolVersion": 13,
  "FileName": "317921bf-1472-4b56-9646-210901066bfa.mp4",
  "Directory": "/usr/src/app/upload/upload/0fea26eb-0579-491c-aa04-bcf760ada932/31/79",
  "FileSize": "1870 kB",
  "FileModifyDate": {
    "_ctor": "ExifDateTime",
    "year": 2025,
    "month": 1,
    "day": 15,
    "hour": 21,
    "minute": 12,
    "second": 31,
    "tzoffsetMinutes": -480,
    "rawValue": "2025:01:15 21:12:31-08:00",
    "zoneName": "UTC-8",
    "inferredZone": false
  },
  "FileAccessDate": {
    "_ctor": "ExifDateTime",
    "year": 2025,
    "month": 1,
    "day": 16,
    "hour": 18,
    "minute": 23,
    "second": 54,
    "tzoffsetMinutes": -480,
    "rawValue": "2025:01:16 18:23:54-08:00",
    "zoneName": "UTC-8",
    "inferredZone": false
  },
  "FileInodeChangeDate": {
    "_ctor": "ExifDateTime",
    "year": 2025,
    "month": 1,
    "day": 16,
    "hour": 18,
    "minute": 23,
    "second": 54,
    "tzoffsetMinutes": -480,
    "rawValue": "2025:01:16 18:23:54-08:00",
    "zoneName": "UTC-8",
    "inferredZone": false
  },
  "FilePermissions": "-rw-r--r--",
  "FileType": "MP4",
  "FileTypeExtension": "mp4",
  "MIMEType": "video/mp4",
  "MajorBrand": "MP4 v2 [ISO 14496-14]",
  "MinorVersion": "0.2.0",
  "CompatibleBrands": [
    "mp42",
    "dby1",
    "iso2",
    "mp41"
  ],
  "MovieHeaderVersion": 0,
  "CreateDate": {
    "_ctor": "ExifDateTime",
    "year": 2025,
    "month": 1,
    "day": 16,
    "hour": 5,
    "minute": 12,
    "second": 31,
    "tzoffsetMinutes": 0,
    "rawValue": "2025:01:16 05:12:31",
    "zoneName": "UTC",
    "inferredZone": true
  },
  "ModifyDate": {
    "_ctor": "ExifDateTime",
    "year": 2025,
    "month": 1,
    "day": 16,
    "hour": 5,
    "minute": 12,
    "second": 31,
    "tzoffsetMinutes": 0,
    "rawValue": "2025:01:16 05:12:31",
    "zoneName": "UTC",
    "inferredZone": true
  },
  "TimeScale": 1000,
  "PreferredRate": 1,
  "PreferredVolume": "100.00%",
  "PreviewTime": "0 s",
  "PosterTime": "0 s",
  "SelectionTime": "0 s",
  "CurrentTime": "0 s",
  "NextTrackID": 4,
  "TrackHeaderVersion": 0,
  "TrackCreateDate": {
    "_ctor": "ExifDateTime",
    "year": 2025,
    "month": 1,
    "day": 16,
    "hour": 5,
    "minute": 12,
    "second": 31,
    "tzoffsetMinutes": 0,
    "rawValue": "2025:01:16 05:12:31",
    "zoneName": "UTC",
    "inferredZone": true
  },
  "TrackModifyDate": {
    "_ctor": "ExifDateTime",
    "year": 2025,
    "month": 1,
    "day": 16,
    "hour": 5,
    "minute": 12,
    "second": 31,
    "tzoffsetMinutes": 0,
    "rawValue": "2025:01:16 05:12:31",
    "zoneName": "UTC",
    "inferredZone": true
  },
  "TrackID": 1,
  "TrackLayer": 0,
  "TrackVolume": "0.00%",
  "ImageWidth": 1920,
  "ImageHeight": 1080,
  "GraphicsMode": "srcCopy",
  "OpColor": "0 0 0",
  "CompressorID": "hvc1",
  "SourceImageWidth": 1440,
  "SourceImageHeight": 1080,
  "XResolution": 72,
  "YResolution": 72,
  "BitDepth": 24,
  "ColorProfiles": "nclx",
  "ColorPrimaries": "BT.709",
  "TransferCharacteristics": "BT.709",
  "MatrixCoefficients": "BT.709",
  "VideoFullRangeFlag": 0,
  "PixelAspectRatio": "4:3",
  "BufferSize": 0,
  "MaxBitrate": 13997354,
  "AverageBitrate": 13997354,
  "VideoFrameRate": 29.97,
  "AudioFormat": "mp4a",
  "Track2Name": "Surround",
  "Track2Title": "Surround",
  "MatrixStructure": "1 0 0 0 1 0 0 0 1",
  "MediaHeaderVersion": 0,
  "MediaCreateDate": {
    "_ctor": "ExifDateTime",
    "year": 2025,
    "month": 1,
    "day": 16,
    "hour": 5,
    "minute": 12,
    "second": 31,
    "tzoffsetMinutes": 0,
    "rawValue": "2025:01:16 05:12:31",
    "zoneName": "UTC",
    "inferredZone": true
  },
  "MediaModifyDate": {
    "_ctor": "ExifDateTime",
    "year": 2025,
    "month": 1,
    "day": 16,
    "hour": 5,
    "minute": 12,
    "second": 31,
    "tzoffsetMinutes": 0,
    "rawValue": "2025:01:16 05:12:31",
    "zoneName": "UTC",
    "inferredZone": true
  },
  "MediaTimeScale": 48000,
  "MediaLanguageCode": "und",
  "HandlerDescription": "Surround",
  "Balance": 0,
  "AudioChannels": 6,
  "AudioBitsPerSample": 16,
  "AudioSampleRate": 48000,
  "Track3Name": "Surround",
  "Track3Title": "Surround",
  "HandlerType": "Metadata",
  "HandlerVendorID": "Apple",
  "Encoder": "HandBrake 1.9.0 2024120100",
  "MediaDataSize": 1866534,
  "MediaDataOffset": 3260,
  "ImageSize": "1920x1080",
  "Megapixels": 2.1,
  "AvgBitrate": "14.6 Mbps",
  "Rotation": 0,
  "warnings": [],
  "Orientation": 1,
  "Duration": "00:00:01.024"
}
[Nest] 7  - 01/17/2025, 2:23:54 AM VERBOSE [Microservices:MetadataService] Asset 14a44c8f-dc85-4b87-8a19-ba2d29676e8d date time is 2025-01-16T05:12:31Z
[Nest] 7  - 01/17/2025, 2:23:54 AM VERBOSE [Microservices:MetadataService] Asset 14a44c8f-dc85-4b87-8a19-ba2d29676e8d timezone is UTC (via defaultVideosToUTC)
[Nest] 7  - 01/17/2025, 2:23:54 AM VERBOSE [Microservices:MetadataService] Asset 14a44c8f-dc85-4b87-8a19-ba2d29676e8d has a local time of 2025-01-16T05:12:31.000Z
[Nest] 7  - 01/17/2025, 2:23:54 AM   DEBUG [Microservices:APIKeyService] Attempting to rename file: upload/upload/0fea26eb-0579-491c-aa04-bcf760ada932/31/79/317921bf-1472-4b56-9646-210901066bfa.mp4 => upload/library/admin/2025/2025-01-16/2011-10-31 191450.mp4
[Nest] 7  - 01/17/2025, 2:23:54 AM   DEBUG [Microservices:MediaRepository] ffmpeg -n 10 /usr/bin/ffmpeg -skip_frame nointra -sws_flags accurate_rnd+full_chroma_int -i upload/library/admin/2025/2025-01-16/2011-10-31 191450.mp4 -y -fps_mode vfr -frames:v 1 -update 1 -v verbose -vf fps=12:eof_action=pass:round=down,thumbnail=12,select=gt(scene\,0.1)-eq(prev_selected_n\,n)+isnan(prev_selected_n)+gt(n\,20),trim=end_frame=2,reverse,format=yuv420p upload/thumbs/0fea26eb-0579-491c-aa04-bcf760ada932/14/a4/14a44c8f-dc85-4b87-8a19-ba2d29676e8d-preview.webp
[Nest] 7  - 01/17/2025, 2:23:54 AM   DEBUG [Microservices:MediaRepository] ffmpeg -n 10 /usr/bin/ffmpeg -skip_frame nointra -sws_flags accurate_rnd+full_chroma_int -i upload/library/admin/2025/2025-01-16/2011-10-31 191450.mp4 -y -fps_mode vfr -frames:v 1 -update 1 -v verbose -vf fps=12:eof_action=pass:round=down,thumbnail=12,select=gt(scene\,0.1)-eq(prev_selected_n\,n)+isnan(prev_selected_n)+gt(n\,20),trim=end_frame=2,reverse,scale=-2:480:flags=lanczos+accurate_rnd+full_chroma_int:out_range=pc upload/thumbs/0fea26eb-0579-491c-aa04-bcf760ada932/14/a4/14a44c8f-dc85-4b87-8a19-ba2d29676e8d-thumbnail.webp
[Nest] 7  - 01/17/2025, 2:23:56 AM   DEBUG [Microservices:PersonService] 0 faces detected in upload/thumbs/0fea26eb-0579-491c-aa04-bcf760ada932/14/a4/14a44c8f-dc85-4b87-8a19-ba2d29676e8d-preview.webp

Additional information

2011-10-31.191450.mp4

Originally asked on reddit, was directed here: https://www.reddit.com/r/immich/comments/1i2mink/comment/m7hr2fi/?context=3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions