[Ffmpeg-cvslog] Re: ffmpeg-cvslog Digest, Vol 20, Issue 26

Steve Lhomme steve.lhomme
Thu Nov 9 18:51:11 CET 2006


>>> From: M?ns Rullg?rd <mru at inprovide.com>
> 
> Lovely broken quoting of non-ascii characters... Again fix your crap.

That one is sent by the digest, Mans' signature is fine.

>> PS: What's the policy on flamewars and trolls around here ?
> 
> The policy is that Mr. Steve Lame is laughed at with extreme
> prejudice, outside the official communication channels. :)

Who cares ?

>> Please tell me about this "per codec special casing" that everybody talked about
>> without any real case example.
>>
>> BTW, I never mentioned NUT because nobody uses it so far. When it's ready we'll
>> see...
>>
>> Steve
>>  
>>
> I posted 3 example cases this morning. Did you miss my post?

I only looked at the VLC demuxer, as I know that code. The 
matroska_segment_c::Select() function just translates the matroska IDs 
to the ones used internally by VLC, which happened to be different than 
the one in lavc too. So tell me which one is the strandard and which one 
has to be blamed.

But I agree Vorbis and AAC have special cases.
For Vorbis it say 'Split the 3 headers'. I assume that's what VLC 
expects internally and has nothing to do with Matroska (apparently 
FFMPEG has no problems with the raw data as they are stored in matroska).
For AAC see the previous discussion on multiple codec IDs.

> RTFS the MKV demuxer in MPlayer or lavf...

OK I only have lavf. So here are all the special cases I can find:

             for(j=0; codec_tags[j].str; j++){
                 if(!strcmp(codec_tags[j].str, track->codec_id)){
                     codec_id= codec_tags[j].id;
                     break;
                 }
             }

             /* Set the FourCC from the CodecID. */
             /* This is the MS compatibility mode which stores a
              * BITMAPINFOHEADER in the CodecPrivate. */
             if (!strcmp(track->codec_id,
                         MATROSKA_CODEC_ID_VIDEO_VFW_FOURCC) &&
                 (track->codec_priv_size >= 40) &&
                 (track->codec_priv != NULL)) {
                 unsigned char *p;

                 /* Offset of biCompression. Stored in LE. */
                 p = (unsigned char *)track->codec_priv + 16;
                 ((MatroskaVideoTrack *)track)->fourcc = (p[3] << 24) |
                                  (p[2] << 16) | (p[1] << 8) | p[0];
                 codec_id = codec_get_bmp_id(((MatroskaVideoTrack 
*)track)->fourcc);

             }

             /* This is the MS compatibility mode which stores a
              * WAVEFORMATEX in the CodecPrivate. */
             else if (!strcmp(track->codec_id,
                              MATROSKA_CODEC_ID_AUDIO_ACM) &&
                 (track->codec_priv_size >= 18) &&
                 (track->codec_priv != NULL)) {
                 unsigned char *p;
                 uint16_t tag;

                 /* Offset of wFormatTag. Stored in LE. */
                 p = (unsigned char *)track->codec_priv;
                 tag = (p[1] << 8) | p[0];
                 codec_id = codec_get_wav_id(tag);

             }

             if (codec_id == CODEC_ID_NONE) {
                 av_log(matroska->ctx, AV_LOG_INFO,
                        "Unknown/unsupported CodecID %s.\n",
                        track->codec_id);
             }

Yeah, that's a hell lot of dirty special case !

Steve




More information about the ffmpeg-cvslog mailing list