Valkka  0.17.0
OpenSource Video Management
Live streaming

Some notes on receiving/sending live streams

Receiving streams

Sending streams

From the point of view of API users, sending frames happens simply by connecting a source to LiveFifo (see the examples). Behind the scene, frames are sent over the net, by calling LiveFifo::writeCopy - i.e. using the unified approach in Valkka library to handle frames; they are handled in the same way, whether they are passed to the decoder or sent to the screen by using OpenGLFrameFifo (see Library architecture).

Sending frames happens roughly as follows:

SDP Streams

Streams sent directly to UDP ports, as defined in an SDP file ("SDP" streams)

RTSP Server

Some misc. observations / code walkthrough:

To get this into one's head, let's take a look at this diagram. "{}" means enclosing object:

RTSPServer {

   H264ServerMediaSubsession {
       - member "fifo" is a reference to FrameFifo
   
       - method : createNewStreamSource
           - creates buffer_source = BufferSource (.., fifo)
           - creates H264VideoStreamDiscreteFramer(buffer_source)
           => returns to RTPServer: H264VideoStreamDiscreteFramer(buffer_source)
           
       - inherited method sdpLines
       - inherited method closeStreamSource
   }
}