Skip to content

feat: millisecond precision#11

Merged
mertalev merged 3 commits intomainfrom
feat/millisecond-precision
Oct 24, 2025
Merged

feat: millisecond precision#11
mertalev merged 3 commits intomainfrom
feat/millisecond-precision

Conversation

@mertalev
Copy link
Member

@mertalev mertalev commented Sep 23, 2025

This PR changes the player APIs from using seconds to milliseconds, allowing for much more precise seeking and position updates. It updates the position up to every 1/120 seconds so as to keep fluidity for high frame rate videos. Because the volume of updates is higher, it also makes optimizations to lower the amount of communication needed between the Dart and platform side. Specifically, the position is now polled on the platform side and not emitted to Dart unless the value is actually different from the last one.

Tested on a branch using these changes in the main Immich app on iOS and Android.

Based on #10, which should be merged first.

Base automatically changed from chore/gradle to main September 24, 2025 00:46
@mertalev mertalev force-pushed the feat/millisecond-precision branch from 69db7b1 to c4cdb27 Compare September 24, 2025 14:44
@CiNcH83
Copy link

CiNcH83 commented Oct 20, 2025

Looking forward to this PR. I tried to evaluate seeking a bit and for local files the iOS Photos app is super smooth while Immich is certainly less smooth (just for clarification, both have been tested with local files). It indeed looks as if this is due to seconds vs. milliseconds precision.

I also tried seeking videos from the Immich server (H.265 1080p30 Dolby Vision recorded with an iPhone 16 Pro). Server is a Raspberry Pi 5 (8 GB) (content is stored on a PCIe 3.0 SSD) and Wi-Fi speed to the server is around 300 mbps on an iPhone 16 Pro:
image
(measured with iPerf3)

I don't really know what to expect here but obviously it is much more choppy compared to local files.

[EDIT]
Some more tests with other services...

Plex on NAS (with HDD) streaming Blu-ray content (1080p24 H.264, avg. bitrate 29.9 Mb/s) without transcoding:
no updates while scrubbing, often takes up to 10s to resume (high bitrate may be the killer here or bad player software)

YouTube (1080p60 HDR) over 100mbps Internet:
scrubbing is quite smooth with many updates, looks like YouTube switches to the low-res low-bitrate stream (the switching is seamless)

@mertalev mertalev merged commit d921ae2 into main Oct 24, 2025
4 checks passed
@mertalev mertalev deleted the feat/millisecond-precision branch October 24, 2025 18:45
@CiNcH83
Copy link

CiNcH83 commented Oct 30, 2025

Seeking local files is still much smoother with the Apple Photos app.

May it be that millisecond accuracy can cause a regression for network file playback? I was under the impression that there have been less updates when moving the slider. iPerf3 speed has been measured at around 400 mbps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants