Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
HTTP/1.0 503 Service Unavailable
Cache-Control: no-cache
Connection: close
Content-Type: text/html

<html>
<head>
<title>HLS Webcam server is currently not running</title>
<style>
body {
margin: 0;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 20px;
color: #333333;
background-color: #ffffff;
}

code {
font-family: Monaco,Menlo,Consolas,"Courier New",monospace;
font-size: 12px;
border-radius: 3px;
padding: 2px 4px;
color: #d14;
white-space: nowrap;
background-color: #f7f7f7;
border: 1px solid #e1e1e8;
}

pre {
font-family: Monaco,Menlo,Consolas,"Courier New",monospace;
font-size: 12px;
border-radius: 3px;
padding: 2px 4px;
white-space: nowrap;
background-color: #f7f7f7;
border: 1px solid #e1e1e8;
}

@media (max-width: 767px) {
.wrapper {
padding: 20px;
}
}

@media (min-width: 768px) {
.wrapper {
position: absolute;
width: 750px;
height: 600px;
top: 50%;
left: 50%;
margin: -300px 0 0 -375px;
}
}

h1 {
line-height: 1.3;
}
</style>
</head>
<body>
<div class="wrapper">
<h1>The HLS webcam server is currently not running</h1>
</div>
</body>
</html>

5 changes: 5 additions & 0 deletions src/modules/octopi/filesystem/root/etc/haproxy/haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ frontend public
bind :::443 v4v6 ssl crt /etc/ssl/snakeoil.pem
option forwardfor except 127.0.0.1
use_backend webcam if { path_beg /webcam/ }
use_backend webcam_hls if { path_beg /hls/ }
use_backend webcam_hls if { path_beg /jpeg/ }
default_backend octoprint

backend octoprint
Expand All @@ -41,3 +43,6 @@ backend webcam
server webcam1 127.0.0.1:8080
errorfile 503 /etc/haproxy/errors/503-no-webcam.http

backend webcam_hls
server webcam_hls_1 127.0.0.1:28126
errorfile 503 /etc/haproxy/errors/503-no-webcam-hls.http
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server {
listen 8051 default_server;
listen 127.0.0.1:28126;

root /tmp/webcam;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ ExecStart=/usr/bin/ffmpeg \
-i /dev/video0 \
\
-c:v mjpeg -q:v 0 \
-f image2 -update 1 \
-f image2 -update 1 -atomic_writing 1 \
/tmp/webcam/jpeg/frame.jpg \
\
-c:v h264_omx -profile:v high \
-b:v 2048k -flags +cgop \
-g 30 -keyint_min 30 \
\
-f hls -hls_time 1 -hls_flags delete_segments \
-hls_allow_cache 1 -hls_segment_type fmp4 \
-f hls -hls_time 1 \
-hls_flags delete_segments+program_date_time+temp_file+independent_segments \
-hls_allow_cache 0 -hls_segment_type fmp4 \
-hls_list_size 32 -hls_delete_threshold 64 \
/tmp/webcam/hls/stream.m3u8

Expand Down