Hello Geirbo,
If you want to add the thumbnails using the Try It function in the documentation (https://developer.bitmovin.com/encoding/reference/postencodingencodingsstreamsthumbnailsbyencodingidandstreamid), you must do this while the encoding is in the CREATED state.
Note: This is NOT a recommended workflow, it is just for explaining when the Add Thumbnails Try It function indeed produces thumbnail files.
In this state the encoding is already prepared but not started yet. If you use the Add Thumbnail “Try it” function when the encoding is CREATED, you add the thumbnail configuration to the encoding and it will generate the thumbnails once you start it.
This workflow goes like this:
1 . Create an encoding with any means (SDK, direct HTTP calls using tools like Postman, etc) but don’t start it.
2. Go to the dashboard and verify that your encoding is in the CREATED state.
3. Get from the dashboard the encoding ID and the ID of one video stream. Also get the ID of the output that is configured with the encoding.
4. Go to https://developer.bitmovin.com/encoding/reference/postencodingencodingsstreamsthumbnailsbyencodingidandstreamid and enter the required values into the input fields, including
- Encoding ID
- Video Stream ID
- Name, height, width,
- The file name pattern (e.g “thumbnail-%number%.png”)
- Interval (e.g. 4 seconds)
- Output ID
- Output Path (this should be the same you configured for the encoding, plus “thumb/”).
The resulting curl request will look like this:
curl --request POST \
--url https://api.bitmovin.com/v1/encoding/encodings/<encoding_id>/streams/<stream_id>/thumbnails \
--header 'X-Api-Key: <api_key>' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"unit": "SECONDS",
"aspectMode": "STRETCH",
"pattern": "thumbnail-%number%.png",
"width": 320,
"height": 240,
"name": "myThumbnail",
"interval": 4,
"outputs": [
{
"outputId": "<output_id>",
"outputPath": "output/path/to/encoded/files/thumb/",
"acl": [
{
"permission": "PUBLIC_READ"
}
]
}
]
}
'
5 . Now, click “Try it” . The result should look like:
{
"requestId": "dbd9870b-5003-488d-b038-b9850fa378d2",
"status": "SUCCESS",
"data": {
"result": {
"id": "98e1ea41-b45b-4c15-8b4c-532a64ff1234",
"createdAt": "2023-11-21T15:33:07Z",
"name": "myThumbnail",
"modifiedAt": "2023-11-21T15:33:07Z",
"height": 240,
"width": 320,
"pattern": "thumbnail-%number%.png",
"unit": "SECONDS",
"outputs": [
{
"outputId": "<output_id>",
"outputPath": "output/path/to/encoded/files/thumb/",
"acl": [
{
"permission": "PUBLIC_READ"
}
]
}
],
"interval": 4,
"aspectMode": "STRETCH"
},
"messages": [
{
"id": "34617150-cfdb-4702-ab7b-2db4411ce90a",
"date": "2023-11-21T15:33:07Z",
"type": "INFO",
"text": "Thumbnail configuration created successfully"
}
]
}
}
6 . Start the encoding (again using the SDK, or direct HTTP calls using tools like Postman, etc)
After the encoding is FINISHED, you will find the thumbnail in the output with the <output_id>, which should be the output that you configured the encoding with and thus, the output where the encoding wrote the encoded segments and manifests as well. You will find the thumbnails in the directory that you configured, e.g. output/path/to/encoded/files/thumb/
.
I have described this workflow because it contains the usage of the Add Thumbnail “Try it” function in the documentation. This workflow is however not recommended for larger scale testing or production. Here, you should configure the whole encoding using the SDK or the Simple API.
As Ludo said, please elaborate about your use case and intended workflow so we can better help you to set it up.
Hope this helps, and kind regards
Peter