mirror of
https://github.com/MichaByte/OnBoard-Live.git
synced 2026-01-29 13:32:12 -05:00
continued wip
This commit is contained in:
parent
af43bbc916
commit
263f91fc11
4 changed files with 21 additions and 17 deletions
|
|
@ -1,9 +1,6 @@
|
||||||
version: '2'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
web-frontend:
|
web-frontend:
|
||||||
build:
|
build:
|
||||||
# build from Dockerfile
|
|
||||||
context: ./tiling-frontend
|
context: ./tiling-frontend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
volumes:
|
volumes:
|
||||||
|
|
@ -14,5 +11,11 @@ services:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
volumes:
|
volumes:
|
||||||
- tiling_frontend_build:/home/obs/html
|
- tiling_frontend_build:/home/obs/html
|
||||||
|
environment:
|
||||||
|
OBSWS_PASSWORD: ${OBSWS_PASSWORD}
|
||||||
|
YT_STREAM_KEY: ${YT_STREAM_KEY}
|
||||||
|
mediamtx:
|
||||||
|
network_mode: host
|
||||||
|
image: docker.io/bluenviron/mediamtx
|
||||||
volumes:
|
volumes:
|
||||||
tiling_frontend_build:
|
tiling_frontend_build:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
FROM docker.io/ubuntu:noble
|
FROM docker.io/ubuntu:noble
|
||||||
|
|
||||||
ENV OBSWS_PASSWORD=""
|
|
||||||
|
|
||||||
RUN apt update && \
|
RUN apt update && \
|
||||||
apt install software-properties-common -y && \
|
apt install software-properties-common -y && \
|
||||||
add-apt-repository ppa:obsproject/obs-studio -y && \
|
add-apt-repository ppa:obsproject/obs-studio -y && \
|
||||||
|
|
@ -16,9 +14,7 @@ USER obs
|
||||||
|
|
||||||
RUN mkdir -p /home/obs/.config/obs-studio/basic/profiles/Untitled
|
RUN mkdir -p /home/obs/.config/obs-studio/basic/profiles/Untitled
|
||||||
|
|
||||||
RUN echo -e "\n[OBSWebSocket]\nFirstLoad=false\nServerEnabled=true\nServerPort=4455\nAlertsEnabled=false\nAuthRequired=true\nServerPassword=${OBSWS_PASSWORD}\n" >> /home/obs/.config/obs-studio/global.ini
|
RUN echo -e "\n[OBSWebSocket]\nFirstLoad=false\nServerEnabled=true\nServerPort=4455\nAlertsEnabled=false\nAuthRequired=false\nServerPassword=does_not_matter\n" >> /home/obs/.config/obs-studio/global.ini
|
||||||
|
|
||||||
RUN echo '{"type":"rtmp_common","settings":{"service":"YouTube - RTMPS","protocol":"RTMPS","server":"rtmps://a.rtmps.youtube.com:443/live2","bwtest":false,"key":"${YT_STREAM_KEY}","stream_key_link":"https://www.youtube.com/live_dashboard","multitrack_video_name":"Multitrack Video","multitrack_video_disclaimer":"Multitrack Video automatically optimizes your settings to encode and send multiple video qualities to YouTube - RTMPS. Selecting this option will send YouTube - RTMPS information about your computer and software setup."}}' > /home/obs/.config/obs-studio/basic/profiles/Untitled/service.json
|
|
||||||
|
|
||||||
COPY requirements.txt /home/obs
|
COPY requirements.txt /home/obs
|
||||||
|
|
||||||
|
|
@ -28,8 +24,6 @@ RUN /home/obs/.venv/bin/pip install -r /home/obs/requirements.txt
|
||||||
|
|
||||||
COPY start.sh /home/obs
|
COPY start.sh /home/obs
|
||||||
|
|
||||||
COPY setup-obs.py /home/obs
|
COPY setup_obs.py /home/obs
|
||||||
|
|
||||||
RUN echo $OBSWS_PASSWORD
|
|
||||||
|
|
||||||
ENTRYPOINT /home/obs/start.sh
|
ENTRYPOINT /home/obs/start.sh
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import obsws_python as obs
|
||||||
import os
|
import os
|
||||||
|
|
||||||
# pass conn info if not in config.toml
|
# pass conn info if not in config.toml
|
||||||
client = obs.ReqClient(host='localhost', port=4455, password=os.environ["OBSWS_PASSWORD"])
|
client = obs.ReqClient(host='localhost', port=4455, password=None)
|
||||||
|
|
||||||
scene = client.get_scene_list().scenes[0]['sceneName']
|
scene = client.get_scene_list().scenes[0]['sceneName']
|
||||||
|
|
||||||
|
|
@ -12,3 +12,11 @@ print(client.get_input_default_settings("browser_source").default_input_settings
|
||||||
|
|
||||||
if inputs == []:
|
if inputs == []:
|
||||||
client.create_input(sceneName=scene, inputName="Browser", inputKind="browser_source", inputSettings={'css': 'body { margin: 0px auto; overflow: hidden; }', 'fps': 30, 'fps_custom': True, 'height': 1080, 'is_local_file': True, 'local_file': '/home/micha/index.html', 'reroute_audio': True, 'restart_when_active': False, 'shutdown': False, 'webpage_control_level': 0, 'width': 1920}, sceneItemEnabled=True)
|
client.create_input(sceneName=scene, inputName="Browser", inputKind="browser_source", inputSettings={'css': 'body { margin: 0px auto; overflow: hidden; }', 'fps': 30, 'fps_custom': True, 'height': 1080, 'is_local_file': True, 'local_file': '/home/micha/index.html', 'reroute_audio': True, 'restart_when_active': False, 'shutdown': False, 'webpage_control_level': 0, 'width': 1920}, sceneItemEnabled=True)
|
||||||
|
|
||||||
|
client.set_stream_service_settings("rtmp_common", {'bwtest': False, 'key': 'kdm0-hum4-31wg-79se-c6us', 'protocol': 'RTMPS', 'server': 'rtmps://a.rtmps.youtube.com:443/live2', 'service': 'YouTube - RTMPS'})
|
||||||
|
|
||||||
|
client.start_stream()
|
||||||
|
|
||||||
|
client.base_client.ws.close()
|
||||||
|
|
||||||
|
print("OBS has been set up")
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
|
|
||||||
export DISPLAY=:99
|
export DISPLAY=:99
|
||||||
Xvfb $DISPLAY &
|
xvfb-run obs &
|
||||||
obs &
|
sleep 5
|
||||||
sleep 1
|
|
||||||
source /home/obs/.venv/bin/activate
|
source /home/obs/.venv/bin/activate
|
||||||
python3 /home/obs/setup-obs.py
|
python3 /home/obs/setup_obs.py
|
||||||
|
sleep 100
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue