Package org.opencastproject.crop.impl
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 Summary
FieldsModifier and TypeFieldDescriptionprotected StringPath to the executablestatic final StringResulting collection in the working file repositorystatic final StringThe threshold of greyscale to use for croppingstatic final StringRegular expression to grep the detected crop parameters from the ffmpeg output.static final StringAdditional parameters that will be added to the ffmpeg command linestatic final StringRegular expression to grep the detected crop parameters from the ffmpeg output.static final StringThe counter that determines after how many frames cropdetect will be executed againstatic final StringThe value which the width/height should be divisible bystatic final StringFile extension for the resulting cropped videostatic final StringThe key to look for in the service configuration file to override the DEFAULT_CROP_JOB_LOADstatic final Integerstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final floatThe load introduced on the system by creating a caption jobstatic final Stringstatic final StringFields inherited from class org.opencastproject.job.api.AbstractJobProducer
ACCEPT_JOB_LOADS_EXCEEDING_PROPERTY, acceptJobLoadsExeedingMaxLoad, DEFAULT_ACCEPT_JOB_LOADS_EXCEEDING, executor, jobTypeFields inherited from interface org.opencastproject.crop.api.CropService
JOB_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext cc) org.opencastproject.job.api.Jobcrop(org.opencastproject.mediapackage.Track track) protected org.opencastproject.security.api.OrganizationDirectoryServiceprotected org.opencastproject.security.api.SecurityServiceprotected org.opencastproject.serviceregistry.api.ServiceRegistryprotected org.opencastproject.security.api.UserDirectoryServiceprotected Stringprocess(org.opencastproject.job.api.Job job) voidsetOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService) voidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) voidsetServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry) voidsetUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService) voidsetWorkspace(org.opencastproject.workspace.api.Workspace workspace) voidupdated(Dictionary<String, ?> dictionary) Methods inherited from class org.opencastproject.job.api.AbstractJobProducer
acceptJob, countJobs, finallyUpdateJob, getJobType, incident, isReadyToAccept, isReadyToAcceptJobs
-
Field Details
-
COLLECTION_ID
Resulting collection in the working file repository- See Also:
-
binary
Path to the executable -
FFMPEG_BINARY_CONFIG
- See Also:
-
FFMPEG_BINARY_DEFAULT
- See Also:
-
DEFAULT_CROP_JOB_LOAD
public static final float DEFAULT_CROP_JOB_LOADThe load introduced on the system by creating a caption job- See Also:
-
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
The threshold of greyscale to use for cropping- See Also:
-
DEFAULT_CROP_GREYSCALE_LIMIT
- See Also:
-
CROP_FFMPEG_ROUND
The value which the width/height should be divisible by- See Also:
-
DEFAULT_CROP_FFMPEG_ROUND
- See Also:
-
CROP_FFMPEG_RESET
The counter that determines after how many frames cropdetect will be executed again- See Also:
-
DEFAULT_CROP_FFMPEG_RESET
- See Also:
-
CROP_FFMPEG_PARAM
Additional parameters that will be added to the ffmpeg command line- See Also:
-
DEFAULT_CROP_FFMPEG_PARAM
- See Also:
-
CROP_FFMPEG_TARGET_EXTENSION
File extension for the resulting cropped video- See Also:
-
DEFAULT_CROP_FFMPEG_TARGET_EXTENSION
- See Also:
-
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
- See Also:
-
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
-
-
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:
activatein classorg.opencastproject.job.api.AbstractJobProducer
-
process
- Specified by:
processin classorg.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:
cropin interfaceorg.opencastproject.crop.api.CropService- Throws:
org.opencastproject.crop.api.CropExceptionorg.opencastproject.mediapackage.MediaPackageException- See Also:
-
updated
public void updated(Dictionary<String, ?> dictionary) throws org.osgi.service.cm.ConfigurationException- Specified by:
updatedin interfaceorg.osgi.service.cm.ManagedService- Throws:
org.osgi.service.cm.ConfigurationException- See Also:
-
getServiceRegistry
protected org.opencastproject.serviceregistry.api.ServiceRegistry getServiceRegistry()- Specified by:
getServiceRegistryin classorg.opencastproject.job.api.AbstractJobProducer
-
getSecurityService
protected org.opencastproject.security.api.SecurityService getSecurityService()- Specified by:
getSecurityServicein classorg.opencastproject.job.api.AbstractJobProducer
-
getUserDirectoryService
protected org.opencastproject.security.api.UserDirectoryService getUserDirectoryService()- Specified by:
getUserDirectoryServicein classorg.opencastproject.job.api.AbstractJobProducer
-
getOrganizationDirectoryService
protected org.opencastproject.security.api.OrganizationDirectoryService getOrganizationDirectoryService()- Specified by:
getOrganizationDirectoryServicein classorg.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)
-