Zenika / alpine-chrome

Chrome Headless docker images built upon alpine official image
https://hub.docker.com/r/zenika/alpine-chrome
Apache License 2.0
1.82k stars 241 forks source link

grab with ffmpeg #90

Open piotr-sikora-v opened 4 years ago

piotr-sikora-v commented 4 years ago

There is any option to grab screen to ffmpeg ? I want to use this headless chrome to broadcast to youtube. I now use https://github.com/kolyadin/live-video-broadcasting but this version crash all time

jlandure commented 4 years ago

Hi @piotr-sikora-v 👋 Thanks for the suggestion. 👌

Could you describe your feature? ✨ Have you tried using this image? What are the dependencies missing? 📦 Do you have an example where it is not working? 📝

ffmpeg seems to be available on apk.

jlandure commented 4 years ago

@all-contributors please add @piotr-sikora-v for bug and ideas

allcontributors[bot] commented 4 years ago

@jlandure

I've put up a pull request to add @piotr-sikora-v! :tada:

piotr-sikora-v commented 4 years ago

the idea is for saving stream from pages like jitsi-meet conferences (jibri is hard to implement). I don't know how to connect... in https://github.com/kolyadin/live-video-broadcasting they use xvfb and then ffmpeg connect to DISPLAY:0 I don't know where i should connect when using headless chrome There is a some display where chrome start ?

jlandure commented 4 years ago

Hey @piotr-sikora-v 👋 Thanks for your answer 👌

Ok I understand. I don't know if it could work because the aim of this image is to run Chromium in Headless mode.

If you arrive to make it work with this X11 example, it could be fun! 🎉

jlandure commented 3 years ago

Hi @piotr-sikora-v 👋

Did you succeed with your problem? 👍

zsinba commented 2 years ago

I've been able to do this successfully, and the results are good. Parameters like this to push:

if [ -z "$FFMPEG_CMD" ]; then FFMPEG_CMD="ffmpeg \ -f pulse -i default \ -f x11grab -video_size ${SCREEN_WIDTH}x${SCREEN_HEIGHT} \ -draw_mouse ${DRAW_MOUSE} \ -i $DISPLAY -async ${ASYNC} -vsync ${VSYNC} -framerate ${FRAMERATE} -vcodec ${VCODEPARAM} -preset ${PRESETPARAM} -profile:v ${PROFILELEVEL} -pix_fmt ${PIXFMT} \ -tune ${TUNEPARAM} -b ${BITRATEPARAM} \ -r ${FRAMERATE} -c:a ${C_A_PARAM} -b:v ${Vedio_Bitrate} -b:a ${Audio_Bitrate} -s ${Output_WIDTH}x${Output_HEIGHT} \ -f flv ${STREAM_URL}" fi