[FFmpeg-devel] Stream Type 0x80 (video?)

Jose Mortensen josemortensen
Fri Apr 10 20:11:17 CEST 2009


Hi,

We are working on some satellite broadcast transport streams in the
US. Some transport streams streams, have the video listed in the PMT
descriptor as type 0x80. Which seems to be not standard, or I can't
find it anywhere. (Maybe somebody can point me out to where is it
defined).

In any case,      av_open_input_file function misses to find the video
stream since it does not recognize the stream_type. As a result it is
not added to the streams in the program ( AVFormatContext::program )
structure

So, from     dump_format(ic, 0, "", 0);

Input #0, mpegts, from '':
  Duration: N/A, bitrate: N/A
  Program 1
    Stream #0.1[0x1020](eng): Audio: ac3, 0 channels, s16
    Stream #0.2[0x1021](ton): Audio: ac3, 0 channels, s16


This function uses the pmt_cb(), that I have added the 0x80 to get it
to work with this stream. (see snipped below)


Later, the function av_find_stream_info()  Does recognize the stream
and adds it to the list of streams (AVFormatContext::streams), but not
 to the list of streams in a program (AVFormatContext::program).
Tracing the code, it comes from a default statement on a switch at the
the new_pes_av_stream() function (see snipped below).



Since Receivers have no problem showing the video, I wonder if this is
some sort of standard???. Does Anyone have experience with this??

Furthermore, should this fix be added to the pmt_cb function?

I can post and test a patch, but first I would like to have some
standard way of identifying this as video, os some input.

-- Jose






static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int
section_len)
{
     [ ... parsing blah blah]

        /* now create ffmpeg stream */
        switch(stream_type) {
        case STREAM_TYPE_AUDIO_MPEG1:
        case STREAM_TYPE_AUDIO_MPEG2:
        case STREAM_TYPE_VIDEO_MPEG1:
        case STREAM_TYPE_VIDEO_MPEG2:
        case STREAM_TYPE_VIDEO_MPEG4:
        case STREAM_TYPE_VIDEO_H264:
        case STREAM_TYPE_VIDEO_VC1:
        case STREAM_TYPE_VIDEO_DIRAC:
        case STREAM_TYPE_AUDIO_AAC:
        case STREAM_TYPE_AUDIO_AC3:
        case STREAM_TYPE_AUDIO_DTS:
        case STREAM_TYPE_AUDIO_HDMV_DTS:
        case STREAM_TYPE_SUBTITLE_DVB:
        case 0x80:  // <---- I added, so this video stream is added to
the stream list in the programs.





static AVStream* new_pes_av_stream(PESContext *pes, uint32_t code)
{
    AVStream *st;
    enum CodecID codec_id;
    enum CodecType codec_type;

    switch(pes->stream_type){

    [ .... cases, blah, blah ]

    default:
        if (code >= 0x1c0 && code <= 0x1df) {
            codec_type = CODEC_TYPE_AUDIO;
            codec_id = CODEC_ID_MP2;
        } else if (code == 0x1bd) {
            codec_type = CODEC_TYPE_AUDIO;
            codec_id = CODEC_ID_AC3;
        } else {
            codec_type = CODEC_TYPE_VIDEO;
            codec_id = CODEC_ID_PROBE;
        }
        break;
}



More information about the ffmpeg-devel mailing list