Can the TcpVideoViewer sample be modified to retrieve the masked live camera stream from milestone?

I am using the TcpVideoViewer to retrieve live feed from milestone and broadcast it as motion jpeg url.

This integration is working as suspected but when the camera has masking , I get the lock image attached .

My goal is to retrieve the masked live stream from the camera.

I modified the FormatConnect

method to the below:

private string FormatConnect()
        {
            string sendBuffer;
 
            if (_token == "BASIC")
            {
                sendBuffer = string.Format(
                    "<?xml version=\"1.0\" encoding=\"utf-8\"?><methodcall><requestid>0</requestid>" +
                    "<methodname>connect</methodname><username>{0}</username><password>{1}</password>" +
                    "<cameraid>{2}</cameraid><alwaysstdjpeg>yes</alwaysstdjpeg>" +
                    "<clientcapabilities>" +
                    "<privacymask>yes</privacymask>" +
                    "<privacymaskversion>1</privacymaskversion>" +
                    "<multipartdata>no</multipartdata >" +
                    "<datarestriction>yes</datarestriction >" +
                    "</clientcapabilities>" +
                    "</methodcall>\r\n\r\n",
                    XmlEscapeGt127(_user), XmlEscapeGt127(_pwd), _cameraGuid);
            }
            else
            {
                sendBuffer = string.Format(
                    "<?xml version=\"1.0\" encoding=\"utf-8\"?><methodcall><requestid>0</requestid>" +
                    "<methodname>connect</methodname><username>gaby</username><password>g</password>" +
                    "<cameraid>{0}</cameraid><alwaysstdjpeg>yes</alwaysstdjpeg>" +
                   "<transcode><allframes>yes</allframes></transcode>" + // Add this line to get all frames in a GOP transcoded
                    "<connectparam>id={1}&amp;connectiontoken={2}" +
                    "</connectparam>"+
                    "<clientcapabilities>" +
                    "<privacymask>yes</privacymask>" +
                    "<privacymaskversion>1</privacymaskversion>" +
                    "<multipartdata>no</multipartdata >" +
                    "<datarestriction>yes</datarestriction >" +
                    "</clientcapabilities>" +
                    "</methodcall>\r\n\r\n",
                    _cameraGuid, _cameraGuid, _token);
            }
 
            return sendBuffer;
        }

according to the bellow url

https://doc.developer.milestonesys.com/html/reference/protocols/imageserver_request_response.html

now I can see the live stream but without the masking.

Can the TcpVideoViewer be modifed in any way to make this possible ?

Best regards,’

Gaby

I need a clarification please. After having modified the FormatConnect do you still get padlock images or do you get correct images but without any masking?

Hello Bo,

I got the correct image but without masking, but never mind I switched to the Media Live viewer sample and I go the needed functionality .

Thank you

I am glad to hear that you now have a solution.

There is currently no plan to extend the TCP Video Viewer sample on the needed masking to support privacy masking, but I will make a note to the Milestone Product Management so that it can be considered for future development work.