immich-app/immich · error · Error

Incompatible video codec for RKMPP

Error message

Incompatible video codec for RKMPP: ${this.config.targetVideoCodec}

What it means

The RKMPP hardware acceleration path only supports a subset of target video codecs; getVideoCodecOptions() has explicit cases for H.264/HEVC levels and throws in the default branch for anything else. It guards against handing ffmpeg_mpp a codec it cannot encode on Rockchip NPUs.

Solutions

  1. Change the target video codec in transcoding settings to H.264 (or HEVC) when using RKMPP.
  2. Switch hardware acceleration to VAAPI/QSV/NVENC if you must keep a non-h264/hevc target codec.
  3. Check the ffmpeg_mpp build on your device for supported codecs before configuring.

Example fix

// before
config.targetVideoCodec = VideoCodec.Vp9; // with RKMPP
// after
config.targetVideoCodec = VideoCodec.H264; // or VideoCodec.Hevc
Defensive patterns

Strategy: validation

Validate before calling

const RKMPP_SUPPORTED = ['h264', 'hevc'];
if (hwAcceleration === 'rkmpp' && !RKMPP_SUPPORTED.includes(targetVideoCodec)) {
  throw new ConfigError('RKMPP requires h264 or hevc target codec');
}

Try / catch

try { options = rkmpp.getVideoCodecOptions(); } catch (e) { if (e.message.startsWith('Incompatible video codec')) { logger.warn('Falling back to h264 for RKMPP'); config.targetVideoCodec = 'h264'; } else throw e; }

Prevention

When it happens

Trigger: Running transcoding with hardware acceleration set to RKMPP while the target video codec setting is anything other than h264 or hevc (e.g. vp9, av1).

Common situations: On Rockchip boards (RK3588 etc.) leaving transcoding target codec at VP9 default; switching hardware backend to RKMPP without changing a codec configured for another GPU.

Related errors


AI-assisted analysis of immich-app/immich@e55ac299a4 (2026-09-15). Data as JSON: /api/errors/d1abe2e1e82cfd3d. Report an issue: GitHub.

Appendix: source

Thrown at server/src/utils/media.ts:1065

    return false;
  }

  getBaseInputOptions(): string[] {
    return [];
  }

  getPresetOptions() {
    switch (this.config.targetVideoCodec) {
      case VideoCodec.H264: {
        // from ffmpeg_mpp help, commonly referred to as H264 level 5.1
        return ['-level', '51'];
      }
      case VideoCodec.Hevc: {
        // from ffmpeg_mpp help, commonly referred to as HEVC level 5.1
        return ['-level', '153'];
      }
      default: {
        throw new Error(`Incompatible video codec for RKMPP: ${this.config.targetVideoCodec}`);
      }
    }
  }

  getBitrateOptions() {
    const bitrate = this.getMaxBitrateValue();
    if (bitrate > 0) {
      // -b:v specifies max bitrate, average bitrate is derived automatically...
      return ['-rc_mode', 'AVBR', '-b:v', `${bitrate}${this.getBitrateUnit()}`];
    }
    // use CRF value as QP value
    return ['-rc_mode', 'CQP', '-qp_init', String(this.config.crf)];
  }

  getVideoCodec(): string {
    return `${this.config.targetVideoCodec}_rkmpp`;
  }
}

View on GitHub (pinned to e55ac299a4)