docker-selenium icon indicating copy to clipboard operation
docker-selenium copied to clipboard

[🚀 Feature]: Add audio in video recording

Open frossigneux opened this issue 3 years ago • 13 comments

Feature and motivation

Video recording is supported. However resulting videos have no sound.

I see that this topic has been discussed here: https://github.com/elgalu/docker-selenium/issues/147

Usage example

Run a browser playing a Youtube video. Run a video container to capture it in /tmp/videos/video.mp4. The resulting file should contain audio.

frossigneux avatar Feb 12 '22 10:02 frossigneux

Do you know what are the use cases related to automated testing?

Would you be interested in sending a pull request for this? It should have automated tests to verify that videos actually have audio.

diemol avatar Feb 20 '22 00:02 diemol

My use case is to be able to automatically record websites (with sound and animations). I got the sound in the videos by using a PulseAudio server on the host server, with a unix socket mapped in the docker container. And then I used a gstreamer server to be able to connect with noVNC on one channel and audio on a separate channel.

frossigneux avatar Feb 24 '22 21:02 frossigneux

Would this increase the size of the docker images considerably? We are open to receive a PR for this.

diemol avatar Mar 25 '22 12:03 diemol

what's progress about record video with audio,thanks~

EzrealerQAQ avatar Apr 24 '22 17:04 EzrealerQAQ

None at all, this is waiting for contributions.

diemol avatar Apr 25 '22 01:04 diemol

None at all, this is waiting for contributions.

Record video with audio is realized in elgalu/docker-selenium,use pulseaudio to create virtual sound card,i think the author of selenium/video image could refer it to add this func~

EzrealerQAQ avatar Apr 25 '22 07:04 EzrealerQAQ

None at all, this is waiting for contributions.

Record video with audio is realized in elgalu/docker-selenium,use pulseaudio to create virtual sound card,i think the author of selenium/video image could refer it to add this func~

Would you like to send a PR with tests to add this?

diemol avatar Apr 25 '22 08:04 diemol

add

srue,but no time now ,maybe a mouth later~

EzrealerQAQ avatar Apr 25 '22 09:04 EzrealerQAQ

add

srue,but no time now ,maybe a mouth later~

Looking forward to more contributions that help us move the status of this forward.

diemol avatar Apr 25 '22 09:04 diemol

@frossigneux @EzrealerQAQ any interest in contributing?

diemol avatar Jul 14 '22 15:07 diemol

Hello, I don't have time to contribute right now, but I gave above the solution that worked for me and you can find attached the corresponding files. I modified the video container and added a nginx server to serve the video and audio over https! deploy.zip

frossigneux avatar Jul 19 '22 11:07 frossigneux

Hi @frossigneux

just tried your solution, but stuck at making a socket:

pactl load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket
Connection failure: Connection refused
pa_context_connect() failed: Connection refused

any idea ?

vitalik avatar Oct 20 '22 13:10 vitalik

I guess Pulseaudio is not started. I don't remind exactly how I started it on my server, maybe using systemctl --user start pulseaudio.service.

frossigneux avatar Oct 20 '22 13:10 frossigneux