Skip to content
This repository was archived by the owner on Jul 2, 2021. It is now read-only.

feature request: include the browser audio stream in the recorded video #74

Open
Akarshit opened this issue Jun 26, 2020 · 4 comments
Open

Comments

@Akarshit
Copy link

Akarshit commented Jun 26, 2020

The video recording works great, but I was also looking to get the audio on the browser and couldn't find any way to do it. I guess because this uses screenCast, it might not be possible, but again I don't know enough.

@jperl
Copy link
Member

jperl commented Jun 26, 2020

Thanks @Akarshit, this uses the screencast from chromium devtools protocol, which only has the video frames of the browser and audio is not included.

Using ffmpeg with a screen capture would allow us to get the audio, but that will require that you run the browser on a virtual display which is different across platforms, and would not allow headless mode.

Perhaps it is possible to merge an audio stream from somewhere else, but I am not sure how. I will leave the issue open.

@rememberlenny
Copy link

In puppeteer, I have successfully been able to make a headful instance of the browser, so accessing audio via the screenCapture api.

I don’t know if it helps, but the implementation to get audio I use is called html2screen. https://github.com/Ventricule/html2screen

For Linux, when you have a docker instance, installing xvfb gives your server a virtual display. With that, you can run a headful instance in Linux as well. This is helpful starting point if you want to package this as a server container.

@Akarshit
Copy link
Author

@rememberlenny Hey!
I have looked at that package before but was unable to record HD videos using it. Are you able to get HD videos out of it?

If you are only use it for audio, how are you getting rid of sync issues, while merging audio from html2screen and video from playwright?

@rememberlenny
Copy link

@Akarshit I didnt end up trying. I've been using html2screen successfully.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants