Skip to content
Pedro Sánchez edited this page Jul 18, 2017 · 11 revisions

Welcome to the rtmp-rtsp-stream-client-java wiki!

What is rtmp-rtsp-stream-client-java?

rtmp-rtsp-stream-client-java is a Android library for stream audio and video to a media server in RTMP or RTSP protocols.

How does this work?

This library get audio and video data, encode it in AAC and H264 respectively and send it to rtsp or rtmp module to stream.

In rtsp module create a RTP packets of video and audio and send to server. In rtmp module create a RTP packets of video and audio, encapsulate it in flv packets and send to server.

This library use MediaCodec Android class to do hardware encoding.

What is the different in the 3 builders base?

The different of this builders is the form that you get audio and video data to encode.

Stable:

  • BuilderBase (API 16+): Get audio data from microphone in PCM buffer and from camera API1 in NV21 frames.

Unstable(Under develop):

  • BuilderFromFileBase (API 18+): Get audio data from a file decoding it in PCM data and render video decoded data in a MediaCodec inputsurface. Only video is working and some devices crash, working test in Samsung S7.

  • BuilderSurfaceModeBase (API 21+): Get audio data from microphone in PCM buffer and from camera API2 rendering a MediaCodec inputsurface. This builder can be executed in background mode if you use a context in the constructor instead of a surfaceview. RTSP stream is working but RTMP audio has problems.