[FFmpeg-devel] [PATCH] als in mp4

Baptiste Coudurier baptiste.coudurier
Sat Mar 21 06:54:35 CET 2009


Hi Jai,

Jai Menon wrote:
> Hi,
> 
> Attached :
> 
> 1) demux als streams from mp4, als codec id and minor lavc version bump
> 2) mux als in to mp4, add isomedia type
> 
> 
> [...]
>  
>      /* subtitle codecs */
>      CODEC_ID_DVD_SUBTITLE= 0x17000,
> Index: libavformat/mov.c
> ===================================================================
> --- libavformat/mov.c	(revision 18065)
> +++ libavformat/mov.c	(working copy)
> @@ -426,6 +426,11 @@
>                                           st->codec->extradata_size);
>                  if (cfg.chan_config > 7)
>                      return -1;
> +                if(cfg.object_type == 36) {
> +                    st->codec->codec_id = CODEC_ID_MP4ALS;
> +                    st->codec->codec_type = CODEC_TYPE_AUDIO;
> +                    return 0;
> +                }
>                  st->codec->channels = ff_mpeg4audio_channels[cfg.chan_config];
>                  if (cfg.object_type == 29 && cfg.sampling_index < 3) // old mp3on4
>                      st->codec->sample_rate = ff_mpa_freq_tab[cfg.sampling_index];

see mp4_audio_types table above.

> 
> ------------------------------------------------------------------------
> 
> Index: libavformat/isom.c
> ===================================================================
> --- libavformat/isom.c	(revision 18065)
> +++ libavformat/isom.c	(working copy)
> @@ -32,6 +32,7 @@
>      { CODEC_ID_MPEG4     , 0x20 },
>      { CODEC_ID_H264      , 0x21 },
>      { CODEC_ID_AAC       , 0x40 },
> +    { CODEC_ID_MP4ALS    , 0x40 },
>      { CODEC_ID_MPEG2VIDEO, 0x61 }, /* MPEG2 Main */
>      { CODEC_ID_MPEG2VIDEO, 0x60 }, /* MPEG2 Simple */
>      { CODEC_ID_MPEG2VIDEO, 0x62 }, /* MPEG2 SNR */
> Index: libavformat/movenc.c
> ===================================================================
> --- libavformat/movenc.c	(revision 18065)
> +++ libavformat/movenc.c	(working copy)
> @@ -928,7 +928,11 @@
>              descr = "VideoHandler";
>          } else if (track->enc->codec_type == CODEC_TYPE_AUDIO) {
>              hdlr_type = "soun";
> -            descr = "SoundHandler";
> +            if(track->enc->codec_id == CODEC_ID_MP4ALS) {
> +                descr = "";
> +            } else {
> +                descr = "SoundHandler";
> +            

Hummm, why do you need this ? This should not be needed at all.

>          } else if (track->enc->codec_type == CODEC_TYPE_SUBTITLE) {
>              if (track->tag == MKTAG('t','x','3','g')) hdlr_type = "sbtl";
>              else                                      hdlr_type = "text";
> @@ -1381,7 +1385,8 @@
>      uint8_t *buf;
>  
>      for (i = 0; i < s->nb_streams; i++)
> -        if (mov->tracks[i].enc->flags & CODEC_FLAG_BITEXACT) {
> +        if (mov->tracks[i].enc->flags & CODEC_FLAG_BITEXACT ||
> +            mov->tracks[i].enc->codec_id == CODEC_ID_MP4ALS) {
>              return 0;
>          }
>  

???? Please explain :>

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no
FFmpeg maintainer                                  http://www.ffmpeg.org




More information about the ffmpeg-devel mailing list