Recording and restreaming
Recording
Section titled “Recording”Archive a live stream while it broadcasts.
# Startcurl -b jar -X POST \ http://localhost:9001/api/v1/apps/default/streams/mystream/record
# Stopcurl -b jar -X DELETE \ http://localhost:9001/api/v1/apps/default/streams/mystream/recordRecordings land under the application’s data directory and are listed by
GET /api/v1/apps/default/recordings. Download one by name, or delete it when
you are done.
Because video is not re-encoded, recording costs disk and very little CPU.
Restreaming
Section titled “Restreaming”Forward a stream to another platform or server, without running a second encoder: YouTube, Twitch or any RTMP endpoint, or a partner’s SRT ingest.
# Define a targetcurl -b jar -X POST http://localhost:9001/api/v1/apps/default/restream \ -H 'content-type: application/json' \ -d '{"name":"youtube","stream":"channel1","url":"rtmp://a.rtmp.youtube.com/live2","key":"abcd-efgh"}'
# Start and stop itcurl -b jar -X POST http://localhost:9001/api/v1/apps/default/restream/youtube/startcurl -b jar -X POST http://localhost:9001/api/v1/apps/default/restream/youtube/stopstream names which of the application’s streams to send. The URL and key
are joined the way the receiving end expects, so paste them exactly as the
platform gives them to you. A target with "enabled": true starts by itself
whenever its stream goes live.
Destinations
Section titled “Destinations”| URL starts with | Sent as | The key is |
|---|---|---|
rtmp://, rtmps:// | FLV, as platforms expect | Appended as the stream name |
srt:// | MPEG-TS | The SRT stream ID |
udp:// | MPEG-TS | Not used |
For an SRT destination, give its address and put the stream ID it expects in
the key, for example URL srt://partner.example:8890 and key
default/from-us, which is exactly what another Jadarit server takes. SRT
options go in the URL as usual, such as ?latency=200000&passphrase=….
RTMP platforms take H.264 only, so an HEVC stream can be restreamed over SRT
or UDP but not RTMP. Nothing else is accepted as a destination: the URL is
handed to FFmpeg, and a file:// path would turn restreaming into writing
files on the server.
Ads and restreaming
Section titled “Ads and restreaming”A restream target can take the clean feed, without your ad breaks. That is usually what a partner or syndication contract requires: they carry the programme and sell their own inventory, while your direct audience sees your commercials.
See Ad insertion for how the clean feed works.