I want to update dynamically ffserver.conf to add a new stream source to it.
Is there anyway to reload ffserver.conf in ffserver without stopping the streams running?
Reloading of "ffserver.conf
" config file is not supported by ffserver. And it have no restart code as I see.
There are the sources of ffserver: ffmpeg/ffserver.c line 4020:
4020 static int parse_ffconfig(const char *filename)
And the config parser is called only once - from main():
4710 int main(int argc, char **argv)
4711 {
...
4735 if ((ret = parse_ffconfig(config_filename)) < 0) { ...
There are no special signal handlers (like HUP in init
) for restarting server or rereading configs (only SIGCHLD
and SIGPIPE
needed to use fork and to work with sockets).
It seems possible to get around this problem through ffserver configuration.
Remembering that feeds come in and streams go out, and that you can supply feeds to the server with ffmpeg - you could just configure a large set of generic feeds and streams (probably grouped according to general needs like SD, HD, audio only etc) and then start up feeds as required, supplying a URL to the relevant client(s), then re-claiming that 'feed slot' once the feed is finished.
This means that you can then effectively manage all the other aspects of dynamically adding/removing streams externally to ffserver. See the example that comes with ffserver (I found it in /etc/ffserver.conf). There is a basic demo here: https://www.ffmpeg.org/ffserver-all.html#How-do-I-make-it-work_003f
The only downside to this would be that your streams would be named non-descriptively like HDStream1 ... etc.