1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

RPi + Other Software NG Hyperion-v4l2 capture resolution issue

Discussion in 'Software Support' started by popecix, 8 August 2019.

  1. popecix

    popecix New Member

    Messages:
    5
    Hardware:
    RPi3
    Hi All,

    I've been using Hyperion for years and have a working classic setup with HDMI2AV on an older TV, and just recently purchased a new 4k.

    On the new one I went with RPi3B, WS2812spi, and Hyperion.ng - all of which appears to be working fine, but running into the same issues of HDR washout, etc... that everyone else sees when using converters/splitters and a USB AV Cap dongle. So decided to try out the USB camera solution as discussed in this thread: https://hyperion-project.org/thread...cam-in-front-of-tv-prepare-input-region.2615/

    Had a Logitech C270 already, so the setup was pretty straight forward and largely works, but strangely the NG version of hyperion-v4l2 will only capture at 160x120, even with no screen decrementing. Even setting the resolution with v4l2-ctl before running it has no effect, because it seems to just get set back whenever hyperion-v4l2 runs:

    Code:
    [email protected]:~ $ v4l2-ctl -v width=640,height=480
    [email protected]:~ $ v4l2-ctl -V
    Format Video Capture:
        Width/Height      : 640/480
        Pixel Format      : 'YUYV' (YUYV 4:2:2)
        Field             : None
        Bytes per Line    : 1280
        Size Image        : 614400
        Colorspace        : sRGB
        Transfer Function : Default (maps to sRGB)
        YCbCr/HSV Encoding: Default (maps to ITU-R 601)
        Quantization      : Default (maps to Limited Range)
        Flags             :
    [email protected]:~ $ hyperion-v4l2 -s 1 --screenshot
    hyperion-v4l2:
        Version   : 1.0.0 (master (Paulchen-Panther-65c2fdba/4fc745e7-1564845603) Git Remote: https://github.com/hyperion-project/hyperion.ng.git)
        build time: Aug  7 2019 17:32:36
    
    Signal detection informations
    =============================
    dimension after decimation: 160 x 120
    signal detection area  : 40,30 x 120,90
    
    WARNING "no signal image" is to dark, signal detection is not relaiable.
    WARNING difference between threshold color and the other color components is to small, signal detection might have problems.
    
    suggested config values for signal detection:
        "redSignalThreshold"   : 0.29,
        "greenSignalThreshold" : 0.39,
        "blueSignalThreshold"  : 0.32,
        "signalDetectionHorizontalOffsetMin" : 0.26,
        "signalDetectionVerticalOffsetMin"   : 0.27,
        "signalDetectionHorizontalOffsetMax" : 0.3,
        "signalDetectionVerticalOffsetMax"   : 0.75
    
    Relevant config entries here:
    Code:
        "general": {
            "name": "My Hyperion Config",
            "showOptHelp": true,
            "watchedVersionBranch": "Stable"
        },
        "grabberV4L2": {
            "blueSignalThreshold": 5,
            "cropBottom": 0,
            "cropLeft": 0,
            "cropRight": 0,
            "cropTop": 0,
            "device": "/dev/video0",
            "greenSignalThreshold": 5,
            "redSignalThreshold": 5,
            "sDHOffsetMax": 0.75,
            "sDHOffsetMin": 0.25,
            "sDVOffsetMax": 0.75,
            "sDVOffsetMin": 0.25,
            "signalDetection": true,
            "sizeDecimation": 1,
            "standard": "NO_CHANGE"
        },
        "instCapture": {
            "systemEnable": false,
            "systemPriority": 250,
            "v4lEnable": true,
            "v4lPriority": 240
        },
    
    Since it looks like the latest hyperion-v4l2 no longer supports setting width/height, I'm at a loss on how to crack this. Not sure if it's a bug or just me missing something simple. Any ideas?
     
  2. Paulchen-Panther

    Paulchen-Panther Active Member Developer

    Messages:
    259
  3. popecix

    popecix New Member

    Messages:
    5
    Hardware:
    RPi3
    Hi Paulchen,

    Yeah, that's the behavior I would expect, however I can set the resolution and whenever I call hyperion-v4l2 it resets the format back to 160x120: Screenshot_1.png
    I'm installing 'motion' now to see if it works under that at a real resolution.
     
  4. popecix

    popecix New Member

    Messages:
    5
    Hardware:
    RPi3
    Well, fine in motion at 1280x720, so that would lead me to believe the camera is recognized correctly by the RPi, and getting the appropriate power. So I'm not sure why the grabber is detecting the dimensions wrong/setting them to that resolution. Thoughts?
     
  5. Paulchen-Panther

    Paulchen-Panther Active Member Developer

    Messages:
    259
    So that I can change something in the source code, I have to know how you installed Hyperion.NG.
     
  6. popecix

    popecix New Member

    Messages:
    5
    Hardware:
    RPi3
    I used the instructions on github, from my history:

    18 sudo apt update
    19 sudo apt upgrade
    20 sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python3-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev
    21 sudo apt-get install libraspberrypi-dev
    22 wget -qO- https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/bin/compile.sh | sh
    23 cd ~/hyperion/build
    24 sudo make install/strip

    then just ran hyperiond from command line to test before installing service.
     
  7. Paulchen-Panther

    Paulchen-Panther Active Member Developer

    Messages:
    259
  8. popecix

    popecix New Member

    Messages:
    5
    Hardware:
    RPi3
    I was able to test it on Sunday and it works great now! The capture is detected as 1280x960 and with a size dec of 4 it looks fantastic and only using 30-40% of CPU on a RPi 3b. Using the external cam for capture, it is independent of source, so all 4k/HDR content is viable.

    Will those changes be rolled into the main branch?

    If there's anything I can do to help out with testing or documenting I'm happy to do so, just let me know how I can help out.

    Thanks for your work on this, I really appreciate it!!!
     
  9. Paulchen-Panther

    Paulchen-Panther Active Member Developer

    Messages:
    259
    Yes, in the next PR I will take it in.
     
    • Like Like x 1