Class VideoToolsServiceImpl

    • Field Detail

      • log

        protected static final Log log
    • Constructor Detail

      • VideoToolsServiceImpl

        public VideoToolsServiceImpl()
    • Method Detail

      • activate

        public void activate​(ComponentContext context)
        Description copied from interface: Component
        Activates the component.

        This method is called by the runtime when a component is activated.

        Specified by:
        activate in interface Component
        Overrides:
        activate in class DefaultComponent
        Parameters:
        context - the runtime context
      • extractClosedCaptions

        public Blob extractClosedCaptions​(Blob video,
                                          String outputFormat,
                                          String startAt,
                                          String endAt)
        Description copied from interface: VideoToolsService
        Extracts the closed captions from a video blob.
        Specified by:
        extractClosedCaptions in interface VideoToolsService
        Parameters:
        video - the input blob
        outputFormat - 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: VideoToolsService
        Concat the input video blobs into a single video blob.
        Specified by:
        concat in interface VideoToolsService
        Returns:
        video blob with the videos concatenated
      • slice

        public List<Blob> slice​(Blob video,
                                String startAt,
                                String duration,
                                boolean encode)
        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 interface VideoToolsService
        Parameters:
        video - the input blob
        startAt - the start time in "xx:xx" format
        duration - the duration of the sliced blob in seconds
        encode - 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: VideoToolsService
        Add a watermark to a video blob.
        Specified by:
        watermark in interface VideoToolsService
        Parameters:
        video - the input blob
        picture - the picture blob to be used as the watermark
        x - the x offset starting from the left
        y - 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: VideoToolsService
        Checks if a determined tool is available.
        Specified by:
        isToolAvailable in interface VideoToolsService
        Parameters:
        toolName - the name of the tool
        Returns:
        true if the tool is available or false otherwise