> ## Documentation Index
> Fetch the complete documentation index at: https://crsdk.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the tracking frame

> Return the box the camera is tracking a subject in, after a
`remoteTouch`. The shape is the same as `getAFAreaPosition` — `normalized`
for overlays, `position` in the coordinate space `remoteTouch` accepts,
`raw` as the camera reports it — so the same overlay code renders both.

Poll this to follow a moving subject: the camera updates the frame on its
own once tracking has been seeded.

`type` is `target-af` for the subject being tracked, `non-target-af` for a
candidate the camera is showing but not acting on.

## Empty is a normal answer

With nothing being tracked this returns `200` with `frames: []` and
`available: true` — the property was readable, there was just no subject.
A `400` means the property could not be read at all, usually because live
view is not running.

Two ways to get a frame here, both measured on an ILCE-7M4:

- `remoteTouch`, with the body's **Touch Func. in Shooting** set to
  `Touch Tracking`. Tracking then holds on its own with no button held.
- The camera tracking for its own reasons — a tracking focus area with AF
  engaged. Holding `af-on` in `Tracking: Expand Flexible Spot` reports a
  `target-af` frame that disappears on release.

With the ILCE-7M4 default of `Touch Focus`, a touch moves the AF frame
instead and nothing appears here — read `getAFAreaPosition` in that case.




## OpenAPI

````yaml /openapi.yaml get /api/cameras/{cameraId}/tracking-frame
openapi: 3.1.0
info:
  title: Alpha Camera REST API
  version: 3.0.0
  description: >
    RESTful control for Sony cameras — shooting, settings, live view with OSD
    overlay,

    focus control, and file transfer through a clean HTTP interface.


    Built on the Sony Camera Remote SDK. Supports USB and network camera
    connections

    with multi-camera simultaneous operation.


    ## Connection Modes


    | Mode | Description |

    |------|-------------|

    | `remote` | Full camera control: shooting, settings, live view.
    Auto-transfer images to host PC. |

    | `remote-transfer` | Camera control + explicit SD card file access. Most
    capable mode. |

    | `contents` | SD card file access only. No shooting or settings control. |


    ## Quick Start


    1. `GET /api/cameras` — discover cameras

    2. `POST /api/cameras/{id}/connection` — connect

    3. `PUT /api/cameras/{id}/priority-key` — set to `pc-remote`

    4. `PUT /api/cameras/{id}/properties/{name}` — configure settings

    5. `POST /api/cameras/{id}/actions/af-shutter` — shoot

    6. `DELETE /api/cameras/{id}/connection` — disconnect


    ## Priority Key Requirement


    The camera's priority key **must** be set to `pc-remote` before it accepts
    any

    remote property changes or shooting commands.
  license:
    name: Proprietary
  contact:
    name: Camera Remote SDK
    url: https://github.com/ocjlee888/camera-remote-sdk-project
servers:
  - url: http://{host}:{port}
    description: |
      Local camera server. The server binary runs on the host that has the
      camera physically connected (USB or network). Defaults to
      `http://localhost:8080`; override `host` and `port` when the server
      runs on a different machine (e.g. a Raspberry Pi next to the camera).
    variables:
      host:
        default: localhost
        description: Host running the camera server binary
      port:
        default: '8080'
        description: Port the camera server is listening on
security: []
tags:
  - name: Connection
    description: Camera discovery, connection, and disconnection
  - name: Properties
    description: Read and write camera properties (ISO, aperture, shutter speed, etc.)
  - name: Actions
    description: Shooting commands and motor control (shutter, zoom, focus)
  - name: Live View
    description: Live view streaming and OSD overlay control
  - name: Events
    description: Server-Sent Events for real-time camera callbacks
  - name: SD Card
    description: SD card file browsing and download
  - name: Settings
    description: Save path configuration and camera settings file management
  - name: Server
    description: Server health, status, and log retrieval
paths:
  /api/cameras/{cameraId}/tracking-frame:
    get:
      tags:
        - Actions
      summary: Get the tracking frame
      description: >
        Return the box the camera is tracking a subject in, after a

        `remoteTouch`. The shape is the same as `getAFAreaPosition` —
        `normalized`

        for overlays, `position` in the coordinate space `remoteTouch` accepts,

        `raw` as the camera reports it — so the same overlay code renders both.


        Poll this to follow a moving subject: the camera updates the frame on
        its

        own once tracking has been seeded.


        `type` is `target-af` for the subject being tracked, `non-target-af` for
        a

        candidate the camera is showing but not acting on.


        ## Empty is a normal answer


        With nothing being tracked this returns `200` with `frames: []` and

        `available: true` — the property was readable, there was just no
        subject.

        A `400` means the property could not be read at all, usually because
        live

        view is not running.


        Two ways to get a frame here, both measured on an ILCE-7M4:


        - `remoteTouch`, with the body's **Touch Func. in Shooting** set to
          `Touch Tracking`. Tracking then holds on its own with no button held.
        - The camera tracking for its own reasons — a tracking focus area with
        AF
          engaged. Holding `af-on` in `Tracking: Expand Flexible Spot` reports a
          `target-af` frame that disappears on release.

        With the ILCE-7M4 default of `Touch Focus`, a touch moves the AF frame

        instead and nothing appears here — read `getAFAreaPosition` in that
        case.
      operationId: getTrackingFrame
      parameters:
        - $ref: '#/components/parameters/cameraId'
      responses:
        '200':
          description: >
            Tracking frame read. `frames` is empty when nothing is being
            tracked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrackingFrameResponse'
        '400':
          description: |
            The tracking frame could not be read — usually live view is not
            running.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Camera not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    cameraId:
      name: cameraId
      in: path
      required: true
      description: Camera identifier (e.g. `D10F60149B0C`)
      schema:
        type: string
  schemas:
    TrackingFrameResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          properties:
            available:
              type: boolean
              description: |
                Whether the tracking property could be read. True with an empty
                `frames` array means nothing is being tracked.
            frame_count:
              type: integer
            frames:
              type: array
              description: One entry per frame the camera reports.
              items:
                $ref: '#/components/schemas/TrackingFrame'
    ErrorResponse:
      type: object
      description: |
        Standard non-2xx response envelope. The API does not currently expose a
        stable machine-readable error code in the JSON body, so clients should
        branch on HTTP status first and then inspect `message` for the
        human-readable reason.
      example:
        success: false
        message: Camera not connected
        camera:
          connected: false
          model: ILCE-7M4
          id: D06CE05E3323
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          const: false
          example: false
        message:
          type: string
          example: Camera not connected
        camera:
          $ref: '#/components/schemas/CameraSummary'
    TrackingFrame:
      type: object
      description: A single tracking frame as the camera reports it.
      properties:
        type:
          type: string
          description: |
            `target-af` for the subject being tracked, `non-target-af` for a
            candidate the camera is showing but not acting on, or `unknown`.
        state:
          type: string
          description: |
            `focused`, `not-focused`, `moving`, `selection`, `registration-af`,
            `island` or `unknown` — the same states the AF frame reports.
        priority:
          type: integer
        normalized:
          type: object
          description: Frame centre as 0-1 fractions — use this to place an overlay.
          properties:
            x:
              type: number
            'y':
              type: number
        position:
          type: object
          description: |
            The same centre in the coordinate space `remoteTouch` accepts, so a
            tracked position can be fed straight back in.
          properties:
            x:
              type: integer
            'y':
              type: integer
        size:
          type: object
          description: Box dimensions, raw and as a fraction of the frame.
          properties:
            width:
              type: integer
            height:
              type: integer
            normalized_width:
              type: number
            normalized_height:
              type: number
        raw:
          type: object
          description: The camera's own numerator/denominator pair, unconverted.
          properties:
            xNumerator:
              type: integer
            xDenominator:
              type: integer
            yNumerator:
              type: integer
            yDenominator:
              type: integer
    CameraSummary:
      type: object
      description: Camera info embedded in API responses
      properties:
        connected:
          type: boolean
          example: false
        model:
          type: string
          example: ILCE-7M4
        id:
          type: string
          example: D06CE05E3323

````