]> git.sesse.net Git - cubemap/blobdiff - cubemap.config.sample
Release Cubemap 1.4.3.
[cubemap] / cubemap.config.sample
index d15e861b6ab19341ea33cf70d151e4f1a0e5a647..51c46d317a4a017bfcabb15ba2cc5eafeffb084e 100644 (file)
@@ -9,11 +9,15 @@
 num_servers 1
 
 #
-# All input ports are treated exactly the same, but you may use multiple ones nevertheless.
+# You may specify multiple input ports; save for TLS settings (TLS is automatically
+# enabled for a port if you give a key pair), they are treated exactly the same.
+# “port N” is equivalent to “listen [::]:N”. TLS requires kTLS support with both
+# RX and TX (Linux >= 4.17, CONFIG_TLS enabled).
 #
 port 9094
 # listen 127.0.0.1:9095
 # listen [::1]:9095
+# listen [::]:443 tls_cert=/etc/letsencrypt/live/example.org/fullchain.pem tls_key=/etc/letsencrypt/live/example.org/privkey.pem
 
 stats_file cubemap.stats
 stats_interval 60
@@ -51,6 +55,32 @@ stream /test-jwplayer.flv src=http://gruessi.zrh.sesse.net:4013/test.flv force_p
 # for sending on to another Cubemap instance.
 stream /test.flv.metacube src=http://gruessi.zrh.sesse.net:4013/test.flv encoding=metacube
 
+# A stream where the input is _not_ Metacube framed. Note that the stream needs to
+# have no header and be self-synchronizing (like with UDP input below), and most formats
+# are not like this. A typical example, however, is MPEG-TS.
+stream /test.ts src=http://gruessi.zrh.sesse.net:4013/test.ts src_encoding=raw
+
+# If your input has PTS Metacube2 blocks (currently only generated by
+# Nageru >= 1.7.2 with MP4 output) and is segmentable (in practice MP4 with the
+# right tags, again typically generated by Nageru), you can serve HLS fragments
+# out of Cubemap's regular backlog, with the playlist served at the given URL
+# (in this case, /stream.m3u8). This allows you to serve video directly to
+# Mobile Safari (you'll need iOS >= 10 for fMP4 support; older iOS only
+# supports TS), and also allow rewinding in the stream if your backlog is large
+# enough. As of April 2018, iOS and hls.js seem to work well, while at least
+# VLC and mpv appear to be buggy.
+#
+# hls_frag_duration= sets the maximum fragment size in seconds; the default, 6,
+# is Apple's default recommendation. Larger fragments will cause more latency but
+# fewer HTTP requests (less chance of performance problems). (Typically, you'll want
+# a bit longer backlog than the default of 10 MB, as you won't fit many six-second
+# fragments into that.) Setting hls_backlog_margin= makes Cubemap not expose any
+# new fragments that are too far, measured in bytes, from the beginning of the
+# backlog, in order to reduce the risk of not managing to deliver them before
+# they rotate out. The default is zero, but you almost certainly want to change that
+# to be some reasonable fraction of your fragment length.
+stream /stream.mp4 src=http://gruessi.zrh.sesse.net:9095/test.mp4.metacube hls_playlist=/stream.m3u8 hls_frag_duration=6 backlog_size=20971520 hls_backlog_margin=1048576 allow_origin=*
+
 # UDP input. TS is the most common container to use over UDP (you cannot
 # take any arbitrary container and expect it to work).
 # backlog_size=<number of bytes> overrides the backlog, which is normally 10 MB.
@@ -91,3 +121,13 @@ udpstream 193.35.52.50:5001 src=http://pannekake.samfundet.no:9094/frikanalen.ts
 # IPv4 multicast output, to the given group. You can explicitly set the TTL
 # and/or multicast output interface, if the defaults do not suit you.
 udpstream 233.252.0.1:5002 src=http://pannekake.samfundet.no:9094/frikanalen.ts.metacube ttl=32 multicast_output_interface=eth1
+
+# A type of HTTP resource that is not a stream, but rather just a very simple
+# document that a HTTP 204 response and nothing else. allow_origin= is optional;
+# if it is set, the response will contain an Access-Control-Allow-Origin header
+# with the given value, allowing the ping response to be read (and
+# differentiated from an error) from a remote domain using XHR.
+#
+# If you have a stream and a gen204 endpoint with the same URL, the stream takes
+# precedence and the ping endpoint is silently ignored.
+gen204 /ping allow_origin=*