0

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.

P. Patel
  • 1
  • 3
  • Can you show the code you've implemented so far ? – Mickael B. Jan 09 '20 at 09:16
  • First of all, have you tried this camera with another app or another camera with your app? It is possible that camera does not produce decodable video stream. – Nanev Jan 09 '20 at 09:28
  • @Nanev I have checked another camera with my app but nothing changed. – P. Patel Jan 09 '20 at 10:12
  • @MickaelB. I have updated the question and you can see the code I've implemented so far. – P. Patel Jan 09 '20 at 10:14
  • 1
    You can try these:https://github.com/ant-media/LibRtmp-Client-for-Android and https://github.com/ant-media/LiveVideoBroadcaster – Murat Jan 11 '20 at 12:52

0 Answers0