# RtspFromFile

@RequiresApi(api = 18)
class RtspFromFile : FromFileBase

More documentation see: com.pedro.library.base.FromFileBase

Created by pedro on 4/06/17.

## Constructors

RtspFromFile
Link copied to clipboard
constructor(openGlView: OpenGlView, connectChecker: ConnectChecker, videoDecoderInterface: VideoDecoderInterface, audioDecoderInterface: AudioDecoderInterface)
constructor(context: Context, connectChecker: ConnectChecker, videoDecoderInterface: VideoDecoderInterface, audioDecoderInterface: AudioDecoderInterface)
constructor(connectChecker: ConnectChecker, videoDecoderInterface: VideoDecoderInterface, audioDecoderInterface: AudioDecoderInterface)

## Properties

audioDuration
Link copied to clipboard
open val audioDuration: Double
audioTime
Link copied to clipboard
open val audioTime: Double
bitrate
Link copied to clipboard
open val bitrate: Int
glInterface
Link copied to clipboard
open val glInterface: GlInterface?
isAudioDeviceEnabled
Link copied to clipboard
open val isAudioDeviceEnabled: Boolean
isRecording
Link copied to clipboard
open val isRecording: Boolean
isStreaming
Link copied to clipboard
open val isStreaming: Boolean
recordStatus
Link copied to clipboard
open val recordStatus: RecordController.Status?
resolutionValue
Link copied to clipboard
open val resolutionValue: Int
streamClient
Link copied to clipboard
open override val streamClient: RtspStreamClient
streamHeight
Link copied to clipboard
open val streamHeight: Int
streamWidth
Link copied to clipboard
open val streamWidth: Int
videoDuration
Link copied to clipboard
open val videoDuration: Double
videoTime
Link copied to clipboard
open val videoTime: Double

## Functions

forceBt709Color
Link copied to clipboard
open fun forceBt709Color(enabled: Boolean)
forceCodecType
Link copied to clipboard
open fun forceCodecType(codecTypeVideo: CodecUtil.CodecType?, codecTypeAudio: CodecUtil.CodecType?)
forceFpsLimit
Link copied to clipboard
open fun forceFpsLimit(enabled: Boolean)

Force stream to work with fps selected in prepareVideo method. Must be called before prepareVideo. This is not recommend because could produce fps problems.

getStreamClient
Link copied to clipboard
open override fun getStreamClient(): RtspStreamClient
moveTo
Link copied to clipboard
open fun moveTo(time: Double)

Working but it is too slow. You need wait few seconds after call it to continue :(

pauseRecord
Link copied to clipboard
open fun pauseRecord()
playAudioDevice
Link copied to clipboard
open fun playAudioDevice()
prepareAudio
Link copied to clipboard
open fun prepareAudio(filePath: String?): Boolean
open fun prepareAudio(context: Context?, uri: Uri?): Boolean
open fun prepareAudio(fileDescriptor: FileDescriptor?, bitRate: Int): Boolean
open fun prepareAudio(filePath: String?, bitRate: Int): Boolean
open fun prepareAudio(context: Context?, uri: Uri?, bitRate: Int): Boolean
prepareVideo
Link copied to clipboard
open fun prepareVideo(fileDescriptor: FileDescriptor?): Boolean
open fun prepareVideo(filePath: String?): Boolean
open fun prepareVideo(context: Context?, uri: Uri?): Boolean
open fun prepareVideo(fileDescriptor: FileDescriptor?, bitRate: Int, rotation: Int): Boolean
open fun prepareVideo(filePath: String?, bitRate: Int, rotation: Int): Boolean
open fun prepareVideo(context: Context?, uri: Uri?, bitRate: Int, rotation: Int): Boolean
open fun prepareVideo(fileDescriptor: FileDescriptor?, bitRate: Int, rotation: Int, profile: Int, level: Int): Boolean
open fun prepareVideo(filePath: String?, bitRate: Int, rotation: Int, profile: Int, level: Int): Boolean
open fun prepareVideo(context: Context?, uri: Uri?, bitRate: Int, rotation: Int, profile: Int, level: Int): Boolean
replaceAudioFile
Link copied to clipboard
open fun replaceAudioFile(fileDescriptor: FileDescriptor?)
open fun replaceAudioFile(filePath: String?)
open fun replaceAudioFile(context: Context?, uri: Uri?)
replaceVideoFile
Link copied to clipboard
open fun replaceVideoFile(fileDescriptor: FileDescriptor?)
open fun replaceVideoFile(filePath: String?)
open fun replaceVideoFile(context: Context?, uri: Uri?)
replaceView
Link copied to clipboard
open fun replaceView(context: Context?)
open fun replaceView(openGlView: OpenGlView?)
requestKeyFrame
Link copied to clipboard
open fun requestKeyFrame()
resetAudioEncoder
Link copied to clipboard
open fun resetAudioEncoder(): Boolean
resetVideoEncoder
Link copied to clipboard
open fun resetVideoEncoder(): Boolean
resumeRecord
Link copied to clipboard
open fun resumeRecord()
reSyncFile
Link copied to clipboard
open fun reSyncFile()
setAudioCodec
Link copied to clipboard
open fun setAudioCodec(codec: AudioCodec?)
setAudioExtractor
Link copied to clipboard
open fun setAudioExtractor(extractor: Extractor?)
setDecoderErrorCallback
Link copied to clipboard
open fun setDecoderErrorCallback(codecErrorCallback: CodecErrorCallback?)
setEncoderErrorCallback
Link copied to clipboard
open fun setEncoderErrorCallback(encoderErrorCallback: CodecErrorCallback?)

Set a callback to know errors related with Video/Audio encoders

setFpsListener
Link copied to clipboard
open fun setFpsListener(callback: FpsListener.Callback?)
setLoopMode
Link copied to clipboard
open fun setLoopMode(loopMode: Boolean)

If you want reproduce video in loop. This mode clear all effects or stream object when video is restarted. TODO: No clear it.

setRecordController
Link copied to clipboard
open fun setRecordController(recordController: RecordController?)
setTimestampMode
Link copied to clipboard
open fun setTimestampMode(timestampModeVideo: TimestampMode?, timestampModeAudio: TimestampMode?)

Set the mode to calculate timestamp. By default CLOCK. Must be called before startRecord/startStream or it will be ignored.

setVideoBitrateOnFly
Link copied to clipboard
@RequiresApi(api = 19)
open fun setVideoBitrateOnFly(bitrate: Int)

Set video bitrate of H264 in bits per second while stream.

setVideoCodec
Link copied to clipboard
open fun setVideoCodec(codec: VideoCodec?)
setVideoExtractor
Link copied to clipboard
open fun setVideoExtractor(extractor: Extractor?)
startRecord
Link copied to clipboard
@RequiresApi(api = 26)
open fun startRecord(@NonNull fd: FileDescriptor)
open fun startRecord(@NonNull path: String)
@RequiresApi(api = 26)
open fun startRecord(@NonNull fd: FileDescriptor, @Nullable listener: RecordController.Listener?)
open fun startRecord(@NonNull path: String, @Nullable listener: RecordController.Listener?)

Starts recording a MP4 video.

startStream
Link copied to clipboard
open fun startStream(url: String?)

Need be called after @prepareVideo.

stopAudioDevice
Link copied to clipboard
open fun stopAudioDevice()
stopRecord
Link copied to clipboard
open fun stopRecord()

Stop record MP4 video started with @startRecord. If you don't call it file will be unreadable.

stopStream
Link copied to clipboard
open fun stopStream()

Stop stream started with @startStream.