trunk/3rdparty/srs-docs/doc/ingest.md
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 FFmpeg, or your tool, to encode or remux to suck known data to RTMP to SRS.
How to deploy ingest, read Ingest
The main use scenarios:
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.
Config SRS with option --with-ingest, read Build
The ingest tool of SRS can use FFMPEG, or use your own tool.
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.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:
-re for FFMPEG.The engine specifies the transcode engine and output:
Note: Engine is copy, when:
SRS does not ingest a file list, a wordaround:
Read https://github.com/ossrs/srs/issues/55
Winlin 2014.11