Difference between revisions of "GStreamer Pan Tilt Zoom and Rotate Element - Demo Tool"

From RidgeRun Developer Connection
Jump to: navigation, search
(Add details of how to use the interactive mode)
Line 36: Line 36:
 
[[File:PTZR-interactive.png|800px|center|thumb|Interactive mode]]
 
[[File:PTZR-interactive.png|800px|center|thumb|Interactive mode]]
  
 +
The interface is designed for using the keypad for controlling the PTZR element. Most of the controls are available single-handedly on the numeric keypad of a full keyboard. Table 1 shows the controls and the actions that can be done in the interactive mode.
 +
 +
<html>
 +
  <center>
 +
  <table class='wikitable'>
 +
    <tr>
 +
      <th>Keys</th>
 +
      <th>Action</th>
 +
    </tr>
 +
    <tr>
 +
      <td>left and right arrows</td>
 +
      <td>change pan value by the selected step</td>
 +
    </tr>
 +
    <tr>
 +
      <td>up and down arrows</td>
 +
      <td>change tilt value by the selected step</td>
 +
    </tr>
 +
    <tr>
 +
      <td>+ and -</td>
 +
      <td>change zoom value by 0.1x</td>
 +
    </tr>
 +
    <tr>
 +
      <td>/ and *</td>
 +
      <td>change rotate value by 5 degrees counterclockwise or clockwise</td>
 +
    </tr>
 +
    <tr>
 +
      <td>d and 0/Ins</td>
 +
      <td>set all values to default</td>
 +
    </tr>
 +
    <tr>
 +
      <td>./DEL</td>
 +
      <td>toggle output-reference mode</td>
 +
    </tr>
 +
    <tr>
 +
      <td>TAB and 5</td>
 +
      <td>toggle normalize-translation mode</td>
 +
    </tr>
 +
    <tr>
 +
      <td>F9 and F10</td>
 +
      <td>decrease and increase step used for pan/tilt from 5 preset values</td>
 +
    </tr>
 +
    <tr>
 +
      <td>q or ENTER</td>
 +
      <td>exit the application</td>
 +
    </tr>
 +
    <caption>Table 1. Interactive mode controls</caption>
 +
  </table>
 +
  </center>
 +
</html>
  
  

Revision as of 15:23, 13 February 2018


iMX6 Pipelines

Home

Home

The demo tool is a Python script called ptzr_test located in the tests/examples directory. It can be used to demonstrate and test the different transformations that are possible using the GStreamer PTZR element.

ptzr_test

The ptzr_test script uses Ridgerun's GStreamer Daemon (gstd) to create a pipeline that can be used to demo the features of GstPTZR. If gstd is not running, it will try to start it.

It will create a pipeline with the name p0 with a GstPTZR element with the name ptzr0. The basic pipeline that will be created will use autovideosrc to pick the first available video source (a webcam, if available; a videotestsrc if not), with some basic caps. If a pipeline with those characteristics already exists, it will use it.

It will allow the user to manipulate the different properties of the GstPTZR element in a number of different ways, according to the mode that is selected.

To start the script, run it directly in your console:

user@host:~/gst-ptzr$ tests/examples/ptzr_test

Modes of operation

The demo tool can be used in a number of different configurations, according to the application. This section describes the different modes and the ways to interact with the element in each mode.

Interactive

Interactive mode is the default mode. It can be started explicitly by using:

user@host:~/gst-ptzr$ tests/examples/ptzr_test -i

It will show a curses UI with all the information you need to control the GstPTZR element.

Error creating thumbnail: Unable to save thumbnail to destination
Interactive mode

The interface is designed for using the keypad for controlling the PTZR element. Most of the controls are available single-handedly on the numeric keypad of a full keyboard. Table 1 shows the controls and the actions that can be done in the interactive mode.

Keys Action
left and right arrows change pan value by the selected step
up and down arrows change tilt value by the selected step
+ and - change zoom value by 0.1x
/ and * change rotate value by 5 degrees counterclockwise or clockwise
d and 0/Ins set all values to default
./DEL toggle output-reference mode
TAB and 5 toggle normalize-translation mode
F9 and F10 decrease and increase step used for pan/tilt from 5 preset values
q or ENTER exit the application
Table 1. Interactive mode controls


Command line

TBD

Demo

TBD

Script

TBD

Other options

Debug mode

TBD

Loop

TBD

Compatibility

ptzr_test has been tested with Python 2.7 and 3.5. If any compatibility issues arise, please report them.

It requires the following Python libraries:

cmd
curses
psutil


iMX6 Pipelines

Home

Home