Class CropServiceImpl

java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.crop.impl.CropServiceImpl
All Implemented Interfaces:
org.opencastproject.crop.api.CropService, org.opencastproject.job.api.JobProducer, org.osgi.service.cm.ManagedService

public class CropServiceImpl extends org.opencastproject.job.api.AbstractJobProducer implements org.opencastproject.crop.api.CropService, org.osgi.service.cm.ManagedService
Media analysis plugin that takes a video stream and removes black bars on each side

This plugin runs

     ffmpeg -i input.file -vf cropdetect=24:16:0 -max_muxing_qurue_size 2000 -f null -

     ffmpeg -i input.file -vf startCropping=wi-2*x:hi:x:0 -max_muxing_queue_size 2000 -y output.file
 
  • Field Details

    • COLLECTION_ID

      public static final String COLLECTION_ID
      Resulting collection in the working file repository
      See Also:
    • binary

      protected String binary
      Path to the executable
    • FFMPEG_BINARY_CONFIG

      public static final String FFMPEG_BINARY_CONFIG
      See Also:
    • FFMPEG_BINARY_DEFAULT

      public static final String FFMPEG_BINARY_DEFAULT
      See Also:
    • DEFAULT_CROP_JOB_LOAD

      public static final float DEFAULT_CROP_JOB_LOAD
      The load introduced on the system by creating a caption job
      See Also:
    • CROP_JOB_LOAD_KEY

      public static final String CROP_JOB_LOAD_KEY
      The key to look for in the service configuration file to override the DEFAULT_CROP_JOB_LOAD
      See Also:
    • CROP_FFMPEG_GREYSCALE_LIMIT

      public static final String CROP_FFMPEG_GREYSCALE_LIMIT
      The threshold of greyscale to use for cropping
      See Also:
    • DEFAULT_CROP_GREYSCALE_LIMIT

      public static final String DEFAULT_CROP_GREYSCALE_LIMIT
      See Also:
    • CROP_FFMPEG_ROUND

      public static final String CROP_FFMPEG_ROUND
      The value which the width/height should be divisible by
      See Also:
    • DEFAULT_CROP_FFMPEG_ROUND

      public static final String DEFAULT_CROP_FFMPEG_ROUND
      See Also:
    • CROP_FFMPEG_RESET

      public static final String CROP_FFMPEG_RESET
      The counter that determines after how many frames cropdetect will be executed again
      See Also:
    • DEFAULT_CROP_FFMPEG_RESET

      public static final String DEFAULT_CROP_FFMPEG_RESET
      See Also:
    • CROP_FFMPEG_PARAM

      public static final String CROP_FFMPEG_PARAM
      Additional parameters that will be added to the ffmpeg command line
      See Also:
    • DEFAULT_CROP_FFMPEG_PARAM

      public static final String DEFAULT_CROP_FFMPEG_PARAM
      See Also:
    • CROP_FFMPEG_TARGET_EXTENSION

      public static final String CROP_FFMPEG_TARGET_EXTENSION
      File extension for the resulting cropped video
      See Also:
    • DEFAULT_CROP_FFMPEG_TARGET_EXTENSION

      public static final String DEFAULT_CROP_FFMPEG_TARGET_EXTENSION
      See Also:
    • CROP_FFMPEG_REGEX

      public static final String CROP_FFMPEG_REGEX
      Regular expression to grep the detected crop parameters from the ffmpeg output. Be aware that the names for the named groups must be present.
      See Also:
    • DEFAULT_CROP_FFMPEG_REGEX

      public static final String DEFAULT_CROP_FFMPEG_REGEX
      See Also:
    • CROP_FFMPEG_MAX_CROPPING_RATIO

      public static final String CROP_FFMPEG_MAX_CROPPING_RATIO
      Regular expression to grep the detected crop parameters from the ffmpeg output. Be aware that the names for the named groups must be present.
      See Also:
    • DEFAULT_CROP_FFMPEG_MAX_CROPPING_RATIO

      public static final Integer DEFAULT_CROP_FFMPEG_MAX_CROPPING_RATIO
  • Constructor Details

    • CropServiceImpl

      public CropServiceImpl()
      Creates a new instance of the startCropping service.
  • Method Details

    • activate

      public void activate(org.osgi.service.component.ComponentContext cc)
      Overrides:
      activate in class org.opencastproject.job.api.AbstractJobProducer
    • process

      protected String process(org.opencastproject.job.api.Job job) throws Exception
      Specified by:
      process in class org.opencastproject.job.api.AbstractJobProducer
      Throws:
      Exception
    • crop

      public org.opencastproject.job.api.Job crop(org.opencastproject.mediapackage.Track track) throws org.opencastproject.crop.api.CropException, org.opencastproject.mediapackage.MediaPackageException
      Specified by:
      crop in interface org.opencastproject.crop.api.CropService
      Throws:
      org.opencastproject.crop.api.CropException
      org.opencastproject.mediapackage.MediaPackageException
      See Also:
      • CropService.crop(org.opencastproject.mediapackage.Track)
    • updated

      public void updated(Dictionary<String,?> dictionary) throws org.osgi.service.cm.ConfigurationException
      Specified by:
      updated in interface org.osgi.service.cm.ManagedService
      Throws:
      org.osgi.service.cm.ConfigurationException
      See Also:
      • ManagedService.updated(java.util.Dictionary)
    • getServiceRegistry

      protected org.opencastproject.serviceregistry.api.ServiceRegistry getServiceRegistry()
      Specified by:
      getServiceRegistry in class org.opencastproject.job.api.AbstractJobProducer
    • getSecurityService

      protected org.opencastproject.security.api.SecurityService getSecurityService()
      Specified by:
      getSecurityService in class org.opencastproject.job.api.AbstractJobProducer
    • getUserDirectoryService

      protected org.opencastproject.security.api.UserDirectoryService getUserDirectoryService()
      Specified by:
      getUserDirectoryService in class org.opencastproject.job.api.AbstractJobProducer
    • getOrganizationDirectoryService

      protected org.opencastproject.security.api.OrganizationDirectoryService getOrganizationDirectoryService()
      Specified by:
      getOrganizationDirectoryService in class org.opencastproject.job.api.AbstractJobProducer
    • setServiceRegistry

      public void setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry)
    • setWorkspace

      public void setWorkspace(org.opencastproject.workspace.api.Workspace workspace)
    • setUserDirectoryService

      public void setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService)
    • setOrganizationDirectoryService

      public void setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService)
    • setSecurityService

      public void setSecurityService(org.opencastproject.security.api.SecurityService securityService)