{"record":{"id":"d1abe2e1e82cfd3d","repo":"immich-app/immich","slug":"incompatible-video-codec-for-rkmpp-this-config","errorCode":null,"errorMessage":"Incompatible video codec for RKMPP: ${this.config.targetVideoCodec}","messagePattern":"Incompatible video codec for RKMPP: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/src/utils/media.ts","lineNumber":1065,"sourceCode":"    return false;\n  }\n\n  getBaseInputOptions(): string[] {\n    return [];\n  }\n\n  getPresetOptions() {\n    switch (this.config.targetVideoCodec) {\n      case VideoCodec.H264: {\n        // from ffmpeg_mpp help, commonly referred to as H264 level 5.1\n        return ['-level', '51'];\n      }\n      case VideoCodec.Hevc: {\n        // from ffmpeg_mpp help, commonly referred to as HEVC level 5.1\n        return ['-level', '153'];\n      }\n      default: {\n        throw new Error(`Incompatible video codec for RKMPP: ${this.config.targetVideoCodec}`);\n      }\n    }\n  }\n\n  getBitrateOptions() {\n    const bitrate = this.getMaxBitrateValue();\n    if (bitrate > 0) {\n      // -b:v specifies max bitrate, average bitrate is derived automatically...\n      return ['-rc_mode', 'AVBR', '-b:v', `${bitrate}${this.getBitrateUnit()}`];\n    }\n    // use CRF value as QP value\n    return ['-rc_mode', 'CQP', '-qp_init', String(this.config.crf)];\n  }\n\n  getVideoCodec(): string {\n    return `${this.config.targetVideoCodec}_rkmpp`;\n  }\n}","sourceCodeStart":1047,"sourceCodeEnd":1083,"githubUrl":"https://github.com/immich-app/immich/blob/e55ac299a4ec7cb372e35dbf2c6c05ee9ce77f6c/server/src/utils/media.ts#L1047-L1083","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Change the target video codec in transcoding settings to H.264 (or HEVC) when using RKMPP.","Switch hardware acceleration to VAAPI/QSV/NVENC if you must keep a non-h264/hevc target codec.","Check the ffmpeg_mpp build on your device for supported codecs before configuring."],"exampleFix":"// before\nconfig.targetVideoCodec = VideoCodec.Vp9; // with RKMPP\n// after\nconfig.targetVideoCodec = VideoCodec.H264; // or VideoCodec.Hevc","handlingStrategy":"validation","validationCode":"const RKMPP_SUPPORTED = ['h264', 'hevc'];\nif (hwAcceleration === 'rkmpp' && !RKMPP_SUPPORTED.includes(targetVideoCodec)) {\n  throw new ConfigError('RKMPP requires h264 or hevc target codec');\n}","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["Check each hardware accelerator's supported codec list before switching backends","Validate transcode settings against the chosen accelerator at config-save time","Keep codecs in sync when migrating between VAAPI/QSV and RKMPP"],"tags":["hardware-acceleration","video-codec","rockchip","configuration"],"backgroundTag":"incompatible-config-options","analyzedSha":"e55ac299a4ec7cb372e35dbf2c6c05ee9ce77f6c","analyzedAt":"2026-09-15T07:20:19.675Z","contentChangedAt":"2026-09-15T07:20:19.675Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}