Skip to content

Ocyss/srs-auth / .agents/skills/internal-docs-for-srs

internal-docs-for-srs

Flagged

Route SRS and Oryx tasks to the smallest relevant set of trusted project documentation and maintain the project documentation bundled with this skill. Use whenever support or development work requires locating, choosing, reading, creating, updating, or reviewing SRS documentation, or whenever Oryx work requires project documentation for deployment, streaming, authentication, recording to local or S3-compatible storage, restreaming, virtual live, camera, transcoding, HTTPS, APIs, callbacks, AI features, or development. Includes the C++ media server documentation, Oryx project documentation, website pages, changelog, executable API examples, and next-generation Go server and performance documentation.

FileKindSize
SKILL.mdskill md12.2 KB
references/cpp-docs/doc/dvr.mdmarkdown11.3 KB
references/cpp-docs/doc/edge.mdmarkdown6.0 KB
references/cpp-docs/doc/exporter.mdmarkdown5.3 KB
references/cpp-docs/doc/ffmpeg.mdmarkdown13.1 KB
references/cpp-docs/doc/flv.mdmarkdown13.3 KB
references/cpp-docs/doc/forward.mdmarkdown8.3 KB
references/cpp-docs/doc/gb28181.mdmarkdown2.2 KB
references/cpp-docs/doc/getting-started-ai.mdmarkdown5.9 KB
references/cpp-docs/doc/getting-started-build.mdmarkdown5.3 KB
references/cpp-docs/doc/getting-started-cdk.mdmarkdown264 B
references/cpp-docs/doc/getting-started.mdmarkdown6.7 KB
references/cpp-docs/doc/hevc.mdmarkdown18.4 KB
references/cpp-docs/doc/hls.mdmarkdown34.8 KB
references/cpp-docs/doc/http-api.mdmarkdown18.4 KB
references/cpp-docs/doc/http-callback.mdmarkdown16.5 KB
references/cpp-docs/doc/http-server.mdmarkdown9.5 KB
references/cpp-docs/doc/ingest.mdmarkdown3.3 KB
references/cpp-docs/doc/introduction.mdmarkdown11.4 KB
references/cpp-docs/doc/low-latency.mdmarkdown6.5 KB
references/cpp-docs/doc/nginx-for-hls.mdmarkdown10.8 KB
references/cpp-docs/doc/origin-cluster.mdmarkdown18.5 KB
references/cpp-docs/doc/performance.mdmarkdown26.8 KB
references/cpp-docs/doc/resource.mdmarkdown3.4 KB
references/cpp-docs/doc/rtmp.mdmarkdown18.6 KB
references/cpp-docs/doc/rtsp.mdmarkdown7.3 KB
references/cpp-docs/doc/security.mdmarkdown2.0 KB
references/cpp-docs/doc/snapshot.mdmarkdown3.6 KB
references/cpp-docs/doc/srt.mdmarkdown29.1 KB
references/cpp-docs/doc/webrtc.mdmarkdown34.0 KB
references/cpp-docs/pages/faq-server-en.mdmarkdown31.0 KB
references/cpp-docs/pages/license-en.mdmarkdown6.8 KB
references/cpp-docs/pages/product-en.mdmarkdown25.7 KB
references/cpp-docs/pages/security-advisories-en.mdmarkdown1.4 KB
references/oryx/2022-04-09-Oryx-Tutorial.mdmarkdown14.2 KB
references/oryx/2022-04-12-Oryx-HTTPS.mdmarkdown5.0 KB
references/oryx/2022-04-15-Oryx-WordPress-Plugin.mdmarkdown4.9 KB
references/oryx/2022-04-29-BT-aaPanel.mdmarkdown5.6 KB
references/oryx/2023-08-29-Oryx-Ensuring-Authentication-for-Live-Streaming-Publishing.mdmarkdown6.2 KB
references/oryx/2023-09-09-Oryx-Multi-Platform-Streaming.mdmarkdown4.9 KB
references/oryx/2023-09-10-Oryx-Record-Live-Streaming.mdmarkdown4.5 KB
references/oryx/2023-09-11-Oryx-Virtual-Live-Events.mdmarkdown6.0 KB
references/oryx/2023-10-11-Oryx-Stream-IP-Camera-Events.mdmarkdown5.3 KB
references/oryx/2023-10-21-Oryx-Live-Transcoding.mdmarkdown5.4 KB
references/oryx/2023-11-28-Oryx-Live-Streams-Transcription.mdmarkdown5.4 KB
references/oryx/2023-12-12-Oryx-OBS-WHIP-Service.mdmarkdown4.5 KB
references/oryx/2024-01-31-Browser-Voice-Driven-GPT.mdmarkdown9.5 KB
references/oryx/2024-02-21-Dubbing-Translating.mdmarkdown5.0 KB
references/oryx/2024-05-20-OCR-Video-Streams.mdmarkdown4.3 KB
references/oryx/faq-oryx-en.mdmarkdown37.0 KB
references/oryx/getting-started-oryx.mdmarkdown15.9 KB
references/perf/proxy-whep.mdmarkdown5.4 KB
references/proxy/features.mdmarkdown9.3 KB
references/proxy/proxy-design.mdmarkdown2.8 KB
references/proxy/proxy-load-balancer.mdmarkdown5.8 KB
references/proxy/proxy-origin-cluster.mdmarkdown5.7 KB
references/proxy/proxy-protocol.mdmarkdown5.8 KB
references/proxy/proxy-usage.mdmarkdown2.7 KB

references/cpp-docs/doc/low-latency.md

View on GitHub
---
title: Low Latency
sidebar_label: Low Latency
hide_title: false
hide_table_of_contents: false
---

# Low Latency Live Stream

The RTMP and HLS can cover all requires for internet live stream,
read  [DeliveryHLS](./hls.md),
while RTMP is designed for low latency live stream.

The deploy for low latency, read [Usage: Realtime](./sample-realtime.md)

## Use Scenario

The low latency use scenario:
* Live show.
* Video meeting.
* Other, for example, monitor, education.

## Latency

RTMP is design for low latency:
* Adobe flash player is good at play RTMP stream.
* RTMP is stable enough for longtime publish and play on PC.
* Low latency, about 0.8-3s.
* For RTMP is base on TCP, the latency maybe very large for network issue.

## HLS LowLatency

HLS has a bigger delay than RTMP, usually more than 5 seconds. If not set up properly, it can be over 15 seconds.

If you want to reduce the HLS delay, please check out [HLS LowLatency](./hls.md#hls-low-latency).

## Benchmark

We use the clock of mobile phone to test the latency,
read [RTMP latency benchmark](http://blog.csdn.net/win_lin/article/details/12615591)

When netowork is ok:
* RTMP can ensure 0.8-3s latency.
* The RTMP cluster add 0.3s latency for each level.
* The latency of nginx-rtmp is larger than SRS, maybe the cache or multiple process issue.
* The gop cache always make the latency larger, but SRS can disable the gop cache.
* The bufferTime of flash client should set to small, see NetStream.bufferTime.

## Min-Latency

When min-latency is enabled, SRS will diable the mr(merged-read) and use timeout cond wait, to send about 1-2 video packets when got it.

We can got 0.1s latency for vp6 video only stream, read [#257](https://github.com/ossrs/srs/issues/257#issuecomment-66773208). The config:

```
vhost mrw.srs.com {
    # whether enable min delay mode for vhost.
    # for min latence mode:
    # 1. disable the publish.mr for vhost.
    # 2. use timeout for cond wait for consumer queue.
    # @see https://github.com/ossrs/srs/issues/257
    # default: off
    min_latency     off;
}
```

For example to deploy realtime stream, read [wiki]([EN](./sample-realtime.md), [CN](./sample-realtime.md)).

## Merged-Read

The perfromance of RTMP read is very low, because we must read 1byte chunk type, then chunk header, finally payload. So SRS 1.0 only supports 1000 publisher, and 2700 player. SRS 2.0 supports 4500 publisher, and 10000 player.

To improve the read performance, SRS2.0 introduced the merged-read, which read Nms packets from socket then parsed in buffer. The config:

```
# the MR(merged-read) setting for publisher.
vhost mrw.srs.com {
    # the config for FMLE/Flash publisher, which push RTMP to SRS.
    publish {
        # about MR, read https://github.com/ossrs/srs/issues/241
        # when enabled the mr, SRS will read as large as possible.
        # default: off
        mr          off;
        # the latency in ms for MR(merged-read),
        # the performance+ when latency+, and memory+,
        #       memory(buffer) = latency * kbps / 8
        # for example, latency=500ms, kbps=3000kbps, each publish connection will consume
        #       memory = 500 * 3000 / 8 = 187500B = 183KB
        # when there are 2500 publisher, the total memory of SRS atleast:
        #       183KB * 2500 = 446MB
        # the value recomment is [300, 2000]
        # default: 350
        mr_latency  350;
    }
}
```

That is, when merged-read enabled, the read buffer of SRS is `latency` ms, the latency also increase to this value.

For low latency, user should disable merged-read, SRS will recv and parse the packet immediately.

## Merged-Write

SRS always use merged-write to send packets. This algorithm can improve about 500% performance, for example, SRS 1.0 writev a packet which supports 2700 clients, while SRS 2.0 writev multiple packets and supports 10000 clients.

User can config the merged write pacets in ms, recomment to use default value:

```
# the MW(merged-write) settings for player.
vhost mrw.srs.com {
    # for play client, both RTMP and other stream clients,
    # for instance, the HTTP FLV stream clients.
    play {
        # set the MW(merged-write) latency in ms.
        # SRS always set mw on, so we just set the latency value.
        # the latency of stream >= mw_latency + mr_latency
        # the value recomment is [300, 1800]
        # default: 350
        mw_latency      350;
    }
}
```

User can config this to 100ms for very low latency.

## GOP-Cache

The gop is the gop between two I frame.

SRS use gop-cache to cache the last gop for the live stream,
when client play stream, SRS can send the last gop to client
to enable the client to start play immediately.

Config of srs:

```bash
# the listen ports, split by space.
listen              1935;
vhost __defaultVhost__ {
    # for play client, both RTMP and other stream clients,
    # for instance, the HTTP FLV stream clients.
    play {
        # whether cache the last gop.
        # if on, cache the last gop and dispatch to client,
        #   to enabled fast startup for client, client play immediately.
        # if off, send the latest media data to client,
        #   client need to wait for the next Iframe to decode and show the video.
        # set to off if requires min delay;
        # set to on if requires client fast startup.
        # default: on
        gop_cache       off;
    }
}
```

Read about the min.delay.com in `conf/full.conf`.

## Low Latency config

Recoment to use the bellow config for low latency application:

```bash
# the listen ports, split by space.
listen              1935;
vhost __defaultVhost__ {
    tcp_nodelay     on;
    min_latency     on;

    play {
        gop_cache       off;
        queue_length    10;
        mw_latency      100;
    }

    publish {
        mr off;
    }
}
```

## Benchmark Data

SRS: 0.9.55

Encoder: FMLE, video(h264, profile=baseline, level=3.1, keyframe-frequency=5seconds), fps=15, input=640x480, 
output(500kbps, 640x480), no audio output.

Network: Publish to aliyun qindao server.

SRS config:

```bash
listen              1935;
vhost __defaultVhost__ {
    enabled         on;
    play {
        gop_cache       off;
    }
    hls {
        enabled         on;
        hls_path        ./objs/nginx/html;
        hls_fragment    5;
        hls_window      20;
    }
}
```

Latency: RTMP 2s, HLS 24s.

Read: ![RTMP-HLS-latency](/img/doc-main-concepts-low-latency-001.png)

## Edge Benchmark Data

SRS RTMP cluster almost not add more latency.

Read ![Edge-latency](/img/doc-main-concepts-low-latency-002.png)

Winlin 2015.8

![](https://ossrs.io/gif/v1/sls.gif?site=ossrs.io&path=/lts/doc/en/v7/low-latency)


writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall