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

Update and simplify recording image build #647

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We know that ffmpeg is available as Alpine package. Could please show the size of resulting video recorder image and compare it with existing video recorder image. Our initial idea was to make it smaller.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes true the size increase 132Mb from 37MB, but probably a ffmpeg alpin dist package more tested, more reliable.
It is trade off.

  • docker image size
  • apline pkg
    • more tested distribution ffmpeg pkg
    • no compile time => faster image build you prefer smaller image. I can move it separate PR or Cancel.
    • no risk that ports not compile

I feel there is always a higher risk to compile own binary from source using ports, than using just a dist binary. Where dist owner make sure it works well the pkg and probably run some tests and have graduated rollout of new versions, , but these are just my 2cents.

The +size 95mb that is bigger but it is still not huge.
But I can go along if you still prefer building, but I got actually an error during the build of ffmpeg with newer alpine version.

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
Loading