[Feature]: Extend video transcoding support #87

Closed
opened 2026-02-04 17:28:27 +03:00 by OVERLORD · 17 comments
Owner

Originally created by @zackpollard on GitHub (Jun 6, 2022).

Feature detail

Video transcoding has now been added for MOV files, however this should be extended. Making a note here as we discussed so this can be picked up and worked on:

  • We should convert anything that isn't already in the desired codec (h264 or VP9) or container (mp4), we should detect this using ffprobe
  • We should make quality (CRF, output resolution, encoding speed, etc) and potentially all ffmpeg settings customisable by the admin of the server
  • An admin page on the web interface for configuration options like the above
  • We should allow hardware acceleration of the ffmpeg encode and decode (could be via the above, or auto detection of hardware presence)
  • Support remuxing container if not in supported format
  • Support re-encoding either audio or video if in incorrect format, rather than always both
  • Stop scaling up videos that are smaller than target quality
  • Stop scaling up videos that are in portrait mode

I believe this is everything we discussed around this, will update if I remember more.

Platform

Server

Originally created by @zackpollard on GitHub (Jun 6, 2022). ### Feature detail Video transcoding has now been added for MOV files, however this should be extended. Making a note here as we discussed so this can be picked up and worked on: - [x] We should convert anything that isn't already in the desired codec (h264 or VP9) or container (mp4), we should detect this using ffprobe - [x] We should make quality (CRF, output resolution, encoding speed, etc) and potentially all ffmpeg settings customisable by the admin of the server - [x] An admin page on the web interface for configuration options like the above - [ ] We should allow hardware acceleration of the ffmpeg encode and decode (could be via the above, or auto detection of hardware presence) - [x] Support remuxing container if not in supported format - [x] Support re-encoding either audio or video if in incorrect format, rather than always both - [x] Stop scaling up videos that are smaller than target quality - [x] Stop scaling up videos that are in portrait mode I believe this is everything we discussed around this, will update if I remember more. ### Platform Server
Author
Owner

@JVT038 commented on GitHub (Sep 9, 2022):

Could it be possible to check whether direct streaming is possible, before transcoding?
I know Edge supports HEVC for example (if the user paid), so transcoding would be unnecessary in that case.
Also, a lot of modern mobile devices support HEVC as well.
So check the compatibility before transcoding to save processing power.

@JVT038 commented on GitHub (Sep 9, 2022): Could it be possible to check whether direct streaming is possible, before transcoding? I know Edge supports HEVC for example (if the user paid), so transcoding would be unnecessary in that case. Also, a lot of modern mobile devices support HEVC as well. So check the compatibility before transcoding to save processing power.
Author
Owner

@zackpollard commented on GitHub (Sep 9, 2022):

I don't think we are planning to do live transcoding, we're going to be converting files at the point of upload and storing them on disk for simple playback. This will be configurable quality and format but default will likely be h264 in an mp4 container.

@zackpollard commented on GitHub (Sep 9, 2022): I don't think we are planning to do live transcoding, we're going to be converting files at the point of upload and storing them on disk for simple playback. This will be configurable quality and format but default will likely be h264 in an mp4 container.
Author
Owner

@bo0tzz commented on GitHub (Nov 26, 2022):

Having the option to downscale 4k videos for playback in the clients would also be nice, not all my devices are entirely happy about playing 4k :D

@bo0tzz commented on GitHub (Nov 26, 2022): Having the option to downscale 4k videos for playback in the clients would also be nice, not all my devices are entirely happy about playing 4k :D
Author
Owner

@palitu commented on GitHub (Nov 30, 2022):

I agree. I have a video that wont play in the web-ui, and also really doesn't need high res. I would be happy with live transcoding as an option, or a default setting for stored transcoded videos.

thanks :D

@palitu commented on GitHub (Nov 30, 2022): I agree. I have a video that wont play in the web-ui, and also really doesn't need high res. I would be happy with live transcoding as an option, or a default setting for stored transcoded videos. thanks :D
Author
Owner

@akoyaxd commented on GitHub (Dec 23, 2022):

It would also help to avoid #958

@akoyaxd commented on GitHub (Dec 23, 2022): It would also help to avoid #958
Author
Owner

@EnochPrime commented on GitHub (Jan 15, 2023):

Going on the assumption that there would not be live transcoding, it would be nice to have the following options:

  1. Transcode to configured format on upload (current functionality)
  2. Don't transcode, files that can't be played will display a note to download the file
  3. Generate set of versions, but keep original as-is ("storage is cheap")
    • high resolution (same as 1)
    • low resolution (to save mobile data)
    • timeline version
    • etc.
@EnochPrime commented on GitHub (Jan 15, 2023): Going on the assumption that there would not be live transcoding, it would be nice to have the following options: 1. Transcode to configured format on upload (current functionality) 2. Don't transcode, files that can't be played will display a note to download the file 3. Generate set of versions, but keep original as-is ("storage is cheap") - high resolution (same as 1) - low resolution (to save mobile data) - timeline version - etc.
Author
Owner

@JosiahBull commented on GitHub (Jan 31, 2023):

H264 is obviously great for wide device support for playback, but I'd personally support keeping the original version as @EnochPrime commented. I'd personally be miffed at losing my original quality backup.

Especially since H264 caps out at 2048x2048 8 bit iirc. Either storing the original as-is or converting to a format like H265 (to preserve 10 bit color, high resolution, and high framerates) would be ideal.

@JosiahBull commented on GitHub (Jan 31, 2023): H264 is obviously great for wide device support for playback, but I'd personally support keeping the original version as @EnochPrime commented. I'd personally be miffed at losing my original quality backup. Especially since H264 caps out at 2048x2048 8 bit iirc. Either storing the original as-is or converting to a format like H265 (to preserve 10 bit color, high resolution, and high framerates) would be ideal.
Author
Owner

@EnochPrime commented on GitHub (Jan 31, 2023):

I'd personally support keeping the original version

The original version is kept, I was mistaken on the process when I made that comment. The transcoded files are in addition to the original.

@EnochPrime commented on GitHub (Jan 31, 2023): > I'd personally support keeping the original version The original version is kept, I was mistaken on the process when I made that comment. The transcoded files are in addition to the original.
Author
Owner

@bt90 commented on GitHub (Jan 31, 2023):

Isn't this just an additional preview file?

@bt90 commented on GitHub (Jan 31, 2023): Isn't this just an additional preview file?
Author
Owner

@printfuck commented on GitHub (Mar 29, 2023):

I've added a bunch of already optimal webm files, which when transcoded (with default settings) grew to 10 times the size of the original file.

I think there should either be an option to:

  • serve the original file, if it's smaller and on a customizable list of filetypes, that are allowed to be served to clients
  • discard the transcoded files if they are bigger than the original, when uploading
  • edit a list with filetypes, that shouldn't be transcoded

At least there should be an option to serve the original file by default. I feel like that's already there but I haven't found it yet.

@printfuck commented on GitHub (Mar 29, 2023): I've added a bunch of already optimal webm files, which when transcoded (with default settings) grew to 10 times the size of the original file. I think there should either be an option to: - serve the original file, if it's smaller and on a customizable list of filetypes, that are allowed to be served to clients - discard the transcoded files if they are bigger than the original, when uploading - edit a list with filetypes, that shouldn't be transcoded At least there should be an option to serve the original file by default. I feel like that's already there but I haven't found it yet.
Author
Owner

@AngelaDMerkel commented on GitHub (Apr 29, 2023):

I've added a bunch of already optimal webm files

I am in agreement with @printfuck in this respect. I have a bunch of 6K and 8K 12bit videos which are extremely highly compressed timelapses already optimised using ffmpeg. Converting to h264 does bad things to them and introduces pretty wild amounts of dithering.

We should make quality (CRF, output resolution, encoding speed, etc) and potentially all ffmpeg settings customisable by the admin of the server

At this point, you might as well add a codec option, or multi codec support. Everything I have supports h265 and does so with hardware acceleration. I'd much rather save the bandwidth with more modern compression than worry about support for a codec with wide adoption

@AngelaDMerkel commented on GitHub (Apr 29, 2023): > I've added a bunch of already optimal webm files I am in agreement with @printfuck in this respect. I have a bunch of 6K and 8K 12bit videos which are extremely highly compressed timelapses already optimised using ffmpeg. Converting to h264 does bad things to them and introduces pretty wild amounts of dithering. > We should make quality (CRF, output resolution, encoding speed, etc) and potentially all ffmpeg settings customisable by the admin of the server At this point, you might as well add a codec option, or multi codec support. Everything I have supports h265 and does so with hardware acceleration. I'd much rather save the bandwidth with more modern compression than worry about support for a codec with wide adoption
Author
Owner

@jrasm91 commented on GitHub (May 29, 2023):

I believe with the exception of hardware support everything in this issue has been implemented. Hardware support probably deserves its own issue anyways, so I'm going to go ahead and close this as completed. Happy to reopen if there are more pending enhancements though.

@jrasm91 commented on GitHub (May 29, 2023): I believe with the exception of hardware support everything in this issue has been implemented. Hardware support probably deserves its own issue anyways, so I'm going to go ahead and close this as completed. Happy to reopen if there are more pending enhancements though.
Author
Owner

@jianglai commented on GitHub (Mar 16, 2024):

Is there an issue to track hardware transcoding support?

@jianglai commented on GitHub (Mar 16, 2024): Is there an issue to track hardware transcoding support?
Author
Owner

@automaton82 commented on GitHub (Aug 26, 2025):

I was forwarded to this ticket from https://github.com/immich-app/immich/issues/307.

I have a very large number (>5,000) videos in hevc/h265 .mp4 containers that Edge is perfectly capable of direct streaming. I can't transcode them since the burden is too large, so I just want to stream them. Plex is able to do so with the same videos.

Is there a ticket tracking direct streaming videos of this type like Plex does? I'd be happy to help implement as well, if needed.

@automaton82 commented on GitHub (Aug 26, 2025): I was forwarded to this ticket from https://github.com/immich-app/immich/issues/307. I have a very large number (>5,000) videos in hevc/h265 .mp4 containers that Edge is perfectly capable of direct streaming. I can't transcode them since the burden is too large, so I just want to stream them. Plex is able to do so with the same videos. Is there a ticket tracking direct streaming videos of this type like Plex does? I'd be happy to help implement as well, if needed.
Author
Owner

@jrasm91 commented on GitHub (Aug 26, 2025):

Sounds like you are looking for this:
https://github.com/immich-app/immich/discussions/7666

@jrasm91 commented on GitHub (Aug 26, 2025): Sounds like you are looking for this: https://github.com/immich-app/immich/discussions/7666
Author
Owner

@jrasm91 commented on GitHub (Aug 26, 2025):

Oh, it sounds like you are actually asking for a video version of isWebCompitible. I don't know off the type of my head if anything like that exists at the moment.

@jrasm91 commented on GitHub (Aug 26, 2025): Oh, it sounds like you are actually asking for a video version of `isWebCompitible`. I don't know off the type of my head if anything like that exists at the moment.
Author
Owner

@automaton82 commented on GitHub (Aug 26, 2025):

Oh, it sounds like you are actually asking for a video version of isWebCompitible. I don't know off the type of my head if anything like that exists at the moment.

Edge natively supports HEVC h265, for example:

<body>
<video src="D:\Path\To\Movie\Movie.m4v" type="video/mp4" controls></video>
</body>

There's no need to transcode it, it just has to be sent directly to be played.

@automaton82 commented on GitHub (Aug 26, 2025): > Oh, it sounds like you are actually asking for a video version of `isWebCompitible`. I don't know off the type of my head if anything like that exists at the moment. Edge natively supports HEVC h265, for example: ```html <body> <video src="D:\Path\To\Movie\Movie.m4v" type="video/mp4" controls></video> </body> ``` There's no need to transcode it, it just has to be sent directly to be played.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#87