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

# Media Sources

> Learn how to provide media assets from various sources including streaming formats and protocols

## Overview

Probe.dev can analyze media files from various sources including traditional file formats, adaptive streaming formats (HLS, DASH), and live streaming protocols (RTMP, RTSP, SRT). Simply provide a direct link to your media asset, and our API will securely fetch and analyze it.

## Static Media Files

### Public URLs

The simplest approach is to provide a direct HTTP/HTTPS URL to your media file:

```json theme={null}
{
    "url": "https://example.com/videos/sample.mp4"
}
```

**Requirements:**

* Must be publicly accessible
* Must be a direct link to the media file (not a webpage)
* Supports HTTP and HTTPS protocols

## Streaming Formats

### HLS (HTTP Live Streaming)

Analyze HLS playlists and their associated media segments:

```json theme={null}
{
    "url": "https://probelibrary.s3.amazonaws.com/hls/sample/big_buck_bunny.m3u8"
}
```

**Supported HLS features:**

* Master playlists (multi-bitrate)
* Media playlists (single bitrate)
* Video, audio, and subtitle tracks
* Variant streams analysis
* Segment information

<Note>
  HLS analysis provides detailed information about adaptive bitrate ladders, segment durations, and track configurations.
</Note>

<Tip>
  For HLS compliance validation against Apple's specifications, use the dedicated `/v1/probe/mediastreamvalidator` endpoint. Essential for App Store submissions and debugging playback issues.
</Tip>

### DASH (Dynamic Adaptive Streaming)

Examine DASH manifests and media presentations:

```json theme={null}
{
    "url": "https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd"
}
```

**Supported DASH features:**

* Media Presentation Description (MPD) analysis
* Adaptation sets and representations
* Video, audio, and text tracks
* Segment templates and timelines
* Initialization segments

<Tip>
  DASH analysis reveals codec profiles, bitrate ladders, and segment structure for adaptive streaming optimization.
</Tip>

## Streaming Protocols

### RTMP (Real-Time Messaging Protocol)

Analyze live RTMP streams and Video on Demand (VOD) content:

```json theme={null}
{
    "url": "rtmp://matthewc.co.uk/vod/scooter"
}
```

**Common RTMP URL formats:**

```
rtmp://server.example.com/live/stream_key
rtmp://server.example.com/vod/video_name
rtmps://secure.example.com/live/stream_key
```

### RTSP (Real Time Streaming Protocol)

Probe RTSP streams for metadata and technical specifications:

```json theme={null}
{
    "url": "rtsp://server.example.com:554/stream/video"
}
```

**Common RTSP URL formats:**

```
rtsp://server.example.com/stream_name
rtsp://server.example.com:554/live/stream
rtsps://secure.example.com/secure_stream
```

### SRT (Secure Reliable Transport)

Analyze SRT streams for low-latency video delivery:

```json theme={null}
{
    "url": "srt://server.example.com:1234"
}
```

**SRT URL formats:**

```
srt://server.example.com:port
srt://server.example.com:port?streamid=stream_name
```

<Warning>
  Streaming protocol analysis may have longer processing times compared to static files due to the need to establish connections and buffer content.
</Warning>

## Content Types Supported

All streaming formats and protocols support analysis of:

<CardGroup cols={3}>
  <Card title="Video Streams" icon="video">
    * Codec identification
    * Resolution and frame rate
    * Bitrate analysis
    * Color space information
  </Card>

  <Card title="Audio Tracks" icon="music">
    * Audio codec details
    * Channel configuration
    * Sample rate and bit depth
    * Bitrate information
  </Card>

  <Card title="Subtitle/Caption Tracks" icon="closed-captioning">
    * Text track formats
    * Language identification
    * Timing information
    * Accessibility features
  </Card>
</CardGroup>

## Example Analysis Results

### HLS Stream Analysis

When analyzing an HLS playlist, you'll receive information about:

```json theme={null}
{
  "master_playlist": {
    "variant_streams": [
      {
        "bandwidth": 1200000,
        "resolution": "1280x720",
        "codecs": "avc1.4d401f,mp4a.40.2",
        "uri": "720p.m3u8"
      }
    ]
  },
  "media_segments": {
    "target_duration": 10,
    "sequence_number": 0,
    "segments_count": 180
  }
}
```

### RTMP Stream Analysis

RTMP stream analysis provides real-time stream characteristics:

```json theme={null}
{
  "stream_info": {
    "video_codec": "H264",
    "audio_codec": "AAC",
    "resolution": "1920x1080",
    "frame_rate": 30,
    "bitrate": 2500000
  }
}
```

## Amazon S3 Integration

### Public S3 Buckets

For publicly accessible S3 objects, use the standard S3 URL format:

```json theme={null}
{
    "url": "https://my-bucket.s3.amazonaws.com/path/to/video.mp4"
}
```

### Key-Based Authorization

For private S3 objects, include your AWS access credentials directly in the URL:

```http theme={null}
https://KEY:SECRET@s3.amazonaws.com/BUCKET/PATH
s3://KEY:SECRET@BUCKET/PATH
```

**Example:**

```json theme={null}
{
    "url": "https://AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY@s3.amazonaws.com/my-bucket/video.mp4"
}
```

<Warning>
  Be careful when using access keys in URLs as they may appear in logs. Consider using presigned URLs for better security.
</Warning>

### Presigned URLs

For private S3 objects, create a presigned URL with temporary access:

```json theme={null}
{
    "url": "https://my-bucket.s3.amazonaws.com/sample-video.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20250506%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250506T121314Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=9a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1"
}
```

**Benefits:**

* Temporary access (configurable expiration)
* No credentials in the URL path
* More secure than embedded keys

### Creating Presigned URLs

<AccordionGroup>
  <Accordion icon="aws" title="AWS CLI">
    Generate a presigned URL using the AWS CLI:

    ```bash theme={null}
    aws s3 presign s3://my-bucket/video.mp4 --expires-in 3600
    ```
  </Accordion>

  <Accordion icon="code" title="AWS SDK (Node.js)">
    Use the AWS SDK to generate presigned URLs programmatically:

    ```javascript theme={null}
    const AWS = require('aws-sdk');
    const s3 = new AWS.S3();

    const params = {
        Bucket: 'my-bucket',
        Key: 'video.mp4',
        Expires: 3600 // 1 hour
    };

    const url = s3.getSignedUrl('getObject', params);
    ```
  </Accordion>

  <Accordion icon="python" title="AWS SDK (Python)">
    Generate presigned URLs with boto3:

    ```python theme={null}
    import boto3
    from botocore.exceptions import ClientError

    s3_client = boto3.client('s3')

    try:
        response = s3_client.generate_presigned_url(
            'get_object',
            Params={'Bucket': 'my-bucket', 'Key': 'video.mp4'},
            ExpiresIn=3600
        )
    except ClientError as e:
        logging.error(e)
        return None
    ```
  </Accordion>
</AccordionGroup>

## Other Cloud Storage

### Google Cloud Storage

```json theme={null}
{
    "url": "https://storage.googleapis.com/my-bucket/video.mp4"
}
```

### Azure Blob Storage

```json theme={null}
{
    "url": "https://mystorageaccount.blob.core.windows.net/my-container/video.mp4"
}
```

### Cloudflare R2

```json theme={null}
{
    "url": "https://my-bucket.r2.cloudflarestorage.com/video.mp4"
}
```

## CDN and Streaming Services

Probe.dev works with media served through CDNs and streaming platforms:

### Content Delivery Networks

* **CloudFront** - Amazon's CDN
* **CloudFlare** - Global CDN
* **Fastly** - Edge cloud platform
* **KeyCDN** - High performance CDN

### Streaming Platforms

* **Vimeo** - Direct links to video files
* **YouTube** - Public video URLs
* **Twitch** - VOD direct links

<Note>
  Some platforms require specific URL formats or may have rate limiting. Ensure you're using direct media file URLs, not embed links.
</Note>

## URL Validation Tips

### Valid URL Examples ✅

```
https://example.com/video.mp4
https://cdn.example.com/media/stream.mkv
https://bucket.s3.amazonaws.com/folder/file.avi
https://probelibrary.s3.amazonaws.com/hls/sample/playlist.m3u8
https://cdn.bitmovin.com/content/manifest.mpd
rtmp://server.com/live/stream_key
rtsp://camera.example.com:554/stream
srt://server.example.com:1234
ftp://server.com/media/video.mov
```

### Invalid URL Examples ❌

```
https://youtube.com/watch?v=abc123        // Embed page, not direct file
https://example.com/player.html           // HTML player page
https://drive.google.com/file/d/abc       // Google Drive share link
file:///local/path/video.mp4              // Local file path
```

## Security Best Practices

<CardGroup cols={2}>
  <Card title="Access Control" icon="shield-check">
    * Use presigned URLs for private content
    * Set appropriate expiration times
    * Limit access to specific IP ranges when possible
    * Monitor access logs for unusual activity
  </Card>

  <Card title="URL Management" icon="link">
    * Don't embed credentials in URLs when possible
    * Use HTTPS for all media URLs
    * Validate URLs before sending to API
    * Consider URL shortening for very long presigned URLs
  </Card>
</CardGroup>

## Troubleshooting

### Common Issues

| **Error**            | **Cause**                                          | **Solution**                                                   |
| -------------------- | -------------------------------------------------- | -------------------------------------------------------------- |
| `403 Forbidden`      | Private content, credentials missing               | Use presigned URL or add credentials                           |
| `404 Not Found`      | Incorrect URL or file doesn't exist                | Verify URL and file existence                                  |
| `Timeout`            | Large file, slow connection, or stream buffer time | Check file size, network connectivity, and stream availability |
| `Invalid URL`        | Malformed URL                                      | Validate URL format                                            |
| `Stream Unavailable` | RTMP/RTSP stream offline                           | Verify stream is active and accessible                         |

### Testing Media Sources

Verify your media URL is accessible:

```bash theme={null}
# Test static files with curl
curl -I "https://your-media-url.com/video.mp4"

# Test HLS playlist
curl -I "https://your-hls-url.com/playlist.m3u8"

# Should return HTTP 200 and appropriate Content-Type
```

### Testing Streaming Protocols

```bash theme={null}
# Test RTMP stream with FFprobe
ffprobe -v quiet -print_format json -show_format rtmp://server.com/live/stream

# Test RTSP stream
ffprobe -v quiet -print_format json -show_format rtsp://camera.com:554/stream
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Report Types" icon="chart-bar" href="/guides/report-types">
    Choose the right analysis tools for your media
  </Card>

  <Card title="Sample Library" icon="video" href="/reference/sample-media-library">
    Try our sample files including streaming formats
  </Card>
</CardGroup>
