public class VideoToolsServiceImpl extends DefaultComponent implements VideoToolsService
VideoToolsService default implementation for handling video blobs. It provides extension points for
handling video operations, such as concat, slice, watermark and extract closed captions.| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
log |
protected Map<String,Class> |
videoTools |
lastModified, name| Constructor and Description |
|---|
VideoToolsServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(ComponentContext context)
Activates the component.
|
Blob |
concat(List<Blob> videos)
Concat the input video blobs into a single video blob.
|
Blob |
extractClosedCaptions(Blob video,
String outputFormat,
String startAt,
String endAt)
Extracts the closed captions from a video blob.
|
boolean |
isToolAvailable(String toolName)
Checks if a determined tool is available.
|
protected CmdParameters |
setupCmdParameters(Map<String,String> parameters) |
List<Blob> |
slice(Blob video,
String startAt,
String duration,
boolean encode)
Slices a video blob from a start time and the input duration.
|
Blob |
watermark(Blob video,
Blob picture,
String x,
String y)
Add a watermark to a video blob.
|
deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContribution, unregisterExtensionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplicationStarted, getApplicationStartedOrderprotected static final org.apache.commons.logging.Log log
protected Map<String,Class> videoTools
public VideoToolsServiceImpl()
public void activate(ComponentContext context)
ComponentThis method is called by the runtime when a component is activated.
activate in interface Componentactivate in class DefaultComponentcontext - the runtime contextpublic Blob extractClosedCaptions(Blob video, String outputFormat, String startAt, String endAt)
VideoToolsServiceextractClosedCaptions in interface VideoToolsServicevideo - the input bloboutputFormat - the outformat of the captions (srt, txt, ttxt is the default)startAt - the start time in format "xx:xx"endAt - the end time in format "xx:xx"public Blob concat(List<Blob> videos)
VideoToolsServiceconcat in interface VideoToolsServicepublic List<Blob> slice(Blob video, String startAt, String duration, boolean encode)
VideoToolsServiceslice in interface VideoToolsServicevideo - the input blobstartAt - the start time in "xx:xx" formatduration - the duration of the sliced blob in secondsencode - option to re-encode the ouptut video blobpublic Blob watermark(Blob video, Blob picture, String x, String y)
VideoToolsServicewatermark in interface VideoToolsServicevideo - the input blobpicture - the picture blob to be used as the watermarkx - the x offset starting from the lefty - the y offset starting from the toppublic boolean isToolAvailable(String toolName)
VideoToolsServiceisToolAvailable in interface VideoToolsServicetoolName - the name of the toolprotected CmdParameters setupCmdParameters(Map<String,String> parameters)
Copyright © 2019 Nuxeo. All rights reserved.