Skip to content

VISCA ​

References: Sony VISCA Command List Version 2.00 (ILME-FR7, cited as Sony) with its chapter "VISCA over IP", and the Axis VISCA interface description (cited as Axis) for the classic 4-digit BRC/EVI command set. Both are vendor documents that may not be redistributed; read them from the official links on the overview page. ptzsim module: ptzsim/visca.py, options --sony, --tcp, --udp, --pty.

VISCA is not one standard: the transport and the replies are common to Sony cameras, the command set differs per model. ptzsim follows the classic Sony BRC/EVI and Axis command set.

Framing and replies ​

SourceRequirementptzsim
Sony, Axismessage 8x … FF, x = camera address 1–7yes; serial uses --address
Sony "ACK/Completion Messages"ACK y0 4z FF on acceptance, completion y0 5z FF after execution, z = socketyes; the completion of an absolute move comes once its axes reach the target
Sony "Inquiry Packet"inquiries answer y0 50 … FF without ACKyes
Sony "Error Messages"syntax error y0 60 02 FF, buffer full y0 60 03 FF, canceled y0 6z 04 FF, no socket y0 6z 05 FF, not executable y0 6z 41 FFyes
Sony "Socket"two command sockets; a command holds its socket until it completesyes; a third command while both are busy gets "buffer full"
Sonycommand cancel 8x 2z FFyes
SonyIF_Clear 8x 01 00 01 FF answers y0 50 FF, stops motion and empties the socketsyes, also as broadcast 88 01 00 01 FF
Sonyaddress set 88 30 0w FF answers 88 30 0w+1 FFyes

VISCA over IP ​

SourceRequirementptzsim
Sony "VISCA over IP"UDP port 52381, 8-byte header: payload type (2), length (2), sequence number (4)yes (--sony)
Sonypayload types 01 00 command, 01 10 inquiry, 01 11 reply, 02 00 control command, 02 01 control replyyes
Sonycontrol command RESET 02 00 … 01 resets the sequence number, answered with ACK 01yes
Sonyreplies carry the sequence number of the requestyes
Sonycontrol replies 0F 01 (sequence number error) and 0F 02 (message error, e.g. wrong payload type)yes
Sonya message answered with an error was not performed, so its retransmission is executedyes
Sonythe VISCA address over IP is fixed: replies come from 90yes

Commands ​

SourceCommandptzsim
Axis "Command list: camera"power, zoom (stop/tele/wide/variable/direct 0000–4000), focus (stop/far/near/variable/direct 1000–F000), auto/manual focus, one push AFyes
Axis, Sonywhite balance mode, red/blue gain (relative and direct), one push WByes; the Sony list uses other mode codes (04 = ATW)
Sonypresets reset/set/recall pp = hex 00–63 (100 presets)yes
Sonypreset speed select, common and separate preset speed 01–32yes
Axis "Command list: pan/tilt"pan/tilt drive, absolute and relative position, home, resetyes; 4- and 5-digit positions; reset does not run a calibration move (issue #14)
Sonymanual focus while autofocus is on is "not executable"yes

Inquiries ​

Power, zoom, focus, focus mode, white balance mode, preset speeds, pan/tilt position, pan/tilt maximum speed, pan/tilt status and version are answered as listed in the Sony inquiry command list.

Known gaps ​

  • Serial replies always come from address 90, even to a controller that is not address 0 (issue #12).
  • No strict check that every data nibble has the form 0p, and no check of the VISCA over IP length field against the payload (issue #13).

A PTZ camera simulator for testing camera integrations. Released under the MIT License.