I want to open device camera for 3 functions:
motion detection
video record
stream video with rtsp
I can do 2 first functions by initialize device camera preview and work with the return byte[] data of camera object.
mPreviewCallBack = new android.hardware.Camera.PreviewCallback() {
@Override
public void onPreviewFrame(byte[] data, android.hardware.Camera camera) {
// motion detection
detectMotion(data);
// auto record video if motion detection
recordVideo(data);
// stream preview to client device
???
}
but i can not do the 3rd function yet. I did try some OS (libstreaming, rtmp-rtsp-stream-client-java ,..) but they both will open new camera preview again to do stream.
Do you have any comment about how to only stream rtsp camera byte[] data of existing camera preview?