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

REQUEST Temporary disable usb capture/grabber on rule

Discussion in 'Feature Requests' started by giovanne, 1 March 2018.

  1. giovanne

    giovanne Member

    Messages:
    59
    Hardware:
    RPi2, RPi3, +nodeMCU/ESP8266
    When using an USB Cam or a Picam for v4l2 grabber capture input, then it would be nice to have a possibility to disable the grabber temporary if there is no need to capture.

    Because a cam will capture all the time, where a (fushicai) grabber only captures when the input source is sending a signal.

    For me the grabber should capture from the cam only if the TV is on.
    It is a SmartTV and when I'm watching TV he is reachable in local network.

    Therefore it should be fine if the v4l2 grabber (USB recording in ng) is deactivated if a specific IP adress isn't reachable and switched on again if the IP is reachable.
    (or can the USB recording controlled remote/command line, then I can write a separate controller script switching it on / off)

    Or maybe there are other, better solutions...

    I'm not sure if related to: https://hyperion-project.org/threads/v4l2-add-shutdown-detection.146/
     
  2. giovanne

    giovanne Member

    Messages:
    59
    Hardware:
    RPi2, RPi3, +nodeMCU/ESP8266
    No ideas :(
     
  3. penfold42

    penfold42 Moderator Developer

    Messages:
    741
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    The quickest way is to write a cron job that checks for Ping response.

    If the tv state changes, send a json request or use hyperion-remote to enable/disable the grabber
     
  4. giovanne

    giovanne Member

    Messages:
    59
    Hardware:
    RPi2, RPi3, +nodeMCU/ESP8266
    Such a json request and Hyperion-remote call to enable/disable the grabber, is this already possible in classic and ng?
    How do they look like? For Hyperion remote, is it something different to --clear or -c black ?
     
  5. penfold42

    penfold42 Moderator Developer

    Messages:
    741
    Hardware:
    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    NG definitely supports disable/enable - in pretty sure classic doesn’t too (but those brain cells are long gone)

    Hyperion-remote -h should give you the help
     
  6. giovanne

    giovanne Member

    Messages:
    59
    Hardware:
    RPi2, RPi3, +nodeMCU/ESP8266
    Ok thanks, I think I will do it by a script/cron and controlling with hyperion remote.
    Found
    Code:
    -E, --enable <enable>                              Enable the Component with the given name. Available Components are [SMOOTHING,                                                                                                                    BLACKBORDER, FORWARDER,                                                                                                                       UDPLISTENER,                                                                                                                                  BOBLIGHT_SERVER, GRABBER,         
                                                                                                                V4L, LEDDEVICE]                                                                            
    -D, --disable <disable> ...
    
    or maybe for all
    Code:
      
    --off                                              deactivates hyperion                                                                       
    --on                                               activates hyperion