Package org.opencastproject.crop.impl
Class CropServiceImpl
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.crop.impl.CropServiceImpl
- All Implemented Interfaces:
CropService,JobProducer,org.osgi.service.cm.ManagedService
public class CropServiceImpl
extends AbstractJobProducer
implements 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) OSGI activate method.Takes the given track and returns the job that can be used to get the resulting mpeg7 catalogprotected OrganizationDirectoryServiceReturns a reference to the organization directory service.protected SecurityServiceReturns a reference to the security serviceprotected ServiceRegistryReturns a reference to the service registry.protected UserDirectoryServiceReturns a reference to the user directory serviceprotected StringAsks the overriding class to process the arguments using the given operation.voidsetOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) voidsetSecurityService(SecurityService securityService) voidsetServiceRegistry(ServiceRegistry serviceRegistry) voidsetUserDirectoryService(UserDirectoryService userDirectoryService) voidsetWorkspace(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) Description copied from class:AbstractJobProducerOSGI activate method.- Overrides:
activatein classAbstractJobProducer- Parameters:
cc- OSGI component context
-
process
Description copied from class:AbstractJobProducerAsks the overriding class to process the arguments using the given operation. The result will be added to the associated job as the payload.- Specified by:
processin classAbstractJobProducer- Parameters:
job- the job to process- Returns:
- the operation result
- Throws:
Exception
-
crop
Takes the given track and returns the job that can be used to get the resulting mpeg7 catalog- Specified by:
cropin interfaceCropService- Parameters:
track- track to crop- Returns:
- the job with which we can obtain the extracted metadata
- Throws:
CropException- if the track could not be croppedMediaPackageException- if the track is invalid- 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
Description copied from class:AbstractJobProducerReturns a reference to the service registry.- Specified by:
getServiceRegistryin classAbstractJobProducer- Returns:
- the service registry
-
getSecurityService
Description copied from class:AbstractJobProducerReturns a reference to the security service- Specified by:
getSecurityServicein classAbstractJobProducer- Returns:
- the security service
-
getUserDirectoryService
Description copied from class:AbstractJobProducerReturns a reference to the user directory service- Specified by:
getUserDirectoryServicein classAbstractJobProducer- Returns:
- the user directory service
-
getOrganizationDirectoryService
Description copied from class:AbstractJobProducerReturns a reference to the organization directory service.- Specified by:
getOrganizationDirectoryServicein classAbstractJobProducer- Returns:
- the organization directory service
-
setServiceRegistry
-
setWorkspace
-
setUserDirectoryService
-
setOrganizationDirectoryService
public void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) -
setSecurityService
-