Repository navigation
perf(video): thread the scaling step in the Video Format block - #731
Merged
Merged
Conversation
wagenet
force-pushed
the
wagenet/videoconvertscale
branch
2 times, most recently
from
August 31, 2026 19:32
b656eb2 to
d856a8a
Compare
wagenet
commented
Aug 31, 2026
wagenet
left a comment
Contributor
Author
There was a problem hiding this comment.
Code looks reasonable.
wagenet
force-pushed
the
wagenet/videoconvertscale
branch
from
September 1, 2026 04:46
d856a8a to
60dc59a
Compare
5 of 9 tasks
Collaborator
|
Noted as a draft, so I am holding off on a full review until it is marked ready for |
Contributor
Author
|
@srperens it could be reviewed now, but it can't be merged until the PR it is stacked upon is merged. |
This was referenced Sep 18, 2026
wagenet
force-pushed
the
wagenet/videoconvertscale
branch
2 times, most recently
from
September 26, 2026 04:21
d13cbf2 to
f8cb697
Compare
wagenet
force-pushed
the
wagenet/videoconvertscale
branch
from
September 26, 2026 05:03
f8cb697 to
b1ca85a
Compare
wagenet
marked this pull request as ready for review
September 26, 2026 05:17
`videoscale` ships with `n-threads=1`, the same default that `configure_video_convert()` already raises on the `videoconvert` beside it, so a resize to or from 4K ran on one core. The block now passes its `videoscale` through the same helper. For progressive video the output in I420, UYVY and NV12 is byte-identical in every shape measured except SD upscaled to 4K, where chroma moves by 1-2 levels. Interlaced input can differ on the rows where one thread's stripe meets the next. Like the conversion threading this is macOS-only. Elsewhere the helper is a no-op and the block behaves as before. M4 Max, gst-launch with n-threads pinned to 4, 150 frames, 6 order-alternated pairs, wall time including the test source: - RGBA 1080p -> I420 720p: 0.74 s -> 0.36 s - UYVY 4K -> I420 1080p: 2.23 s -> 1.36 s - I420 720p -> UYVY 4K: 1.49 s -> 0.53 s Total CPU stays within 4% in all three. A single `videoconvertscale` doing both steps is ~5% faster on the first shape, but 1.1-2x slower on the other two, and single-threaded, as on Linux, costs up to 2.5x the CPU of the two-element chain. Also corrects a doc comment in thumbnail.rs that names elements the module no longer uses. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
wagenet
force-pushed
the
wagenet/videoconvertscale
branch
from
September 28, 2026 15:29
b1ca85a to
4c60f2d
Compare
srperens
approved these changes
Sep 29, 2026
srperens
left a comment
Collaborator
There was a problem hiding this comment.
Verified locally on macOS: scale_and_convert_are_threaded passes at this head and fails with configure_video_convert did not reach 'vf0:videoscale' when the new call is removed. Change is macOS-only and a no-op elsewhere. Thanks!
srperens
added a commit
that referenced
this pull request
Sep 29, 2026
Add #731, #882 and #889, which landed on main after the bump was opened. Audit every section from 0.4.10 on against the commits between its tags and add the PRs that were never written up: #505-#507 and #514 in 0.4.11, #533, #541 and #550 in 0.5.0, #577, #580, #581 and #584 in 0.6.0, #638 in 0.6.5 and #829 in 0.6.9. Only version-bump PRs are left unlisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
srperens
added a commit
that referenced
this pull request
Sep 29, 2026
Add #731, #882 and #889, which landed on main after the bump was opened. Audit every section from 0.4.10 on against the commits between its tags and add the PRs that were never written up: #505-#507 and #514 in 0.4.11, #533, #541 and #550 in 0.5.0, #577, #580, #581 and #584 in 0.6.0, #638 in 0.6.5 and #829 in 0.6.9. Only version-bump PRs are left unlisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
srperens
added a commit
that referenced
this pull request
Sep 29, 2026
* chore(release): bump version to 0.6.11 Bump the workspace version to 0.6.11 (Cargo.toml, Cargo.lock, the OpenAPI info.version in openapi.json) and add the 0.6.11 changelog entry for the 27 commits since 0.6.10. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(changelog): add the three PRs since, and fill gaps in 0.4.11-0.6.9 Add #731, #882 and #889, which landed on main after the bump was opened. Audit every section from 0.4.10 on against the commits between its tags and add the PRs that were never written up: #505-#507 and #514 in 0.4.11, #533, #541 and #550 in 0.5.0, #577, #580, #581 and #584 in 0.6.0, #638 in 0.6.5 and #829 in 0.6.9. Only version-bump PRs are left unlisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(changelog): add #876 to 0.6.11 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
The Video Format block builds
videoscale -> videoconvert -> capsfilter.configure_video_convert()raisesn-threadson thevideoconvert, butvideoscalehas the same property with the same default of 1 and nothing set it, so a resize to or from 4K ran on one core. The block now passesvideoscalethrough the same helper.Like the existing conversion threading, this is macOS-only: elsewhere the helper is a no-op and the block is unchanged.
Measurements
M4 Max (12 performance cores),
gst-launch-1.0withn-threadspinned to 4, 150 frames, 6 order-alternated pairs,videoscale ! videoconvert n-threads=4againstvideoscale n-threads=4 ! videoconvert n-threads=4. Wall time includes the test source.6/6 pairs in every shape. On this machine the block itself uses
video_convert_threads()= 12. Each resizing block adds that many threads; the CPU cost of many such blocks competing on a Mac with fewer cores was not measured.For progressive video the output is byte-identical to the unthreaded chain. That covers the shapes above, I420 1080p → RGBA 720p, and every resolution in the block's dropdown from 1080p, 720p, 576p and 480p sources in I420, UYVY and NV12. The exception is SD upscaled to 4K, where chroma moves by 1–2 levels. 10-bit packed v210 output differs byte-wise; whether that reaches pixel values was not checked. Interlaced input can differ on the rows where one thread's stripe meets the next.
A single
videoconvertscaledoing both steps was also measured. It is ~5% faster than this on the first shape, but 1.1–2x slower on the other two. Single-threaded, as on Linux, it costs up to 2.5x the CPU of the two-element chain. It also changes output at sharp chroma edges.Tests
scale_and_convert_are_threaded(macOS) builds the block and checks that every element withn-threadsgotvideo_convert_threads(). It fails withconfigure_video_convert did not reach 'vf0:videoscale'when the new call is removed.The test is macOS-only, because the thread count is only raised there. The macOS CI job does not run on PRs without the
ci:macoslabel, so it was run on the fork at this head, where the test passed: https://github.com/wagenet/strom/actions/runs/36247628073.Ran locally on macOS at this head: the 11
videoformatandgpulib tests,cargo fmt --all --check, andcargo clippy --workspace --all-targets -D warnings. The full suite runs in the Linux CI job, where the change compiles to nothing. Windows was not built.Also corrects a doc comment in
thumbnail.rsthat names elements the module no longer uses.🤖 Generated with Claude Code