Package io.antmedia.muxer
Class MuxAdaptor
java.lang.Object
io.antmedia.muxer.MuxAdaptor
- All Implemented Interfaces:
IEndpointStatusListener,IStreamListener,IRecordingListener
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longstatic final String(package private) List<EncoderSettings>protected booleanprivate IAntMediaStreamHandlerprotected AppSettingsprotected org.bytedeco.ffmpeg.avcodec.AVCodecParametersprivate byte[]private org.bytedeco.javacpp.BytePointerprotected intprivate org.bytedeco.ffmpeg.avutil.AVRationalprivate booleanMux adaptor is generally used in RTMP.private Broadcastprotected ClientBroadcastStreamprivate longprivate AtomicBooleanAccessed from multiple threads so make it volatileprivate longThe time when buffering has been finished.private intprivate ConcurrentSkipListSet<IStreamPacket>private longprotected org.bytedeco.ffmpeg.avutil.AVChannelLayoutprivate longprivate static final intprotected Stringprotected MuxerIt's defined here because EncoderAdaptor should access it directly to add new streams.protected booleanprotected Stringprotected Stringprotected DataStoreprivate intprotected booleanprotected booleanprivate booleanprivate longprotected booleanprotected booleanprotected List<EncoderSettings>private ConcurrentHashMap<String,String> private AtomicLongprotected ConcurrentHashMap<String,Integer> (package private) booleanprivate booleanBy default first video key frame should be checked and below flag should be set to true If first video key frame should not be checked, then below should be flag in advanceprivate longprivate int(package private) booleanprivate intprotected booleanprotected intprotected intprotected Stringprotected booleanprotected Stringprotected Stringprivate AtomicBooleanprotected ConcurrentHashMap<String,Boolean> protected AtomicBooleanprotected AtomicBooleanprotected static booleanprotected intprivate longprivate intprivate longprotected longprivate longprivate longprivate longprivate longprivate doubleprivate static org.slf4j.Loggerprivate intprivate booleanprotected booleanprivate intprotected PacketFeederprivate longprivate Deque<MuxAdaptor.PacketTime>Packet times in ordered way to calculate streaming health Key is the packet ime Value is the system time at that momentprivate intprivate intprotected booleanprivate AtomicIntegerstatic final intstatic final intstatic final intprotected ConcurrentHashMap<String,Integer> protected intprotected IScopeprotected ServerSettingsprivate longstatic final intprotected ConcurrentHashMap<String,String> private booleanprotected StorageClientprotected Stringprotected ConcurrentLinkedQueue<IStreamPacket>protected org.bytedeco.ffmpeg.avformat.AVFormatContextprotected Stringstatic final org.bytedeco.ffmpeg.avutil.AVRationalHelper field to get the timebase for milliseconds Pay attention: Use them in basic conversions(av_rescale), do not use them by giving directly to the Muxers, Encoders as Timebase because Muxers and Encoders can close the timebase and we'll get error For muxers, encoders, use the gettimebaseForMs() methodprivate longprotected intprotected longprotected io.vertx.core.Vertxprivate intprivate org.bytedeco.ffmpeg.avcodec.AVCodecParametersprivate byte[]private org.bytedeco.javacpp.BytePointerprivate intprivate org.bytedeco.ffmpeg.avutil.AVRationalprotected static final longprotected booleanprotected booleanprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBufferQueue(IStreamPacket packet) booleanaddID3Data(String data) private Muxerbooleanbooleanprotected booleanaddMuxerInternal(Muxer muxer) voidaddPacketListener(IPacketListener listener) booleanaddSEIData(String data) voidaddStream2Muxers(org.bytedeco.ffmpeg.avcodec.AVCodecParameters codecParameters, org.bytedeco.ffmpeg.avutil.AVRational rat, int streamIndex) voidaudioBufferReceived(long dts, ByteBuffer byteBuffer) voidvoidCheck if max analyze time has been passed.voidvoidclearCounterMapsAndCancelTimer(String url, Long id) voidvoidlongcorrectPacketDtsOverflow(long packetDts) voiddebugSetStopRequestExist(boolean stopRequest) booleanThis method means that if the MuxAdaptor writes incoming packets to muxers(muxerList) directly without any StreamAdaptor/Encoders It's true for RTMP, SRT ingest to MP4, HLS, RTMP Endpoint writing but it's not true WebRTC ingest.protected voidvoidprotected voidvoidPeriodically check the endpoint health status every 2 seconds If each check returned failed, try to republish to the endpointvoidendpointStatusUpdated(String url, String status) It's called when the endpoint status is updatedvoidexecute()findDynamicRecordMuxer(RecordType recordType) longstatic byte[]getAnnexbExtradata(byte[] avcExtradata) org.bytedeco.ffmpeg.avcodec.AVCodecParametersprivate voidgetAudioDataConf(IStreamCodecInfo codecInfo) intorg.bytedeco.ffmpeg.avutil.AVRationallongintintNumber of frames dropped in the encodingintNumber of packets dropped in the ingestionlongintNumber of frames waiting to be encoded.getEndpointMuxer(String rtmpUrl) static StringgetExtendedSubfolder(String mainTrackId, String streamId, String subFolder) intintlongintdoubleorg.json.simple.JSONObjectgetMetaData(Notify notifyEvent) intprivate StringgetParametersAsJson(Map<String, String> parameters) intintstatic StringgetStreamType(int codecType) static StringgetSubfolder(Broadcast broadcast, AppSettings appSettings) static org.bytedeco.ffmpeg.avutil.AVRationallongio.vertx.core.VertxgetVertx()intorg.bytedeco.ffmpeg.avcodec.AVCodecParametersvoidgetVideoDataConf(IStreamCodecInfo codecInfo) intorg.bytedeco.ffmpeg.avutil.AVRationalintgetWidth()booleaninit(IConnection conn, String name, boolean isAppend) Initialize the listener.booleanInitialize the listener.static MuxAdaptorinitializeMuxAdaptor(ClientBroadcastStream clientBroadcastStream, Broadcast broadcast, boolean isSource, IScope scope) protected voidvoidprivate voidbooleanisAlreadyRecording(RecordType recordType, int resolutionHeight) booleanbooleanisAvc()booleanisBlacklistCodec(int codecId) booleanbooleanbooleanbooleanstatic booleanisEncoderAdaptorShouldBeTried(Broadcast broadcast, AppSettings appSettings) booleanbooleanbooleanbooleanbooleanprivate voidmeasureIngestTime(long pktTimeStamp, long receivedTime) org.json.simple.JSONObjectnotifyMetaDataReceived(IStreamPacket packet, long dts) voidpacketReceived(IBroadcastStream stream, IStreamPacket packet) A packet has been received from a stream.booleanprepare()Prepares the parameters.booleanprepareFromInputFormatContext(org.bytedeco.ffmpeg.avformat.AVFormatContext inputFormatContext) Prepares parameters and muxers.booleanprepareMuxer(Muxer muxer, int resolutionHeight) voidprivate voidvoidregisterToMainTrackIfExists(String mainTrack) booleanremoveMuxer(Muxer muxer) booleanremovePacketListener(IPacketListener listener) voidvoidsetAppSettings(AppSettings appSettings) voidsetAudioCodecParameter(org.bytedeco.ffmpeg.avcodec.AVCodecParameters audioCodecParameters) voidsetAudioDataConf(byte[] audioDataConf) voidsetAudioStreamIndex(int audioStreamIndex) voidsetAudioTimeBase(org.bytedeco.ffmpeg.avutil.AVRational audioTimeBase) voidsetAvc(boolean avc) voidsetBroadcast(Broadcast broadcast) voidsetBroadcastMetaData(Map<String, String> parameters) voidsetBuffering(boolean buffering) voidsetBufferingFinishTimeMs(long bufferingFinishTimeMs) voidsetBufferTimeMs(long bufferTimeMs) voidsetDeleteDASHFilesOnExit(boolean deleteDASHFilesOnExit) voidsetDirectMuxingSupported(boolean directMuxingSupported) voidsetDurationMs(long durationMs) voidsetEnableAudio(boolean enableAudio) voidsetEnableVideo(boolean enableVideo) voidsetEncoderSettingsList(List<EncoderSettings> encoderSettingsList) voidsetFileConsumer(FileConsumer recordingConsumer) voidsetFileName(String fileName) voidsetFirstKeyFrameReceivedChecked(boolean firstKeyFrameReceivedChecked) Setter forfirstKeyFrameReceivedCheckedvoidsetGeneratePreview(boolean generatePreview) voidsetHeight(int height) voidsetHLSFilesDeleteOnExit(boolean deleteHLSFilesOnExit) voidsetInputQueueSize(int size) voidsetIsRecording(boolean isRecording) voidsetLastFrameTimestamp(int lastFrameTimestamp) voidsetPacketFeeder(PacketFeeder packetFeeder) voidsetPreviewCreatePeriod(int previewCreatePeriod) voidsetPreviewHeight(int previewHeight) voidsetPreviewOverwrite(boolean overwrite) voidvoidsetStartTime(long startTime) voidsetStorageClient(StorageClient storageClient) voidsetStreamId(String streamId) voidsetStreamSource(boolean isStreamSource) voidsetTotalByteReceived(long totalByteReceived) static voidsetUpEndPoints(MuxAdaptor muxAdaptor, Broadcast broadcast, io.vertx.core.Vertx vertx) voidsetVideoCodecParameter(org.bytedeco.ffmpeg.avcodec.AVCodecParameters videoCodecParameters) voidsetVideoDataConf(byte[] videoDataConf) voidsetVideoStreamIndex(int videoStreamIndex) voidsetVideoTimeBase(org.bytedeco.ffmpeg.avutil.AVRational videoTimeBase) voidsetWebRTCEnabled(boolean webRTCEnabled) voidsetWidth(int width) voidstart()Start the recording.startEndpointStreaming(String endpointUrl, int resolutionHeight) startRecording(RecordType recordType, int resolutionHeight) Start recording is used to start recording on the fly(stream is broadcasting).startRecording(RecordType recordType, int resolutionHeight, String baseFileName) private RecordMuxerstartRecordingInternal(RecordType recordType, int resolutionHeight, String baseFileName) voidstop(boolean shutdownCompletely) Stop the recording.stopEndpointStreaming(String endpointUrl, int resolutionHeight) stopRecording(RecordType recordType, int resolutionHeight) Stop recording is called to stop recording when the stream is broadcasting(on the fly)private voidtryToRepublish(String url, Long id) private voidvoidupdateQualityParameters(long pts, org.bytedeco.ffmpeg.avutil.AVRational timebase, long packetSize, boolean isKeyFrame) voidupdateStreamQualityParameters(String streamId, double speed) voidvideoBufferReceived(long dts, boolean isKeyFrame, long pts, ByteBuffer byteBuffer) private voidvoidThis method is called when rtmpIngestBufferTime is bigger than zerovoidwritePacket(org.bytedeco.ffmpeg.avformat.AVStream stream, org.bytedeco.ffmpeg.avcodec.AVPacket pkt) voidwriteStreamPacket(IStreamPacket packet) This is the entrance points for the packet coming from the RTMP stream.void
-
Field Details
-
STAT_UPDATE_PERIOD_MS
public static final int STAT_UPDATE_PERIOD_MS- See Also:
-
ADAPTIVE_SUFFIX
- See Also:
-
logger
private static org.slf4j.Logger logger -
streamPacketQueue
-
isPipeReaderJobRunning
-
isBufferedWriterRunning
-
muxerList
-
deleteHLSFilesOnExit
protected boolean deleteHLSFilesOnExit -
deleteDASHFilesOnExit
protected boolean deleteDASHFilesOnExit -
videoStreamIndex
private int videoStreamIndex -
audioStreamIndex
protected int audioStreamIndex -
dataStreamIndex
private int dataStreamIndex -
previewOverwrite
protected boolean previewOverwrite -
enableVideo
protected volatile boolean enableVideo -
enableAudio
protected volatile boolean enableAudio -
firstAudioPacketSkipped
boolean firstAudioPacketSkipped -
firstVideoPacketSkipped
boolean firstVideoPacketSkipped -
packetPollerId
private long packetPollerId -
bufferQueue
-
stopRequestExist
private volatile boolean stopRequestExist -
RECORDING_ENABLED_FOR_STREAM
public static final int RECORDING_ENABLED_FOR_STREAM- See Also:
-
RECORDING_DISABLED_FOR_STREAM
public static final int RECORDING_DISABLED_FOR_STREAM- See Also:
-
RECORDING_NO_SET_FOR_STREAM
public static final int RECORDING_NO_SET_FOR_STREAM- See Also:
-
WAIT_TIME_MILLISECONDS
protected static final long WAIT_TIME_MILLISECONDS- See Also:
-
isRecording
-
broadcastStream
-
mp4MuxingEnabled
protected boolean mp4MuxingEnabled -
webMMuxingEnabled
protected boolean webMMuxingEnabled -
addDateTimeToMp4FileName
protected boolean addDateTimeToMp4FileName -
hlsMuxingEnabled
protected boolean hlsMuxingEnabled -
dashMuxingEnabled
protected boolean dashMuxingEnabled -
isHealthCheckStartedMap
-
errorCountMap
-
retryCounter
-
statusMap
-
rtmpEndpointRetryLimit
protected int rtmpEndpointRetryLimit -
healthCheckPeriodMS
protected int healthCheckPeriodMS -
webRTCEnabled
protected boolean webRTCEnabled -
storageClient
-
hlsTime
-
hlsListSize
-
hlsPlayListType
-
dashSegDuration
-
dashFragmentDuration
-
targetLatency
-
adaptiveResolutionList
List<EncoderSettings> adaptiveResolutionList -
dataStore
-
firstKeyFrameReceivedChecked
private boolean firstKeyFrameReceivedCheckedBy default first video key frame should be checked and below flag should be set to true If first video key frame should not be checked, then below should be flag in advance -
lastKeyFramePTS
private long lastKeyFramePTS -
streamId
-
startTime
private long startTime -
scope
-
appAdapter
-
encoderSettingsList
-
isStreamSource
protected static boolean isStreamSource -
previewCreatePeriod
private int previewCreatePeriod -
latestSpeed
private double latestSpeed -
lastQualityUpdateTime
private long lastQualityUpdateTime -
broadcast
-
appSettings
-
previewHeight
private int previewHeight -
lastFrameTimestamp
private int lastFrameTimestamp -
maxAnalyzeDurationMS
private int maxAnalyzeDurationMS -
generatePreview
protected boolean generatePreview -
firstReceivedFrameTimestamp
private int firstReceivedFrameTimestamp -
totalIngestedVideoPacketCount
protected int totalIngestedVideoPacketCount -
bufferTimeMs
private long bufferTimeMs -
serverSettings
-
packetTimeList
Packet times in ordered way to calculate streaming health Key is the packet ime Value is the system time at that moment -
lastDTS
private long lastDTS -
overflowCount
private int overflowCount -
vertx
protected io.vertx.core.Vertx vertx -
buffering
Accessed from multiple threads so make it volatile -
bufferLogCounter
private int bufferLogCounter -
bufferingFinishTimeMs
private volatile long bufferingFinishTimeMsThe time when buffering has been finished. It's volatile because it's accessed from multiple threads -
avc
private boolean avcMux adaptor is generally used in RTMP. However it can be also used to stream RTSP Pull so that isAVC can be false -
bufferedPacketWriterId
private long bufferedPacketWriterId -
lastPacketTimeMsInQueue
private volatile long lastPacketTimeMsInQueue -
firstPacketReadyToSentTimeMs
private volatile long firstPacketReadyToSentTimeMs -
dataChannelWebHookURL
-
absoluteTotalIngestTime
protected long absoluteTotalIngestTime -
dashMuxer
It's defined here because EncoderAdaptor should access it directly to add new streams. Don't prefer to access to dashMuxer directly. Access it with getter -
checkStreamsStartTime
private long checkStreamsStartTime -
videoDataConf
private byte[] videoDataConf -
audioDataConf
private byte[] audioDataConf -
queueSize
-
totalIngestTime
protected long totalIngestTime -
fps
private int fps -
width
private int width -
height
protected int height -
keyFramePerMin
protected int keyFramePerMin -
lastKeyFrameStatsTimeMs
protected long lastKeyFrameStatsTimeMs -
totalByteReceived
private long totalByteReceived -
streamSourceInputFormatContext
protected org.bytedeco.ffmpeg.avformat.AVFormatContext streamSourceInputFormatContext -
videoCodecParameters
private org.bytedeco.ffmpeg.avcodec.AVCodecParameters videoCodecParameters -
audioCodecParameters
protected org.bytedeco.ffmpeg.avcodec.AVCodecParameters audioCodecParameters -
audioExtraDataPointer
private org.bytedeco.javacpp.BytePointer audioExtraDataPointer -
videoExtraDataPointer
private org.bytedeco.javacpp.BytePointer videoExtraDataPointer -
endpointStatusUpdaterTimer
-
endpointStatusUpdateMap
-
packetFeeder
-
COUNT_TO_LOG_BUFFER
private static final int COUNT_TO_LOG_BUFFER- See Also:
-
TIME_BASE_FOR_MS
public static final org.bytedeco.ffmpeg.avutil.AVRational TIME_BASE_FOR_MSHelper field to get the timebase for milliseconds Pay attention: Use them in basic conversions(av_rescale), do not use them by giving directly to the Muxers, Encoders as Timebase because Muxers and Encoders can close the timebase and we'll get error For muxers, encoders, use the gettimebaseForMs() method -
videoTimeBase
private org.bytedeco.ffmpeg.avutil.AVRational videoTimeBase -
audioTimeBase
private org.bytedeco.ffmpeg.avutil.AVRational audioTimeBase -
channelLayout
protected org.bytedeco.ffmpeg.avutil.AVChannelLayout channelLayout -
lastTotalByteReceived
private long lastTotalByteReceived -
durationMs
private long durationMs -
videoCodecId
private int videoCodecId -
metadataTimeout
private boolean metadataTimeout -
lastWebhookStreamStatusUpdateTime
private long lastWebhookStreamStatusUpdateTime -
directMuxingSupported
private boolean directMuxingSupported
-
-
Constructor Details
-
MuxAdaptor
-
-
Method Details
-
addID3Data
-
setScope
-
addSEIData
-
getTimeBaseForMs
public static org.bytedeco.ffmpeg.avutil.AVRational getTimeBaseForMs() -
initializeMuxAdaptor
public static MuxAdaptor initializeMuxAdaptor(ClientBroadcastStream clientBroadcastStream, Broadcast broadcast, boolean isSource, IScope scope) -
isEncoderAdaptorShouldBeTried
-
addMuxer
-
addMuxer
-
removeMuxer
-
addMuxerInternal
-
init
Description copied from interface:IRecordingListenerInitialize the listener.- Specified by:
initin interfaceIRecordingListener- Parameters:
conn- Stream source connectionname- Stream nameisAppend- Append mode- Returns:
- true if initialization completes and false otherwise
-
enableSettings
public void enableSettings() -
initStorageClient
public void initStorageClient() -
init
Description copied from interface:IRecordingListenerInitialize the listener.- Specified by:
initin interfaceIRecordingListener- Parameters:
scope- Stream source scopestreamId- Stream nameisAppend- Append mode- Returns:
- true if initialization completes and false otherwise
-
addHLSMuxer
-
getDashMuxer
-
initVertx
private void initVertx() -
initServerSettings
protected void initServerSettings() -
enableMp4Setting
protected void enableMp4Setting() -
enableWebMSetting
protected void enableWebMSetting() -
setUpEndPoints
public static void setUpEndPoints(MuxAdaptor muxAdaptor, Broadcast broadcast, io.vertx.core.Vertx vertx) -
getAudioCodecParameters
public org.bytedeco.ffmpeg.avcodec.AVCodecParameters getAudioCodecParameters() -
getVideoCodecParameters
public org.bytedeco.ffmpeg.avcodec.AVCodecParameters getVideoCodecParameters() -
prepare
Prepares the parameters. This method is called in RTMP ingesting- Returns:
- Throws:
Exception
-
registerToMainTrackIfExists
-
prepareFromInputFormatContext
public boolean prepareFromInputFormatContext(org.bytedeco.ffmpeg.avformat.AVFormatContext inputFormatContext) throws Exception Prepares parameters and muxers. This method is called when pulling stream source- Parameters:
inputFormatContext-- Returns:
- Throws:
Exception
-
getAnnexbExtradata
public static byte[] getAnnexbExtradata(byte[] avcExtradata) -
getStreamType
-
addStream2Muxers
public void addStream2Muxers(org.bytedeco.ffmpeg.avcodec.AVCodecParameters codecParameters, org.bytedeco.ffmpeg.avutil.AVRational rat, int streamIndex) -
prepareMuxerIO
public void prepareMuxerIO() -
updateStreamQualityParameters
- Parameters:
streamId- id of the streamquality- , quality stringpacketTime- , time of the packet in millisecondsduration- , the total elapsed time in millisecondsinputQueueSize- , input queue size of the packets that is waiting to be processed
-
getLatestSpeed
public double getLatestSpeed() -
getStreamHandler
-
getAppSettings
-
getDataStore
-
correctPacketDtsOverflow
public long correctPacketDtsOverflow(long packetDts) -
writeStreamPacket
This is the entrance points for the packet coming from the RTMP stream. It's directly used in EncoderAdaptor in Enterprise We override the videoBufferReceived, audioBufferReceived, and notifyDataReceived methods to handle the packets in EncoderAdaptor- Parameters:
packet-
-
notifyMetaDataReceived
-
audioBufferReceived
-
videoBufferReceived
-
getMetaData
-
getInput
-
checkMaxAnalyzeTotalTime
public void checkMaxAnalyzeTotalTime()Check if max analyze time has been passed. If it initializes the prepare then isRecording is set to true in prepareParameters -
execute
public void execute() -
clearAndStopStream
public void clearAndStopStream() -
addBufferQueue
-
calculateBufferStatus
public void calculateBufferStatus() -
getVideoDataConf
-
getAudioDataConf
-
prepareParameters
private void prepareParameters() -
setBroadcastMetaData
-
getParametersAsJson
-
measureIngestTime
private void measureIngestTime(long pktTimeStamp, long receivedTime) -
getAbsoluteTimeMs
public long getAbsoluteTimeMs() -
updateQualityParameters
public void updateQualityParameters(long pts, org.bytedeco.ffmpeg.avutil.AVRational timebase, long packetSize, boolean isKeyFrame) -
closeRtmpConnection
public void closeRtmpConnection() -
writePacket
public void writePacket(org.bytedeco.ffmpeg.avformat.AVStream stream, org.bytedeco.ffmpeg.avcodec.AVPacket pkt) -
writeTrailer
public void writeTrailer() -
closeResources
public void closeResources() -
setDirectMuxingSupported
public void setDirectMuxingSupported(boolean directMuxingSupported) -
directMuxingSupported
public boolean directMuxingSupported()This method means that if the MuxAdaptor writes incoming packets to muxers(muxerList) directly without any StreamAdaptor/Encoders It's true for RTMP, SRT ingest to MP4, HLS, RTMP Endpoint writing but it's not true WebRTC ingest. This method is being implemented in subclasses- Returns:
-
start
public void start()Description copied from interface:IRecordingListenerStart the recording.- Specified by:
startin interfaceIRecordingListener
-
stop
public void stop(boolean shutdownCompletely) Description copied from interface:IRecordingListenerStop the recording.- Specified by:
stopin interfaceIRecordingListener
-
setInputQueueSize
public void setInputQueueSize(int size) -
getInputQueueSize
public int getInputQueueSize() -
getEncodingQueueSize
public int getEncodingQueueSize()Number of frames waiting to be encoded. It's zero here because MuxAdaptor does not transcode the stream- Returns:
-
getDroppedPacketCountInIngestion
public int getDroppedPacketCountInIngestion()Number of packets dropped in the ingestion- Returns:
-
getDroppedFrameCountInEncoding
public int getDroppedFrameCountInEncoding()Number of frames dropped in the encoding- Returns:
-
isStopRequestExist
public boolean isStopRequestExist() -
debugSetStopRequestExist
public void debugSetStopRequestExist(boolean stopRequest) -
writeBufferedPacket
public void writeBufferedPacket()This method is called when rtmpIngestBufferTime is bigger than zero -
writeAllBufferedPackets
private void writeAllBufferedPackets() -
packetReceived
Description copied from interface:IRecordingListenerA packet has been received from a stream.- Specified by:
packetReceivedin interfaceIRecordingListener- Specified by:
packetReceivedin interfaceIStreamListener- Parameters:
stream- the stream the packet has been received forpacket- the packet received
-
isRecording
public boolean isRecording()- Specified by:
isRecordingin interfaceIRecordingListener- Returns:
- recording state, true if recording and false otherwise
-
isAppending
public boolean isAppending()- Specified by:
isAppendingin interfaceIRecordingListener- Returns:
- appending state, true if appending and false otherwise
-
getFileConsumer
- Specified by:
getFileConsumerin interfaceIRecordingListener- Returns:
- the recordingConsumer
-
setFileConsumer
- Specified by:
setFileConsumerin interfaceIRecordingListener- Parameters:
recordingConsumer- the recordingConsumer to set
-
getFileName
- Specified by:
getFileNamein interfaceIRecordingListener- Returns:
- the fileName
-
setFileName
- Specified by:
setFileNamein interfaceIRecordingListener- Parameters:
fileName- the fileName to set
-
getMuxerList
-
setStorageClient
-
isWebRTCEnabled
public boolean isWebRTCEnabled() -
setWebRTCEnabled
public void setWebRTCEnabled(boolean webRTCEnabled) -
setHLSFilesDeleteOnExit
public void setHLSFilesDeleteOnExit(boolean deleteHLSFilesOnExit) -
setPreviewOverwrite
public void setPreviewOverwrite(boolean overwrite) -
isPreviewOverwrite
public boolean isPreviewOverwrite() -
setStartTime
public void setStartTime(long startTime) -
getEncoderSettingsList
-
setEncoderSettingsList
-
isStreamSource
public boolean isStreamSource() -
setStreamSource
public void setStreamSource(boolean isStreamSource) -
getPreviewCreatePeriod
public int getPreviewCreatePeriod() -
setPreviewCreatePeriod
public void setPreviewCreatePeriod(int previewCreatePeriod) -
getStreamId
-
setStreamId
-
getStorageClient
-
setFirstKeyFrameReceivedChecked
public void setFirstKeyFrameReceivedChecked(boolean firstKeyFrameReceivedChecked) Setter forfirstKeyFrameReceivedChecked- Parameters:
firstKeyFrameReceivedChecked-
-
getBroadcast
-
setBroadcast
-
setGeneratePreview
public void setGeneratePreview(boolean generatePreview) -
getPreviewHeight
public int getPreviewHeight() -
setPreviewHeight
public void setPreviewHeight(int previewHeight) -
createMp4Muxer
-
addMp4Muxer
-
startRecording
Start recording is used to start recording on the fly(stream is broadcasting).- Parameters:
recordType- MP4 or WEBMresolutionHeight- resolution height for the recording- Returns:
-
startRecording
-
startRecordingInternal
private RecordMuxer startRecordingInternal(RecordType recordType, int resolutionHeight, String baseFileName) -
prepareMuxer
-
isAlreadyRecording
-
findDynamicRecordMuxer
-
stopRecording
Stop recording is called to stop recording when the stream is broadcasting(on the fly)- Parameters:
recordType- MP4 or WEBMresolutionHeight- resolution height for the recording- Returns:
-
getBroadcastStream
-
startEndpointStreaming
-
sendEndpointErrorNotifyHook
-
endpointStatusHealthCheck
Periodically check the endpoint health status every 2 seconds If each check returned failed, try to republish to the endpoint- Parameters:
url- is the URL of the endpoint
-
clearCounterMapsAndCancelTimer
-
tryToRepublish
-
endpointStatusUpdated
Description copied from interface:IEndpointStatusListenerIt's called when the endpoint status is updated- Specified by:
endpointStatusUpdatedin interfaceIEndpointStatusListener- Parameters:
url- is the URL of the endpointstatus- is the current status of the rtmp endpoint
-
updateBroadcastRecord
private void updateBroadcastRecord() -
getEndpointMuxer
-
stopEndpointStreaming
-
getExtendedSubfolder
-
getSubfolder
-
isEnableVideo
public boolean isEnableVideo() -
setEnableVideo
public void setEnableVideo(boolean enableVideo) -
isEnableAudio
public boolean isEnableAudio() -
setEnableAudio
public void setEnableAudio(boolean enableAudio) -
getLastFrameTimestamp
public int getLastFrameTimestamp() -
setLastFrameTimestamp
public void setLastFrameTimestamp(int lastFrameTimestamp) -
setAppSettings
-
getBufferTimeMs
public long getBufferTimeMs() -
isBuffering
public boolean isBuffering() -
setBuffering
public void setBuffering(boolean buffering) -
getDataChannelWebHookURL
-
isDeleteDASHFilesOnExit
public boolean isDeleteDASHFilesOnExit() -
setDeleteDASHFilesOnExit
public void setDeleteDASHFilesOnExit(boolean deleteDASHFilesOnExit) -
isAvc
public boolean isAvc() -
setAvc
public void setAvc(boolean avc) -
getBufferQueue
-
setBufferingFinishTimeMs
public void setBufferingFinishTimeMs(long bufferingFinishTimeMs) -
getPacketTimeList
-
getVideoStreamIndex
public int getVideoStreamIndex() -
setVideoStreamIndex
public void setVideoStreamIndex(int videoStreamIndex) -
getAudioStreamIndex
public int getAudioStreamIndex() -
setAudioStreamIndex
public void setAudioStreamIndex(int audioStreamIndex) -
getDataStreamIndex
public int getDataStreamIndex() -
addPacketListener
-
removePacketListener
-
setVideoCodecParameter
public void setVideoCodecParameter(org.bytedeco.ffmpeg.avcodec.AVCodecParameters videoCodecParameters) -
setAudioCodecParameter
public void setAudioCodecParameter(org.bytedeco.ffmpeg.avcodec.AVCodecParameters audioCodecParameters) -
getVideoTimeBase
public org.bytedeco.ffmpeg.avutil.AVRational getVideoTimeBase() -
getAudioTimeBase
public org.bytedeco.ffmpeg.avutil.AVRational getAudioTimeBase() -
setVideoTimeBase
public void setVideoTimeBase(org.bytedeco.ffmpeg.avutil.AVRational videoTimeBase) -
setAudioTimeBase
public void setAudioTimeBase(org.bytedeco.ffmpeg.avutil.AVRational audioTimeBase) -
getVertx
public io.vertx.core.Vertx getVertx() -
getEndpointStatusUpdateMap
-
getIsHealthCheckStartedMap
-
setHeight
public void setHeight(int height) -
getHeight
public int getHeight() -
setIsRecording
public void setIsRecording(boolean isRecording) -
setAudioDataConf
public void setAudioDataConf(byte[] audioDataConf) -
isBlacklistCodec
public boolean isBlacklistCodec(int codecId) -
setBufferTimeMs
public void setBufferTimeMs(long bufferTimeMs) -
getIsPipeReaderJobRunning
-
getTotalByteReceived
public long getTotalByteReceived() -
getWidth
public int getWidth() -
setWidth
public void setWidth(int width) -
getLastDTS
public long getLastDTS() -
getOverflowCount
public int getOverflowCount() -
getPacketFeeder
-
setTotalByteReceived
public void setTotalByteReceived(long totalByteReceived) -
getDurationMs
public long getDurationMs() -
setDurationMs
public void setDurationMs(long durationMs) -
getVideoCodecId
public int getVideoCodecId() -
setVideoDataConf
public void setVideoDataConf(byte[] videoDataConf) -
setPacketFeeder
-