Package io.antmedia.muxer
Class RecordMuxer
java.lang.Object
io.antmedia.muxer.Muxer
io.antmedia.muxer.RecordMuxer
-
Nested Class Summary
Nested classes/interfaces inherited from class io.antmedia.muxer.Muxer
Muxer.VideoBuffer -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Fileprotected Stringprotected intstatic final intprivate Stringprivate longMillisecond timestamp with record muxer initialization.protected StorageClientprotected int[]protected booleanprivate StringFields 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
ConstructorsModifierConstructorDescriptionprotectedRecordMuxer(StorageClient storageClient, io.vertx.core.Vertx vertx, String s3FolderPath) -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleandoesFileExistInS3(StorageClient storageClient, String name) protected voidfinalizeRecordFile(File file) getFinalFileName(boolean isS3Enabled) org.bytedeco.ffmpeg.avformat.AVFormatContextstatic StringgetS3Prefix(String s3FolderPath, String subFolder) getVodId()voidInits the file to write.booleanisCodecSupported(int codecId) booleanprotected booleanprepareAudioOutStream(org.bytedeco.ffmpeg.avformat.AVStream inStream, org.bytedeco.ffmpeg.avformat.AVStream outStream) static voidsaveToStorage(String prefix, File fileToUpload, String fileName, StorageClient storageClient) static voidsaveToStorage(String prefix, File fileToUpload, String fileName, StorageClient storageClient, boolean deleteLocalFile) voidsetFileTmp(File fileTmp) voidsetPreviewPath(String path) voidsetSubfolder(String subFolder) voidvoidThis function may be called by multiple encoders.Methods inherited from class io.antmedia.muxer.Muxer
addAudioStream, addExtradataIfRequired, addStream, addStream, addVideoStream, allocateAVPacket, avNewStream, checkToDropPacket, clearResource, 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, writeAudioFrame, writeDataFrame, writeHeader, writeMetaData, writePacket, writePacket, writePacket, writeVideoBuffer, writeVideoBuffer, writeVideoFrame
-
Field Details
-
fileTmp
-
storageClient
-
resolution
protected int resolution -
uploadMP4ToS3
protected boolean uploadMP4ToS3 -
previewPath
-
S3_CONSTANT
public static final int S3_CONSTANT- See Also:
-
s3FolderPath
-
startTime
private long startTimeMillisecond timestamp with record muxer initialization. It will be define when record muxer is called by anywhere -
vodId
-
SUPPORTED_CODECS
protected int[] SUPPORTED_CODECS
-
-
Constructor Details
-
RecordMuxer
-
-
Method Details
-
isCodecSupported
public boolean isCodecSupported(int codecId) - Specified by:
isCodecSupportedin classMuxer
-
init
Inits the file to write. Multiple encoders can init the muxer. It is redundant to init multiple times. -
getOutputFormatContext
public org.bytedeco.ffmpeg.avformat.AVFormatContext getOutputFormatContext()- Specified by:
getOutputFormatContextin classMuxer
-
prepareAudioOutStream
protected boolean prepareAudioOutStream(org.bytedeco.ffmpeg.avformat.AVStream inStream, org.bytedeco.ffmpeg.avformat.AVStream outStream) -
getOutputURL
- Overrides:
getOutputURLin classMuxer
-
setPreviewPath
-
setFileTmp
-
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:
writeTrailerin classMuxer
-
getS3Prefix
-
getFinalFileName
-
doesFileExistInS3
-
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
- Throws:
IOException
-
isUploadingToS3
public boolean isUploadingToS3() -
getVodId
-
setVodId
-
setSubfolder
- Overrides:
setSubfolderin classMuxer
-