[FFmpeg-cvslog] mpegts: Enable muxing of SMPTE KLV metadata

Peter Ross git at videolan.org
Fri Jun 14 13:42:33 CEST 2013


ffmpeg | branch: master | Peter Ross <pross at xvid.org> | Thu Apr 11 09:57:15 2013 -0700| [d891d354c551f8b645b115758596326bbe629096] | committer: Michael Niedermayer

mpegts: Enable muxing of SMPTE KLV metadata

Muxer code rebased/split out by: Jeff Blackburne <jblackburne at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d891d354c551f8b645b115758596326bbe629096
---

 libavformat/mpegtsenc.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 0ddae65..d92fcb1 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -397,6 +397,16 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
                 *q++ = 'c';
             }
             break;
+        case AVMEDIA_TYPE_DATA:
+            if (st->codec->codec_id == AV_CODEC_ID_SMPTE_KLV) {
+                *q++ = 0x05; /* MPEG-2 registration descriptor */
+                *q++ = 4;
+                *q++ = 'K';
+                *q++ = 'L';
+                *q++ = 'V';
+                *q++ = 'A';
+            }
+            break;
         }
 
         val = 0xf000 | (q - desc_length_ptr - 2);
@@ -977,8 +987,8 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
             *q++ = len >> 8;
             *q++ = len;
             val = 0x80;
-            /* data alignment indicator is required for subtitle data */
-            if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE)
+            /* data alignment indicator is required for subtitle and data streams */
+            if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE || st->codec->codec_type == AVMEDIA_TYPE_DATA)
                 val |= 0x04;
             *q++ = val;
             *q++ = flags;



More information about the ffmpeg-cvslog mailing list