[FFmpeg-devel] [PATCH] a couple of updates for MPEGTS

Måns Rullgård mans
Tue Feb 12 01:42:35 CET 2008

Nico Sabbi <Nicola.Sabbi at poste.it> writes:

> In incoming there are a couple of interesting samples: one is a trailer
> of resident evil that uses 0x82 as stream_type to identify DCA
> (I don't know in what system this mapping is defined) ;

I'd obviously like to know what system uses this value.  The sample
has a Bluray registration descriptor, so it maybe that is where it
comes from.  The PS3 refuses to recognise any audio in the file, but
that need not mean anything.

Otherwise I have only the standard objection about non-standard
features.  Randomly assigning codes in the private range to codecs
will sooner or later lead to a clash.  In this case, the registration
descriptor could probably be used to identify the codec mapping in a
safer manner.  It's hard to say for sure without access to the Bluray

Given the amount of work required to implement this properly, and that
we so far only have this sample using stream type 0x82, I reckon we
can still add this to the list.

> other (search *latm*) contain AAC in LATM over LOAS syntax,
> that mplayer's libfaad (or libfaad with a patch I posted to faad-devel)
> can decode.

I get the feeling this ought really be properly demuxed.  Then
anything expecting an AAC elementary stream would cope with it.  I am
definitely against labelling anything other than proper AAC with

> Patch attached
> Index: libavformat/mpegts.c
> ===================================================================
> --- libavformat/mpegts.c	(revisione 11620)
> +++ libavformat/mpegts.c	(copia locale)
> @@ -915,6 +915,7 @@
>          codec_id = CODEC_ID_VC1;
>          break;
>          codec_type = CODEC_TYPE_AUDIO;
>          codec_id = CODEC_ID_AAC;
>          break;

See above.

> @@ -923,6 +924,7 @@
>          codec_id = CODEC_ID_AC3;
>          break;
>          codec_type = CODEC_TYPE_AUDIO;
>          codec_id = CODEC_ID_DTS;
>          break;

OK, reluctantly.

> Index: libavformat/mpegts.h
> ===================================================================
> --- libavformat/mpegts.h	(revisione 11620)
> +++ libavformat/mpegts.h	(copia locale)
> @@ -49,12 +49,14 @@
>  #define STREAM_TYPE_PRIVATE_DATA    0x06
>  #define STREAM_TYPE_AUDIO_AAC       0x0f
>  #define STREAM_TYPE_VIDEO_MPEG4     0x10
>  #define STREAM_TYPE_VIDEO_H264      0x1b
>  #define STREAM_TYPE_VIDEO_VC1       0xea

Adding this macro is of course harmless.  Feel free to do so if you

>  #define STREAM_TYPE_AUDIO_AC3       0x81
>  #define STREAM_TYPE_AUDIO_DTS       0x8a
> +#define STREAM_TYPE_AUDIO_DTS2      0x82

Maybe these should be sorted numerically.  Or maybe not... I can't

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list