Repository navigation
Video plays smoothly at 4K and at 60 fps - #137
Closed
shinyobjectz wants to merge 3 commits into
Closed
shinyobjectz wants to merge 3 commits into
shinyobjectz wants to merge 3 commits into
Conversation
…own when due, a faster BGRA conversion, halvings from the decoder's thread, no relayout for a same-size frame
…nds only the halving it is drawn from
shinyobjectz
force-pushed
the
video-playback
branch
from
November 13, 2026 19:35
352662e to
5e31d06
Compare
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Video in a page (the app's players) lagged and dropped frames, most at 4K and at 60 fps. This makes four changes, each measured.
What changes
Msg::Due). A decode that stalls for 40 to 85 ms (a reader starting again, a busy machine) no longer reaches the picture. At each of its own frames the page shows the frame due then. How long a frame takes to decode is no longer part of when it is shown, and a loop's first frame is ready before its last has gone.io/apple/src/convert.rs). A 4K frame takes 1.9 ms, was about 5.5: it was most of what decoding one cost.imgalready gets) is now made on the decoder's thread and is all that is sent: the frame comes as its size and that halving (Cmd::Halvings, blitz-paintpreload_mipsandvideo_level). A 4K frame waiting is then 8 or 2 MB, which is what makes the quarter second affordable.RAEA_MEDIA_HALVINGS=0draws frames as they come, to compare.Also:
RAEA_PAGE_FPSsets a headless window's frame rate (60 as before), to measure a 60 fps video on a page that draws 120 times a second.RAEA_MEDIA_STATS=1now also says how late frames were shown and how far apart the page's syncs were.Measured
RAEA_MEDIA_STATS=1in the built app's headless window, two videos side by side, 10 s each, the same reel at each size and rate.With the page's loop uncapped, the halvings take the page's longest frame on two 4K60 videos from 11 to 12 ms down to 5 to 8 ms.
Not in this change
timeupdate, which makes one page frame in fifteen about 9 ms longer. That is the app's to fix.Checked
cargo test -p raea-runtime-js media_play(each playing frame is due on the clock, through two laps of a loop; a loop's first frame comes before it is due; a paused picture asked for halvings comes again as its size and the one it is drawn from; a halving is the mean of four).cargo test -p raea-runtime-dom-media(the frame shown is the latest one due).cargo test -p raea-io-apple --release convert(the conversion, and its time).tools/agents/check --land --lane video-playback: L1 ok.