[FFmpeg-devel] [PATCH] lavf/mpegtsenc: add special case for handling timed ID3 packets

Stefano Sabatini stefasab at gmail.com
Thu May 19 18:45:41 CEST 2016


Set the stream_id to 0xbd (private_stream_id_1). Tools seem to assume
that value, and this is consistent with MPEG TS (ITU-T H.222.0) section
2.12.3.
---
 libavformat/mpegtsenc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 4b9e71b..0e1e55f 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1240,6 +1240,9 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
                         st->codecpar->codec_id == AV_CODEC_ID_AC3 &&
                         ts->m2ts_mode) {
                 *q++ = 0xfd;
+            } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA &&
+                       st->codecpar->codec_id == AV_CODEC_ID_TIMED_ID3) {
+                *q++ = 0xbd;
             } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) {
                 *q++ = stream_id != -1 ? stream_id : 0xfc;
 
-- 
1.9.1



More information about the ffmpeg-devel mailing list