[BUG] Videos without audio are not transcoded #932

Closed
opened 2026-02-04 23:37:53 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @subract on GitHub (Jun 12, 2023).

The bug

I want to upload videos from my drone, which have no audio track. However, these videos are never transcoded by the server. The relevant check is in server/src/domain/media/media.service.ts:

    if (!mainVideoStream || !mainAudioStream || !containerExtension) {
      return false;
    }

Because this check occurs before the ffmpegConfig.transcode configuration is checked, the issue persists even when the transcode policy is set to "All videos" in the ffmpeg settings.

I can probably take a crack at this issue when I have some time - it seems like it will just require a handful of changes in that file to make it sufficient for a file to have just a video track and still be eligible for transcoding. I believe the transcode policy should simply ignore the target audio codec in that case, and the -acodec option for ffmpeg should be omitted (though in my testing, it seems to work fine even when the -acodec option is included.

Thank you! The project is truly incredible.

The OS that Immich Server is running on

Docker on Debian 10

Version of Immich Server

v1.60.0

Version of Immich Mobile App

v1.60.0 build.100

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

networks:
  immich:
  web:

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: ["start-server.sh"]
    volumes:
      - ${IMMICH_UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    networks:
      immich:
    restart: unless-stopped
 ...

Your .env content

DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=<redacted>
DB_DATABASE_NAME=immich
IMMICH_UPLOAD_LOCATION=/ssd/app/immich/upload
TYPESENSE_API_KEY=<redacted>
IMMICH_API_URL_EXTERNAL=<redacted>
IMMICH_VERSION=v1.60.0
LOG_LEVEL=verbose

Reproduction steps

1. Upload a video without an audio track (for example, this [sample video from Pexels](https://www.pexels.com/video/drops-of-liquid-on-a-tray-to-be-use-as-samples-3195394/)
2. Watch the microservices logs and see that a transcoded asset is not generated

Additional information

No response

Originally created by @subract on GitHub (Jun 12, 2023). ### The bug I want to upload videos from my drone, which have no audio track. However, these videos are never transcoded by the server. The relevant check is in `server/src/domain/media/media.service.ts`: ``` if (!mainVideoStream || !mainAudioStream || !containerExtension) { return false; } ``` Because this check occurs _before_ the `ffmpegConfig.transcode` configuration is checked, the issue persists even when the transcode policy is set to "All videos" in the ffmpeg settings. I can probably take a crack at this issue when I have some time - it seems like it will just require a handful of changes in that file to make it sufficient for a file to have just a video track and still be eligible for transcoding. I believe the transcode policy should simply ignore the target audio codec in that case, and the `-acodec` option for ffmpeg should be omitted (though in my testing, it seems to work fine even when the `-acodec` option is included. Thank you! The project is truly incredible. ### The OS that Immich Server is running on Docker on Debian 10 ### Version of Immich Server v1.60.0 ### Version of Immich Mobile App v1.60.0 build.100 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" networks: immich: web: services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} command: ["start-server.sh"] volumes: - ${IMMICH_UPLOAD_LOCATION}:/usr/src/app/upload env_file: - .env depends_on: - redis - database - typesense networks: immich: restart: unless-stopped ... ``` ### Your .env content ```Shell DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_PASSWORD=<redacted> DB_DATABASE_NAME=immich IMMICH_UPLOAD_LOCATION=/ssd/app/immich/upload TYPESENSE_API_KEY=<redacted> IMMICH_API_URL_EXTERNAL=<redacted> IMMICH_VERSION=v1.60.0 LOG_LEVEL=verbose ``` ### Reproduction steps ```bash 1. Upload a video without an audio track (for example, this [sample video from Pexels](https://www.pexels.com/video/drops-of-liquid-on-a-tray-to-be-use-as-samples-3195394/) 2. Watch the microservices logs and see that a transcoded asset is not generated ``` ### Additional information _No response_
Author
Owner

@brighteyed commented on GitHub (Jul 10, 2023):

Fixed by #3147

@brighteyed commented on GitHub (Jul 10, 2023): Fixed by #3147
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#932