Media Server 26.2
Media Server Help

# 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
`gpudeviceid` | The device ID of the GPU to use, if you have enabled GPU acceleration and want to override the value of the GPUDeviceID configuration parameter. You can also set this parameter to `CPU`, to disable GPU acceleration for this action and use the CPU instead. | No
`identifier` | A unique identifier for the item (maximum 254 bytes). If you do not set this parameter, Media Server generates an identifier automatically. | No
`metadata` | A comma-separated list of metadata key-value pairs to add to the item. Separate keys from values using a colon (`:`). To include a comma or colon in a key name or value, you must enclose the key name or value in quotation marks (`"`) and escape any quotation marks that occur within the string with a backslash (`\`). | 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. To strengthen security, Media Server can be configured to read files only from specified directories. For information about the directories that Media Server is permitted to read from, see the parameter AllowedInputDirectories. | Set this or `sourcedata`
`nullsourcedata` | A Boolean value, default `false`, that specifies whether to discard the source data after training is complete. Setting this to `true` is equivalent to running the action NullVisualClusteringItemSourceData after training. 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 the training (default 1), subject to the limit specified by MaxNumParallel. | 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.

Copyright 2026 Open Text
Version 26.2 | Last updated April 2026

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery Media Server 26.2

Topic Title: TrainVisualClusteringItem