Class Mp4Muxer


public class Mp4Muxer extends RecordMuxer
  • Field Details

    • bsfContext

      private org.bytedeco.ffmpeg.avcodec.AVBSFContext bsfContext
    • isAVCConversionRequired

      private boolean isAVCConversionRequired
    • MP4_SUPPORTED_CODECS

      private static int[] MP4_SUPPORTED_CODECS
  • Constructor Details

    • Mp4Muxer

      public Mp4Muxer(StorageClient storageClient, io.vertx.core.Vertx vertx, String s3FolderPath)
  • Method Details

    • addVideoStream

      public boolean addVideoStream(int width, int height, org.bytedeco.ffmpeg.avutil.AVRational timebase, int codecId, int streamIndex, boolean isAVC, org.bytedeco.ffmpeg.avcodec.AVCodecParameters codecpar)
      Add video stream to the muxer with direct parameters. This method is called when there is a WebRTC ingest and there is no adaptive streaming
      Overrides:
      addVideoStream in class Muxer
      Parameters:
      width - , video width
      height - , video height
      codecId - , codec id of the stream
      streamIndex - , stream index
      isAVC - , true if packets are in AVC format, false if in annexb format
      Returns:
      true if successful, false if failed
    • prepareAudioOutStream

      protected boolean prepareAudioOutStream(org.bytedeco.ffmpeg.avformat.AVStream inStream, org.bytedeco.ffmpeg.avformat.AVStream outStream)
      Overrides:
      prepareAudioOutStream in class RecordMuxer
    • remux

      public static void remux(String srcFile, String dstFile, int rotation)
      Parameters:
      srcFile -
      dstFile -
      rotation - clockwise rotation
    • finalizeRecordFile

      protected void finalizeRecordFile(File file) throws IOException
      Overrides:
      finalizeRecordFile in class RecordMuxer
      Throws:
      IOException
    • clearResource

      public void clearResource()
      Overrides:
      clearResource in class Muxer
    • writeAudioFrame

      protected void writeAudioFrame(org.bytedeco.ffmpeg.avcodec.AVPacket pkt, org.bytedeco.ffmpeg.avutil.AVRational inputTimebase, org.bytedeco.ffmpeg.avutil.AVRational outputTimebase, org.bytedeco.ffmpeg.avformat.AVFormatContext context, long dts)
      Overrides:
      writeAudioFrame in class Muxer