3 Star 6 Fork 4

winlinvip / srs.wiki

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
v3_EN_Ingest.md 3.46 KB
一键复制 编辑 原始数据 按行查看 历史
winlinvip 提交于 2022-01-06 11:57 . Update

HOME > EN > Ingest

Ingest

Ingest is used to ingest file(flv, mp4, mkv, avi, rmvb...), stream(RTMP, RTMPT, RTMPS, RTSP, HTTP, HLS...) and device, encode or passthrough then publish as RTMP to SRS.

Ingest actually use FFMEPG, or your tool, to encode or remux to suck known data to RTMP to SRS.

How to deploy ingest, read Ingest

Use Scenario

The main use scenarios:

  • Virtual Live Stream: Convert vod file to live stream.
  • Input RTSP IP Camera: Many IP Camera supports to pull in RTSP, user can ingest the RTSP to RTMP to SRS.
  • Directly ingest device, use the FFMEPG as encoder actually.
  • Ingest HTTp stream to RTMP for some old stream server.

In a word, the Ingest is used to ingest any stream supported by FFMPEG to SRS.

SRS server is support encoder to publish stream, while ingest can enable SRS to act like a client to pull stream from other place.

Build

Config SRS with option --with-ingest, read Build

The ingest tool of SRS can use FFMPEG, or use your own tool.

Config

The config to use ingest:

vhost your_vhost {
    # ingest file/stream/device then push to SRS over RTMP.
    # the name/id used to identify the ingest, must be unique in global.
    # ingest id is used in reload or http api management.
    ingest livestream {
        # whether enabled ingest features
        # default: off
        enabled      on;
        # input file/stream/device
        # @remark only support one input.
        input {
            # the type of input.
            # can be file/stream/device, that is,
            #   file: ingest file specifies by url.
            #   stream: ingest stream specifeis by url.
            #   device: not support yet.
            # default: file
            type    file;
            # the url of file/stream.
            url     ./doc/source.200kbps.768x320.flv;
        }
        # the ffmpeg 
        ffmpeg      ./objs/ffmpeg/bin/ffmpeg;
        # the transcode engine, @see all.transcode.srs.com
        # @remark, the output is specified following.
        engine {
            # @see enabled of transcode engine.
            # if disabled or vcodec/acodec not specified, use copy.
            # default: off.
            enabled          off;
            # output stream. variables:
            # [vhost] current vhost which start the ingest.
            # [port] system RTMP stream port.
            output          rtmp://127.0.0.1:[port]/live?vhost=[vhost]/livestream;
        }
    }
}

The word after ingest keyword is the id of ingest, the id must be unique.

The type specifies the ingest type:

  • file: To ingest file to RTMP, SRS will add -re for FFMPEG.
  • stream: To ingest stream to RTMP.
  • device: Not support yet.

The engine specifies the transcode engine and output:

  • enabled: Whether transcode, remux when off.
  • output:The output RTMP url. The vhost and port is variable.
  • others is same to FFMPEG

Note: Engine is copy, when:

  • The enabled is off.
  • The vcodec and acodec is not specified.

Ingest File list

SRS does not ingest a file list, a wordaround:

  • Use script as the ingest tool, which use ffmpeg to copy file to RTMP stream one by one.

Read https://github.com/ossrs/srs/issues/55

Winlin 2014.11

1
https://gitee.com/winlinvip/srs-wiki.git
git@gitee.com:winlinvip/srs-wiki.git
winlinvip
srs-wiki
srs.wiki
master

搜索帮助