On Fri, 27 Jan 2017, Peter Große wrote:

This patch is based on the stream assignment code in webmdashenc.

Additional changes:
 * Default to one AdaptationSet per stream

   Previously all mapped streams of a media type (video, audio) where assigned
   to a single AdaptationSet. Using the DASH live profile it is mandatory, that
   the segments of all representations are aligned, which is currently not
   enforced. This leads to problems when using video streams with different
   key frame intervals. So to play safe, default to one AdaptationSet per 
stream,
   unless overwritten by explicit assignment
 * Make sure all streams are assigned to exactly one AdaptationSet

Signed-off-by: Peter Große <[email protected]>
---
libavformat/dashenc.c | 193 ++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 162 insertions(+), 31 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 1b12d4f..c561ad1 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -24,6 +24,7 @@
#include <unistd.h>
#endif

+#include "libavutil/avutil.h"
#include "libavutil/avstring.h"
#include "libavutil/eval.h"
#include "libavutil/intreadwrite.h"
@@ -58,9 +59,15 @@ typedef struct Segment {
    int n;
} Segment;

+typedef struct AdaptationSet {
+    char id[10];
+    enum AVMediaType media_type;
+    AVDictionary *metadata;
+} AdaptationSet;

Oh, I also forgot to say; as far as I can see (on a sloppy read-through), metadata is unused in this patch. If that's really true, skip it here and only add it in the next patch where it is used. That makes this patch slightly less confusing.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to