[FFmpeg-devel] [PATCH] ffmpeg_opt: Allow program metadata other than title to be set.

Vittorio Gambaletta (VittGam) ffmpeg-dev at vittgam.net
Sun Jan 24 05:23:22 CET 2016


This commit makes it possible to add optional metadata (such as "service_provider") to an mpegts output stream composed by multiple programs (mpts).

This is needed because the global metadata is not inherited by the single programs.

Signed-off-by: Vittorio Gambaletta <ffmpeg-dev at vittgam.net>
---
 ffmpeg_opt.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 9b341cf..286c182 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -2461,15 +2461,11 @@ loop_end:
                 exit_program(1);
             p2++;
 
-            if (!strcmp(key, "title")) {
-                av_dict_set(&program->metadata, "title", p2, 0);
-            } else if (!strcmp(key, "program_num")) {
-            } else if (!strcmp(key, "st")) {
+            if (!strcmp(key, "st")) {
                 int st_num = strtol(p2, NULL, 0);
                 av_program_add_stream_index(oc, progid, st_num);
-            } else {
-                av_log(NULL, AV_LOG_FATAL, "Unknown program key %s.\n", key);
-                exit_program(1);
+            } else if (strcmp(key, "program_num")) {
+                av_dict_set(&program->metadata, key, p2, 0);
             }
         }
     }


More information about the ffmpeg-devel mailing list