-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
117 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
* | ||
!/.bazelrc | ||
!/BUILD | ||
!/data/ | ||
!/resolved.bzl | ||
!/variables.bzl | ||
!/third_party | ||
!/variables.bzl | ||
!/voidstar | ||
!/WORKSPACE | ||
!/xvfb.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,11 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- run: DOCKER_BUILDKIT=1 docker build -o=./bin/ --target=voidstar . --progress=plain | ||
- run: ./bin/voidstar --help | ||
- uses: Wandalen/[email protected] | ||
with: | ||
command: DOCKER_BUILDKIT=1 docker build -o=. --target=video-gcc . --progress=plain | ||
attempt_limit: 20 | ||
attempt_delay: 1000 | ||
|
||
build_on_ubuntu_with_clang: | ||
name: Build on ubuntu with Clang | ||
|
@@ -41,7 +46,11 @@ jobs: | |
- uses: actions/checkout@v2 | ||
- run: DOCKER_BUILDKIT=1 docker build -o=./bin/ --target=voidstar-clang . --progress=plain | ||
- run: ./bin/voidstar --help | ||
|
||
- uses: Wandalen/[email protected] | ||
with: | ||
command: DOCKER_BUILDKIT=1 docker build -o=. --target=video-clang . --progress=plain | ||
attempt_limit: 20 | ||
attempt_delay: 1000 | ||
|
||
build_on_macos: | ||
name: Build on macos | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
/bazelisk | ||
|
||
/bin/* | ||
/video.webm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/bash -eux | ||
set -o pipefail | ||
|
||
_kill_procs() { | ||
kill -TERM $companion | ||
wait $companion | ||
kill -TERM $xvfb | ||
} | ||
trap _kill_procs SIGTERM | ||
|
||
display=99 | ||
|
||
wxhxd=${WxHxD:-800x600x24} | ||
bin=${BIN:-./bin/voidstar} | ||
file=${FILE:-"$bin"} | ||
out=${OUT:-video.webm} | ||
|
||
case "$file" in | ||
http://*|https://*) | ||
curl -fsSLo /file "$file" | ||
file=/file | ||
# ls -lh "$file"; exit 42 | ||
;;*) ;; | ||
esac | ||
|
||
rm -rf /tmp/xvfb-run.* | ||
|
||
xvfb-run \ | ||
--server-num="$display" \ | ||
--error-file=/dev/stdout \ | ||
-s "-screen 0 $wxhxd" \ | ||
"$bin" \ | ||
--move \ | ||
--exit-at-fin \ | ||
"$file" & | ||
xvfb=$! | ||
|
||
touch ~/.Xauthority | ||
xauth generate :0 . trusted || true | ||
xauth list | ||
|
||
ls /tmp/xvfb*/Xauthority >/dev/null | ||
|
||
XAUTHORITY=$(echo /tmp/xvfb*/Xauthority) \ | ||
ffmpeg \ | ||
-r 30 \ | ||
-f x11grab \ | ||
-draw_mouse 0 \ | ||
-s "$(cut -dx -f1-2 <<<"$wxhxd")" \ | ||
-i :"$display" \ | ||
-c:v libvpx \ | ||
-quality realtime \ | ||
-cpu-used 0 \ | ||
-b:v 384k \ | ||
-qmin 10 \ | ||
-qmax 42 \ | ||
-maxrate 384k \ | ||
-bufsize 1000k \ | ||
-an "$out" & | ||
companion=$! | ||
|
||
wait $xvfb | ||
kill -TERM $companion | ||
wait $companion || true |