ffplayout/docs/live_ingest.md

28 lines
1.5 KiB
Markdown
Raw Normal View History

2022-04-14 10:13:38 -04:00
### Live Ingest
2024-10-02 12:34:23 -04:00
With live ingest, you have the possibility to switch from playlist or folder mode to a live stream.
2022-04-14 10:13:38 -04:00
2024-10-02 12:34:23 -04:00
It works by creating an ffmpeg instance in _listen_ (_server_) mode. For example, when streaming over RTMP, you can set the ingest input parameters to:
2022-04-14 10:13:38 -04:00
```
-f live_flv -listen 1 -i rtmp://0.0.0.0:1936/live/my-secrete-streaming-key
```
For SRT you could use:
```
-f mpegts -i 'srt://0.0.0.0:40077?mode=listener&passphrase=12345abcde'
2022-04-14 10:13:38 -04:00
```
2024-10-02 12:34:23 -04:00
Keep in mind that the ingest mode **can't** pull from a server; it can only act as its own server and listen for incoming streams.
2022-04-14 10:13:38 -04:00
2024-10-02 12:34:23 -04:00
When it detects an incoming stream, it will stop the currently playing content and switch to the live source. The output will not be interrupted, so you will have a continuous output stream.
2022-04-14 10:13:38 -04:00
2024-10-02 12:34:23 -04:00
In rare cases, it may happen that, for a short moment after switching, the image freezes, but then it will continue. Also, a brief frame flicker might occur.
2022-04-14 10:13:38 -04:00
2024-10-02 12:34:23 -04:00
You should know that **ffmpeg, in its current version, has no authentication mechanism and simply listens to the protocol and port (no app and stream name).**
2022-04-14 10:13:38 -04:00
2024-10-02 12:34:23 -04:00
ffplayout addresses this issue by monitoring the output from ffmpeg. When the input is **rtmp** and the app or stream name differs from the configuration, it stops the ingest process. So, in a way, we have some control over which streams are accepted and which are not.
2022-04-14 10:13:38 -04:00
2024-10-02 12:34:23 -04:00
In theory, you can use any [protocol](https://ffmpeg.org/ffmpeg-protocols.html) from ffmpeg that supports a **listen** mode.