Get screenshot using REST/Websocket API

  • I currently have a use case where I need to get the screenshot from the grabber while hyperion is running. Unfortunately, I cannot do this using the hyperion remote in the current release of hyperion. Whenever I try to do a screen grab when hyperion is running, I get an error saying the device is busy. I need to get this screengrab every second overwriting the previous one and it would be pointless to stop the service every second.


    Is there a way that this would be achievable using hyperion.ng? and if so, how? I cannot find any references to grabbing screenshots in the api documentation that I managed to come across.


    It is worth mentioning that this is running on a RasberryPi 3 so if I can grab these screenshots and save it to the SD card every second using either a bash script or better yet, python, then that would be awesome!! This project is going to be epic! I have it working with other LED lights but I need it to work with hyperion also. I just need the final piece to the puzzle.


    The only other options I can see to achieve this is trying to modify the code of the current hyperion release to get it to save the current screenshot in mimory which it is using to set the LED's as discussed here:
    https://github.com/hyperion-project/hyperion/issues/761


    I suppose I can always try and modify the source code myself and add the following code to https://github.com/hyperion-pr…yperion/Hyperion.cpp#L696 under the if (priority == getCurrentPriority()) statement.


    FILE* file;
    if ((file = fopen("/home/pi/test.png", "wb")) != NULL)
    {
    fwrite(image, sizeof(char), sizeof(image), file);
    }


    would this work as a viable option?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!