PiCapture SD1 Documentation

Installing the PiCapture hardware is straightforward:

  1. Connect the CSI-2 Ribbon Cable

Hold the PiCapture board above the Raspberry Pi and make sure that it is oriented so that the 40-pin connectors will mate.  Pull up on the ribbon cable locking mechanism, insert the ribbon cable, and push down on the locking mechanism to secure the cable.

ribbon2

  1. Mount the PiCapture board to the Raspberry Pi

Carefully connect the 40-pin connectors along the side of the boards.  Use the provided screws and spacers to secure the PiCapture board to the Raspberry Pi.

Note that the size of the mounting holes may vary slightly, and it may be necessary to gently ream out the holes slightly for the screws to fit.

IMG_0128

  1. Check the interface jumpers

The jumpers used to select the communications mode are located directly behind the red RCA connector.  There are two blocks:  a 2×2 block used to enable serial communication, and a 2×3 block used to select either I2C0 or I2C1.

topview-labels-jumpers

Jumpers-serial


The jumpers should be placed vertically on the block marked “UART” for serial communication.

 


Jumpers-i2c1The jumpers should be placed horizontally on the left using the pins marked “I2C1” for i2c communication on port 1.  This is the default configuration.

 


Jumpers-i2c0The jumpers should be placed horizontally on the right using the pins marked “I2C0” for i2c communication on port 0.

Because PiCapture works by emulating the Raspberry Pi Camera, you can use the same software that you would normally use with a camera.  For example, raspivid and the picamera library will both work with PiCapture.  There are some important considerations when using this software:

  • You should use the status LEDs on the PiCapture board to verify that it is operating properly and receiving video. Please refer to the installation and operation guide for the meaning of these indicators and a troubleshooting guide
  • The resolution of the “camera mode” selected should correspond to the resolution of the video source. For PiCapture SD1, this is always 640×480.
  • The Raspberry Pi camera drivers will attempt to “correct” the video received as if it were the camera. It may improve the quality of the PiCapture image to disable some of these functions.  As an example, the Automatic White Balance function does not generally help with PiCapture.

The following command will show 640×480 video in a preview window, with the AWB and exposure control functions turned off:   raspivid  –md 6 –awbg 1.0,1.0 –awb off –ex off -o

It is recommended that you always use these command line switches in your video captures.

The Raspberry Pi camera has a variety of different modes.  The PiCapture SD1 will only produce video from standard definition NTSC and PAL sources, sampled to 640×480 resolution.  It is recommended to use “mode 6” for raspivid, raspistill, or other programs using the mmal drivers.

Because the frame rate is dependent upon the video source, playback of a recorded video may not be at the same rate and it will likely appear to be “slowed down”.  One way to correct this is through the use of a program “MP4box”, which will package the recorded video with a wrapper that specifies the frame rate.

To install this software, use the command:

sudo apt-get install gpac

Then, run the program using:

MP4Box –fps 60 –add xxxx.h264 yyyy.mp4

This will take an h.264 format video named “xxxx” and create an mp4 file named yyyy with the frame rate specified.

PiCapture has multiple video inputs, and will attempt to search these inputs for a valid source automatically.  As an alternative, you can specify the desired source using the PiVideo control software or from application software using the PiVideo class.  Not all combinations of source inputs are valid.

With the PiCapture SD1 you could have:

  • Three independent composite sources
  • An S-Video source, and one additional composite source
  • A single YPbPr component video source.

The physical connections are shared:

Input Green Blue Red
Video 1 X    
Video 2   X  
Video 3     X
S-Video X X  
Component X X X

 

This means that if the input mode selected is different from the physical connection, you may not be seeing full color information.  If an S-Video input is connected, nothing should be connected to the Green or Blue RCA connectors.

There are several LED indicators on the PiCapture board:

GREEN                  Indicates that the video processor is operating properly

BLUE                     Indicates that input video has been detected and is available to the Raspberry Pi

YELLOW                Indicates that the Raspberry Pi is communicating with the video processor.  This light     will flash during software updates.

There are also 4 “Format” LEDs that indicate the video standard detected:

LED 0                     Lit when video locked – flashing for NTSC

LED 1                     Lit when video locked – flashing for PAL

LED 2                     Reserved for future function

LED 3                     Reserved for future function

PiCapture HD1 Documentation

Installing the PiCapture hardware is straightforward:

  1. Connect the CSI-2 Ribbon Cable

Hold the PiCapture board above the Raspberry Pi and make sure that it is oriented so that the 40-pin connectors will mate.  Pull up on the ribbon cable locking mechanism, insert the ribbon cable, and push down on the locking mechanism to secure the cable.

ribbon2

  1. Mount the PiCapture board to the Raspberry Pi

Carefully connect the 40-pin connectors along the side of the boards.  Use the provided screws and spacers to secure the PiCapture board to the Raspberry Pi.

Note that the size of the mounting holes may vary slightly, and it may be necessary to gently ream out the holes slightly for the screws to fit.

hd1-img_0360

 

 

 

 

 

  1. Check the interface jumpers

The jumpers used to select the communications mode are located directly behind the red RCA connector.  There are two blocks:  a 2×2 block used to enable serial communication, and a 2×3 block used to select either I2C0 or I2C1.

 

hd1-jumpers

 

 

 

 

 

Jumpers-serial

The jumpers should be placed vertically on the block marked “UART” for serial communication.

 


Jumpers-i2c1

The jumpers should be placed horizontally on the left using the pins marked “I2C1” for i2c communication on port 1.  This is the default configuration.

 


Jumpers-i2c0

The jumpers should be placed horizontally on the right using the pins marked “I2C0” for i2c communication on port 0.

Because PiCapture works by emulating the Raspberry Pi Camera, you can use the same software that you would normally use with a camera.  For example, raspivid and the picamera library will both work with PiCapture.  There are some important considerations when using this software:

  • You should use the status LEDs on the PiCapture board to verify that it is operating properly and receiving video. If the Blue “Video Detected” LED is not lit, you may receive an MMAL error if you attempt to capture video.
  • The resolution of the “camera mode” selected should correspond to the resolution of the video source. For PiCapture HD1, the green “Format” LEDs indicate the detected resolution.  Please refer to the table below.
  • The Raspberry Pi camera drivers will attempt to “correct” the video received as if it were the camera. It will improve the quality of the PiCapture image to disable some of these functions.  As an example, the Automatic White Balance function does not generally help with PiCapture.

The following command will show 1080p video in a preview window, with the AWB and exposure control functions turned off:          raspivid  –md 1 –awbg 1.0,1.0 –awb off –ex off -o

It is recommended that you use these command line switches for the highest quality video captures.

Captured video can be optimized by using other command line switches available in raspivid such as —sharpness (-sh), –contrast (-co), –brightness (-br), and –saturation (-sa).  Consult the raspivid documentation for more information.

For some HDMI sources you may consider reducing both the brightness and saturation levels with the PiCapture HD1.

Because the frame rate is dependent upon the video source, playback of a recorded video may not be at the same rate and it will likely appear to be “slowed down”.  One way to correct this is with the program “MP4box”, which will package the recorded video with a wrapper that specifies the frame rate.

To install this software, use the command:

sudo apt-get install gpac

Then, run the program using:

MP4Box –fps 60 –add xxx.h264 yyy.mp4

This takes an h.264 format video named “xxx” and create an mp4 file named “yyy” with the frame rate specified.

You may also use the PiVideo Control Software to reduce the captured frame rate by half, with the “—skip” option.  This will, for example, cause source vide at 60fps to be captured at 30fps which will match the default camera frame rate.

PiCapture has two video inputs, and will attempt to search these inputs for a valid source automatically.  As an alternative, you can specify the desired source using the PiVideo control software or from application software using the PiVideo class.

With the PiCapture HD1 you could have:

  • A single HDMI video source
  • A single YPbPr component video source.

There are several LED indicators on the PiCapture board:

GREEN                  Indicates that the video processor is operating properly

BLUE                      Indicates that input video has been detected and is available to the Raspberry Pi.  Note that if you attempt to capture video when the blue light is not on, you may receive an “MMAL” (camera driver) error on the Raspberry Pi.  In some cases, it may be necessary to restart the Raspberry Pi in order to recover.

YELLOW                Indicates that the Raspberry Pi is communicating with the video processor.  This light     will flash during software updates.

There are also 4 “Format” LEDs (labeled LED0 – LED3) that indicate the video standard detected:

DETECTED MODES Not Locked 480p 720p 1080i 1080p
LED 0   Flashing Flashing Flashing Flashing
LED 1     On On On
LED 2       On On
LED 3         On
Output   640×480 1296×730 960×540 1920×1080
Mode   6 5 5 1
Comments     Padded from 1280×720 Must set region of interest  

 

If the camera mode set in the Raspberry Pi does not match the locked video, you may receive an “MMAL” (camera driver) error or see random noise in the captured frame.

1080i Video Sources

Although the PiCapture HD1 is designed for progressive video sources, we have implemented a mode to allow the capture of 1080i video at reduced resolution.  The resulting 960×540 video does not correspond to an existing Raspberry Pi camera mode, and capturing this video requires using “Mode 5” and setting the “region of interest” to match the captured resolution using the “-roi” option:

raspivid  –md 5 –awbg 1.0,1.0 –awb off –ex off -roi 0.0,0.0,0.74,0.74 -o

General PiCapture Documentation

PiCapture is a unique video capture solution that enables all of the video processing capability of the Raspberry Pi Graphics Processing Unit (GPU).  By using the Raspberry Pi CSI-2 camera interface and providing complete camera emulation, all of the video encoding and management capabilities of the Raspberry Pi are usable with any compatible video source.  In addition, applications that require large amounts of Raspberry Pi resources (e.g. real-time image processing) are now enabled since CPU intensive USB capture devices are not required.

The PiCapture board is compatible with the “HAT” form factor and plugs directly into I/O header of the Raspberry Pi.  Standoffs and screws are supplied for securely mounting the PiCapture to the Raspberry Pi as shown above.  A ribbon cable connects to the CSI-2 camera interface.

Power is provided through the Raspberry Pi, with a standard 5V AC Adapter.  Pass-through connection header pins are provided for the Raspberry Pi I/O header so that additional devices may be attached.

The Raspberry Pi Camera driver must be enabled.  Detailed instructions are provided for Raspbian, and the process is similar for other operating systems.

The PiCapture board communicates with the Raspberry Pi through the CSI-2 camera interface.  In addition, it can be controlled using software provided through either the I2C or Asynchronous Serial Interface ports.  This flexibility is provided so that the PiCapture board is compatible with other devices or applications that my require use of these ports.  A jumper is used to select the interface port.

The PiVideo™ software, for control of the PiCapture board, provides a Python module that may be used with your software.  A command line interface based upon this module is also provided.  This software may be downloaded through the Python Package Index (PyPI) or is available at www.lintestsystems.com/downloads.

It is recommended that you use PyPi for installation of the latest Pivideo Software.  If you are installing for the first time:

sudo pip install pivideo

If you have previously installed an earlier version:

sudo pip install –upgrade pivideo

The PiVideo software may be used to control the PiCapture processor.  Some of the functions provided by this software include:

  • Automatic or manual video source selection
  • Optional on-screen source indication
  • Test mode control
  • A firmware update utility

By default, the PiVideo software communicates with the PiCapture processor using the Raspberry Pi i2c port 1.  If you are using this port for other applications,  jumpers may be used to select either i2c port 0 or the serial port as an alternative.  The default I2C address is 0x40, and the PiCapture can operate with other I2C slave devices attached to the port.  The serial port is required to perform software updates.

Download the full user documentation or enter pivideo –help for a complete list of command line options.

Please note that starting with version 1.9 the PiVideo software is compatible with wither Python 2 or Python 3.  If you are using Python 2, it is necessary to install the “future” package using sudo pip install future  

The PiCapture SD1 will operate “out of the box” using the Raspberry Pi camera interface and software.  At a minimum, the camera interface must be enabled on your Raspberry Pi.  For additional control of the various features and options it is necessary to configure the interface and install the control software.

Please note that these procedures are based on the currently released Raspbian code, but there have been changes between releases.  If you have difficulty, please consult the Raspberry Pi camera documentation or our website at https://lintestsystems.com.

Enabling Camera Support

From the desktop, navigate:  “Menu” > “Preferences” > “Raspberry Pi Configuration”

On the “Interfaces” tab:

Make sure that “Camera” is enabled.

Enabling the desired control interface

The serial port interface is required to apply software updates to the PiCapture video processor.  The simplest interface to use for all other operations is I2C-1.

From the desktop, navigate:  “Menu” à “Preferences” à “Raspberry Pi Configuration”

On the “Interfaces” tab:

If you want to use I2C for control of the PiCapture, make sure “I2C” is enabled.

If you want to use Serial for control of the PiCapture, make sure “Serial” is enabled.

You will need to reboot your Raspberry Pi when prompted for these changes to take effect.

Additional setup for the serial interface

If you want to use Serial for control, you must also disable the serial console interface

Note that the steps needed to disable the serial console interface have changed for various releases of Raspbian.  If you receive an error message from PiVideo that it is unable to access the serial port, it is likely that the console or another program is already using the port.

With the Raspberry Pi 3 the device names have changed as well.  The PiCapture uses the serial port that is mapped to physical pins 8 and 10 on the 40-pin connector.

Additional setup for the I2C-0 interface

The I2C-1 port will operate without additional configuration, but if you have a conflict and would like to use I2C-0 you must enable application access to that port by adding the following lines to /boot/config.txt:

dtparam=i2c_arm=on

dtparam=i2c_vc=on

device_tree_param=i2c0=on

device_tree_param=i2c=on

Ensure that the jumpers on the PiCapture board are in place to enable the desired I2C port connection.

Installing the PiCapture control software

It is recommended that you use pip to install the control software directly from the PiPy respository.  Simply enter:

sudo pip install pivideo

You can safely ignore error messages as long as the process concludes with “Successfully installed pivideo.”

An alternative is to download the Python package from https://lintestsystems.com.

If you will be using the I2C bus to communicate with PiCapture, you will also need to install Python support for I2C with:

sudo apt-get install python-smbus

I2C port one is the default for PiVideo.

Lintest Systems LLC provides a limited warranty for our products for 90 days from the date of first consumer purchase.   If the product is not purchased directly from Lintest Systems, a copy of the original dated bill of sale must be presented whenever warranty service is requested.

WHAT IS COVERED BY THIS WARRANTY

Except as specified below, the Lintest Systems warranty covers all defects in material and workmanship. The following are NOT covered: Damage caused by accident, misuse, abuse, product modification, or neglect; damage occurring during shipment; damage from failure to follow instructions contained the owner’s guide; damage resulting from the performance of repairs by someone not authorized by Lintest Systems; damage caused by installation of parts that do not conform to Lintest Systems specifications; any claims based on misrepresentations by the seller; products sold on an “as-is” or final sale basis; or the cost of installing, removing, or re-installing the unit.

Lintest Systems liability is limited to the repair or replacement, at our option, of any defective product and shall not include incidental or consequential damages. Lintest Systems reserves the right to replace a discontinued model with a comparable model. Any replacement units or parts may be new or rebuilt.

mwlinderDocumentation