The "Push" panel - pushing out and recording
This panel allows configuring, controlling and monitoring automated pushes. In MistServer terminology, a "push" is a stream being sent to another host or to a file on disk. In other words: recordings are a special type of push (a push to disk).
There are two types of pushes you can create: a regular push and an automatic push.
A regular push is a one-time only action, that is started and then disappears when the stream ends or the connection to the target is broken.
An automatic push is remembered, and will activate both immediately upon creation as well as every time a matching stream becomes active. Additionally, if retries are turned on, automatic pushes will re-activate every time they are shut off and/or fail until the matching stream becomes inactive again.
A stream "matches" for push purposes under either of these conditions:
-
An exact match (e.g. 'foo' matches the stream 'foo', 'foo+bar' matches the stream 'foo+bar', but neither matches 'bar+foo').
-
A wildcard match (e.g. 'foo+' matches 'foo+bar' and 'foo+baz' but not simply 'foo')
Automatic push settings
There are two more settings on this screen that can be configured for automatic pushes:
The delay before retry
setting decides how many seconds a failed
automatic push will wait before a retry attempt. If this is set to zero
(the default) there will be no retry attempts at all. In other words, it
must be set to at least one to enable the automatic retry feature for
pushes.
The maximum retries
setting decides how many retries per second will
happen. This feature can be used to rate-limit retries to prevent
overloading a target and/or the server itself. The default is zero,
which here means "no limit".
Target URLs and settings
When using MistServer to push or record it will always be done through a target URL specifying the type of push or recording followed by parameters. Every target URL will apply and may contain to select tracks and apply specific commands/requests to the push.
The current outputs available to MistServer are:
-
FLV file
Setup by setting the target URL to a path ending with.flv
-
TS file
Setup by setting the target URL to a path ending with.ts
-
WAV file
Setup by setting the target URL to a path ending with.wav
-
RTMP stream
Setup by setting the target URL to a full RTMP URL
rtmp://hostname:port/passphrase/streamname
-
TS UDP stream
Setup by setting the target URL to a full TS UDP URL
tsudp://[host]:port[/interface[,interface[,...]]]
-
TS over standard input to executable
Setup by setting the target URL to an executablets-exec:PATH
-
TS over SRT
Setup by setting the target URL to an SRT url
srt://[host]:port
-
TS over RIST
Setup by setting the target URL to an RIST url
rist://[host]:port
-
HLS segmented files
Setup by setting the target URL to TS adding a playlist and how to handle segments
/path/to/file/$segmentCounter.ts?index=/path/to/index.m3u8
Note that for URL-based push targets, MistServer will assume that the
last '?
' character in your target URL is the start of your . If your
target URL itself should include a '?
' character this means that you
will have to add a second '?
' character at the end to make sure your
target URL is preserved as-is and not parsed by MistServer.
Three scheduling parameters are available as optional parameters. These are used schedule recording or pushes in advance.
The available scheduling parameters are:
-
Schedule time
- The date and time when the recording/push should become active. Note that this only starts the recording process, not the actual recording itself. -
Recording start time
- This is the same option asrecstartunix
listed above. The date and time when the recording/push should start. Note that a keyframe will be required before video playback is possible. -
Complete time
- The date and time when the recording/push will be terminated. -
Based on a variable
- This allows you to use default MistServer or custom variables to decide on pushing logic.
Target URL examples
In all of the below examples we will assume a whole stream name of 'foo+bar' and a date/time of February 1st, 2018 at 12:34:56 (UTC). As shown in the examples below parameters can be used with any type of target URL. If parameters are repeated only the last repetition will be used.
/media/recording/$stream-$datetime.ts
Records the stream in TS format to the file
/media/recording/foo+bar-2018.02.01.12.34.56.ts
.
/media/recording/$basename/$wildcard.flv
Records the stream in FLV format to the file
/media/recording/foo/bar.flv
.
/media/recording/$year/$month/$day/$stream-$hour$minute$seconds.ts
Records the stream in TS format to the file
/media/recording/2018/02/01/foo+bar-123456.ts
.\
/media/recording/$stream.ts?recstartunix=1517490000
Records the stream in TS format to the file
/media/recording/foo+bar.ts
with the data inserted into the stream
starting at February 1st, 2018 13:00:00 until either the stream ends or
the recording is aborted manually.\
/media/recording/$stream.ts?recstopunix=1517490000
Records the stream in TS format to the file
/media/recording/foo+bar.ts
and stops the recording at February 1st,
2018 at 13:00:00.\
/media/recording/$stream.ts?recstartunix=1517490000&recstopunix=1517493600
Records the stream in TS format to the file
/media/recording/foo+bar.ts
with the data inserted into the stream
between February 1st, 2018 13:00:00 and 14:00:00.\
/media/recording/$stream.ts?recstartunix=1517486400&recstopunix=1517490000
Records the stream in TS format to the file
/media/recording/foo+bar.ts
with the data that was inserted into the
stream between February 1st, 2018 12:00:00 and 13:00:00, assuming that
this section of the stream was still in the buffer at the time
(otherwise the biggest part of that duration that still was available in
buffers).\
/media/recording/$stream.ts?recstart=5000&recstop=65000
Records the stream in TS format to the file
/media/recording/foo+bar.ts
with the data that was inserted into the
stream between timestamp 5000 milliseconds and 65000 milliseconds.\
/media/recording/$stream.ts?video=h264&audio=aac&subtitle=eng
Records the stream in TS format to the file
/media/recording/foo+bar.ts
while selecting the first available H264
video track, the first available AAC audio track and the first available
English subtitle track until stream end or manual abort.\
/media/recording/$stream.ts?video=1&audio=2&subtitle=7
Records the stream in TS format to the file
/media/recording/foo+bar.ts
while selecting the first track for video,
the second track for audio and the seventh track for the subtitle.\
/media/recording/$stream.ts?video=english&audio=english&subtitle=en
Records the stream in TS format to the file
/media/recording/foo+bar.ts
while selecting the first available
English track for video, audio and subtitle until stream end or manual
abort.\
/media/recording/$stream.ts?video=all&audio=&subtitle=all
Records the stream in TS format to the file
/media/recording/foo+bar.ts
while selecting all available tracks for
video, audio and subtitle until stream end or manual abort.\
/media/recording/$stream.ts?video=all&audio=0&subtitle=0
Records the stream in TS format to the file
/media/recording/foo+bar.ts
while selecting all available tracks for
video, while removing all audio and subtitle tracks until stream end or
manual abort.\
/media/recording/$stream.ts?passthrough=1
Records the stream in TS format to the file
/media/recording/foo+bar.ts
including every track in the stream, even
unsupported or unrecognized codecs until stream end or manual abort.\
/media/recording/$stream/$segmentCounter.ts?m3u8=../index.m3u8&split=6
Records the stream as a segmented TS playlist. Segments will be stored at /media/recording/foo+bar/
starting at 1.ts
adding a new segment each 6 seconds. The playlist to play the stream is stored at /media/recording/index.m3u8
rtmp://example.com/live/stream01
Pushes out the stream in RTMP format to host 'example.com' using port
1935, application 'live' and stream key 'stream01' until stream end or
manual abort.\
rtmp://example.com/live/
Pushes out the stream in RTMP format to host 'example.com' using port
1935, application 'live' and stream key 'foo+bar' until stream end or
manual abort.\
rtmp://example.com:1950/live/$basestream
Pushes out the stream in RTMP format to host 'example.com' using port
1950, application 'live' and stream key 'foo' until stream end or manual
abort.\
rtmp://example.com/1234567890/stream01
Pushes out the stream in RTMP format to host 'example.com' using port
1935, application '1234567890' and stream key 'stream01' (application
can be used as password for streaming to MistServer) until stream end or
manual abort.\
rtmp://example.com
Pushes out the stream in RTMP format to host 'example.com' using port
1935, application 'default' and stream key 'foo+bar' until stream end or
manual abort.\
rtmp://example.com/
Pushes out the stream in RTMP format to host 'example.com' using port
1935, a blank application and stream key 'foo+bar' until stream end or
manual abort.\
rtmp://example.com/live/streamtoken?withaquestionmark?
Pushes out the stream in RTMP format to host 'example.com' using port
1935, application 'live' and stream key 'streamtoken?withaquestionmark' until stream end or
manual abort.
Adding the extra '?' on the end is something to remember for pushing locations that tend to use '?' in their stream tokens. Youtube and Facebook often have these.
rtmp://example.com/live/stream?01?recstartunix=1517490000
Pushes out the stream in RTMP format to host 'example.com' using port
1935, application 'live' and stream key 'stream?01' starting with the
data inserted starting at February first, 2018 at 13:00:00 until stream
end or manual abort.\
tsudp://example.com:8765
Pushes out the stream in TS format to host 'example.com' using port 8765
selecting the first video and audio track.\
tsudp://example.com:8765?recstartunix=1517490000&passthrough=1
Pushes out the stream in TS format to host 'example.com' using port 8765
selecting all tracks even unsupported/unrecognized tracks starting with
the data inserted starting at February first, 2018 at 13:00:00 until
stream end or manual abort.\
srt://example.com:8877?streamid=$basename
Pushes out the stream as SRT towards 'example.com' using port 8877 and setting the streamid to 'foo' until stream end or manual abort.
rist://example.com:8888
Pushes out the stream as RIST towards 'example.com' using port 8888 until stream end or manual abort.