Skip to main content

Request a pull URL (HTTP-FLV / RTSP)

POST /server/v1/stream/pull-url Authentication: required (see Overview) Requests a pull URL (HTTP-FLV or RTSP) for audio and video in a meeting. Video and audio each choose their own source: video is the meeting’s composite video, one of a user’s video tracks, or none; audio is the meeting’s mixed audio, one of a user’s audio tracks, or none, following the video by default. For example, “presenter’s video + meeting mixed audio” is video=user, video_uid=presenter, audio=mix.
  • When the composite video or the meeting’s mixed audio is used, the meeting must have a stream mixing task in progress (recording task_type includes 2); otherwise error code 1073 is returned
  • flv: video must be H264 (no transcoding; if the publisher uses VP8, no video can be pulled); audio is transcoded to AAC
  • rtsp: only RTSP over TCP is supported (the player must use TCP, for example ffplay with -rtsp_transport tcp); video is passed through as is (H264 or VP8), audio is transcoded to AAC by default; pass rtsp_audio=opus to pass Opus through as is and skip server-side transcoding
  • The URL is signed and can be pulled repeatedly by multiple players until it expires; after expiry, new pull requests are rejected, while playback already in progress is not affected
  • Sources are subscribed only when someone pulls and unsubscribed automatically after the last player disconnects, so nothing is consumed when no one is pulling; there is no stop endpoint to call
  • The meeting must have started (the channel is open), otherwise error code 1024 is returned; 2101 is returned if the meeting doesn’t exist
  • Whether the user is in the meeting is not checked; if the source hasn’t published yet when pulling, the player gets a 404 and should retry
The actual validity period is the returned expire_at (the server-configured limit may be smaller than the requested value). Request parameters
string
required
Meeting ID Example: jd8w2k
string
required
Pull protocol: flv (HTTP-FLV), rtsp (RTSP over TCP) Example: flv
string
required
Video source: mcu is the meeting’s composite video (a stream mixing task must be in progress), user is a specific user’s video (with video_uid), none means no video Example: mcu
string
Required when video is user: which user’s video to use (in-meeting user ID) (max length 64) Example: 1001
string
Optional when video is user: when the user publishes multiple video tracks at once (such as camera and screen sharing), specifies one of them (exact match on the track description); if omitted, the first one to arrive is used (max length 50) Example: camera
string
Audio source: auto follows the video (default; the composite video comes with the meeting’s mixed audio, a single user’s video with that user’s own audio; auto can’t be used without video), mix is the meeting’s mixed audio (a stream mixing task must be in progress), user is a specific user’s audio (with audio_uid), none means no audio. Video and audio can’t both be none Example: auto
string
Required when audio is user: which user’s audio to use (in-meeting user ID) (max length 64) Example: 1002
string
When the user publishes multiple audio tracks, specifies one of them (exact match on the track description); if omitted, the first one is used. Effective when audio is user, or auto following a single user’s video (max length 50) Example: mic
integer
URL validity in seconds; defaults to 24 hours if omitted, up to one day Example: 86400
string
Audio codec for RTSP, effective only when protocol is rtsp: aac (default, compatible with NVRs and surveillance platforms), opus (passed through as is, no server-side transcoding) Example: aac
Request example:
Response parameters
string
Pull URL; signed, and can be pulled repeatedly by multiple players until it expires Example: http://1.2.3.4:8080/f/eyJhcHBpZCI6....flv
integer
URL expiry time, Unix timestamp in seconds; after expiry, new pull requests are rejected, while playback already in progress is not affected Example: 1718198266
Response example:

Start a push

POST /server/v1/stream/push/start Authentication: required (see Overview) Start a push: pushes the selected video and audio in the meeting to your RTMP live room (rtmp:// and rtmps:// are supported) and returns a push_id. The source parameters are the same as for requesting a pull URL, and a meeting can have multiple pushes at once (for example, the composite video to one platform and a guest’s own video to another).
  • The meeting must be in progress (someone is in the meeting), and error code 2101 is returned if the meeting doesn’t exist; when the meeting ends and everyone leaves, all of its pushes stop automatically
  • Calling again for the same push URL in the same meeting doesn’t start another push: if the sources are unchanged, the existing push_id is returned; if they changed, this push is updated to the new sources
  • While a source doesn’t exist yet (for example, the stream mixing task hasn’t started, or the user to push hasn’t published), the push stays in waiting; this is not a failure, and pushing starts automatically once the source appears
  • Pushes reconnect automatically after a disconnection; query push status with List push tasks
  • Error code 1072 is returned when no push service is available, and 1075 when the push URL is invalid
Request parameters
string
required
Meeting ID; the meeting must be in progress (someone is in the meeting) Example: jd8w2k
string
required
Push URL; rtmp:// and rtmps:// are supported, and it must include the stream key (URLs with an empty stream name such as rtmp://host/app/ are rejected) (max length 1024) Example: rtmp://live.example.com/app/stream_key
string
required
Video source: mcu is the meeting’s composite video (a stream mixing task must be in progress), user is a specific user’s video (with video_uid), none means no video Example: mcu
string
Required when video is user: which user’s video to use (in-meeting user ID) (max length 64) Example: 1001
string
Optional when video is user: when the user publishes multiple video tracks at once (such as camera and screen sharing), specifies one of them (exact match on the track description); if omitted, the first one to arrive is used (max length 50) Example: camera
string
Audio source: auto follows the video (default; the composite video comes with the meeting’s mixed audio, a single user’s video with that user’s own audio; auto can’t be used without video), mix is the meeting’s mixed audio (a stream mixing task must be in progress), user is a specific user’s audio (with audio_uid), none means no audio. Video and audio can’t both be none Example: auto
string
Required when audio is user: which user’s audio to use (in-meeting user ID) (max length 64) Example: 1002
string
When the user publishes multiple audio tracks, specifies one of them (exact match on the track description); if omitted, the first one is used. Effective when audio is user, or auto following a single user’s video (max length 50) Example: mic
Request example:
Response parameters
string
Push task ID, used to stop the push and query its status Example: p7k2xq
Response example:

Stop a push

POST /server/v1/stream/push/stop Authentication: required (see Overview) Stops a push. Stopping a push that has already stopped is treated as success; error code 1074 is returned if the push_id doesn’t exist or doesn’t belong to this meeting. Request parameters
string
required
Meeting ID; the push must belong to this meeting Example: jd8w2k
string
required
Push task ID, from the response of Start a push Example: p7k2xq
Request example:
Response parameters data is null Response example:

List push tasks

POST /server/v1/stream/push/list Authentication: required (see Overview) Queries the push tasks of a meeting: sources, masked push URL, push status, and most recent error, in reverse order of creation. If push_id is omitted, pushes in progress and those stopped within the last day are returned. Status values: waiting for the source, connecting to the live streaming platform, publishing, retrying after a push failure (see err for the reason), stopped. Request parameters
string
required
Meeting ID Example: jd8w2k
string
Push task ID; pass it to see only that push. If omitted, pushes in progress and those stopped within the last day in the meeting are returned Example: p7k2xq
Request example:
Response parameters
string
Push task ID Example: p7k2xq
string
Meeting ID Example: jd8w2k
string
Video source: mcu is the composite video, user is a specific user, none means no video Example: mcu
string
Whose video is used when video is user Example: 1001
string
Which of the user’s video tracks is used when video is user; empty means the first one to arrive Example: camera
string
Audio source: auto follows the video, mix is the meeting’s mixed audio, user is a specific user, none means no audio Example: auto
string
Whose audio is used when audio is user Example: 1002
string
Which of the user’s audio tracks; empty means the first one Example: mic
string
Push URL with the stream key masked (only the scheme, server, and first path segment are kept) Example: rtmp://live.example.com/app/***
string
Push status: waiting for the source (for example, the stream mixing task hasn’t started or the user to push hasn’t published; pushing starts automatically once the source appears, and this is not a failure), connecting to the live streaming platform, publishing, retrying after a push failure (see err for the reason), stopped Example: publishing
string
Most recent error; empty when everything is normal Example: connection refused
integer
Creation time, Unix timestamp in seconds Example: 1718194666
integer
Push start time (when it first entered publishing), Unix timestamp in seconds; 0 means it has never actually started pushing (for example, it has stayed in waiting) Example: 1718194667
integer
Stop time, Unix timestamp in seconds; 0 means not stopped Example: 1718198266
Response example: