USB camera live Streaming over RTMP having issue in android

1.4k views Asked by At

I am using https://github.com/saki4510t/UVCCamera library to preview USB camera to texture view and for streaming, I am using https://github.com/pedroSG94/rtmp-rtsp-stream-client-java library.

I have used the RtmpCamera2 class for streaming and UVCCameraTextureView to render the output to the device. My issue is that when I start the streaming, only audio packets are sent. sendVideo() is not calling from SrsFlvMuxer. It will be great if anyone having some solution regarding this issue.

Here is my code I have implemented so far :

RtmpCamera2 rtmpCamera2 = new RtmpCamera2(mUVCCameraTextureView, MyActivity.this);

On button click of "start stream" I have wrote below lines:

if (!rtmpCamera2.isStreaming()) {
        if (rtmpCamera2.isRecording() || rtmpCamera2.prepareAudio() && rtmpCamera2.prepareVideo()) {
            rtmpCamera2.startStream(STREAM_URL);
        } else {
            Toast.makeText(DashboardActivity.this, "Error preparing stream, This device cant do it", Toast.LENGTH_SHORT).show();
        }
    } else {
        rtmpCamera2.stopStream();
   }

Note: I have added rtmp-rtsp library as dependency in UVCCamera project and the usb camera preview is visible in the android device.

0

There are 0 answers