Hello,
Following the SDK instructions regarding Mobile Server Video Push I have successfully requested and received response for ‘Connect’, ‘Login’ and ‘RequestStream’ commands as mentioned in the SDK. I see examples in the SDK regarding pulling video, but not a lot regarding the exact parameters or the video url when doing a Push. I’m currently just testing with a HTML5
I have some questions and I apologize they will be in no particular order, but I’m going to lay on the table everything I’ve came across and anyone who can enlighten me; just know it would be greatly appreciated.
1. Can anyone elaborate on how the sequenceID is triggered. Is it just an increment for every response or request?
2. The below parameters are what I have sent to the RequestStream.
//'Fps' : '15',
'StreamType' : 'Transcoded',
'MethodType' : 'Push',
'SrcWidth' : '160',
'SrcHeight' : '120',
//'CameraId' : 'a7537081-be53-4477-8631-d8cf3326a0e5',
'CameraId' : '00000000-0000-0000-0000-000000000000',
'SignalType' : 'Upload',
'ExportAvi' : 'Yes',
'ExportDatabase' : 'Yes',
'ExportJpeg' : 'Yes'
As you can see above I have toyed with them as I’m not sure which are needed and which are not. When I watch the logs after manually using Milestone Mobile App and doing a successful video push I see that it uses an id of 00000000-0000-0000-0000-000000000000 as opposed to the camera guid. I’ve tried with and without and still having issues so if anyone could inform me of why the Milestone Mobile App uses this bogus id I would appreciate. Additionally which params are ‘required’ for what I am trying to achieve?
3. When the RequestStream response is returned in the OutputParams I see protocol, port, address and information needed for the videoChannelURL. However if I just make a request to the videoChannelURL + videoID then I get a failed request. What is the proper videoChannelURL that way I know I’m on the right path. I believe it is:
http://127.0.0.1:8081/XProtectMobile/Video/a7537081-be53-4477-8631-d8cf3326a0e5
For example..
4. When I look in the Mobile Server log file DeviceHandling.log I see:
2017-03-11 03:59:28.947-05:00 [ 56] WARNING - a7537081-be53-4477-8631-d8cf3326a0e5 Video Push Driver (127.0.0.1) - Camera 1 Device communication error (NoDataException). Error: GetMediaDataBlock returned no data.
I assume this is because the JPEG frames that I am sending are not getting through? Does this mean I used the right parameters and url.. but the data was blank? If it means the data was blank could this be a CORS issue? Using Internet Explorer with cross domain security disabled I am able to make the request without any errors in the Developer Console of the browser. However when I use Google Chrome I see a SecurityError and some CORS messages which is what I’m working to resolve at the time of writing this.
5. In the code snippet from the SDK below.. there seems to be an issue. This loop never gets called and ‘as is’ the page errors because of the uuid.replace is undefined. I apologize if I’m missing something, but does the uuid not exist in some cases or is this just deprecated? I know this was probably a dumb question, but I needed to ask it so thank you.
// convert the uuid string representation to Array of bytes
var videoIDBytes = (function(str) {
var result = \[\];
for(var i=0; i<str.length; i=i+2)
result.push(parseInt(str.substring(i,i+2),16));
return result;
} (this.uuid.replace(/-/g,'')) );
// put UUID bytes in server expected order
if(videoIDBytes) {
for(var bytePosition=0; bytePosition < videoIDBytes.length; bytePosition++ )
headerData.setUint8( bytePosition ,
videoIDBytes\[
\[3,2,1,0,5,4,7,6,8,9,10,11,12,13,14,15\]\[bytePosition\]
\]
);
}
6. I would assume that this JPEG extraction snippet in the SDK would need to go in a event that does something like:
videoContext.drawImage($this, 0, 0);
setTimeout(loop, 1000 / 15);
// perform JPEG operation and send via XMLHTTPRequest
... videoCanvas.toDataURL ... etc etc
The reason I mentioned this is it seems to me that the example in the SDK is only to show you how to send one frame which of course is not what we are looking for in the real world. So would I loop like shown above and send each frame in a XMLHTTPRequest?
I’ll leave it at this for now. Thank you everyone for your time!
Update:
When I try videoChannelURL:
http://127.0.0.1:8081/XProtectMobile/Video/a7537081-be53-4477-8631-d8cf3326a0e5
I get:
{readyState: 4, responseText: “”, status: 410, statusText: “Gone”}
Do I need to keep this stream alive? I am immediately sending a request and would imagine a timeout would be at minimum in seconds.



