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
FieldsModifier and TypeFieldDescriptionprivate org.bytedeco.ffmpeg.avcodec.AVBSFContextprivate booleanprivate static int[]Fields inherited from class io.antmedia.muxer.RecordMuxer
fileTmp, previewPath, resolution, S3_CONSTANT, storageClient, SUPPORTED_CODECS, uploadMP4ToS3Fields 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, initialResourceNameOverride, 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
ConstructorsConstructorDescriptionMp4Muxer(StorageClient storageClient, io.vertx.core.Vertx vertx, String s3FolderPath) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddVideoStream(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.voidprotected voidfinalizeRecordFile(File file) protected booleanprepareAudioOutStream(org.bytedeco.ffmpeg.avformat.AVStream inStream, org.bytedeco.ffmpeg.avformat.AVStream outStream) static voidprotected voidwriteAudioFrame(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, writeTrailerMethods inherited from class io.antmedia.muxer.Muxer
addAudioStream, addExtradataIfRequired, addStream, addStream, allocateAVPacket, avNewStream, checkToDropPacket, contextChanged, contextChanged, contextWillChange, contextWillChange, getAppAdaptor, getAppSettings, getAudioNotWrittenCount, getAverageBitrate, getBitStreamFilter, getBsfAudioNames, getBsfFilterContextList, getCurrentVoDTimeStamp, getDurationInMs, getDurationInMs, getErrorDefinition, getExtendedName, getFile, getFileName, getFormat, getInputTimeBaseMap, getIsRunning, getLastPts, getOptionDictionary, getPacketBufferWithExtradata, getPreviewFile, getRecordFile, getRegisteredStreamIndexList, getResolution, getResourceFile, getSubFolder, getTmpPacket, getUserRecordFile, getVideoCodecId, getVideoExtradata, getVideoHeight, getVideoNotWrittenCount, getVideoWidth, init, initAudioBitstreamFilter, initVideoBitstreamFilter, isAddDateTimeToSourceName, logPacketIssue, openIO, prepareIO, replaceDoubleSlashesWithSingleSlash, setAddDateTimeToSourceName, setAudioBitreamFilter, setBitstreamFilter, setCurrentVoDTimeStamp, setFormat, setInitialResourceNameOverride, setIsRunning, setOption, setStreamId, 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:
addVideoStreamin 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:
prepareAudioOutStreamin classRecordMuxer
-
remux
- Parameters:
srcFile-dstFile-rotation- clockwise rotation
-
finalizeRecordFile
- Overrides:
finalizeRecordFilein classRecordMuxer- Throws:
IOException
-
clearResource
public void clearResource()- Overrides:
clearResourcein 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:
writeAudioFramein classMuxer
-