# place.stream.media.finalizeLivestream

> Published by [did:web:stream.place](https://lexicon.garden/identity/did:web:stream.place)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:web:stream.place/place.stream.media.finalizeLivestream)
- [Documentation](https://lexicon.garden/lexicon/did:web:stream.place/place.stream.media.finalizeLivestream/docs)
- [Examples](https://lexicon.garden/lexicon/did:web:stream.place/place.stream.media.finalizeLivestream/examples)

## Definitions

### `place.stream.media.finalizeLivestream`

**Type**: `procedure`

Turn a finished livestream into a VOD. The server concatenates the MUXL segments it recorded for the livestream into a single content blob, derives the playback sidecars, and publishes the place.stream.media.track records. Processing completes server-side and creates a draft VOD; the client does not need to poll or publish — the user publishes the draft later via place.stream.vod.publishDraft. Returns the draft's ats:// URI so the client can navigate to it, alongside an uploadId for backwards compatibility.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `livestream` | `string` (at-uri) | Yes | AT-URI of the place.stream.livestream record to finalize into a VOD. Must belong to the authenticated user. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `draftUri` | `string` | Yes | The ats:// URI of the draft VOD created for this finalize. The draft reaches status 'ready' when processing completes; the user publishes it from the Drafts tab via place.stream.vod.publishDraft. |
| `uploadId` | `string` | Yes | Identifier for the finalize job. Retained for backwards compatibility; the draft flow no longer requires the client to poll getUploadStatus. |

#### Errors

- **LivestreamNotFound**: No livestream with the given URI is known, or it does not belong to the authenticated user.
- **NoRecording**: The livestream has no recorded MUXL segments to finalize (recording was not enabled, or none completed).

## Raw Schema

```json
{
  "id": "place.stream.media.finalizeLivestream",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "livestream"
          ],
          "properties": {
            "livestream": {
              "type": "string",
              "format": "at-uri",
              "description": "AT-URI of the place.stream.livestream record to finalize into a VOD. Must belong to the authenticated user."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "LivestreamNotFound",
          "description": "No livestream with the given URI is known, or it does not belong to the authenticated user."
        },
        {
          "name": "NoRecording",
          "description": "The livestream has no recorded MUXL segments to finalize (recording was not enabled, or none completed)."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "uploadId",
            "draftUri"
          ],
          "properties": {
            "draftUri": {
              "type": "string",
              "description": "The ats:// URI of the draft VOD created for this finalize. The draft reaches status 'ready' when processing completes; the user publishes it from the Drafts tab via place.stream.vod.publishDraft."
            },
            "uploadId": {
              "type": "string",
              "description": "Identifier for the finalize job. Retained for backwards compatibility; the draft flow no longer requires the client to poll getUploadStatus."
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": null,
      "description": "Turn a finished livestream into a VOD. The server concatenates the MUXL segments it recorded for the livestream into a single content blob, derives the playback sidecars, and publishes the place.stream.media.track records. Processing completes server-side and creates a draft VOD; the client does not need to poll or publish — the user publishes the draft later via place.stream.vod.publishDraft. Returns the draft's ats:// URI so the client can navigate to it, alongside an uploadId for backwards compatibility."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
