-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify when requestFrame() captures the canvas content #28
Comments
Another detail in need of spec'ing here is the behavior when the |
The text for http://w3c.github.io/mediacapture-fromelement/#methods-1
I think for simplicity |
Yep, spelling out that it sets |
A use case of captureStream is to record video of rendered graphics on a canvas. Naturally, with graphics rendering the FPS may be variable. For realtime graphics a variable output FPS is acceptable, but for graphics rendered on given time steps, but with variable processing time, such as for a movie (could be using raytracing or other expensive techniques), it should be possible to render frames one by one and specify a fixed framerate. I actually expected this behavior for captureStream(0), but found no way to control the output framerate. Maybe requestFrame could take a dt or timestamp parameter, to override the realtime default? Or maybe there could be a way to apply constraints? Syncing with an audio stream would then be another challenge. I understand that realtime streams may be prioritized, but then maybe the output framerate control belongs in MediaRecorder. Edit: This answers seems to provide a kind of solution for the non-realtime rendering at variable rate: https://stackoverflow.com/a/41275515/4071801 |
@EliasHasle What issue are you having achieving the requirement? |
Thank you. The issue is that MediaRecorder seems to record real-time with variable framerate when stream framerate is 0. This is probably by design. Trying to hack around this by pausing and resuming the recorder is tricky and possibly depends on timely triggering of events etc.. However, I found that ccapture.js solves my use case well. It captures frame by frame as images and joins them into a fixed-framerate video afterwards. :-) |
It seems that implementations currently read
as saying "Set this's Given that to actually "render" a new frame to the track,
Both Firefox and Chrome do render half-baked frames when we do use To avoid this, |
http://w3c.github.io/mediacapture-fromelement/#dfn-requestframe
This doesn't say what invoking
requestFrame()
should actually do. Does requesting mean that what is currently on the canvas gets encoded as a new frame, or is it a request to capture the canvas content at some later time, and if so at what time?The text was updated successfully, but these errors were encountered: