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 the same feed to another RTMP endpoint, without running a second encoder.
# Define a targetcurl -b jar -X POST http://localhost:9001/api/v1/apps/default/restream \ -H 'content-type: application/json' \ -d '{"name":"partner","url":"rtmp://partner.example/live","key":"abc123"}'
# Start and stop itcurl -b jar -X POST http://localhost:9001/api/v1/apps/default/restream/partner/startcurl -b jar -X POST http://localhost:9001/api/v1/apps/default/restream/partner/stopThe target URL and key are joined the way the receiving platform expects, so paste them exactly as that platform gives them to you.
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.