Package io.antmedia.muxer
Class Mp4Muxer
java.lang.Object
io.antmedia.muxer.Muxer
io.antmedia.muxer.RecordMuxer
io.antmedia.muxer.Mp4Muxer
-
Nested Class Summary
Nested classes/interfaces inherited from class io.antmedia.muxer.Muxer
Muxer.VideoBuffer
-
Field Summary
Modifier and TypeFieldDescriptionprivate org.bytedeco.ffmpeg.avcodec.AVBSFContext
private boolean
private static int[]
Fields inherited from class io.antmedia.muxer.RecordMuxer
fileTmp, previewPath, resolution, storageClient, SUPPORTED_CODECS, uploadMP4ToS3
Fields inherited from class io.antmedia.muxer.Muxer
audioPkt, avRationalTimeBase, BITSTREAM_FILTER_H264_MP4TOANNEXB, BITSTREAM_FILTER_HEVC_MP4TOANNEXB, bsfAudioFilterContextList, bsfFilterContextList, bsfVideoNames, DATE_TIME_PATTERN, extension, file, firstAudioDts, firstKeyFrameReceived, firstVideoDts, format, headerWritten, initialResourceNameWithoutExtension, inputOutputStreamIndexMap, inputTimeBaseMap, isInitialized, isRunning, logger, loggerStatic, optionDictionary, options, outputFormatContext, registeredStreamIndexList, rotation, scope, SEGMENT_INDEX_LENGTH, streamId, subFolder, TEMP_EXTENSION, time2log, tmpPacket, vertx, videoExtradata, videoHeight, videoPkt, videoWidth
-
Constructor Summary
ConstructorDescriptionMp4Muxer
(StorageClient storageClient, io.vertx.core.Vertx vertx, String s3FolderPath) -
Method Summary
Modifier and TypeMethodDescriptionboolean
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.void
protected void
finalizeRecordFile
(File file) protected boolean
prepareAudioOutStream
(org.bytedeco.ffmpeg.avformat.AVStream inStream, org.bytedeco.ffmpeg.avformat.AVStream outStream) static void
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) Methods inherited from class io.antmedia.muxer.RecordMuxer
getFinalFileName, getOutputFormatContext, getOutputURL, getS3Prefix, getVodId, init, isCodecSupported, isUploadingToS3, saveToStorage, saveToStorage, setFileTmp, setPreviewPath, setSubfolder, setVodId, writeTrailer
Methods inherited from class io.antmedia.muxer.Muxer
addAudioStream, addExtradataIfRequired, addStream, addStream, avNewStream, checkToDropPacket, contextChanged, contextWillChange, getAppAdaptor, getAppSettings, getAudioNotWrittenCount, getAverageBitrate, getBitStreamFilter, getBsfAudioNames, getCurrentVoDTimeStamp, getDurationInMs, getDurationInMs, getErrorDefinition, getExtendedName, getFile, getFileName, getFormat, getInputTimeBaseMap, getIsRunning, getLastPts, getOptionDictionary, getPacketBufferWithExtradata, getPreviewFile, getRecordFile, getRegisteredStreamIndexList, getResolution, getResourceFile, getSubFolder, getTmpPacket, getUserRecordFile, getVideoCodecId, getVideoHeight, getVideoNotWrittenCount, getVideoWidth, init, initAudioBitstreamFilter, initVideoBitstreamFilter, isAddDateTimeToSourceName, logPacketIssue, openIO, prepareIO, replaceDoubleSlashesWithSingleSlash, setAddDateTimeToSourceName, setAudioBitreamFilter, setBitstreamFilter, setCurrentVoDTimeStamp, setIsRunning, setOption, writeAudioBuffer, writeDataFrame, writeHeader, writeMetaData, writePacket, writePacket, writePacket, writeVideoBuffer, writeVideoBuffer, writeVideoFrame
-
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
-
-
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 classMuxer
- Parameters:
width
- , video widthheight
- , video heightcodecId
- , codec id of the streamstreamIndex
- , stream indexisAVC
- , 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 classRecordMuxer
-
remux
- Parameters:
srcFile
-dstFile
-rotation
- clockwise rotation
-
finalizeRecordFile
- Overrides:
finalizeRecordFile
in classRecordMuxer
- Throws:
IOException
-
clearResource
public void clearResource()- Overrides:
clearResource
in classMuxer
-
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 classMuxer
-