Control remote capture
Vicon Shogun supports a simple UDP protocol to broadcast when capture has started. Shogun can also receive these messages, which can be used to trigger a capture remotely.
You can control remote capture in these ways:
- Use the Tracker API to trigger capture remotely or receive capture notifications. For more information, see Connect a Python client to Shogun Live.
- Use a simple UDP protocol to broadcast when capture has started. Shogun can also receive these messages, which can be used to trigger a capture remotely over a network.
Vicon Shogun supports a simple UDP protocol to broadcast when capture has started. Shogun can also receive these messages, which can be used to trigger a capture remotely.
Sample code is provided showing how to remotely start, stop or cancel a capture and extensive documentation is included in the code (see Example code for Control remote capture).
The port for broadcast and trigger is configurable and defaults to 30. Click
to view these fields.Note that the packet contents are null terminated.
The XML file contains the following notifications:
Start notification
The following example shows a Start notification. Note that the broadcast must fit into one UDP packet. The actual packet is not indented and white space between tokens is removed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <CaptureStart> <Name VALUE="dance"/> <Notes VALUE="The pets ants crime deer jump. "/> <Description VALUE="The crowd pencil pets alert fold deer. With welcome practice representative complete great? Or jolly tiny memorise thread. However wool insect pipe! "/> <DatabasePath VALUE="D:/Jeremy/Susan/Captures/Take"/> <Delay VALUE="33"/> <PacketID VALUE="33360"/> </CaptureStart>
Where:
Name | The name of the trial, which is used as the filename for the capture files, for example
|
Notes | Any notes provided |
Description | Any description provided. Avoid very long description strings as the broadcast must fit into one UDP packet. If it does not, the broadcast is not sent. |
DatabasePath | The target path for the capture files. DatabasePath updates the current capture folder and capture files are written to this path.
|
Delay | The number of milliseconds that the broadcast is made before the capture starts. This delay enables clients to do any preparation required to respond. |
PacketID | A unique number that individually identifies the packet. It is incremented for each packet generated. Use it to discard duplicate packets that are delivered by UDP. (This can happen if there are multiple paths between the broadcasting and listening machines.) |
Stop notification
The following example shows a Stop notification. It is a notification that capturing has stopped.
Note that writing the file to disk may not be complete. Wait for the corresponding Complete notification before trying to open the file.
Possible values for the result are:
- SUCCESS - Everything was ok.
- FAIL - Everything was not ok. Perhaps the disk ran out of room, or the system was unplugged. You may get a truncated file.
- CANCEL - The user stopped the capture process. There will not be a Complete notification. For more information, see 84230045.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <CaptureStop RESULT="SUCCESS"> <Name VALUE="dance"/> <DatabasePath VALUE="D:/Jeremy/Susan/Captures/Take"/> <Delay VALUE="33"/> <PacketID VALUE="33361"/> </CaptureStop>
Complete notification
The following example shows a Complete notification. It indicates that the captured file is ready at the path specified. Note that:
- When capture is complete, buffers have yet to be flushed to disk.
- If the file is on a remote drive, it may be captured locally and then copied to the final location. This may take some time.
- The DatabasePath value is the same as the path provided in the Start notification.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <CaptureComplete> <Name VALUE="dance"/> <DatabasePath VALUE="D:/Jeremy/Susan/Captures/Take"/> <PacketID VALUE="33362"/> </CaptureComplete>
Timecode Start notification
The following example shows a Timecode Start notification. It is generated when the system is armed. Note that:
- Capture starts when the system receives the timecode specified.
- Additional notifications may be generated if the start timecode is updated after the system is armed.
- You cannot update a Timecode Start notification once a system has started. If you send multiple Timecode Start notifications, only the first notification is acknowledged.
Below is an example of a Timecode Start notification.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <CaptureStart> <TimeCode VALUE="0 38 10 17 0 0 0 4"/> <Name VALUE="slip"/> <Notes VALUE="The last ants great blade jump. "/> <Description VALUE="The truthful pencil pets ants crime deer. With geese trail representative complete crowd? Or jolly toothbrush slip thread. However worried insect nest! "/> <DatabasePath VALUE="D:/Captures/Take/DayOne/Final"/> <PacketID VALUE="33364"/> </CaptureStart>
Where:
TimeCode
is represented as a sequence of integers delimited with spaces.
- Hours
- Minutes
- Seconds
- Frames
- Sub-Frame (Always zero)
- Field
- 0 - Even Field
- 1 - Odd Field
- Standard
- 0 - PAL
- 1 - NTSC
- 2 - NTSC Drop
- 3 - Film at 24fps
- 4 - NTSC Film
- 5 - 30Hz exactly
- Sub-Frames Per Frame (the multiple of the timecode rate that the system is running at)
Timecode Stop notification
The following example shows a Timecode Stop notification. Note that additional notifications may be generated if the Timecode Stop is updated after the system is armed or possibly even capturing.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <CaptureStop> <TimeCode VALUE="0 46 27 15 0 0 0 4"/> <Name VALUE="slip"/> <DatabasePath VALUE="D:/Captures/Take/DayOne/Final"/> <PacketID VALUE="33365"/> </CaptureStop>
The values for TimeCode
are as listed in Timecode start notification.
Duration Stop notification
The packet is generated when the system is armed, or immediately prior to the capture being started.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <CaptureStop> <Duration FRAMES="12867" PERIOD="32865" TICKS="5553087"/> <Name VALUE="memorise"/> <DatabasePath VALUE="D:/Take/DayOne/Final/Susan"/> <PacketID VALUE="33367"/> </CaptureStop>
Where:
Duration
is the number of frames that will be captured.
The packet may contain extra information describing the frame rate:
PERIOD
is the number of clock ticks between each frameTICKS
is the number of ticks in each second
The frames per second of the system can be calculated as TICKS/PERIOD
. This representation of the frame rate avoids rounding errors for rates such as NTSC, which cannot be stored in a double without a loss of precision.
<Duration FRAMES="12867" PERIOD="653254" TICKS="135000000" />
Cancel notification
Send a cancel notification to cancel a take and discard the capture. Note that the RESULT
parameter in CaptureStop
is set to CANCEL
.
If you send a cancel notification, the recording is stopped and the corresponding Complete notification is not sent.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <CaptureStop RESULT="CANCEL"> <Name VALUE="dance"/> <DatabasePath VALUE="D:/Jeremy/Susan/Captures/Take"/> <Delay VALUE="33"/> <PacketID VALUE="33361"/> </CaptureStop>