hyperion source from cam in front of tv - prepare input region

  • Hello,

    is it possible to implement some functionality in the grabber to use(analyse) a perspective part of the source picture?

    See the attached picture to see some details about the idea.

    Why do I want to have such feature?
    -> Because there are more and more 4k/UHD sources and currently only very expensive solutions (HDfury or maybe Ambivision 4k) to capture/get the source picture into the pi.
    Therefore I want to use a mini cam in front of the TV (e.g. https://www.amazon.de/gp/produ…age_o00_s00?ie=UTF8&psc=1)
    The cam has cinch video to go into the already existing usb grabber (instead of the video out from my sat receiver before).

    For first tests I received the cam, but maybe it is not ideal because if there is black picture the cam doesn't show black - maybe because of night-sight support of the cam.
    -> have to look for a better one...??

    But first the requirements in software/hyperion:
    If I place the cam in front of the tv the picture will be somehow like in the attached picture (trapez).

    I want to crop the necessary part of the picture and expand the smallest size to the longest size (see attached picture).

    Therefore I need the functionality in hyperion/grabber :-)

    The advantage would be, that I can visualize all content on the TV (Apps on the SmartTV like Netflix, Prime, Youtube; Sky+ Pro Rec., PS3/4, ...) ;-)

    Should this be possible or are there better ideas?

    (for info: german disussion was also started before: https://hyperion-project.org/t…le-%C3%BCber-grabber.837/)


  • There was a hint in the german thread, to manually edit the LEDs values in the hyperion-config file to get the trapez-area of the captured picture of the usbcam/picam.
    I think that is a good idea until hyperion does support such analytics :)

    But for the first step, to get hyperion working with a cam (usb or picam), I have the question,
    should hyperion already be able to get the source video from a usbcam and picam.
    Are there special requirements for the cams? E.g. support using v4l driver?

    So I tried to test a usbcam which is laying around here (hama snakecam usb, is not that good - only for testing), it is recognized as /dev/video0 (haven't a picam yet - will be the next step)
    but if I try to start hyperion, than it throws:
    terminate called after throwing an instance of 'std::runtime_error'
    what(): VIDIOC_S_STD error 25, Inappropriate ioctl for device

    Maybe it doesn't support v4l ?

    how do I tell/configure hyperion to work with the usbcam and later on with the picam?
    (hyperiond -version: -> Application build time: Feb 27 2016 12:33:50, no hyperion.ng)
    => I think it is configured also like the usb-grabber in the hyperionconfig in the grabber-v4l2 section, am I am right?

    Is there someone using/testing a usbcam and picam already with hyperion and how?

    Thanks for hints...

  • with hyperion-v4l2:

    root@PI:/home/pi/screenshots# /opt/hyperion/bin/hyperion-v4l2 -d /dev/video0 --video-standard "PAL" --screenshot
    VIDIOC_S_STD error 25, Inappropriate ioctl for device
    root@Pi:/home/pi/screenshots# /opt/hyperion/bin/hyperion-v4l2 -d /dev/video0 --video-standard "PAL"
    VIDIOC_S_STD error 25, Inappropriate ioctl for device
    root@Pi:/home/pi/screenshots# /opt/hyperion/bin/hyperion-v4l2 -d /dev/video0
    V4L2 width=640 height=480
    Only pixel formats UYVY, YUYV, and RGB32 are supported error
    root@Pi:/home/pi/screenshots# /opt/hyperion/bin/hyperion-v4l2 -d /dev/video0 --screenshot
    V4L2 width=640 height=480
    Only pixel formats UYVY, YUYV, and RGB32 are supported error

    But maybe the usbcam (hama snakecam) is not that good.
    I will get an other the next days and will see if this changes something...

    In the end I will have a picam working with hyperion (in case of performace compared to the usbcam). But I have to wait for the picam before I can test this.

    I'm very interested if there is already someone using (testing) a picam in combination with hyperion and how to do this :cool:

  • What pixel formats does your USB camera support ?

    # v4l2-ctl -d /dev/video1 --list-formats-ext

    ioctl: VIDIOC_ENUM_FMT
    Index : 0
    Type : Video Capture
    Pixel Format: 'YUYV'
    Name : YUYV 4:2:2
    Size: Discrete 320x240
    Interval: Discrete 0.005s (187.000 fps)
    Interval: Discrete 0.007s (150.000 fps)
    Interval: Discrete 0.007s (137.000 fps)
    Interval: Discrete 0.008s (125.000 fps)
    Interval: Discrete 0.010s (100.000 fps)
    Interval: Discrete 0.013s (75.000 fps)
    Interval: Discrete 0.017s (60.000 fps)
    Interval: Discrete 0.020s (50.000 fps)
    Interval: Discrete 0.027s (37.000 fps)
    Interval: Discrete 0.033s (30.000 fps)
    Size: Discrete 640x480
    Interval: Discrete 0.017s (60.000 fps)
    Interval: Discrete 0.020s (50.000 fps)
    Interval: Discrete 0.025s (40.000 fps)
    Interval: Discrete 0.033s (30.000 fps)
    Interval: Discrete 0.067s (15.000 fps)

  • @penfold42,

    Thank you for your testing :)

    pixel format for my Hama SnakeCam:
    root@Pi:/opt/hyperion/bin# v4l2-ctl -d /dev/video0 --list-formats-ext
    ioctl: VIDIOC_ENUM_FMT
    Index : 0
    Type : Video Capture
    Pixel Format: 'PJPG' (compressed)
    Name : PJPG
    Size: Discrete 640x480

    I think not good :( and not supported, but it was only for testing for me, because I haven't a different one currently.

    I'm waiting for PiCam/Logitech C250 for further tests...

    Do you think it should also work with Hyperion instead of Hyperion.ng or do I have to Upgrade?

    What does your pull-request about 'no-change' mean?

    And what do you think, will there be a chance that hyperion will support 'trapezoid' analysis or definition in the future? :bigsmile:
    In the meantime I will manually edit the hyperion.config.json file with the LEDs values to grab in trapezoid area like the hint in the german thread (https://hyperion-project.org/threads/videokamera-also-quelle-über-grabber.837/#post-10030). Maybe with a little Excel-sheet to calculate the needed values...

  • trapezoid could be implemented - I think th best way is with the web UI and it’s pixel map generator.
    NG does a much nicer job of led layouts and doing it there means no additional performance hit. The downside is some effects will be weird !

    @Brindosch might be able to add nonchange to classic if you ask nicely as it’s a small change.

    Hyperion assumes a USB grabber is a video capture device and lets you specify pal, ntsc or secam video standards. This doesn’t appl to web cams so we need an option to just leave it

  • If I / we need the nochange for webcam support, than it would be nice to have it also in the classic hyperion.
    Do you mean I have to ask you nicely to add it to hyperion classic or do I have to ask Brindosch?
    If you, please add it or let Brindosch add it :D. Sorry, but I don't know how to address this correctly to the hyperion classic (git, issue, pull-request,...)

  • Update for my tests after I have received the Logitech C250 USB WebCam (got it for only 5€):
    - hyperion classic is working with the C250 USBCam :)
    - only change I have done in my existing hyperion working with the usbgrabber before: in 'hyperion.config.json' changed in the sequence 'grabber-v4l2' to 'no-change' => "standard" : "no-change",
    - it is very smooth, same like before with the grabber
    Next Steps with C250:
    - manually define the input region / 'trapezoid' -> started an Excel Sheet to calculate the values for the hyperion.config.json
    Current Disadvantage:
    - black TV Screen is not resulting in LEDs off, because the Cam gets some 'rest' lightning -> try to optimize, maybe better after 'trapezoid'
    Edit: Update, LEDs are off if the TV is black and the room is without daylight coming from windows etc. Also good for me, because normally no need for ambilight in bright conditions

    - Also waiting for the PiCam to test and compare
    - Update my Led Setup behind the TV because the UHD TV now is 65" instead of 46" before

    At the moment I think a solution with a cam will be the next setup for me to be able to support 4k/UHD, Smart Apps on TV, ... :thumbsup:
    I don't need the currently very expensive solutions which support 4k like Ambivision Pro, HDfury/HDLinker, etc.

  • As descripted in #13 I started testing with Logitech C250 Cam.
    Here are some updated informations.
    Also tested a Playstation 3 Eye Cam -> it is also running and has a higher horizontal field of view (degree) from 56 or (wide) 75
    So both cams are working, but I will stay with the C250 ;-)
    Today also the PiCam arrived, but I haven't tested it (esp. because with usb extension cable the C250 is simplier to position, waiting for a PiCam extension cable)

    Because I will stay with the C250, I have started first positioning of the cam and trapezoid test until my new LED strip arrives:
    To not edit each LEDs data in the hyperion.config.json I used an excel sheet, to define the Picture, Corners, LEDs - Visualize this and generate the LEDs hyperion-json part.
    Maybe it helps other with similiar Cam setups ;-) Feel free to use it.
    ! Maybe there are bugs in it, optimization possible and espacilly for other LED setup modifications are necessary !
    I attached a file from my old 32/16/32/16 LED setup and one from my new planned 45/26/45/26 LED setup
    Sheet 1 'Calculation': Insert Picture Size, 4 Corner Points and LEDs on each side
    Sheet 2 'Visualization': only for visualization of the inputs
    Sheet 3 'LED minmax + ToJSON': data copied from Sheet 1 and manually define the max areas; button to generate json 'json-LEDS-Hyperion.json' (LEDs part)

    For me it is working well with the cam (c250) in testing mode, now I have to wait for my new LED strip to prepare the new hardware setup ;-)

    Next steps/todos:
    [- optional: Test PiCam when the extension cable arrives]
    - optimize infrastructure and setup of colors/hyperion...
    - waiting for new LED strip and update my Led Setup behind the TV because the UHD TV now is 65" instead of 46" before

  • @penfold42, I think you are already using NG and for me to be prepared for it, can NG installed/compiled beside the existing Classic hyperion on a Raspberry Pi and switched (stop on and start the other) between both? Would be nice to have a look for the NG and test it... (have you a feeling how long a release for NG will take?)

    Thanks, giovanne

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!