Channel Operations
Live channel operations let you perform actions on a channel while it is running. This can be useful for live events where you might insert slate images or videos, insert program start/end signals or insert custom SCTE-35 data to be consumed by your clients.
Inserting Slates
Slates are images or short videos that get overlayed to hide the input source video on the live stream. You pass the URI when slating in or out.
- CLI
- Javascript
- Go
# Show the slate
$ restish isp slate-in $CHANNEL_ID uri: https://example.com/slate.jpg
# Return to the input source video
$ restish isp slate-out $CHANNEL_ID
// TODO
request := client.ChannelOperationsApi.SlateIn(context.Background(), "CHANNEL_ID")
request.Slate(isp.Slate{
Uri: "https://example.com/slate.jpg",
})
_, err := request.Execute()
if err.Error() != "" {
panic(err)
}
And then remove the slate:
request := client.ChannelOperationsApi.SlateOut(context.Background(), "CHANNEL_ID")
_, err := request.Execute()
if err.Error() != "" {
panic(err)
}
Starting & Stopping Programs
Program start and stop signals provide a way to tell video players when a logically distinct piece of content has started and stopped, such as a live sporting event. Each program has a unique event ID so that multiple overlapping programs are supported.
- CLI
- Javascript
- Go
# Insert program start
$ restish isp program-start $CHANNEL_ID event_id: 1
# End a program
$ restish isp program-stop $CHANNEL_ID event_id: 1
// TODO
request := client.ChannelOperationsApi.ProgramStart(context.Background(), "CHANNEL_ID")
request.ProgramSignal(isp.ProgramSignal{
EventId: 1,
})
_, err := request.Execute()
if err.Error() != "" {
panic(err)
}
And then stop the same program:
request := client.ChannelOperationsApi.ProgramEnd(context.Background(), "CHANNEL_ID")
request.ProgramSignal(isp.ProgramSignal{
EventId: 1,
})
_, err := request.Execute()
if err.Error() != "" {
panic(err)
}
Arbitrary Signaling
Arbitrary out-of-band signaling is supported, allowing you to send any custom data into the stream. The slate and program functionality above is just a convenience layer on the signaling API.
- CLI
- Javascript
- Go
# Insert a program start signal
$ restish isp signal $CHANNEL_ID segment_type: program, signal_type: start, event_id: 1
// TODO
request := client.ChannelOperationsApi.Signal(context.Background(), "CHANNEL_ID")
request.GenericSignal([]isp.GenericSignal{
{
SegmentType: "program",
SignalType: "start",
EventId: 1
}
})
_, err := request.Execute()
if err.Error() != "" {
panic(err)
}