How to take screenshot from grabber using hyperion-v4l2?

When leds do not react to external video, you should check if grabber is working and what image it is passing into RPi. Hyperion has great feature of saving the screenshot from the grabber. Exact command is different depending on the operating system so we will have 2 sections here:

OpenElec

login to pi: root/openelec

cd /storage/.config
killall hyperiond
LD_LIBRARY_PATH=/storage/hyperion/bin /storage/hyperion/bin/hyperion-v4l2 --screenshot

In your working directory there will be screenshot.png. Using Samba share (windows network neighborhood) go to \\openelec\ConfigFiles and open screenshot.png

Raspbmc and raspbian

login to pi: pi/raspberry
killall hyperiond
hyperion-v4l2 --screenshot

In your working directory there will be screenshot.png created. Using Samba share (windows network neighborhood) or FTP go to /home/pi directory and get screenshot.png

In order to find out exactly how hyperion sees the input video, you should apply the same settings a in grabber-v4l2 section, for instance:

LD_LIBRARY_PATH=/storage/hyperion/bin /storage/hyperion/bin/hyperion-v4l2 -v PAL --width 360 --height 288 --screenshot

Full list of available options you can get with –help option:

OpenELEC:~ # LD_LIBRARY_PATH=/storage/hyperion/bin /storage/hyperion/bin/hyperion-v4l2 --help
V4L capture application for Hyperion
Build time: May 30 2014 20:07:11

Usage: /storage/hyperion/bin/hyperion-v4l2 [OPTIONS]

Parameters:
    -d, --device            The device to use [default=/dev/video0]
    -v, --video-standard    The used video standard. Valid values are PAL or NTSC (optional)
        --pixel-format      The use pixel format. Valid values are YUYV, UYVY, and RGB32 (optional)
        --input             Input channel (optional)
        --width             Try to set the width of the video input (optional)
        --height            Try to set the height of the video input (optional)
        --crop-width        Number of pixels to crop from the left and right sides of the picture before decimation [default=0]
        --crop-height       Number of pixels to crop from the top and the bottom of the picture before decimation [default=0]
        --crop-left         Number of pixels to crop from the left of the picture before decimation (overrides --crop-width)
        --crop-right        Number of pixels to crop from the right of the picture before decimation (overrides --crop-width)
        --crop-top          Number of pixels to crop from the top of the picture before decimation (overrides --crop-height)
        --crop-bottom       Number of pixels to crop from the bottom of the picture before decimation (overrides --crop-height)
    -s, --size-decimator    Decimation factor for the output size [default=1]
    -f, --frame-decimator   Decimation factor for the video frames [default=1]
        --screenshot             Take a single screenshot, save it to file and quit
    -t, --signal-threshold  The signal threshold for detecting the presence of a signal. Value should be between 0.0 and 1.0.
        --red-threshold     The red signal threshold. Value should be between 0.0 and 1.0. (overrides --signal-threshold)
        --green-threshold   The green signal threshold. Value should be between 0.0 and 1.0. (overrides --signal-threshold)
        --blue-threshold    The blue signal threshold. Value should be between 0.0 and 1.0. (overrides --signal-threshold)
        --3DSBS                  Interpret the incoming video stream as 3D side-by-side
        --3DTAB                  Interpret the incoming video stream as 3D top-and-bottom
    -a, --address           Set the address of the hyperion server [default: 127.0.0.1:19445]
    -p, --priority          Use the provided priority channel (the lower the number, the higher the priority) [default: 800]
        --skip-reply             Do not receive and check reply messages from Hyperion
    -h, --help                   Show this help message and exit

If you got an error or hyperion-v4l2 command has not finished, you may have:

  1. used OS that does not support your grabber
  2. Your grabber may not get enough power from pi (active/powered USB hub is recommended)
  3. your grabber is broken
  4. input provided to the grabber is not PAL/NTSC standard

Leave a Reply

Your email address will not be published. Required fields are marked *