# Añadir subtítulos

## 1. Ejemplo de subtítulos inline

```json
{
  "type": "subtitle",
  "start": 0,
  "duration": 6,
  "words": [
    { "word": "hello", "punctuated_word": "Hello", "start": 0, "end": 0.4 },
    { "word": "world", "punctuated_word": "world!", "start": 0.4, "end": 0.9 }
  ],
  "config": {
    "position": "bottom",
    "fontSize": 58,
    "textColor": "#ffffff",
    "highlightColor": "#22d3ee",
    "backgroundColor": "rgba(0,0,0,0.45)"
  }
}
```

## 2. Ejemplo de subtítulos basados en assets

```json
{
  "assets": {
    "subtitles": [
      {
        "id": "sub-main",
        "words": [
          { "word": "hello", "punctuated_word": "Hello", "start": 0, "end": 0.4 },
          { "word": "world", "punctuated_word": "world!", "start": 0.4, "end": 0.9 }
        ]
      }
    ]
  }
}
```

Úsalo así:

```json
{
  "type": "subtitle",
  "start": 0,
  "duration": 6,
  "words": { "$ref": "sub-main" },
  "config": {
    "position": "bottom",
    "fontSize": 58,
    "highlightColor": "#22d3ee"
  }
}
```

## 3. JSON remoto de subtítulos

```json
{
  "type": "subtitle",
  "start": 0,
  "duration": 6,
  "words": {
    "src": "https://example.com/subtitle.json"
  }
}
```

## 4. Consejos prácticos

- Alinea la duración de los subtítulos con el segmento hablado
- Mantén suficiente padding inferior para las zonas seguras en móvil
- Prefiere `$ref` cuando los mismos subtítulos se reutilicen en varias plantillas o ejemplos

## 5. Documentos relacionados

- Elemento de subtítulos: [Elemento de subtítulo](https://renderingvideo.com/docs/elements/subtitle.md)
- Colección de ejemplos: [Ejemplos](https://renderingvideo.com/docs/examples.md)