3

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?

osgx
  • 90,338
  • 53
  • 357
  • 513
3wic
  • 500
  • 6
  • 22

2 Answers2

5

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).

osgx
  • 90,338
  • 53
  • 357
  • 513
  • I don't think ffserver is actually a server, it's just a command line program you can run in the background if you wanted to. It's a shame, for it to be actually useful it would need functionality like this. Not complaining though... – Luke May 13 '16 at 06:18
2

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.

QA Collective
  • 2,222
  • 21
  • 34