reacTIVision icon indicating copy to clipboard operation
reacTIVision copied to clipboard

feature request: Multi Camera input

Open s-light opened this issue 7 years ago • 3 comments

as discussed at https://sourceforge.net/p/reactivision/discussion/user/thread/9504717b/#32be it would be super to have a basic multi-cam input option. i will start with the porting of the things mostly already done by cmayer0087 to the simpler approach based on the current master branch. Pull request will follow.

This Feature request is meant as discussion platform for 'what should work in which way'.

Current Approach from my side would be:

  • [x] Getting v4l2loopback to work with portvideo to have a stable test-setup (more info)
  • [ ] port/copy MultiCamera Driver (mainly done)
  • [ ] document usage

configuration would be done in camera.xml something like this:

<portvideo>
    <camera driver="multicam" id="0">
        <capture format="mjpeg" width="600" height="360" fps="30" color="true" flip_h="false" flip_v="false"/>
        <settings/>
        <frame width="600" height="360" xoff="0" yoff="0" mode="-1"/>
        <childcamera driver="default" id="0">
            <capture format="mjpeg" width="320" height="240" fps="30" color="true" flip_h="false" flip_v="false"/>
            <settings/>
            <frame x="100" y="0" width="200" height="200" xoff="110" yoff="30" mode="-1"/>
        </childcamera>
        <childcamera driver="default" id="19">
            <capture format="mjpeg" width="320" height="240" fps="30" color="true" flip_h="false" flip_v="false"/>
            <settings exposure="auto"/>
            <frame x="300" y="0" width="300" height="200" xoff="10" yoff="30" mode="-1"/>
        </childcamera>
        <childcamera driver="default" id="20">
            <capture format="mjpeg" width="320" height="240" fps="30" color="true" flip_h="false" flip_v="false"/>
            <settings exposure="auto"/>
            <frame x="100" y="200" width="240" height="140" xoff="20" yoff="50" mode="-1"/>
        </childcamera>
    </camera>
</portvideo>

reactivision_multicam_configuration

the idea is you have a canvas defined by the first <capture width="600" height="360" /> tag (green border). than for every camera you want to show you create one <childcamera> tag. in this element the <capture> tag defines the hardware camera config/format. then there is a <frame x="100" y="200" width="240" height="140" xoff="20" yoff="50" mode="-1" /> tag to define the position and visible portion of the camera image.

If you have ideas how to change this for easier understanding pleas let me know.

s-light avatar Oct 11 '17 16:10 s-light

For anyone else stumbling upon this feature idea: you can achieve the desired output (as outlined by s-light) by using OBS Studio and combining multiple camera sources into a virtual camera output stream. However, OBS Virtual Camera used as input seems to freeze reacTIVIsion (1.5.1)

davidsalamon avatar Oct 20 '22 16:10 davidsalamon

However, OBS Virtual Camera used as input seems to freeze reacTIVIsion (1.5.1)

great idea !! its a while back - but if i remember correctly i also had freezes with virtual cameras - i think it had to do with order of opening and the pixel format that is used... so maybe it is possible to get it running if you find the correct order of device-opening / accessing and pixel-format options...

s-light avatar Oct 21 '22 14:10 s-light

@davidsalamon

For anyone else stumbling upon this feature idea: you can achieve the desired output (as outlined by s-light) by using OBS Studio and combining multiple camera sources into a virtual camera output stream. However, OBS Virtual Camera used as input seems to freeze reacTIVIsion (1.5.1)

I'm stumbling upon this now. I need to connect my OBS virtual camera to reactivision, but it doesn't seem to be able to recognise it. And I have no clue how to find the correct camera id if it would recognise it (as I need to change the camera id in camera.xml to change camera inputs). Do you have experience doing this? If so could you help me out?

Malmaars avatar Dec 17 '23 19:12 Malmaars