[FFmpeg-devel] [PATCH] ffserver: add initial log showing available streams

Stefano Sabatini stefasab at gmail.com
Fri Nov 29 11:29:10 CET 2013


---
 ffserver.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/ffserver.c b/ffserver.c
index 1e465ea..d549e8b 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -196,6 +196,12 @@ enum StreamType {
     STREAM_TYPE_REDIRECT,
 };
 
+static const char *stream_type[] = {
+   "live",
+   "status",
+   "redirect",
+};
+
 enum IPAddressAction {
     IP_ALLOW = 1,
     IP_DENY,
@@ -4780,6 +4786,24 @@ int main(int argc, char **argv)
         av_log_set_callback(http_av_log);
     }
 
+    {
+        FFStream *stream;
+        char type[32];
+        http_log("Available streams\n");
+        http_log("\t%-10s %s [feed_file:FEED_FILE]\n", "TYPE", "NAME");
+
+        for (stream = first_stream; stream; stream = stream->next) {
+            if (stream->is_feed)
+                snprintf(type, sizeof(type), "%s[FEED]", stream_type[stream->stream_type]);
+            else
+                snprintf(type, sizeof(type), "%s", stream_type[stream->stream_type]);
+            http_log("\t%-10s %s", type, stream->filename);
+            if (stream->feed_filename[0])
+                http_log(" feed_file:%s", stream->feed_filename);
+            http_log("\n");
+        }
+    }
+
     build_file_streams();
 
     build_feed_streams();
-- 
1.8.1.2



More information about the ffmpeg-devel mailing list