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

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    protected org.opencastproject.security.api.OrganizationDirectoryService
    The organization directory service
    protected org.opencastproject.security.api.SecurityService
    The security service
    protected org.opencastproject.smil.api.SmilService
     
    protected org.opencastproject.security.api.UserDirectoryService
    The user directory service

    Fields inherited from class org.opencastproject.job.api.AbstractJobProducer

    ACCEPT_JOB_LOADS_EXCEEDING_PROPERTY, acceptJobLoadsExeedingMaxLoad, DEFAULT_ACCEPT_JOB_LOADS_EXCEEDING, executor, jobType

    Fields inherited from interface org.opencastproject.silencedetection.api.SilenceDetectionService

    JOB_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    activate(org.osgi.framework.BundleContext bundleContext, org.osgi.service.component.ComponentContext context)
     
    protected void
    deactivate(org.osgi.service.component.ComponentContext context)
     
    org.opencastproject.job.api.Job
    detect(org.opencastproject.mediapackage.Track sourceTrack)
    org.opencastproject.job.api.Job
    detect(org.opencastproject.mediapackage.Track sourceTrack, org.opencastproject.mediapackage.Track[] referenceTracks)
    protected org.opencastproject.smil.entity.api.Smil
    generateSmil(org.opencastproject.silencedetection.api.MediaSegments segments, List<org.opencastproject.mediapackage.Track> referenceTracks)
    Create a smil from given parameters.
    protected org.opencastproject.security.api.OrganizationDirectoryService
     
    protected org.opencastproject.security.api.SecurityService
     
    protected org.opencastproject.serviceregistry.api.ServiceRegistry
     
    protected org.opencastproject.security.api.UserDirectoryService
     
    protected String
    process(org.opencastproject.job.api.Job job)
     
    protected org.opencastproject.silencedetection.api.MediaSegments
    runDetection(org.opencastproject.mediapackage.Track track)
    Run silence detection on the source track and returns MediaSegments XML as string.
    void
    setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService)
     
    void
    setSecurityService(org.opencastproject.security.api.SecurityService securityService)
     
    void
    setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry)
     
    void
    setSmilService(org.opencastproject.smil.api.SmilService smilService)
     
    void
    setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService)
     
    void
    setWorkspace(org.opencastproject.workspace.api.Workspace workspace)
     

    Methods inherited from class org.opencastproject.job.api.AbstractJobProducer

    acceptJob, activate, countJobs, finallyUpdateJob, getJobType, incident, isReadyToAccept, isReadyToAcceptJobs

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • JOB_LOAD_KEY

      public static final String JOB_LOAD_KEY
      See Also:
    • organizationDirectoryService

      protected org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService
      The organization directory service
    • securityService

      protected org.opencastproject.security.api.SecurityService securityService
      The security service
    • userDirectoryService

      protected org.opencastproject.security.api.UserDirectoryService userDirectoryService
      The 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:
      detect in interface org.opencastproject.silencedetection.api.SilenceDetectionService
      Throws:
      org.opencastproject.silencedetection.api.SilenceDetectionFailedException
      See Also:
      • SilenceDetectionService.detect(org.opencastproject.mediapackage.Track)
    • 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:
      detect in interface org.opencastproject.silencedetection.api.SilenceDetectionService
      Throws:
      org.opencastproject.silencedetection.api.SilenceDetectionFailedException
      See Also:
      • SilenceDetectionService.detect(org.opencastproject.mediapackage.Track, org.opencastproject.mediapackage.Track[])
    • 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:
      process in class org.opencastproject.job.api.AbstractJobProducer
      Throws:
      org.opencastproject.silencedetection.api.SilenceDetectionFailedException
      org.opencastproject.smil.api.SmilException
      org.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 returns MediaSegments XML as string. Source track should have an audio stream. All detected MediaSegments (one or more) are non silent sequences.
      Parameters:
      track - track where to run silence detection
      Returns:
      MediaSegments Xml 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 timestamps
      referenceTracks - 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:
      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
    • 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)