saki4510t / UVCCamera

library and sample to access to UVC web camera on non-rooted Android device
3.02k stars 1.21k forks source link

Add support to stream over rtmp #217

Open ManojMMWWIndia opened 7 years ago

ManojMMWWIndia commented 7 years ago

Need rtmp support for lib. Other RTMP lib using android native camera to get data from and UVCCamera is not working with them. Can you help on this?

sappho192 commented 7 years ago

The creator of this project have stopped replying on issues so I'm afraid that you need to develop it by yourself.

ManojMMWWIndia commented 7 years ago

please tell me how do I get audio+video data in byte form so that I can stream that data

jp1017 commented 7 years ago

@ManojMMWWIndia

You can get byte[] from this:

mUVCCamera.setFrameCallback(mIFrameCallback, UVCCamera.PIXEL_FORMAT_YUV);

        private final IFrameCallback mIFrameCallback = new IFrameCallback() {
            @Override
            public void onFrame(final ByteBuffer frame) {
                try {
                        byte[] buf = new byte[frame.remaining()];
                        frame.get(buf);

                                               //then we can get byte[]
                    }
                } catch (Exception e) {
                    KLog.e(TAG, e.getMessage());
                }

            }
        };