TrainVisualClusteringItem
Adds an item to a visual clustering database. After adding all of your visual media to the database, you can perform clustering with the action ClusterVisualItems.
Type: asynchronous
Parameter | Description | Required |
---|---|---|
database
|
The name of the database to add the item to. The database must already exist. | Yes |
identifier
|
A unique identifier for the item (maximum 254 bytes). If you do not set this parameter, Media Server generates an identifier automatically. | No |
sourcedata
|
The item to add. Files must be uploaded as multipart/form-data. For more information about sending data to Media Server, see Send Actions to Media Server. | Set this or sourcepath |
sourcepath
|
The path of the item to add. The path must be absolute, or relative to the Media Server executable file. | Set this or sourcedata |
nullsourcedata
|
A Boolean value, default By default, samples from the source media are stored in the Media Server training database. You can run visual clustering without the source data, but future enhancements to visual clustering might require retraining and this is not possible without the source data (you would need to supply the source media again). |
No |
numparallel
|
The maximum number of threads to use to complete this action (default 1). | No |
Example
The following example adds an item by sending a video file as multipart/form-data using the sourcedata
parameter:
curl http://localhost:14000 -F action=TrainVisualClusteringItem -F database=BroadcastClips -F identifier=item1 -F sourcedata=@video.mp4
Response
This action is asynchronous, so Media Server always returns success accompanied by a token. You can use this token with the QueueInfo action to retrieve the status of your request.