[FFmpeg-devel] [PATCH 01/18] avformat/mpegts: demux timed ID3 metadata

Anssi Hannula anssi.hannula at iki.fi
Mon Dec 30 12:14:15 CET 2013


Used in some HLS streams ("Timed Metadata for HTTP Live Streaming").

This is just ID3 tags at arbitrary stream positions, but I still added
"timed" to the codec name to avoid confusion with regular non-stream ID3
tags.

Signed-off-by: Anssi Hannula <anssi.hannula at iki.fi>
---

As noted above, I'm not entirely sure about the naming here... 
Feel free to give your 2 cents.

 libavcodec/avcodec.h    | 1 +
 libavcodec/codec_desc.c | 6 ++++++
 libavformat/mpegts.c    | 1 +
 3 files changed, 8 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index c614829..37f6807 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -513,6 +513,7 @@ enum AVCodecID {
     AV_CODEC_ID_OTF        = MKBETAG( 0 ,'O','T','F'),
     AV_CODEC_ID_SMPTE_KLV  = MKBETAG('K','L','V','A'),
     AV_CODEC_ID_DVD_NAV    = MKBETAG('D','N','A','V'),
+    AV_CODEC_ID_TIMED_ID3  = MKBETAG('T','I','D','3'),
 
 
     AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index c62734f..1639046 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -2622,6 +2622,12 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .name      = "dvd_nav_packet",
         .long_name = NULL_IF_CONFIG_SMALL("DVD Nav packet"),
     },
+    {
+        .id        = AV_CODEC_ID_TIMED_ID3,
+        .type      = AVMEDIA_TYPE_DATA,
+        .name      = "timed_id3",
+        .long_name = NULL_IF_CONFIG_SMALL("timed ID3 metadata"),
+    },
 
 };
 
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 18d8d8f..1aa98bc 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -662,6 +662,7 @@ static const StreamType REGD_types[] = {
 
 static const StreamType METADATA_types[] = {
     { MKTAG('K','L','V','A'), AVMEDIA_TYPE_DATA, AV_CODEC_ID_SMPTE_KLV },
+    { MKTAG('I','D','3',' '), AVMEDIA_TYPE_DATA, AV_CODEC_ID_TIMED_ID3 },
     { 0 },
 };
 
-- 
1.8.1.5



More information about the ffmpeg-devel mailing list