Step 5 : Send Audio/Video stream

MQTT & UDP payload (previous steps required)

If you want to start a stream through the application, your device will receive the following JSON payload on MQTT and UDP.

{
 "action":"command",
 "timestamp":"2020-02-13 14:32:13",
 "uid":"UID",
 "modules":[
     {
         "id":"deviceID",
         "device":{
             "bearerId":"deviceID",
             "status":[
                 {
                     "capability":"start_stream",
                     "value":{
                         // Ignore this part currently
                     }
                 }
             ]
         }
     }
 ],
 "clientId":"applicationId"
}

And when you leave the stream on the application you receive the same payload but with “capability”:”stop_stream”.

Start the audio and/or video stream

Please refer to the samples ./sample/linux/x86_64/av

  1. Initialise the cl_av module with the cl_av_init function

  2. Create a rtp channel to the IP and port of your choice with the cl_av_start function.

  3. Send Audio/Video with the cl_av_send_audio or cl_av_send_video

In order to visualise the stream. You can use the ComfortLife application if you followed the previous steps. Otherwise you can use a tool like VLC (rtp with vlc) to view the stream.