[PR #8942] feat(server): enable AV1 encoding for QSV #12255

Closed
opened 2026-02-05 14:53:56 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/immich-app/immich/pull/8942

State: closed
Merged: Yes


Tested on Intel Arc A380 by mounting a modified version of immich/server/dist/utils/media.js with AV1 added to the list of supported codecs of QuickSync. Works flawlessly.

Testing steps:

GPU info

$ lspci  -v -s  $(lspci | grep ' VGA ' | cut -d" " -f 1)
2d:00.0 VGA compatible controller: Intel Corporation DG2 [Arc A380] (rev 05) (prog-if 00 [VGA controller])
	Subsystem: ASRock Incorporation DG2 [Arc A380]
	Flags: bus master, fast devsel, latency 0, IRQ 69, IOMMU group 19
	Memory at fb000000 (64-bit, non-prefetchable) [size=16M]
	Memory at 7c00000000 (64-bit, prefetchable) [size=8G]
	Expansion ROM at fc000000 [disabled] [size=2M]
	Capabilities: <access denied>
	Kernel driver in use: i915
	Kernel modules: i915

Mounted a customized version of immich/server/dist/utils/media.js with this portion modified (added system_config_entity_1.VideoCodec.AV1)

class QSVConfig extends BaseHWConfig {
...
    getSupportedCodecs() {
        return [system_config_entity_1.VideoCodec.H264, system_config_entity_1.VideoCodec.HEVC, system_config_entity_1.VideoCodec.VP9, system_config_entity_1.VideoCodec.AV1];
    }
...
}

Changed video codec to AV1 and hardware acceleration API to Quick Sync
2024-04-20_13-13
Manually triggered transcoding
2024-04-20_13-11
Activity detected in intel_gpu_top
2024-04-20_13-10

Downloaded one of the previews and ensured AV1 codec is used

mediainfo 3aa99fe9-a2e9-4487-932c-2aa8f2f5c238.mp4                                                                            [13:19:12]
General
Complete name                            : 3aa99fe9-a2e9-4487-932c-2aa8f2f5c238.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/av01/iso2/mp41)
File size                                : 192 KiB
Duration                                 : 2 s 740 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 574 kb/s
Frame rate                               : 29.565 FPS
Writing application                      : Lavf60.3.100

Video
ID                                       : 1
Format                                   : AV1
Format/Info                              : AOMedia Video 1
Format profile                           : Main@L4.0
Codec ID                                 : av01
Duration                                 : 2 s 740 ms
Bit rate                                 : 443 kb/s
Maximum bit rate                         : 1 000 kb/s
Width                                    : 1 080 pixels
Height                                   : 1 440 pixels
Display aspect ratio                     : 0.750
Frame rate mode                          : Variable
Frame rate                               : 29.565 FPS
Minimum frame rate                       : 9.977 FPS
Maximum frame rate                       : 90 000.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.010
Stream size                              : 148 KiB (77%)
Title                                    : VideoHandle
Language                                 : English
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
Codec configuration box                  : av1C

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 2 s 713 ms
Bit rate mode                            : Variable
Bit rate                                 : 122 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 40.0 KiB (21%)
Title                                    : SoundHandle
Language                                 : English
Default                                  : Yes
Alternate group                          : 1
**Original Pull Request:** https://github.com/immich-app/immich/pull/8942 **State:** closed **Merged:** Yes --- Tested on Intel Arc A380 by mounting a modified version of `immich/server/dist/utils/media.js` with AV1 added to the list of supported codecs of QuickSync. Works flawlessly. ### Testing steps: GPU info ``` $ lspci -v -s $(lspci | grep ' VGA ' | cut -d" " -f 1) 2d:00.0 VGA compatible controller: Intel Corporation DG2 [Arc A380] (rev 05) (prog-if 00 [VGA controller]) Subsystem: ASRock Incorporation DG2 [Arc A380] Flags: bus master, fast devsel, latency 0, IRQ 69, IOMMU group 19 Memory at fb000000 (64-bit, non-prefetchable) [size=16M] Memory at 7c00000000 (64-bit, prefetchable) [size=8G] Expansion ROM at fc000000 [disabled] [size=2M] Capabilities: <access denied> Kernel driver in use: i915 Kernel modules: i915 ``` Mounted a customized version of `immich/server/dist/utils/media.js` with this portion modified (added `system_config_entity_1.VideoCodec.AV1`) ```javascript class QSVConfig extends BaseHWConfig { ... getSupportedCodecs() { return [system_config_entity_1.VideoCodec.H264, system_config_entity_1.VideoCodec.HEVC, system_config_entity_1.VideoCodec.VP9, system_config_entity_1.VideoCodec.AV1]; } ... } ``` Changed video codec to AV1 and hardware acceleration API to Quick Sync ![2024-04-20_13-13](https://github.com/immich-app/immich/assets/1162128/699d9d58-58f1-401f-9254-12ff36186d59) Manually triggered transcoding ![2024-04-20_13-11](https://github.com/immich-app/immich/assets/1162128/69f842f4-b1ba-4561-96df-6ba2ab87ff72) Activity detected in `intel_gpu_top` ![2024-04-20_13-10](https://github.com/immich-app/immich/assets/1162128/fd103491-7543-4dd3-b0c8-fe038c714ee1) Downloaded one of the previews and ensured AV1 codec is used ``` mediainfo 3aa99fe9-a2e9-4487-932c-2aa8f2f5c238.mp4 [13:19:12] General Complete name : 3aa99fe9-a2e9-4487-932c-2aa8f2f5c238.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/av01/iso2/mp41) File size : 192 KiB Duration : 2 s 740 ms Overall bit rate mode : Variable Overall bit rate : 574 kb/s Frame rate : 29.565 FPS Writing application : Lavf60.3.100 Video ID : 1 Format : AV1 Format/Info : AOMedia Video 1 Format profile : Main@L4.0 Codec ID : av01 Duration : 2 s 740 ms Bit rate : 443 kb/s Maximum bit rate : 1 000 kb/s Width : 1 080 pixels Height : 1 440 pixels Display aspect ratio : 0.750 Frame rate mode : Variable Frame rate : 29.565 FPS Minimum frame rate : 9.977 FPS Maximum frame rate : 90 000.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.010 Stream size : 148 KiB (77%) Title : VideoHandle Language : English Color range : Limited Color primaries : BT.709 Transfer characteristics : BT.709 Matrix coefficients : BT.709 Codec configuration box : av1C Audio ID : 2 Format : AAC LC Format/Info : Advanced Audio Codec Low Complexity Codec ID : mp4a-40-2 Duration : 2 s 713 ms Bit rate mode : Variable Bit rate : 122 kb/s Channel(s) : 2 channels Channel layout : L R Sampling rate : 48.0 kHz Frame rate : 46.875 FPS (1024 SPF) Compression mode : Lossy Stream size : 40.0 KiB (21%) Title : SoundHandle Language : English Default : Yes Alternate group : 1 ```
OVERLORD added the pull-request label 2026-02-05 14:53:56 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#12255