headless chrome can't capture screenvideo or animation
See original GitHub issueI try to capture some animations from a website and stitch them together using ffmpeg. As far as I understand the docs startScreencast is the way to go.
If I understand that right I can start the screencast with
await Page.startScreencast({format: 'png', everyNthFrame: 1});
and listen to every incoming frame with
Page.screencastFrame( image =>{
const {data, metadata} = image;
console.log(metadata);
});
But it’s never printed out something. So I assume it’s not triggered.
I archived my goal with something like this:
let counter = 0;
while(counter < 500){
await Page.startScreencast({format: 'png', everyNthFrame: 1});
const {data, metadata} = await Page.screencastFrame();
console.log(metadata);
counter += 1;
}
Which feels like a non-performant hack.
So any suggestions on how to use startScreencast
and screencastFrame
properly?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
headless chrome capture screen video or animation
Save this question. Show activity on this post. I try to capture some animations from a website and stitch them together using ffmpeg....
Read more >Capture CSS Animations into video with frame precision
Running headless Chrome and executing DevTools protocol command HeadlessExperimental.beginFrame() fetching the screenshots seems like the way to go. Now I'm ...
Read more >Using a headless browser to capture page screenshots
Puppeteer - A headless Chrome node API · Launch the browser · Open a new page · Navigate to the chosen URL ·...
Read more >How to perform server-side rendering in Verge3D - Soft8Soft
Unmasked Vendor/Renderer lines say that Chrome Headless uses real GPU of the ... With Puppeteer you can also capture videos of your Verge3D...
Read more >Set up Chrome Remote Desktop for Linux on Compute Engine
Create a headless Compute Engine VM instance to run Chrome Remote ... with Chrome Remote Desktop (Light Locker displays a blank screen that ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@t-io I was curious so I decided to implement this in my Go library (cdp) and I think I know why this is not working for you, there are two reasons:
Page.screencastFrameAck
) with the received session ID (e.g. do this in yourscreencastFrame
-handler)Implemented in Go, the relevant part would look like this.
All this makes sense, from a protocol standpoint, on the other hand it’s not very intuitive for a user, easy to miss.
@mafredri thanks a lot! You are totally right. I was not aware of the fact that you have to acknowledge the frames. After I adjusted my code according your example it works.
All the frames are triggered and saved.