TrainVideoMatchClip
Trains Media Server to recognize a video clip.
Type: asynchronous
Parameter | Description | Required |
---|---|---|
database
|
The name of the database to add the video clip to. The database must already exist. | Yes |
identifier
|
A unique identifier for the clip (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 clip. 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 |
nullvideodata
|
A Boolean value (default false) that specifies whether to discard the video data when training is complete, rather than storing it in the database. | No |
trainingoptions
|
A comma-separated list of training options to apply to the clip. Separate training options from their values using a colon ( You can set the training option |
No |
videodata
|
The video data. Send files to Media Server using a multipart/form-data HTTP POST request. | Set this or videopath |
videopath
|
The path of the file that contains the video clip. 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 videodata |
Example
The following example trains Media Server by sending the path of the video clip:
curl http://localhost:14000 -F action=TrainVideoMatchClip -F database=movies -F videopath=clip.mp4 -F trainingoptions=maximumduration:45s
Alternatively, you can train Media Server by sending the video data, for example:
curl http://localhost:14000 -F action=TrainVideoMatchClip -F database=movies -F videodata=@clip.mp4 -F trainingoptions=maximumduration:45s
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.