mirror of
https://github.com/MichaByte/OnBoard-Live.git
synced 2025-12-06 03:23:40 -05:00
IT WORKS!!!111!!!1!!1
This commit is contained in:
parent
1c91c56d30
commit
5774a351e1
4 changed files with 48 additions and 23 deletions
|
|
@ -17,19 +17,21 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- tiling_frontend_build:/usr/src/app/dist
|
- tiling_frontend_build:/usr/src/app/dist
|
||||||
live-stream:
|
live-stream:
|
||||||
|
network_mode: "host"
|
||||||
|
env_file: .stream.env
|
||||||
depends_on:
|
depends_on:
|
||||||
active_stream_proxy:
|
backend:
|
||||||
|
condition: service_started
|
||||||
|
web-frontend:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
build:
|
build:
|
||||||
context: ./live-stream
|
context: ./live-stream
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
volumes:
|
volumes:
|
||||||
- tiling_frontend_build:/html
|
- tiling_frontend_build:/html
|
||||||
env_file: .stream.env
|
|
||||||
backend:
|
backend:
|
||||||
|
network_mode: "host"
|
||||||
env_file: .backend.env
|
env_file: .backend.env
|
||||||
ports:
|
|
||||||
- "8000:8000"
|
|
||||||
build:
|
build:
|
||||||
context: ./backend
|
context: ./backend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ FROM ubuntu:latest
|
||||||
|
|
||||||
RUN apt update
|
RUN apt update
|
||||||
|
|
||||||
RUN apt install -y ffmpeg xvfb software-properties-common dbus-x11
|
RUN apt install -y ffmpeg xvfb software-properties-common dbus-x11 pulseaudio
|
||||||
|
|
||||||
RUN add-apt-repository -y ppa:xtradeb/apps
|
RUN add-apt-repository -y ppa:xtradeb/apps
|
||||||
|
|
||||||
|
|
@ -10,10 +10,16 @@ RUN apt update
|
||||||
|
|
||||||
RUN apt install -y chromium
|
RUN apt install -y chromium
|
||||||
|
|
||||||
|
RUN apt install -y sudo
|
||||||
|
|
||||||
RUN rm -rf /var/lib/apt/lists/*
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN apt clean
|
RUN apt clean
|
||||||
|
|
||||||
COPY run.sh .
|
RUN useradd -ms /bin/bash stream
|
||||||
|
|
||||||
|
COPY run.sh ./
|
||||||
|
|
||||||
|
COPY user_run.sh /home/stream
|
||||||
|
|
||||||
ENTRYPOINT ["./run.sh"]
|
ENTRYPOINT ["./run.sh"]
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
export CHROMIUM_FLAGS="--disable-software-rasterizer --disable-dev-shm-usage"
|
dbus-daemon --config-file=/usr/share/dbus-1/system.conf &
|
||||||
dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address
|
|
||||||
export LIBGL_ALWAYS_INDIRECT=1
|
|
||||||
|
|
||||||
bash -c "sleep 5 && DISPLAY=:99 ffmpeg -f x11grab -r 30 -s 1920x1080 -draw_mouse 0 -i :99.0 -f alsa -ac 2 -i hw:0 -vcodec libx264 -preset medium -b:v 7000k -framerate 30 -g 2 -pix_fmt yuv420p -acodec aac -f flv rtmp://x.rtmp.youtube.com/live2/$YT_STREAM_KEY" &
|
echo $YT_STREAM_KEY >/home/stream/key.txt
|
||||||
|
|
||||||
DISPLAY=:99 xvfb-run \
|
chown stream /home/stream/key.txt
|
||||||
--server-num 99 \
|
|
||||||
-s "-nocursor -ac -screen 0 1920x1080x24" \
|
chown stream /home/stream/user_run.sh
|
||||||
dbus-launch chromium \
|
|
||||||
--temp-profile \
|
sudo -i -u stream bash /home/stream/user_run.sh
|
||||||
--window-size=1920,1080 \
|
|
||||||
--disable-gpu \
|
|
||||||
--window-position=0,0 \
|
|
||||||
--no-sandbox \
|
|
||||||
--hide-scrollbars \
|
|
||||||
--disable-setuid-sandbox \
|
|
||||||
--app=http://web-frontend:4173
|
|
||||||
|
|
|
||||||
26
live-stream/user_run.sh
Executable file
26
live-stream/user_run.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
pulseaudio -D &
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
pacmd load-module module-null-sink sink_name=VirtSink
|
||||||
|
pacmd update-sink-proplist VirtSink device.description=VirtSink
|
||||||
|
|
||||||
|
pacmd load-module module-loopback sink=VirtSink
|
||||||
|
|
||||||
|
export CHROMIUM_FLAGS="--disable-software-rasterizer --disable-dev-shm-usage"
|
||||||
|
export LIBGL_ALWAYS_INDIRECT=1
|
||||||
|
|
||||||
|
bash -c "sleep 5 && DISPLAY=:99 ffmpeg -f x11grab -r 30 -s 1920x1080 -draw_mouse 0 -i :99.0 -f pulse -ac 2 -i default -vcodec libx264 -preset medium -b:v 7000k -framerate 30 -g 2 -pix_fmt yuv420p -acodec aac -f flv rtmp://x.rtmp.youtube.com/live2/$(cat /home/stream/key.txt)" &
|
||||||
|
|
||||||
|
DISPLAY=:99 xvfb-run \
|
||||||
|
--server-num 99 \
|
||||||
|
-s "-nocursor -ac -screen 0 1920x1080x24" \
|
||||||
|
dbus-launch chromium \
|
||||||
|
--temp-profile \
|
||||||
|
--window-size=1920,1080 \
|
||||||
|
--disable-gpu \
|
||||||
|
--window-position=0,0 \
|
||||||
|
--hide-scrollbars \
|
||||||
|
--autoplay-policy=no-user-gesture-required \
|
||||||
|
--app=http://localhost:4173
|
||||||
Loading…
Add table
Add a link
Reference in a new issue