SRT ingress

Secure Reliable Transport (SRT) lets you ingest audio/video into Stream Video calls and livestreams. It's a modern alternative to RTMP with UDP transport, codec-agnostic support, and strong resilience to jitter and packet loss.

The target resolution and bitrate depend on your content type. See Video bandwidth requirements for detailed guidance.

Quickstart

1) Create a call and generate SRT credentials

String userId = "user-" + RandomStringUtils.randomAlphanumeric(10);
client.updateUsers(
        UpdateUsersRequest.builder()
                .users(Map.of(userId, UserRequest.builder().id(userId).name("User Name").build()))
                .build()
);

String callID = "call-" + RandomStringUtils.randomAlphanumeric(10);
Call call = video.call("livestream", callID);
call.getOrCreate(GetOrCreateCallRequest.builder().data(
        CallRequest.builder().createdByID(userId).build()
).build());

String srtToken = call.createSRTCredentials(testUser.getId()).getAddress();
System.out.println("SRT Token: " + srtToken);

2) Send video to Stream via ffmpeg or OBS

If you have ffmpeg installed, you can quickly send a sample video to your call. Replace ${SRT_ADDRESS} with the generated address above.

Send with FFMPEG

ffmpeg -re \
  -i "https://cdn.jsdelivr.net/npm/big-buck-bunny-1080p@0.0.6/video.mp4" \
  -c:v libx264 -preset veryfast -tune zerolatency -g 50 -pix_fmt yuv420p \
  -c:a aac -b:a 128k -ac 2 \
  -f mpegts "${SRT_ADDRESS}"

Send with OBS

To stream from OBS using SRT, use a recent OBS release (32.0.0 or newer). Then set Service to “Custom” and paste the SRT address into the Server/URL field.

OBS SRT settings

Note: OBS 32.0.0+ is required for stable SRT support; older versions may fail to publish.

3) Preview the stream

Use the viewer demo to watch the livestream via WebRTC/HLS. Ensure you use the same API key and call ID you used in step 1.

  • Video codec: H.264
  • Choose resolution/bitrate for your content. See Quality for guidance.

SRT vs RTMP

FeatureSRTRTMP
Latency~100 ms – 1s~2s
TransportUDP (ARQ/FEC)TCP
ReliabilityHigh (handles jitter/loss)Moderate (retransmits add delay)
SecurityAES encryptionRTMPS/TLS required
CodecsH.264, AV1, VP8, VP9Commonly H.264/AAC