Skip to content

Serve HLS with Docker #299

Answered by aler9
moritz157 asked this question in Questions
Mar 21, 2021 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Hello, you simply need to build a docker image with

  • rtsp-simple-server
  • ffmpeg
  • nginx

You can do it by saving this into a file called Dockerfile

FROM aler9/rtsp-simple-server AS rtsp

FROM alpine:3.12
RUN apk add --no-cache ffmpeg nginx

RUN mkdir /run/nginx
COPY nginx.conf /etc/nginx/conf.d/default.conf

COPY --from=rtsp /rtsp-simple-server /
COPY rtsp-simple-server.yml /

ENTRYPOINT [ "sh", "-c", "nginx && /rtsp-simple-server" ]

save this into rtsp-simple-server.yml

paths:
  all:
    runOnPublish: cd /var/www && ffmpeg -re -i rtsp://localhost:$RTSP_PORT/$RTSP_PATH -c copy -f hls -hls_time 1 -hls_list_size 3 -hls_flags delete_segments -hls_allow_cache 0 stream.m3u8
    runOnPublishResta…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@aler9
Comment options

Answer selected by moritz157
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #245 on March 30, 2021 16:34.