Class SilenceDetectionServiceImpl
java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.silencedetection.impl.SilenceDetectionServiceImpl
- All Implemented Interfaces:
org.opencastproject.job.api.JobProducer,org.opencastproject.silencedetection.api.SilenceDetectionService
public class SilenceDetectionServiceImpl
extends org.opencastproject.job.api.AbstractJobProducer
implements org.opencastproject.silencedetection.api.SilenceDetectionService
Implementation of SilenceDetectionService using FFmpeg.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected org.opencastproject.security.api.OrganizationDirectoryServiceThe organization directory serviceprotected org.opencastproject.security.api.SecurityServiceThe security serviceprotected org.opencastproject.smil.api.SmilServiceprotected org.opencastproject.security.api.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) org.opencastproject.job.api.Jobdetect(org.opencastproject.mediapackage.Track sourceTrack) org.opencastproject.job.api.Jobdetect(org.opencastproject.mediapackage.Track sourceTrack, org.opencastproject.mediapackage.Track[] referenceTracks) protected org.opencastproject.smil.entity.api.SmilgenerateSmil(org.opencastproject.silencedetection.api.MediaSegments segments, List<org.opencastproject.mediapackage.Track> referenceTracks) Create a smil from given parameters.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) protected org.opencastproject.silencedetection.api.MediaSegmentsrunDetection(org.opencastproject.mediapackage.Track track) Run silence detection on the source track and returnsMediaSegmentsXML as string.voidsetOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService) voidsetSecurityService(org.opencastproject.security.api.SecurityService securityService) voidsetServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry) voidsetSmilService(org.opencastproject.smil.api.SmilService smilService) voidsetUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService) voidsetWorkspace(org.opencastproject.workspace.api.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
protected org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryServiceThe organization directory service -
securityService
protected org.opencastproject.security.api.SecurityService securityServiceThe security service -
userDirectoryService
protected org.opencastproject.security.api.UserDirectoryService userDirectoryServiceThe user directory service -
smilService
protected org.opencastproject.smil.api.SmilService smilService
-
-
Constructor Details
-
SilenceDetectionServiceImpl
public SilenceDetectionServiceImpl()
-
-
Method Details
-
detect
public org.opencastproject.job.api.Job detect(org.opencastproject.mediapackage.Track sourceTrack) throws org.opencastproject.silencedetection.api.SilenceDetectionFailedException - Specified by:
detectin interfaceorg.opencastproject.silencedetection.api.SilenceDetectionService- Throws:
org.opencastproject.silencedetection.api.SilenceDetectionFailedException- See Also:
-
detect
public org.opencastproject.job.api.Job detect(org.opencastproject.mediapackage.Track sourceTrack, org.opencastproject.mediapackage.Track[] referenceTracks) throws org.opencastproject.silencedetection.api.SilenceDetectionFailedException - Specified by:
detectin interfaceorg.opencastproject.silencedetection.api.SilenceDetectionService- Throws:
org.opencastproject.silencedetection.api.SilenceDetectionFailedException- See Also:
-
process
protected String process(org.opencastproject.job.api.Job job) throws org.opencastproject.silencedetection.api.SilenceDetectionFailedException, org.opencastproject.smil.api.SmilException, org.opencastproject.mediapackage.MediaPackageException - Specified by:
processin classorg.opencastproject.job.api.AbstractJobProducer- Throws:
org.opencastproject.silencedetection.api.SilenceDetectionFailedExceptionorg.opencastproject.smil.api.SmilExceptionorg.opencastproject.mediapackage.MediaPackageException
-
runDetection
protected org.opencastproject.silencedetection.api.MediaSegments runDetection(org.opencastproject.mediapackage.Track track) throws org.opencastproject.silencedetection.api.SilenceDetectionFailedException 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:
org.opencastproject.silencedetection.api.SilenceDetectionFailedException- if an error occures
-
generateSmil
protected org.opencastproject.smil.entity.api.Smil generateSmil(org.opencastproject.silencedetection.api.MediaSegments segments, List<org.opencastproject.mediapackage.Track> referenceTracks) throws org.opencastproject.smil.api.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:
org.opencastproject.smil.api.SmilException- if smil creation failed
-
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
-
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
public void setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry) -
setWorkspace
public void setWorkspace(org.opencastproject.workspace.api.Workspace workspace) -
setSecurityService
public void setSecurityService(org.opencastproject.security.api.SecurityService securityService) -
setUserDirectoryService
public void setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService) -
setOrganizationDirectoryService
public void setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService) -
setSmilService
public void setSmilService(org.opencastproject.smil.api.SmilService smilService)
-