RootEncoder
RootEncoder copied to clipboard
E/H264Packet: waiting for a valid sps and pps
Hi @pedroSG94, First I'm greatful of this library it helped me wind up my streaming problems.
I have an android app that integrates a USB camera (Otoscope) using a UVC usb library but without RTMP support. The usb camera library (written in java) supports video encoder and exports chunk of videos which is ByteArray, and with offset, length, timestamp.
I want to stream this chunk of video data into my RTMP server (nginx). Using the RTMPClient
class, I called sendVideo
I sent the video data as:
val info = MediaCodec.BufferInfo()
info.offset = offset
info.size = length
info.presentationTimeUs = timestamp
rtmpClient.sendVideo(ByteBuffer.wrap(data), info)
But I'm getting
I/RtmpSender: Skipping iteration, frame null
E/H264Packet: waiting for a valid sps and pps
E/H264Packet: waiting for a valid sps and pps
E/H264Packet: waiting for a valid sps and pps
E/H264Packet: waiting for a valid sps and pps
E/H264Packet: waiting for a valid sps and pps
E/H264Packet: waiting for a valid sps and pps
E/H264Packet: waiting for a valid sps and pps
Hello,
You missed flag value in MediaCodec.BufferInfo class. Also, you need set sps and pps to RtmpClient class to init stream. You have an issue here that is like your case: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/issues/1033 RtspClient and RtmpClient usage is the same so you can apply all for this case.
Thank you! I will try this and get back to you with results