Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Update and simplify recording image build (#647)
Browse files Browse the repository at this point in the history
Simpler video recorder image
  • Loading branch information
misi authored Oct 26, 2023
1 parent 9f5fe1e commit a66fe6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
18 changes: 2 additions & 16 deletions selenium/video/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
FROM alpine:3.12
FROM alpine:3

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"]
2 changes: 1 addition & 1 deletion selenium/video/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a66fe6e

Please sign in to comment.