Class SilenceDetectionServiceImpl
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.silencedetection.impl.SilenceDetectionServiceImpl
- All Implemented Interfaces:
JobProducer,SilenceDetectionService
public class SilenceDetectionServiceImpl
extends AbstractJobProducer
implements SilenceDetectionService
Implementation of SilenceDetectionService using FFmpeg.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected OrganizationDirectoryServiceThe organization directory serviceprotected SecurityServiceThe security serviceprotected SmilServiceprotected UserDirectoryServiceThe user directory serviceFields 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.silencedetection.api.SilenceDetectionService
JOB_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.framework.BundleContext bundleContext, org.osgi.service.component.ComponentContext context) protected voiddeactivate(org.osgi.service.component.ComponentContext context) Run silence detection on audio (visual) file.Run silence detection on audio (visual) file.protected SmilgenerateSmil(MediaSegments segments, List<Track> referenceTracks) Create a smil from given parameters.protected 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.protected MediaSegmentsrunDetection(Track track) Run silence detection on the source track and returnsMediaSegmentsXML as string.voidsetOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) voidsetSecurityService(SecurityService securityService) voidsetServiceRegistry(ServiceRegistry serviceRegistry) voidsetSmilService(SmilService smilService) voidsetUserDirectoryService(UserDirectoryService userDirectoryService) voidsetWorkspace(Workspace workspace) Methods inherited from class org.opencastproject.job.api.AbstractJobProducer
acceptJob, activate, countJobs, finallyUpdateJob, getJobType, incident, isReadyToAccept, isReadyToAcceptJobs
-
Field Details
-
JOB_LOAD_KEY
- See Also:
-
organizationDirectoryService
The organization directory service -
securityService
The security service -
userDirectoryService
The user directory service -
smilService
-
-
Constructor Details
-
SilenceDetectionServiceImpl
public SilenceDetectionServiceImpl()
-
-
Method Details
-
detect
Run silence detection on audio (visual) file.- Specified by:
detectin interfaceSilenceDetectionService- Parameters:
sourceTrack- track to detect non silent segments from- Returns:
- Job detection job
- Throws:
SilenceDetectionFailedException- if fails- See Also:
-
detect
public Job detect(Track sourceTrack, Track[] referenceTracks) throws SilenceDetectionFailedException Run silence detection on audio (visual) file.- Specified by:
detectin interfaceSilenceDetectionService- Parameters:
sourceTrack- track to detect non silent segments fromreferenceTracks- tracks to reference in smil file instead of sourceTrack- Returns:
- Job detection job
- Throws:
SilenceDetectionFailedException- if fails- See Also:
-
process
protected String process(Job job) throws SilenceDetectionFailedException, SmilException, MediaPackageException 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:
SilenceDetectionFailedExceptionSmilExceptionMediaPackageException
-
runDetection
Run silence detection on the source track and returnsMediaSegmentsXML as string. Source track should have an audio stream. All detectedMediaSegments (one or more) are non silent sequences.- Parameters:
track- track where to run silence detection- Returns:
MediaSegmentsXml as String- Throws:
SilenceDetectionFailedException- if an error occures
-
generateSmil
protected Smil generateSmil(MediaSegments segments, List<Track> referenceTracks) throws SmilException Create a smil from given parameters.- Parameters:
segments- media segment list with timestampsreferenceTracks- tracks to put as media segment source files- Returns:
- generated smil
- Throws:
SmilException- if smil creation failed
-
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
-
activate
public void activate(org.osgi.framework.BundleContext bundleContext, org.osgi.service.component.ComponentContext context) -
deactivate
protected void deactivate(org.osgi.service.component.ComponentContext context) -
setServiceRegistry
-
setWorkspace
-
setSecurityService
-
setUserDirectoryService
-
setOrganizationDirectoryService
public void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectoryService) -
setSmilService
-