[FFmpeg-devel] [PATCH] mpegtsenc: Add support to mux s302 stream

Thierry Foucu tfoucu at gmail.com
Fri Apr 6 21:56:05 CEST 2012


On Fri, Apr 6, 2012 at 12:47 PM, Thierry Foucu <tfoucu at gmail.com> wrote:

>
>
> On Fri, Apr 6, 2012 at 9:32 AM, Michael Niedermayer <michaelni at gmx.at>wrote:
>
>> On Wed, Apr 04, 2012 at 08:48:22PM -0700, Thierry Foucu wrote:
>> > ---
>> >  libavformat/mpegtsenc.c |    9 ++++++++-
>> >  1 files changed, 8 insertions(+), 1 deletions(-)
>> [...]
>> > @@ -1070,7 +1078,6 @@ static int
>> mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
>> >      }
>> >
>> >      if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO || size >
>> ts->pes_payload_size) {
>> > -        av_assert0(!ts_st->payload_size);
>> >          // for video and subtitle, write a single pes packet
>> >          mpegts_write_pes(s, st, buf, size, pts, dts, pkt->flags &
>> AV_PKT_FLAG_KEY);
>> >          av_free(data);
>>
>> why do you remove this assert ?
>>
>
> Oups.. Sorry, this was for testing.. Let me send you a new patch.
>
>
>
>> [...]
>> --
>> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>>
>> The educated differ from the uneducated as much as the living from the
>> dead. -- Aristotle
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>>
>
Here is the new patch.

---
 libavformat/mpegtsenc.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 0618beb..531a231 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -306,6 +306,14 @@ static void mpegts_write_pmt(AVFormatContext *s,
MpegTSService *service)
                 *q++=1; // 1 byte, all flags sets to 0
                 *q++=0; // omit all fields...
             }
+            if(st->codec->codec_id==CODEC_ID_S302M){
+                *q++ = 0x05; /* MPEG-2 registration descriptor*/
+                *q++ = 4;
+                *q++ = 'B';
+                *q++ = 'S';
+                *q++ = 'S';
+                *q++ = 'D';
+            }

             if (lang) {
                 char *p;
-- 
1.7.7.3


More information about the ffmpeg-devel mailing list