Package io.antmedia.muxer
Class RtmpProvider
java.lang.Object
io.antmedia.muxer.Muxer
io.antmedia.muxer.RtmpProvider
- All Implemented Interfaces:
IMessageComponent,IProvider
Lightweight provider that converts encoded H.264 / AAC
AVPackets coming from
PacketFeeder into Red5 RTMP messages and pushes them to an
InMemoryPushPushPipe.-
Nested Class Summary
Nested classes/interfaces inherited from class io.antmedia.muxer.Muxer
Muxer.VideoBuffer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.bytedeco.ffmpeg.avutil.AVRationalprivate IBroadcastScopeprivate final AtomicIntegerprivate final org.bytedeco.ffmpeg.avutil.AVRationalFields 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
ConstructorsConstructorDescriptionRtmpProvider(IScope appScope, io.vertx.core.Vertx vertx, String streamId, org.bytedeco.ffmpeg.avutil.AVRational videoTimebase, org.bytedeco.ffmpeg.avutil.AVRational audioTimebase) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddStream(org.bytedeco.ffmpeg.avcodec.AVCodecParameters codecParameters, org.bytedeco.ffmpeg.avutil.AVRational timebase, int streamIndex) Add stream to the muxer.attachRtmpPublisher(String streamId) voiddetachRtmpPublisher(String streamId) org.bytedeco.ffmpeg.avformat.AVFormatContextbooleanisCodecSupported(int codecId) voidonOOBControlMessage(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg) voidsetBroadcastScope(IBroadcastScope broadcastScope) booleanvoidwritePacket(org.bytedeco.ffmpeg.avcodec.AVPacket packet, org.bytedeco.ffmpeg.avutil.AVRational inputTimebase, org.bytedeco.ffmpeg.avutil.AVRational outputTimebase, int codecType) All other writePacket functions call this function to make the jobvoidThis function may be called by multiple encoders.Methods inherited from class io.antmedia.muxer.Muxer
addAudioStream, addExtradataIfRequired, 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, getOutputURL, getPacketBufferWithExtradata, getPreviewFile, getRecordFile, getRegisteredStreamIndexList, getResolution, getResourceFile, getSubFolder, getTmpPacket, getUserRecordFile, getVideoCodecId, getVideoExtradata, getVideoHeight, getVideoNotWrittenCount, getVideoWidth, init, init, initAudioBitstreamFilter, initVideoBitstreamFilter, isAddDateTimeToSourceName, logPacketIssue, openIO, prepareIO, replaceDoubleSlashesWithSingleSlash, setAddDateTimeToSourceName, setAudioBitreamFilter, setBitstreamFilter, setCurrentVoDTimeStamp, setFormat, setInitialResourceNameOverride, setIsRunning, setOption, setStreamId, setSubfolder, writeAudioBuffer, writeAudioFrame, writeDataFrame, writeMetaData, writePacket, writePacket, writeVideoBuffer, writeVideoBuffer, writeVideoFrame
-
Field Details
-
broadcastScope
-
videoTb
private final org.bytedeco.ffmpeg.avutil.AVRational videoTb -
audioTb
private final org.bytedeco.ffmpeg.avutil.AVRational audioTb -
firstVideoTs
-
-
Constructor Details
-
RtmpProvider
-
-
Method Details
-
setBroadcastScope
-
getBroadcastScope
-
addStream
public boolean addStream(org.bytedeco.ffmpeg.avcodec.AVCodecParameters codecParameters, org.bytedeco.ffmpeg.avutil.AVRational timebase, int streamIndex) Description copied from class:MuxerAdd stream to the muxer. This method is called by direct muxing. For instance from RTMP, SRT ingest & Stream Pull to HLS, MP4, HLS, DASH WebRTC Muxing -
writePacket
public void writePacket(org.bytedeco.ffmpeg.avcodec.AVPacket packet, org.bytedeco.ffmpeg.avutil.AVRational inputTimebase, org.bytedeco.ffmpeg.avutil.AVRational outputTimebase, int codecType) Description copied from class:MuxerAll other writePacket functions call this function to make the job- Overrides:
writePacketin classMuxer- Parameters:
packet- Content of the data in AVPacket classinputTimebase- input time base is required to calculate the correct dts and pts values for the containeroutputTimebase- output time base is required to calculate the correct dts and pts values for the container
-
attachRtmpPublisher
-
detachRtmpPublisher
-
isCodecSupported
public boolean isCodecSupported(int codecId) - Specified by:
isCodecSupportedin classMuxer
-
getOutputFormatContext
public org.bytedeco.ffmpeg.avformat.AVFormatContext getOutputFormatContext()- Specified by:
getOutputFormatContextin classMuxer
-
writeHeader
public boolean writeHeader()- Overrides:
writeHeaderin classMuxer
-
writeTrailer
public void writeTrailer()Description copied from class:MuxerThis 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
-
onOOBControlMessage
- Specified by:
onOOBControlMessagein interfaceIMessageComponent- Parameters:
source- Message component sourcepipe- Connection pipeoobCtrlMsg- Out-of-band control message
-