I called getExport method and got a export object with state 0. i stored the export id and called this method again but ts state is 0 after 4 hours. Please help me how i can do implementation to get exported video
ExportSample or DataExport might be helpful. Can you please explore these samples?
ExportSample
DataExport
Thanks for your interest.
I want this for XPMobileSDK web implementation.
Can you help me on that?
Hi Amandeep,
I’ve tried to prepare very basic sample which demonstrates how to use the export functionality trough the MIP SDK Mobile.
The sample creates video export on the clicked camera with duration of 30 seconds.
In general if your export stays to much time in state “0” indicates some problem with the Mobile server.
State 0 means export is queued in the server but is waiting for it’s execution.
It is possible to happen if there are too many exports triggered before that.
Or currently processing export takes to long to complete.
You can check the states of the exports in the Mobile server MIP Plug-in (Management client → Mobile servers → <your_mobile_server> → Investigations).
If you restart your Mobile server, the queue will be thrown away and you could start again new exports.
Please bear in mind that AVI export over huge intervals take too much time and size on disc.
@Rie Kiuchi (Milestone Systems)
I am trying to do video export but I am getting State as -10 in XPMobileSDK.getExport success response.
{"StartTime":"2021-05-20T10:41:55.579Z","EndTime":"2021-05-20T10:42:05.579Z","ExportId":"1df83622-0ad4-430f-bd94-451d54abaf38","Name":"CAM 17 - Office Room 4-2021.05.20-14.41.55-10s.mkv","FileName":"CAM 17 - Office Room 4-2021.05.20-14.41.55-10s.mkv","CameraId":"fd9de0af-5b93-45f2-9511-4866e21307b3","CameraName":"CAM 17 - Office Room 4","Type":"Mkv","State":-10,"User":"administrator","FullUserName":"Administrator","UserSid":"S-1-5-21-3027694188-3782197065-3406205062-500","InitType":"Manual","QueuedTime":"2021-05-20T10:42:38.114Z","CompletedTime":"0001-01-01T00:00:00.000Z","Size":0,"KeepOriginals":"false","IncludeAudio":"false","InvestigationId":"00000000-0000-0000-0000-000000000000","ReExportFromId":"00000000-0000-0000-0000-000000000000","ServerId":"bf68233f-6292-4bd4-b0f1-2ceec2f615ae"}
Version: milestone 2020 r2
Hi Donny,
Looking at this one, seems that error code means:
“-10 = Export not performed due to folder size limitation reached.”
Please check if there is some limitation set in the Mobile Server settings in the Management Client in the tab “Investigations”.
@Petar Vutov I have checked there was space issue now it is working but video exported without audio. How can i get video with audio?
On a protocol level there is parameter named “IncludeAudio” that can be added to the StartExport or StartInvestigationExport commands. It could have value of “Yes” if audio is about to be included.
Or you are talking more in the context of the SDK / Samples perspective ?
@Petar Vutov I have passed the “IncludeAudio”: “yes” parameter to startExport command but i am getting error:
logging.js:6088 Response error UnknownItemID 21 Complete response: <?xml version="1.0" encoding="utf-8"?><Communication xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ConnectionId>e486b0df-be70-426c-b3b5-cbc69a0d9775</ConnectionId><Command SequenceId="10"><Type>Response</Type><Name>StartExport</Name><InputParams /><OutputParams><Param Name="Challenge" Value="CB8C3F05-3272-46E3-8901-A18FCF832241" /></OutputParams><Items /><Result>Error</Result><ErrorCode>21</ErrorCode></Command></Communication>
XPMobileSDK.library.ConnectionResponse @ logging.js:6088
b @ logging.js:5882
v @ logging.js:5854
r.onreadystatechange @ logging.js:2611
XMLHttpRequest.send (async)
Request @ logging.js:2630
g @ logging.js:5817
XPMobileSDK.library.ConnectionRequest @ logging.js:5776
Connection.sendCommand @ logging.js:5381
sendCommand @ XPMobileSDK.js:1823
startExport @ cctv.js:677
(anonymous) @ cctv.js:862
logging.js:5379
Response error WrongInputParameter 14 Complete response: <?xml version="1.0" encoding="utf-8"?><Communication xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ConnectionId>e486b0df-be70-426c-b3b5-cbc69a0d9775</ConnectionId><Command SequenceId="11"><Type>Response</Type><Name>GetExport</Name><InputParams /><OutputParams><Param Name="Challenge" Value="E4D25628-673E-4202-B476-323E96DF5228" /></OutputParams><Items /><Result>Error</Result><ErrorCode>14</ErrorCode></Command></Communication>
XPMobileSDK.library.ConnectionResponse @ logging.js:6088
b @ logging.js:5882
v @ logging.js:5854
r.onreadystatechange @ logging.js:2611
XMLHttpRequest.send (async)
Request @ logging.js:2630
g @ logging.js:5817
XPMobileSDK.library.ConnectionRequest @ logging.js:5776
Connection.sendCommand @ logging.js:5381
Connection.getExport @ logging.js:4602
getExport @ XPMobileSDK.js:1247
updateStatus @ cctv.js:695
startExportCallback @ cctv.js:687
b @ logging.js:5886
v @ logging.js:5854
r.onreadystatechange @ logging.js:2611
XMLHttpRequest.send (async)
Request @ logging.js:2630
g @ logging.js:5817
XPMobileSDK.library.ConnectionRequest @ logging.js:5776
Connection.sendCommand @ logging.js:5381
sendCommand @ XPMobileSDK.js:1823
startExport @ cctv.js:677
(anonymous) @ cctv.js:862
Hi Donny,
To summarize up,
When you don’t pass the IncludeAudio option, everything works, but if you pass it - you get UknownItemId error ?
Can you provide dump of how the requests look like ?
Btw, what version of the MoS are you using ?
Hi Donny,
It seems I’ve mislead you.
The Mobile server doesn’t support exports with audio.
I mean exports created via “StartExport” command.
However, It supports audio for the exports made from the investigation.
So in your case you have to first create an investigation via “CreateInvestigation”. Then (once investigation is saved) you could call “StartInvestigationExport”.
Simple exports are deprecated and the commands are considered as obsolete. Therefore they are not updated with functionality for audio.
Also, going further, the way exports are downloaded will change, making almost impossible to downloads exports “simple” exports trough the Mobile server. All this will be made trough the investigations functionality.
So I’ll advice you to migrate to investigations in order to achieve what you need (export with audio). As a bonus, you will be able to create investigation for multiple cameras (and related audio devices) and make a single export package to all of them.
Hi @Petar Vutov ,
MOS version: 20.3a
I recently facing issue while exporting the video, error response shows state as -13. Can you provide description for this code
Hi @Donny Fernandes
You could see all the Error codes in the official documentation page:
https://doc.developer.milestonesys.com/mipsdkmobile/
Just Navigate to “Getting Started…”, Then from left-side menu “Mobile Server protocol” and “Appendix”.
In particular, error code “-13” for exports means “No video in selected time”.
After updating my milestone mobile server to 2023. I am facing issue for export video. error is 11 = Bad command kind
Hi @Donny Fernandes ,
DeleteExport command had been deprecated for years, so we removed it altogether in 2023 R3.
The proper way to create an export is to create an investigation first and then use StartInvestigationExport command.
This is what Web Client does, so if you have troubles you can inspect the xmls which Web Client is sending.
Br,
Nikolay
Export video process:
- Create Investigation .
- Start export Investigation.
- Create export for download
On calling StartInvestigationExport method, i got error as Not Allowed In this state 23.
There is no sample for this, unfortunately.
But your approach is totally in the right direction:
- CreateInvestigation
- GetInvestigation multiple times (e.g. every second) - until returned Status is “Saved”
- StartInvestigationExport
- GetExport multiple times (e.g. every second) - until State is “101” (meaning ready for download)
- CreateExportDownloadLink and use returned ExportLink to download
You’re getting error 23 because ‘XProtect export’ is disabled by admin. Please make sure to enable it, as shown:
@Nikolay Dimitrov I am facing issue in exporting video from offline camera. I have export video for 1 minute duration and I received file with size i.e 250mb. This file cannot be played in my web application. What is the process to export video from offline camera?
Hi Donny,
In relation to your original question, you can see this forum thread, where I provided code sample on how to create export via Mobile SDK.
Your latest question (file size) has nothing to do with the current topic discussed here, so please open another forum thread if you need further assistance with that.
Br,
Nikolay
