melnijir / Dicaffeine

Repository for things connected to Dicaffeine player/streamer.
https://dicaffeine.com
MIT License
120 stars 5 forks source link

Camera parameters #18

Open johannes1002003 opened 2 years ago

johannes1002003 commented 2 years ago

Hello,

is there a chance to get access to camera parameters like with raspivid , at least basic functions like rotating cameras?

Kind regards Johannes

melnijir commented 2 years ago

Hi,

it's not directly supported via GUI, but you can set them manually. After hitting the Stream button, the configuration file is generated in:

/tmp/yuri_config_streamer.xml

you can start the stream manually without the gui using command:

yuri2 /tmp/yuri_config_streamer.xml

in the output you should see Supported controls for your webcamera. If you edit the file, you'll see the section called \<event>, there you can add some specific settings, for example:

<event>
  route(pass(160))->webcam:brightness;
  route(pass(100))->webcam:contrast;
</event>

For functions like rotating you can use the specific functions, for example the simplest configuration file /tmp/yuri_config_streamer.xml would be:

<?xml version="1.0" encoding="UTF-8"?>
<app name="streamer">
    <description>Yuri auto-generated config streamer.</description>
    <node class="v4l2source" name="video_in_0">
        <parameter name="path">/dev/video0</parameter>
        <parameter name="format">MJPG</parameter>
        <parameter name="resolution">1024x576</parameter>
        <parameter name="fps">24</parameter>
    </node>
    <node class="jpeg_decoder" name="convert_0">
        <parameter name="format">rgba32</parameter>
    </node>
    <node class="ndi_output" name="ndi_output_0">
        <parameter name="stream">Dicaffeine stream</parameter>
        <parameter name="fps">24</parameter>
        <parameter name="audio">false</parameter>
    </node>
    <link class="single" name="link_video_input_0" source="video_in_0:0" target="convert_0:0"/>
    <link class="count_limited" name="link_video_output_ndi_out_0" source="convert_0:0" target="ndi_output_0:0" count="3"/>
</app>

To rotate the stream you can add the node with class rotate and the interconnection link:

<?xml version="1.0" encoding="UTF-8"?>
<app name="streamer">
    <description>Yuri auto-generated config streamer.</description>
    <node class="v4l2source" name="video_in_0">
        <parameter name="path">/dev/video0</parameter>
        <parameter name="format">MJPG</parameter>
        <parameter name="resolution">1024x576</parameter>
        <parameter name="fps">24</parameter>
    </node>
    <node class="jpeg_decoder" name="convert_0">
        <parameter name="format">rgb24</parameter>
    </node>
    <node class="rotate" name="rotate_0">
        <parameter name="angle">90</parameter>
    </node>
    <node class="convert" name="convert_1">
        <parameter name="format">rgba32</parameter>
    </node>
    <node class="ndi_output" name="ndi_output_0">
        <parameter name="stream">Dicaffeine stream</parameter>
        <parameter name="fps">24</parameter>
        <parameter name="audio">false</parameter>
    </node>
    <link class="single" name="link_video_input_0" source="video_in_0:0" target="convert_0:0"/>
    <link class="single" name="link_video_rotate_0" source="convert_0:0" target="rotate_0:0"/>
    <link class="single" name="link_video_convert_0" source="rotate_0:0" target="convert_1:0"/>
    <link class="count_limited" name="link_video_output_ndi_out_0" source="convert_1:0" target="ndi_output_0:0" count="3"/>
</app>

But again it's not supported in GUI and the file would be rewritten every time when you use the Stream button. Also the configuration files are a little bit different for Raspberry and PC.

Best regards, Jiri