ffplayout/docs/ingest_error.md

34 lines
1.4 KiB
Markdown
Raw Normal View History

2023-02-06 06:23:44 -05:00
In some situations, application closure may occur in conjunction with Live Ingest.
2024-10-02 12:34:23 -04:00
Here is an example in combination with SRS:
2023-02-06 06:23:44 -05:00
When a live stream is sent, it is forwarded to ffplayout, which then switches the TV program to the live stream.
2024-10-02 12:34:23 -04:00
Problems can occur if the internet connection for the live stream is not stable. In such cases, timeouts can occur, SRS breaks the connection to the playout, and the entire ffplayout process has to be restarted. The default timeout is 5000ms, or 5 seconds.
2023-02-06 06:23:44 -05:00
2024-10-02 12:34:23 -04:00
The timeout can be changed in SRS in the respective vhosts with:
2023-02-06 06:23:44 -05:00
```NGINX
publish {
normal_timeout 30000;
}
```
Here the new timeout would be 30 seconds.
The error behavior can be simulated under Linux using the tool **tc**. Then carry out the following steps:
- Start SRS
- start ffplayout, with rtmp target SRS
- after a few seconds start a livestream to ffplayout
- shortly afterwards start **tc**: `tc qdisc add dev eth0 root netem loss 70%`
- wait until the timeout time is exceeded
- ffplayout should close the process with encoder errors
- undo **tc** rule: `tc qdisc delete dev eth0 root`
`eth0` must be replaced with the physical network interface.
2023-02-06 06:30:36 -05:00
2023-02-06 06:32:41 -05:00
Reference:
- [simulate-delayed-and-dropped-packets-on-linux](https://stackoverflow.com/questions/614795/simulate-delayed-and-dropped-packets-on-linux)
- [publish-normal-timeout](https://ossrs.io/lts/en-us/docs/v4/doc/special-control/#publish-normal-timeout)