From 61a89176239828d8ffcb4c346800826cfd7ff719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Mih=C3=A1ly?= Date: Tue, 24 Oct 2023 11:50:46 +0200 Subject: [PATCH 1/3] Simplify recording --- selenium/video/Dockerfile | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/selenium/video/Dockerfile b/selenium/video/Dockerfile index 920570ad0..d49c0893a 100644 --- a/selenium/video/Dockerfile +++ b/selenium/video/Dockerfile @@ -1,21 +1,7 @@ -FROM alpine:3.12 +FROM alpine:3.18 -RUN apk add -U alpine-sdk && adduser -g "" -D -G abuild selenoid -USER selenoid -RUN git clone git://git.alpinelinux.org/aports /home/selenoid/aports -ADD APKBUILD /home/selenoid/aports/community/ffmpeg/ -RUN cd /home/selenoid/aports/community/ffmpeg/ && \ - abuild checksum && \ - abuild unpack && \ - abuild deps && \ - abuild build -USER root - -FROM alpine:3.12 - -RUN apk add -U x264-libs sdl2 libxcb libbz2 xset pulseaudio-utils && \ +RUN apk add -U x264-libs sdl2 libxcb libbz2 xset pulseaudio-utils ffmpeg && \ rm -rf /var/cache/apk/* -COPY --from=0 /home/selenoid/aports/community/ffmpeg/src/ffmpeg-4.3/ffmpeg /usr/bin/ffmpeg COPY entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"] From f44ba1417b0036b26b7c4446d9b89745e108b03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Mih=C3=A1ly?= Date: Tue, 24 Oct 2023 11:52:56 +0200 Subject: [PATCH 2/3] Increase -thread_queue_size to not drop frames * remove warnings with increasing the -thread_queue_size --- selenium/video/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selenium/video/entrypoint.sh b/selenium/video/entrypoint.sh index e07ad60ca..b2456ef7c 100755 --- a/selenium/video/entrypoint.sh +++ b/selenium/video/entrypoint.sh @@ -36,7 +36,7 @@ echo -n 'gIvST5iz2S0J1+JlXC1lD3HWvg61vDTV1xbmiGxZnjB6E3psXsjWUVQS4SRrch6rygQgtpw export PULSE_SERVER=${BROWSER_CONTAINER_NAME} if pactl info >/dev/null 2>&1; then - exec ffmpeg -f pulse -i default -y -f x11grab -video_size ${VIDEO_SIZE} -r ${FRAME_RATE} ${INPUT_OPTIONS} -i ${BROWSER_CONTAINER_NAME}:${DISPLAY} -codec:v ${CODEC} ${PRESET} -pix_fmt yuv420p -filter:v "pad=ceil(iw/2)*2:ceil(ih/2)*2" "/data/$FILE_NAME" + exec ffmpeg -f pulse -thread_queue_size 1024 -i default -y -f x11grab -video_size ${VIDEO_SIZE} -r ${FRAME_RATE} ${INPUT_OPTIONS} -i ${BROWSER_CONTAINER_NAME}:${DISPLAY} -codec:v ${CODEC} ${PRESET} -pix_fmt yuv420p -filter:v "pad=ceil(iw/2)*2:ceil(ih/2)*2" "/data/$FILE_NAME" else exec ffmpeg -y -f x11grab -video_size ${VIDEO_SIZE} -r ${FRAME_RATE} ${INPUT_OPTIONS} -i ${BROWSER_CONTAINER_NAME}:${DISPLAY} -codec:v ${CODEC} ${PRESET} -pix_fmt yuv420p -filter:v "pad=ceil(iw/2)*2:ceil(ih/2)*2" "/data/$FILE_NAME" fi From e933f55ac86072c4df67ea0a696dd17b195f0aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Mih=C3=A1ly?= Date: Wed, 25 Oct 2023 12:09:24 +0200 Subject: [PATCH 3/3] Use alpine:3 --- selenium/video/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selenium/video/Dockerfile b/selenium/video/Dockerfile index d49c0893a..90a411e80 100644 --- a/selenium/video/Dockerfile +++ b/selenium/video/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.18 +FROM alpine:3 RUN apk add -U x264-libs sdl2 libxcb libbz2 xset pulseaudio-utils ffmpeg && \ rm -rf /var/cache/apk/*