I
Immich2mo ago
N306

How to exclude specific videos from being transcoded?

For some videos I would prefer no transcoding at all as they are quite large. Are there some kind of exclusion patterns for video transcoding or another trick to achieve this?
11 Replies
Immich
Immich2mo ago
:wave: Hey @N306, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time). 2. :ballot_box_with_check: read applicable release notes. 3. :ballot_box_with_check: reviewed the FAQs for known issues. 4. :ballot_box_with_check: reviewed Github for known issues. 5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy). 6. :ballot_box_with_check: uploaded the relevant information (see below). 7. :blue_square: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed. Successfully submitted, a tag has been added to inform contributors. :white_check_mark:
Zeus
Zeus2mo ago
Nothing by size, no
N306
N306OP2mo ago
By size would not help as there are also some larger videos I want to be transcoded. By name I hoped (or by format or so)? @Zeus I would flag them manually with a tag before - thought there might be something like the exclusion patterns for external libraries but for transcoding? 🙂
Zeus
Zeus2mo ago
No, doesn’t exist
N306
N306OP2mo ago
Okey...thanks for the information...is there any workaround? E.g. using a filename the transcoder will ignore or so?
Sergey Katsubo
Sergey Katsubo2mo ago
You can try a monkey patch: modifying Immich files right in the container (without recompilation/building) to exclude videos from transcoding based on a custom rule. The patch below enables ignoring files having _large in file names. It adds custom "if - then" that checks file path.
# patch
docker exec --user root immich_server sed -i '/const input = asset.originalPath/a\ if (input.includes("_large")) { this.logger.log(`Skipping asset from transcoding (custom patch): ${asset.id} ${input}`); return enum_1.JobStatus.Skipped; }' server/dist/services/media.service.js

# verify
docker exec immich_server grep -A1 -B1 'custom patch' server/dist/services/media.service.js

# restart container to apply
docker restart immich_server
# patch
docker exec --user root immich_server sed -i '/const input = asset.originalPath/a\ if (input.includes("_large")) { this.logger.log(`Skipping asset from transcoding (custom patch): ${asset.id} ${input}`); return enum_1.JobStatus.Skipped; }' server/dist/services/media.service.js

# verify
docker exec immich_server grep -A1 -B1 'custom patch' server/dist/services/media.service.js

# restart container to apply
docker restart immich_server
Original handleVideoConversion in sources https://github.com/immich-app/immich/blob/f15376a107f5cab7acca9ad8968afa6a0f9caaf2/server/src/services/media.service.ts#L466-L472 Log:
LOG [Microservices:MediaService] Skipping asset from transcoding (custom patch): 548a1f1f-149b-459e-8ffd-25d58dde4746 /data/library/admin/2025/2025-08/VID_20250823_131435_large.mp4
LOG [Microservices:MediaService] Skipping asset from transcoding (custom patch): 548a1f1f-149b-459e-8ffd-25d58dde4746 /data/library/admin/2025/2025-08/VID_20250823_131435_large.mp4
Immich
Immich2mo ago
async handleVideoConversion({ id }: JobOf<JobName.AssetEncodeVideo>): Promise<JobStatus> {
const asset = await this.assetJobRepository.getForVideoConversion(id);
if (!asset) {
return JobStatus.Failed;
}

const input = asset.originalPath;
async handleVideoConversion({ id }: JobOf<JobName.AssetEncodeVideo>): Promise<JobStatus> {
const asset = await this.assetJobRepository.getForVideoConversion(id);
if (!asset) {
return JobStatus.Failed;
}

const input = asset.originalPath;
N306
N306OP2mo ago
Thank you guys so much! ❤️ @Immich @Sergey Katsubo
Can I use the same trick to e.g. modify the swiping speed needed to turn around in 360 videos? 🥺
Sergey Katsubo
Sergey Katsubo2mo ago
Yes, you can! Try the monkey patch below. Btw, you can create a Feature Request for exposing certain settings, such as move speed or zoom speed, for better UX. (Maybe through the settings cog in sphere/panorama videos) Related: https://github.com/immich-app/immich/pull/20595, https://github.com/immich-app/immich/pull/15747. Monkey patch Set 3x speed (default 1). Server side:
docker exec immich_server sh -c ' SPEED=3.1416
PATTERN="minFov:15"
JS=$(grep -l "$PATTERN" /build/www/_app/immutable/chunks/*.js)
sed -i "s/$PATTERN/moveSpeed:$SPEED,$PATTERN/" "$JS"
grep -Eo "moveSpeed:.{50}" "$JS"
rm "$JS.br" "$JS.gz" '

docker restart immich_server
docker exec immich_server sh -c ' SPEED=3.1416
PATTERN="minFov:15"
JS=$(grep -l "$PATTERN" /build/www/_app/immutable/chunks/*.js)
sed -i "s/$PATTERN/moveSpeed:$SPEED,$PATTERN/" "$JS"
grep -Eo "moveSpeed:.{50}" "$JS"
rm "$JS.br" "$JS.gz" '

docker restart immich_server
Then in broswer - Reload the page without cache to force loading new JS. - Verify in Dev console > Debugger > Search for "moveSpeed:", it should contain the patched number. To undo the change: docker compose down immich-server or re-run the patch with different speed value, e.g. 1.
Immich
Immich2mo ago
[Pull Request] chore: tweak photo sphere fov and zoom speed constants (immich-app/immich#20595) [Pull Request] feat: resolution selection and default preview playback for 360° panorama videos (immich-app/immich#15747)
N306
N306OP3w ago
@Immich Thanks for the information! 🙂 Sadly this is no use case for me as I use Immich via touch devices or oj desktop with a mouse (dragging arround with a touchpad in a 360 sphere would drive me crazy on non-Apple devices as they don't support 3-finger-drag as it's patented). My main issues still are: 1. 360 drag speed on touch devices is barely unusable slow on videos and images (compare with Google Maps e.g.) (a setting would be amazing here) 2. 360 images have the same preview image size as regular images making a quick zoom in zoom out necessary each time to not get a blurry image (as in 360 6k is the absolute minimum, even 8k just results in a 1080p image as you are just looking at a small frame of the whole image) → the current threads topic and I will try the fix above but it is just a temporary workaround as it is not embedded and maintained in the source code) 3. 3D360 image previews are displayed wrong (not converted to 2D as the non-preview files then do) Sadly I have not the needed dev experience to fix that stuff :/ especially things like writing tests etc - finding the correct parameter via trial and error to tweak it might be possible though...

Did you find this page helpful?