mirror of
https://github.com/MichaByte/OnBoard-Live.git
synced 2025-12-06 02:53:40 -05:00
bug squashing
This commit is contained in:
parent
fa4bd9e7c1
commit
8b4f6b8d26
4 changed files with 9 additions and 5 deletions
|
|
@ -20,4 +20,4 @@ RUN prisma generate
|
|||
|
||||
COPY main.py .
|
||||
|
||||
CMD [ "uvicorn", "main:api", "--log-level", "warning", "--workers", "4", "--host", "0.0.0.0", "--port", "8000" ]
|
||||
CMD [ "uvicorn", "main:api", "--log-level", "warning", "--host", "0.0.0.0", "--port", "8000" ]
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ async def rotate_fernet_key():
|
|||
|
||||
def get_recording_duration(timestamp, stream_key):
|
||||
vid = cv2.VideoCapture(
|
||||
f"/home/onboard/recordings/{stream_key}/{datetime.strptime(timestamp, '%Y-%m-%dT%H:%M:%S.%fZ').strftime('%Y-%m-%d_%H-%M-%S-%f')}.mp4"
|
||||
f"/recordings/{stream_key}/{datetime.strptime(timestamp, '%Y-%m-%dT%H:%M:%S.%fZ').strftime('%Y-%m-%d_%H-%M-%S-%f')}.mp4"
|
||||
)
|
||||
return int(
|
||||
(vid.get(cv2.CAP_PROP_FRAME_COUNT) / vid.get(cv2.CAP_PROP_FPS)) / 60
|
||||
|
|
|
|||
|
|
@ -49,8 +49,7 @@ services:
|
|||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ./backend/db:/usr/src/app/db
|
||||
mediamtx:
|
||||
condition: service_started
|
||||
- mediamtx_recordings:/recordings
|
||||
caddy:
|
||||
image: docker.io/caddy:alpine
|
||||
restart: unless-stopped
|
||||
|
|
|
|||
|
|
@ -22,4 +22,9 @@ bash -c "DISPLAY=:99 xvfb-run \
|
|||
--autoplay-policy=no-user-gesture-required \
|
||||
--app=http://localhost:4173" & disown
|
||||
|
||||
bash -c "sleep 3 && DISPLAY=:99 ffmpeg -f x11grab -r 60 -s 1920x1080 -draw_mouse 0 -i :99.0 -f pulse -ac 2 -i default -vcodec libx264 -preset medium -b:v 7000k -framerate 60 -g 2 -pix_fmt yuv420p -acodec aac -f flv rtmp://x.rtmp.youtube.com/live2/$(cat /home/stream/key.txt)"
|
||||
sleep 3
|
||||
|
||||
until bash -c "DISPLAY=:99 ffmpeg -xerror -f x11grab -r 60 -s 1920x1080 -draw_mouse 0 -i :99.0 -f pulse -ac 2 -i default -vcodec libx264 -preset medium -b:v 7000k -framerate 60 -g 2 -pix_fmt yuv420p -acodec aac -f flv -flvflags no_duration_filesize rtmp://x.rtmp.youtube.com/live2/$(cat /home/stream/key.txt)"; do
|
||||
echo "FFMpeg died, restarting..."
|
||||
sleep 1
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue