How to register more than two devices with VideoImportFileDriver.

I am using VideoFileImportDriver which is a sample code provided within the forum post by Milestone Systems.

https://download.milestonesys.com/DevCon22/VideoFileImportDriver.zip

I would like to know how to register more than two devices with VideoImportFileDriver.

The video import using the standalone driver VideoFileImportDriver has been confirmed. Based on this, I created VideoFileImportDriver2 to recognize it as multiple drivers.

The changes made in VideoFileImportDriver2 are as follows. For details, please refer to the attached diff.

[Solution]

Assembly information such as title, product, and GUID

[Constants.cs]

HardwareId

ProductDefinition.Id (same as the assembly GUID)

ProductDefinition.Name

DriverId

Audio1

Video1

Metadata1

VideoStream1RefId

AudioStream1RefId

[VideoFileImportDriverConfigurationManager.cs]

_firmware

_hardwareName

_serialNumber

macAddress

CameraDeviceDefinition.DisplayName

MetadataDeviceDefinition.DisplayName

MicrophoneDeviceDefinition.DisplayName

StreamDefinition.DisplayName

[VideoFileImportDriverDriverDefinition.cs]

Constructor arguments of DriverInfo

With this, we have confirmed that it can be recognized as different hardware with different drivers. However, when trying to import videos using the camera of Driver2, there is an issue where Accord.Video.FFMPEG.dll cannot be loaded, and an exception occurs. The cause of this issue is unknown. In the case of video imports using the camera of the original driver, there is no issue with loading Accord.Video.FFMPEG.dll.

Please let me know the cause and how to resolve this issue.

I believe that VideoImportFileDriver was created back in a time where the driver framework only supported one camera channel/device. If you look at the reference sample we have today it actually implements two cameras. Perhaps a step back and a look at the newer sample is the best advise.

I assume that the sample you are referring to is not VideoFileImportDriver but the DemoDriver of the Driver Framework. Is this correct? If I am wrong and there is a new version of VideoFileImportDriver, please share it.

Yes,

https://doc.developer.milestonesys.com/html/index.html?base=samples/pluginsamples/demodriver/readme.html&tree=tree_1.html

My answer wasn’t clear as to what sample I meant, you guessed right.

Let me inquire about this matter on behalf of Mr. Kusunoki, this is Matsuyama.

The issue we are facing occurs when modifying the sample code “VideoFileImportDriver” provided by Milestone Systems to enable video import from multiple devices.

Specifically, when attempting to import a video using VideoFileImportDriver2, an exception is raised because the Accord.Video.FFMPEG.dll cannot be loaded.

Q1) Please confirm whether the method used to create VideoFileImportDriver2 is correct.

Q2) If the method is correct, please let us know the cause of the issue where Accord.Video.FFMPEG.dll cannot be loaded and the corresponding solution.

I would like to know how to register more than two devices using the VideoImportFileDriver.

Let me explain once again what I am trying to achieve.

I want to use the VideoFileImportDriver to import video files accumulated by multiple IP cameras, treating each file as if it were from a different IP camera.

Even if it is not possible to make the VideoFileImportDriver recognized as multiple drivers, I would like to know if the following setup is feasible:

If I can import files to each VideoFileImportDriver on different recording servers from a management server that integrates multiple recording servers, that would suffice.

- Set up one Recording Server on a single Windows machine for each IP camera.

- Integrate and manage multiple Recording Servers with an XProtect Management Server set up on a separate Windows machine.

Could you let me know if such an arrangement is possible?

Hello Matsuyama,

The VideoFileImportDriver was only developed and tested for one device. However, it should be possible to add it multiple times/as multiple devices, if you ensure the MAC address is individual pr. configured instance:

  var macAddress = "DE:AD:C0:DE:50:07"; // TODO: Magic calculate from IP & port! 

as you also do in your VideoFileImportDriver2.

For your actual issue, where Accord.Video.FFMPEG.dll cannot be loaded, and an exception occurs, we need more details (and also accept that it is an external library which has only been tried out for the particular sample).

Are there any hints in the log file DriverFramework_VideoFileImportDriver.log? (or VideoFileImportDriver2).

Read more about the sample and its debugging in this article: https://developer.milestonesys.com/s/article/Video-File-Import-Driver-Using-the-Driver-Framework-to-write-a-Video-File-Import-Driver-sample

Using multiple Recording Servers should be fine, though the MAC addresses still have to be different.

Thank you for your reply, Hans Kierulff.

I am attaching the DriverFramework_VideoFileImportDriver2.log file.

Additionally, I will explain the details of the execution and the results. Please tell me the cause and how to address it.

From 2025-01-24 17:19:19, I executed Retrieve with the following files specified in RemoteRetrievalTaskSample.exe, but all attempts failed:

[C:\Program](file:C:/Program) Files\Milestone\MIPDrivers\VideoFileImportDriver02\10in1-fps15-5m-gop1.mp4

[C:\Program](file:C:/Program) Files\Milestone\MIPDrivers\VideoFileImportDriver\51M15S.mp4

[C:\Program](file:C:/Program) Files\Milestone\MIPDrivers\VideoFileImportDriver02\factory.mp4

The error message in DriverFramework_VideoFileImportDriver2.log is as follows. The error displayed in RemoteRetrievalTaskSample.exe is the same:

2025-01-24 17:19:19.793+09:00 ERROR - Execute: Device Command DefineImportFile - file not loaded for 56fafc2d-da34-48e6-bb49-4aa8a1f3eac5 with <?xml version="1.0" encoding="utf-16"?>

The configuration is as follows:

Two VideoFileImportDrivers are placed.

[C:\Program](file:C:/Program) Files\Milestone\MIPDrivers\VideoFileImportDriver

[C:\Program](file:C:/Program) Files\Milestone\MIPDrivers\VideoFileImportDriver02

In the Management Client, hardware was added to the recording server.

VideoFileImportDriver video

VideoFileImportDriver2 video

When executing Retrieve with the following files (all of which exist) specified in RemoteRetrievalTaskSample.exe, all attempts failed:

[C:\Program](file:C:/Program) Files\Milestone\MIPDrivers\VideoFileImportDriver02\10in1-fps15-5m-gop1.mp4

[C:\Program](file:C:/Program) Files\Milestone\MIPDrivers\VideoFileImportDriver\51M15S.mp4

[C:\Program](file:C:/Program) Files\Milestone\MIPDrivers\VideoFileImportDriver02\factory.mp4

Hi Kouzou Matsuyama,

the files you import must be reachable and readable by the Recording Server on which the driver is installed, in this case, for example, [C:\Program](file:C:/Program) Files\Milestone\MIPDrivers\VideoFileImportDriver02\10in1-fps15-5m-gop1.mp4 must be readable from the Recording Server. As a hint: “C:\”… will normally only work in cases where everything is run on the same machine.

Maybe the logging can be enhanced to state why file file is not loaded, like does it exists, are permissions ok, is it locked?

We created multiple instances of the VideoFileImportDriver DLL, making the following attributes unique in addition to the MacAddress, and successfully integrated multiple drivers:

・SerialNumber

・HardwareId (GUID)

・DriverId (GUID)

・Video1 (GUID)

・VideoStream1RefId (GUID)

After that, we registered multiple drivers via the recording server’s hardware addition function. However, in this process, VideoFileImportDriver08 was recognized as having an invalid license.

This issue is consistently reproducible in the same environment but has not occurred in a different environment.

Could you provide the cause of this license invalidation issue and possible solutions?

Below are logs and screenshots from the time the issue occurred (around 2025/02/14 14:48):

・DriverFramework_VideoFileImportDriver08.log

・RecordingEngine.log

・license.png

・RecordingServer.png

Hi Kouzou Matsuyama,

I am not a license expert, but on the License Information screen there are some red text that might be related to what seems to an expired grace period. I would recommend to Activate the License to get things in balance, before adding more devices.

Thanks and hope this helps!