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
The
VideoToolsService
default 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 inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate
(ComponentContext context) Activates the component.Concat the input video blobs into a single video 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) Slices a video blob from a start time and the input duration.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
getApplicationStartedOrder
-
Field Details
-
videoTools
-
-
Constructor Details
-
VideoToolsServiceImpl
public VideoToolsServiceImpl()
-
-
Method Details
-
activate
Description copied from interface:Component
Activates the component.This method is called by the runtime when a component is activated.
- Specified by:
activate
in interfaceComponent
- Overrides:
activate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
extractClosedCaptions
Description copied from interface:VideoToolsService
Extracts the closed captions from a video blob.- Specified by:
extractClosedCaptions
in 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
Description copied from interface:VideoToolsService
Concat the input video blobs into a single video blob.- Specified by:
concat
in interfaceVideoToolsService
- Returns:
- video blob with the videos concatenated
-
slice
Description copied from interface:VideoToolsService
Slices 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:
slice
in 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
Description copied from interface:VideoToolsService
Add a watermark to a video blob.- Specified by:
watermark
in 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
Description copied from interface:VideoToolsService
Checks if a determined tool is available.- Specified by:
isToolAvailable
in interfaceVideoToolsService
- Parameters:
toolName
- the name of the tool- Returns:
- true if the tool is available or false otherwise
-
setupCmdParameters
-