File size: 1,549 Bytes
8939f6f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Template final-output validation

Template runs validate the final artifact before publishing it to the media download layer.

## Checks

- The final artifact exists and has a non-zero file size.
- The artifact's extension matches the template's declared output format (except `source`, which preserves the input format).
- Probeable media is passed through the existing FFprobe validation path. The probe rejects outputs without decodable audio/video streams.
- When stream metadata is available, the final check confirms that audio and video MIME types have their corresponding stream and that reported audio/video duration is positive.

A failed check raises a template execution error, so the output is not published as a successful result.

## Response metadata

Successful template responses include an `output_validation` object in `metadata`, for example:

```json
{
  "output_validation": {
    "valid": true,
    "size_bytes": 4821093,
    "mime_type": "video/mp4",
    "container": "mov,mp4,m4a,3gp,3g2,mj2",
    "duration_seconds": 31.25,
    "video_stream_count": 1,
    "audio_stream_count": 1,
    "resolution": {
      "width": 1080,
      "height": 1920
    }
  }
}
```

Stream counts, container, duration, and resolution can be `null` when the output type is not probeable or a metadata field is unavailable. The file size and MIME type are always reported for a valid file artifact.

This validation is applied to template pipeline outputs; it does not imply that every standalone media endpoint has the same response metadata.