omg...i have tried and need help here...

Hello all, its Jayson:

I understand multicamera api is not good enough to have two cameras that 
are in two directions

so i need a solution to access     "camera_concurrent" possibilities

My large plan:  

combine front and back camera @ 720px by 720 px horizontally for 1440x720 
output with recording

i have tried in app with kivy
i have tried with opencv
i have now tried with javascript?

i have the tools except concurrent camera right now....
Any help?

The Program i have started using for this is an npm server for https....

run with: 

sudo node /var/www/webrtc-broadcast/server.js


my main file is in /var/www/webrtc-broadcasst/broadcasttwo2.html
here it is:
```
<!DOCTYPE html>
<html>
  <head>
    <title>Broadcaster</title>
    <meta charset="UTF-8" />
  </head>
<style>
        body {        background-color: cyan;        }
</style>
<body>
    <section class="select">
      <label for="audioSource">Audio source: </label>
      <select id="audioSource"></select>
    </section>
    <section class="select">
      <label for="videoSource">Video source: </label>
      <select id="videoSource"></select>
    </section>
    <section class="select">
      <label for="audioSource2">Audio source: </label>
      <select id="audioSource2"></select>
    </section>
    <section class="select">
      <label for="videoSource2">Video source: </label>
      <select id="videoSource2"></select>
    </section>
<br></br>
<hr></hr>
<hr></hr>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
//<canvas id="canvas" height="720px" width="720px" controls playsinline 
autoplay muted></canvas>
//<canvas id="canvas2" height="720px" width="720px" controls playsinline 
autoplay muted></canvas>
<br>
<video id="videoInput" height="720px" width="720px" controls playsinline 
autoplay muted></video>
<video id="videoInput2" height="720px" width="720px" controls playsinline 
autoplay muted></video>

<br></br>
<hr></hr>
<canvas id="canvasOutput" width=1440 height=720></canvas>
<script src="/RecordRTC1.js"></script>
<script src="/RecordRTC2.js"></script>
    <script src="/socket.io/socket.io.js"></script>
    <script src="/broadcastone.js"></script>
    <script src="/broadcasttwo.js"></script>
<script>
let src = new cv.Mat(video.height, video.width, cv.CV_8UC4);
let src2 = new cv.Mat(video2.height, video2.width, cv.CV_8UC4);
let dst = new cv.Mat(video.height, video.width(2), cv.CV_8UC1);
let cap = new cv.VideoCapture(video);
let cap2 = new cv.VideoCapture(video2);

const FPS = 30;
function processVideo() {
    try {
        if (!streaming) {
            // clean and stop.
            src.delete();
            src2.delete();
            dst.delete();
            return;
        }
        let begin = Date.now();
        // start processing.
        cap.read(src);
        cap2.read(src2);
cv.hconcat(src, src2, dst);
        cv.imshow('canvasOutput', dst);
        // schedule the next one.
        let delay = 1000/FPS - (Date.now() - begin);
        setTimeout(processVideo, delay);
    } catch (err) {
        utils.printError(err);
    }
};

// schedule the first one.
setTimeout(processVideo, 0);
</script>
<script src="https://docs.opencv.org/3.4/utils.js"; 
type="text/javascript"></script>
<script type="text/javascript">
let utils = new Utils('errorMessage');

utils.loadCode('codeSnippet', 'codeEditor');

let streaming = false;
let videoInput = document.getElementById('videoInput');
let startAndStop = document.getElementById('startAndStop');
let canvasOutput = document.getElementById('canvasOutput');
let canvasContext = canvasOutput.getContext('2d');

startAndStop.addEventListener('click', () => {
    if (!streaming) {
        utils.clearError();
        utils.startCamera('qvga', onVideoStarted, 'videoInput');
    } else {
        utils.stopCamera();
        onVideoStopped();
    }
});

function onVideoStarted() {
    streaming = true;
    startAndStop.innerText = 'Stop';
    videoInput.width = videoInput.videoWidth;
    videoInput.height = videoInput.videoHeight;
    utils.executeCode('codeEditor');
}

function onVideoStopped() {
    streaming = false;
    canvasContext.clearRect(0, 0, canvasOutput.width, canvasOutput.height);
    startAndStop.innerText = 'Start';
}

utils.loadOpenCv(() => {
    startAndStop.removeAttribute('disabled');
});
</script>
</body>
</html>
```



NOW, can i add simultaneous front and back cameras? with JavaScript?

Thank you in advance for jumping in and reading.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/652ca315-1c8d-425a-9d59-fb4accddc7aan%40googlegroups.com.

Reply via email to