Jump to content

Direct Streams


Recommended Posts

What are Direct Streams?

Direct streams are a new way to stream that doesn't rely on FFmpeg. To get the incoming stream and send it to clients, it uses a streaming engine written entirely in PHP (future versions will be written in Rust to save even more CPU cycles).


Here is a short list illustrating the pros and cons when using Direct streams:


  • no audio-sync issues
  • no need to restart streams under any circumstances (some FFmpeg streams need to be restarted periodically in order to work properly)
  • ultra fast stream start when on-demand mode on, even from multiple hops (server1 (on-demand) -> server2 (on-demand) -> server3 (on-demand) -> server4 (on-demand) -> server5 (on-demand) in 4s<)
  • no need to tweak the probe size setting
  • can open sources without prebuffer (slow streams) in on-demand. Regular on-demand cannot open streams in time without or with a small prebuffer
  • avoided issues caused by demuxing and remuxing (note: FFmpeg de/remuxes even if the stream is just copied without transcoding, while Direct streams forward the input to the output as-is)
  • no issues when restreaming encrypted streams
  • less CPU usage (-20% per stream on average compared to FFmpeg)


  • no transcoding available
  • no mapping available (audio and subtitle tracks cannot be selected)
  • no HLS input and output available (only MPEG-TS input / output is supported by Direct streams)
  • no archives available
  • no video/audio codec and bitrate info is shown


➡️ In MidnightStreamer you can choose between both FFmpeg and Direct streams. It's up to you when to use one or the other.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...