pedroSG94 / RootEncoder

RootEncoder for Android (rtmp-rtsp-stream-client-java) is a stream encoder to push video/audio to media servers using protocols RTMP, RTSP, SRT and UDP with all code written in Java/Kotlin
Apache License 2.0
2.54k stars 772 forks source link

rtmp streaming yuv #1185

Closed supr3me closed 1 year ago

supr3me commented 1 year ago

Hi, @pedroSG94 Good afternoon!

I push stream from third library TextureView widget. It decoder from h264 and render. I can get the h264 data and yuv data from its function:

h264 callback : onReceive(byte[] videoBuffer, int size) (offical say it is h264 data, but i am not sure :( yuvdata callback: onYuvDataReceived(MediaFormat mediaFormat, ByteBuffer yuvFrame, int dataSize, int width, int height);

I see SrsFlvMuxer has send h264buffer, but its function not match the onReceive(byte[] videoBuffer, int size)

How can I use this library push stream with h264callback or yuvdatacallback?

thank you very much!

supr3me commented 1 year ago

817

pedroSG94 commented 1 year ago

Hello,

Try to implement this using this way: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/issues/144#issuecomment-375305491 SrsFlvMuxer can be replace to RtmpClient.

After that, let me know the result and we can fix possible issues