Introduction¶
The Luna-Video-Agent service is intended for streams and video files analytics.
The Luna-Video-Agent assumes to work with Luna-Video-Manager. The Luna-Video-Manager distributes streams to Luna-Video-Agent taking into account available analytics and agent possibilities of simultaneous streams processing.
Luna-Video-Manager interaction¶
The procedure of interaction with Luna-Video-Manager:
analytics registration: before start, the Luna-Video-Agent makes HTTP-request to Luna-Video-Manager to register analytics with whom it knows how to work. If such analytics register successfully or already exists in Luna-Video-Manager, it will proceed to the next step, otherwise Luna-Video-Agent will raise an error and will not start
agent registration: each instance of Luna-Video-Agent must register as a separate agent in Luna-Video-Manager by making an HTTP-request containing its name, list of available analytics and maximum number of streams available to it for simultaneous processing, optionally some description can be provided too. If registration will be successful, the response will contain agent_id which will be used for future requests to Luna-Video-Manager, otherwise, Luna-Video-Agent will raise an error and will not start
streams management: to get streams for processing, the Luna-Video-Agent periodically makes HTTP-requests to Luna-Video-Manager and read streams, its meta information and analytic parameters for streams processing. The main task of Luna-Video-Manager is to distribute streams to agents. To calculate which agents are available for streams processing, it checks that requests are made with sufficient frequency. For more information about agents and managers interaction, requests and responses structure, see Luna-Video-Manager developers documentation
streams processing: while there are streams for processing Luna-Video-Agent periodically sends feedback with streams statuses and errors occurred during analysis to Luna-Video-Manager. The feedback sending period is calculated as follows - each stream metadata received from Luna-Video-Manager contains feedback_frequency. The used period will equal a minimum of these values. If no streams are processed, no feedback will be sent. While stream processing is in progress, Luna-Video-Agent will send data using callbacks provided by user. For more information about analytic parameters and their’ callbacks see analytics documentation. As a response of each feedback request, agent will receive information of what it must to do with each stream - continue or stop processing. The Luna-Video-Agent also can provide realtime analytics results using websockets, see analytics documentation for details.
streams processing restrictions: Luna-Video-Agent can process streams in different formats, if stream format does not fit, an error will be occurred, write log stream logs and stream will be failed. In general, all streams, which can be proceed using ffmpeg, can be proceed using Luna-Video-Agent, but there is known restriction of pixel format - Luna-Video-Agent supports BGR, BGR_32F, NV12, P10, P12, RGB, RGB_32F, RGB_32F_PLANAR, RGB_PLANAR, YCBCR, YUV420, YUV420_10bit, YUV422, YUV444, YUV444_10bit pixel formats. To process unsupported stream it is possible to restream it, for example, using ffmpeg:
ffmpeg -rtsp_transport tcp -i <input_stream> -rtsp_transport tcp -pix_fmt yuv420p -c:v copy -f rtsp <output_stream>shutdown: Luna-Video-Agent will make HTTP-request to remove its registration on shutdown to prevent streams distribution to this agent.
Analytics¶
The list of available analytics for the Luna-Video-Agent:
people_count: the analytic is intended for determining the number of people, it also allows to determine people coordinates. More information about people_count analytic parameters and callback is available at people count analytic description.