# place.stream.segment

> Published by [did:web:longos.iameli.link](https://lexicon.garden/identity/did:web:longos.iameli.link)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:web:longos.iameli.link/place.stream.segment)
- [Documentation](https://lexicon.garden/lexicon/did:web:longos.iameli.link/place.stream.segment/docs)
- [Examples](https://lexicon.garden/lexicon/did:web:longos.iameli.link/place.stream.segment/examples)

## Definitions

### `place.stream.segment`

**Type**: `record`

Media file representing a segment of a livestream

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | Unique identifier for the segment |
| `size` | `integer` | No | The size of the segment in bytes |
| `audio` | `array` | No |  |
| `video` | `array` | No |  |
| `creator` | `string` (did) | Yes |  |
| `duration` | `integer` | No | The duration of the segment in nanoseconds |
| `startTime` | `string` (datetime) | Yes | When this segment started |
| `signingKey` | `string` | Yes | The DID of the signing key used for this segment |
| `contentRights` | `ref` → `place.stream.metadata.contentRights` | No |  |
| `contentWarnings` | `ref` → `place.stream.metadata.contentWarnings` | No |  |
| `distributionPolicy` | `ref` → `place.stream.metadata.distributionPolicy` | No |  |

### `place.stream.segment#audio`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `rate` | `integer` | Yes |  |
| `codec` | `string` | Yes |  |
| `channels` | `integer` | Yes |  |

### `place.stream.segment#video`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `codec` | `string` | Yes |  |
| `width` | `integer` | Yes |  |
| `height` | `integer` | Yes |  |
| `bframes` | `boolean` | No |  |
| `framerate` | `ref` → `#framerate` | No |  |

### `place.stream.segment#framerate`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `den` | `integer` | Yes |  |
| `num` | `integer` | Yes |  |

### `place.stream.segment#segmentView`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | Yes |  |
| `record` | `unknown` | Yes |  |

## Raw Schema

```json
{
  "id": "place.stream.segment",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "id",
          "signingKey",
          "startTime",
          "creator"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the segment"
          },
          "size": {
            "type": "integer",
            "description": "The size of the segment in bytes"
          },
          "audio": {
            "type": "array",
            "items": {
              "ref": "#audio",
              "type": "ref"
            }
          },
          "video": {
            "type": "array",
            "items": {
              "ref": "#video",
              "type": "ref"
            }
          },
          "creator": {
            "type": "string",
            "format": "did"
          },
          "duration": {
            "type": "integer",
            "description": "The duration of the segment in nanoseconds"
          },
          "startTime": {
            "type": "string",
            "format": "datetime",
            "description": "When this segment started"
          },
          "signingKey": {
            "type": "string",
            "description": "The DID of the signing key used for this segment"
          },
          "contentRights": {
            "ref": "place.stream.metadata.contentRights",
            "type": "ref"
          },
          "contentWarnings": {
            "ref": "place.stream.metadata.contentWarnings",
            "type": "ref"
          },
          "distributionPolicy": {
            "ref": "place.stream.metadata.distributionPolicy",
            "type": "ref"
          }
        }
      },
      "description": "Media file representing a segment of a livestream"
    },
    "audio": {
      "type": "object",
      "required": [
        "codec",
        "rate",
        "channels"
      ],
      "properties": {
        "rate": {
          "type": "integer"
        },
        "codec": {
          "enum": [
            "opus"
          ],
          "type": "string"
        },
        "channels": {
          "type": "integer"
        }
      }
    },
    "video": {
      "type": "object",
      "required": [
        "codec",
        "width",
        "height"
      ],
      "properties": {
        "codec": {
          "enum": [
            "h264"
          ],
          "type": "string"
        },
        "width": {
          "type": "integer"
        },
        "height": {
          "type": "integer"
        },
        "bframes": {
          "type": "boolean"
        },
        "framerate": {
          "ref": "#framerate",
          "type": "ref"
        }
      }
    },
    "framerate": {
      "type": "object",
      "required": [
        "num",
        "den"
      ],
      "properties": {
        "den": {
          "type": "integer"
        },
        "num": {
          "type": "integer"
        }
      }
    },
    "segmentView": {
      "type": "object",
      "required": [
        "cid",
        "record"
      ],
      "properties": {
        "cid": {
          "type": "string",
          "format": "cid"
        },
        "record": {
          "type": "unknown"
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
