The Windows Azure documentation provides a task preset to create thumbnails and sample code in C#: https://msdn.microsoft.com/en-us/library/azure/hh973624.aspx
I am trying to do this using the java SDK http://azure.microsoft.com/en-us/develop/java/ and getting an error 400 from the server.
The relevant excerpt from my code is:
JobInfo jobInfo = mediaService
.create(Job
.create()
.setName(
"Encoding " + assetToEncode.getName() + " to "
+ encodingPreset
+ " and Packaging to HLS")
.addInputMediaAsset(assetToEncode.getId())
// Thumbnails see
// https://msdn.microsoft.com/en-us/library/azure/hh973624.aspx
.addTaskCreator(
Task.create(
mediaProcessor.getId(),
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
+
"<Thumbnail Size=\"100%,*\" Type=\"Jpeg\" Filename=\"{OriginalFilename}_{Size}_{ThumbnailTime}_{ThumbnailIndex}_{Date}_{Time}.{DefaultExtension}\">"
+ "<Time Value=\"10%\" Step=\"10%\" Stop=\"95%\"/>" +
"</Thumbnail>").setConfiguration( "Thumbnails")
.setOptions(
TaskOption.ProtectedConfiguration).setName(
"Thumbnails"))
Does anyone have a working example using this task with java?
Short Answer:
This answer is for azure-media maven package versions 0.6.0 to 0.8.x
You should use the usual XML on
create
method and set the thumbnail XML viasetConfiguration
like this example:Complete Example:
Usage:
Code: