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
Modifier and TypeFieldDescriptionprotected File
protected String
protected int
private static final int
private String
private long
Millisecond timestamp with record muxer initialization.protected StorageClient
protected int[]
protected boolean
private String
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
ModifierConstructorDescriptionprotected
RecordMuxer
(StorageClient storageClient, io.vertx.core.Vertx vertx, String s3FolderPath) -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
doesFileExistInS3
(StorageClient storageClient, String name) protected void
finalizeRecordFile
(File file) getFinalFileName
(boolean isS3Enabled) org.bytedeco.ffmpeg.avformat.AVFormatContext
static String
getS3Prefix
(String s3FolderPath, String subFolder) getVodId()
void
Inits the file to write.boolean
isCodecSupported
(int codecId) boolean
protected boolean
prepareAudioOutStream
(org.bytedeco.ffmpeg.avformat.AVStream inStream, org.bytedeco.ffmpeg.avformat.AVStream outStream) static void
saveToStorage
(String prefix, File fileToUpload, String fileName, StorageClient storageClient) static void
saveToStorage
(String prefix, File fileToUpload, String fileName, StorageClient storageClient, boolean deleteLocalFile) void
setFileTmp
(File fileTmp) void
setPreviewPath
(String path) void
setSubfolder
(String subFolder) void
void
This function may be called by multiple encoders.Methods inherited from class io.antmedia.muxer.Muxer
addAudioStream, addExtradataIfRequired, addStream, addStream, addVideoStream, avNewStream, checkToDropPacket, clearResource, 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, 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
private 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:
isCodecSupported
in 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:
getOutputFormatContext
in classMuxer
-
prepareAudioOutStream
protected boolean prepareAudioOutStream(org.bytedeco.ffmpeg.avformat.AVStream inStream, org.bytedeco.ffmpeg.avformat.AVStream outStream) -
getOutputURL
- Overrides:
getOutputURL
in 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:
writeTrailer
in 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:
setSubfolder
in classMuxer
-