I’m using the Mobile Server API to export sequences of video. I am exporting AVI format, and had hoped that the underlying codec would be whatever the camera produced - so, for example, if the camera produced H.264 video, I hoped that the AVI would contain H.264. This doesn’t seem to be the case, though, and I am not sure it is even possible using the API even though I think it’s technically possible because an AVI is just a container for other codecs.
The AVIs I got back in my tests were enormous (1.9GB for about 45 seconds of 720p video) so I would like to use something more efficient if possible. And to preserve quality and not introduce encoding artefacts, I was hoping to avoid transcoding if possible. But as I said, this doesn’t seem to be possible.
So then I looked at whether there are other options.
The Smart Client allows exporting AVIs that use either the “Intel IYUV codec” or the “Microsoft Video 1” codec, but the Mobile Server API doesn’t seem to allow me to choose the Microsoft codec (which, on the the Smart Client, can also be configured for quality). I would like to specify via the API that the Microsoft codec should be used, and I would like to be able to specify the quality/compression too, like you can with the Smart Client. Is this possible…?
Also, the StartExport command is no longer documented but the StartInvestigationExport command rather unhelpfully refers to it…
So to summarise, my questions regarding the Mobile Server API are:
- Can I export an AVI containing H.264 or whatever the camera’s codec is?
- Can I export an AVI that uses the Microsoft Video 1 codec (since the Smart Client can)?
- And if so, can I specify the compression/quality?
Thanks!
Hi,
The codec used for exports can be setup from Mobile Server Mip plugin in Management Client. Though, you cannot make any specific configurations. It is a configuration that is made once for the mobile server and clients cannot modify it.
Thanks Svetlana. How does the Smart Client configure export formats? I assume it must use an API for its exports, and it does have the ability to choose the codec as well as the format, and when the Microsoft codec is selected, the “Codec Configuration…” button allows the “Temporal Quality Ratio” to be set (but strangely, I see that this can’t be set in the Mobile Server plugin!).
Thanks Bo, I didn’t realise Smart Client uses its own routines. If I were developing using C# were an option, the exporter classes would be a great solution!
Unfortunately, as I’m using Java I have to use protocol integration and (as I understand it) the Mobile Server API is the best option in that case. I’m hoping that a Java SDK for XProtect will be created at some point, but in the meantime I’ll have to make do with protocol integration.
I’ve a closely-related question: can I use one of the APIs to export MKV format videos? According to this support article:
By default Windows only includes a few codecs built-in, such as Intel Indeo and Microsoft Video-1, which are very limited and not meant for high-quality video evidence export. (The Intel IYUV codec is more than 20+ years old and rarely useful in practice.)
so the options that are available for export via the APIs are not really much use!
If I could export MKV files that would solve my problems very easily. Is this possible using a protocol API? Or will it be (soon)?
(The real problems are that Intel IYUV AVIs tend to be huge and only OK quality, and the smaller Microsoft Video-1 files tend to be poor quality! As I think I’ve indicated before, I would really like to export the original encoding, partly for speed and partly to avoid losing quality, and the MKV format seems to be a good way of doing that, but doesn’t seem possible from the protocol APIs.)
To export you need to retrieve the video data and then you need to write the data to a file in the appropriate way. The Image Server protocol gives you the means to get the data. File handling and such is in my view not something for a server protocol.
The way I see it I do not envision the Image Server protocol doing other than serve data.
There is a protocol actually. The mobile server does export by creating an export package in the server. This can then be downloaded from the server. So using Mobile Server and mobile server protocol you can get an export.
Thanks Bo. Yeah, the Mobile Server export is what I’ve been using, but as far as I can tell (but I hope I’m wrong!) there’s no way of exporting an MKV file using this.
Thank you!! I configured the request so long ago, I forgot that “Mkv” was an option for the export type. I think I originally dismissed it because MKV files I had seen were enormous, but these are small and super-quick to prepare! 
(That first link didn’t work for me, by the way, but the second one reminded me of this part of the documentation.)