Class VideoToolsServiceImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.platform.video.tools.service.VideoToolsServiceImpl
-
- All Implemented Interfaces:
VideoToolsService,Adaptable,Component,Extensible,TimestampedService
public class VideoToolsServiceImpl extends DefaultComponent implements VideoToolsService
TheVideoToolsServicedefault implementation for handling video blobs. It provides extension points for handling video operations, such as concat, slice, watermark and extract closed captions.- Since:
- 8.4
-
-
Field Summary
Fields Modifier and Type Field Description protected static Loglogprotected Map<String,Class<?>>videoTools-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description VideoToolsServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(ComponentContext context)Activates the component.Blobconcat(List<Blob> videos)Concat the input video blobs into a single video blob.BlobextractClosedCaptions(Blob video, String outputFormat, String startAt, String endAt)Extracts the closed captions from a video blob.booleanisToolAvailable(String toolName)Checks if a determined tool is available.protected CmdParameterssetupCmdParameters(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.Blobwatermark(Blob video, Blob picture, String x, String y)Add a watermark to a video blob.-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContribution, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Method Detail
-
activate
public void activate(ComponentContext context)
Description copied from interface:ComponentActivates the component.This method is called by the runtime when a component is activated.
- Specified by:
activatein interfaceComponent- Overrides:
activatein classDefaultComponent- Parameters:
context- the runtime context
-
extractClosedCaptions
public Blob extractClosedCaptions(Blob video, String outputFormat, String startAt, String endAt)
Description copied from interface:VideoToolsServiceExtracts the closed captions from a video blob.- Specified by:
extractClosedCaptionsin interfaceVideoToolsService- Parameters:
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"- Returns:
- the closed captions if any were found
-
concat
public Blob concat(List<Blob> videos)
Description copied from interface:VideoToolsServiceConcat the input video blobs into a single video blob.- Specified by:
concatin interfaceVideoToolsService- Returns:
- video blob with the videos concatenated
-
slice
public List<Blob> slice(Blob video, String startAt, String duration, boolean encode)
Description copied from interface:VideoToolsServiceSlices a video blob from a start time and the input duration. If start it empty, the blob will be sliced in n-parts with similar duration. If duration is empty, the video blob will be sliced from startAt until the end.- Specified by:
slicein interfaceVideoToolsService- Parameters:
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 blob- Returns:
- video blobs generated by the slicer
-
watermark
public Blob watermark(Blob video, Blob picture, String x, String y)
Description copied from interface:VideoToolsServiceAdd a watermark to a video blob.- Specified by:
watermarkin interfaceVideoToolsService- Parameters:
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 top- Returns:
- a video blob with a watermark at the position specified
-
isToolAvailable
public boolean isToolAvailable(String toolName)
Description copied from interface:VideoToolsServiceChecks if a determined tool is available.- Specified by:
isToolAvailablein interfaceVideoToolsService- Parameters:
toolName- the name of the tool- Returns:
- true if the tool is available or false otherwise
-
setupCmdParameters
protected CmdParameters setupCmdParameters(Map<String,String> parameters)
-
-