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
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, getLastModified, registerContribution, registerExtension, setLastModified, setModifiedNow, start, stop, unregisterContribution, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
protected static final org.apache.commons.logging.Log log
protected Map<String,Class> videoTools
public VideoToolsServiceImpl()
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic Blob extractClosedCaptions(Blob video, String outputFormat, String startAt, String endAt)
VideoToolsService
extractClosedCaptions
in interface VideoToolsService
video
- 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)
VideoToolsService
concat
in interface VideoToolsService
public List<Blob> slice(Blob video, String startAt, String duration, boolean encode)
VideoToolsService
slice
in interface VideoToolsService
video
- 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)
VideoToolsService
watermark
in interface VideoToolsService
video
- 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)
VideoToolsService
isToolAvailable
in interface VideoToolsService
toolName
- the name of the toolprotected CmdParameters setupCmdParameters(Map<String,String> parameters)
Copyright © 2018 Nuxeo. All rights reserved.