Skip to content

Streaming ​

Functions for live streaming rendering output via RTMP or SRT.

Requires --with-ffmpeg at build time.

vio_stream ​

php
VioStream|false vio_stream(VioContext $context, array $config)

Create a network stream.

Config:

KeyTypeDefaultDescription
urlstringrequiredStream endpoint (e.g., "rtmp://server/live/key")
fpsint30Target frames per second
bitrateintautoTarget bitrate in bits/s
codecstringautoEncoder name
formatstringautoContainer format

vio_stream_push ​

php
bool vio_stream_push(VioStream $stream, VioContext $context)

Push the current framebuffer as one frame to the stream. Call once per frame after vio_end().

Returns true on success.

vio_stream_stop ​

php
void vio_stream_stop(VioStream $stream)

Stop streaming and close the connection.

Released under the MIT License.