mkalten / reacTIVision

computer vision framework for tangible interactive surfaces
Other
306 stars 65 forks source link

feature request: Multi Camera input #29

Open s-light opened 7 years ago

s-light commented 7 years ago

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:

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.

davidsalamon commented 2 years ago

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)

s-light commented 2 years ago

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...

Malmaars commented 10 months ago

@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?