Class RecordMuxer

java.lang.Object
io.antmedia.muxer.Muxer
io.antmedia.muxer.RecordMuxer
Direct Known Subclasses:
Mp4Muxer, WebMMuxer

public abstract class RecordMuxer extends Muxer
  • Field Details

    • fileTmp

      protected File fileTmp
    • storageClient

      protected StorageClient storageClient
    • resolution

      protected int resolution
    • uploadMP4ToS3

      protected boolean uploadMP4ToS3
    • previewPath

      protected String previewPath
    • S3_CONSTANT

      private static final int S3_CONSTANT
      See Also:
    • s3FolderPath

      private String s3FolderPath
    • startTime

      private long startTime
      Millisecond timestamp with record muxer initialization. It will be define when record muxer is called by anywhere
    • vodId

      private String vodId
    • SUPPORTED_CODECS

      protected int[] SUPPORTED_CODECS
  • Constructor Details

    • RecordMuxer

      protected RecordMuxer(StorageClient storageClient, io.vertx.core.Vertx vertx, String s3FolderPath)
  • Method Details

    • isCodecSupported

      public boolean isCodecSupported(int codecId)
      Specified by:
      isCodecSupported in class Muxer
    • init

      public void init(IScope scope, String name, int resolutionHeight, String subFolder, int bitrate)
      Inits the file to write. Multiple encoders can init the muxer. It is redundant to init multiple times.
      Overrides:
      init in class Muxer
    • getOutputFormatContext

      public org.bytedeco.ffmpeg.avformat.AVFormatContext getOutputFormatContext()
      Specified by:
      getOutputFormatContext in class Muxer
    • prepareAudioOutStream

      protected boolean prepareAudioOutStream(org.bytedeco.ffmpeg.avformat.AVStream inStream, org.bytedeco.ffmpeg.avformat.AVStream outStream)
    • getOutputURL

      public String getOutputURL()
      Overrides:
      getOutputURL in class Muxer
    • setPreviewPath

      public void setPreviewPath(String path)
    • setFileTmp

      public void setFileTmp(File fileTmp)
    • writeTrailer

      public void writeTrailer()
      This function may be called by multiple encoders. Make sure that it is called once. See the sample implementations how it is being protected Implement this function with synchronized keyword as the subclass
      Overrides:
      writeTrailer in class Muxer
    • getS3Prefix

      public static String getS3Prefix(String s3FolderPath, String subFolder)
    • getFinalFileName

      public File getFinalFileName(boolean isS3Enabled)
    • doesFileExistInS3

      private static boolean doesFileExistInS3(StorageClient storageClient, String name)
    • saveToStorage

      public static void saveToStorage(String prefix, File fileToUpload, String fileName, StorageClient storageClient)
    • saveToStorage

      public static void saveToStorage(String prefix, File fileToUpload, String fileName, StorageClient storageClient, boolean deleteLocalFile)
    • finalizeRecordFile

      protected void finalizeRecordFile(File file) throws IOException
      Throws:
      IOException
    • isUploadingToS3

      public boolean isUploadingToS3()
    • getVodId

      public String getVodId()
    • setVodId

      public void setVodId(String vodId)
    • setSubfolder

      public void setSubfolder(String subFolder)
      Overrides:
      setSubfolder in class Muxer