Skip to content

feat: Implement hardware-accelerated video export toggle - #49

Open
KacperSynator wants to merge 3 commits into
mainfrom
hw-acceleration-export-10768794111236745684
Open

feat: Implement hardware-accelerated video export toggle#49
KacperSynator wants to merge 3 commits into
mainfrom
hw-acceleration-export-10768794111236745684

Conversation

@KacperSynator

Copy link
Copy Markdown
Owner

This commit adds a runtime configuration option for hardware-accelerated video exports.

Key changes:

  • ProjectConfig updated with use_hardware_acceleration: bool (defaulting to true) to maintain backwards compatibility.
  • default_config.json updated with the new property.
  • Added a new UI checkbox in src/gui/controls.rs to allow the user to toggle this feature on or off.
  • src/export.rs updated to discover and utilize supported hardware encoders via ffmpeg::encoder::find_by_name.
  • Test suites appropriately updated to support the new config field.

PR created automatically by Jules for task 10768794111236745684 started by @KacperSynator

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Details
Benchmark suite Current: 7504324 Previous: 3414d8e Ratio
pixel_copy_1080p/allocate_every_frame 418213 ns/iter (± 1902) 416328 ns/iter (± 1831) 1.00
pixel_copy_1080p/reuse_buffer 213088 ns/iter (± 1183) 276759 ns/iter (± 1266) 0.77
auto_correlate_gps_100_laps 1865222 ns/iter (± 89858) 1826840 ns/iter (± 82471) 1.02
auto_correlate_gps_lissajous_12min 74759054 ns/iter (± 79518) 74516457 ns/iter (± 151948) 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@codecov-commenter

codecov-commenter commented Aug 13, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 43 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/export.rs 0.00% 41 Missing ⚠️
src/gui/controls.rs 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 710b1e2 Previous: 20fbb0c Ratio
pixel_copy_1080p/allocate_every_frame 822495 ns/iter (± 8101) 326220 ns/iter (± 2540) 2.52
pixel_copy_1080p/reuse_buffer 525429 ns/iter (± 8281) 216117 ns/iter (± 2871) 2.43

This comment was automatically generated by workflow using github-action-benchmark.

google-labs-jules Bot and others added 3 commits August 14, 2026 12:28
Adds a `use_hardware_acceleration` configuration setting to allow using
hardware encoders (nvenc, amf, qsv, videotoolbox) during video export,
falling back gracefully to the software H.264 encoder if unavailable or disabled.

Co-authored-by: KacperSynator <62207289+KacperSynator@users.noreply.github.com>
When searching for hardware encoders (e.g. nvenc, amf), finding the codec
by name is not sufficient as runtime drivers (like libcuda) may be missing.
This updates the logic to actively open the encoder context and only
commit to using it if initialization succeeds, falling back to CPU otherwise.

Co-authored-by: KacperSynator <62207289+KacperSynator@users.noreply.github.com>
Resolves initialization crashes by targeting correct pixel formats
per hardware encoder (e.g., NV12 for Intel QSV, YUV420P for AMD/NVENC)
and omitting the software-specific "preset" parameter which caused AMD
AMF encoders to throw parsing errors.

Co-authored-by: KacperSynator <62207289+KacperSynator@users.noreply.github.com>
@KacperSynator
KacperSynator force-pushed the hw-acceleration-export-10768794111236745684 branch from 3414d8e to 7504324 Compare August 14, 2026 10:28
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.

2 participants