[FFmpeg-devel] [PATCH] als in mp4

Jai Menon jmenon86
Mon Mar 23 07:08:08 CET 2009


On 3/23/09, Alex Converse <alex.converse at gmail.com> wrote:
> On Mon, Mar 23, 2009 at 1:49 AM, Jai Menon <jmenon86 at gmail.com> wrote:
>  > On 3/23/09, Alex Converse <alex.converse at gmail.com> wrote:
>  >> On Mon, Mar 23, 2009 at 12:11 AM, Jai Menon <jmenon86 at gmail.com> wrote:
>  >>  > On 3/21/09, Alex Converse <alex.converse at gmail.com> wrote:
>  >>  >> On Sat, Mar 21, 2009 at 1:50 AM, Jai Menon <jmenon86 at gmail.com> 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
>  >>  >>  >
>  >>  >>  > --
>  >>  >>  > Regards,
>  >>  >>  >
>  >>  >>  > Jai
>  >>  >>  >
>  >>  >>
>  >>  >> > _______________________________________________
>  >>  >>  > ffmpeg-devel mailing list
>  >>  >>  > ffmpeg-devel at mplayerhq.hu
>  >>  >>  > https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>  >>  >>
>  >>  >>
>  >>  >> > 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];
>  >>  >>
>  >>  >>
>  >>  >> I hope this isn't too bikeshedy but can this be made part of the
>  >>  >>  codec_get_id section below.
>  >>  >
>  >>  > It can and it should be. But as i said, the reference codec does not
>  >>  > write the channel config correctly. So some if(codec_id != MP4ALS)
>  >>  > will still be required. So it will still look like a hack ;)
>  >>  >
>  >>
>  >>
>  >> Do you mean it's incorrect or do you mean it's set to zero? AAC still
>  >>  works fine when it's set to zero.
>  >
>  > It's set to zero, which i think implies that the value should be read
>  > from als specifc config (what i understood from the spec). But as of
>  > now, the code doesn't check if any of the values read from the audio
>  > config object are zero, instead, it just overwrites the values which
>  > were set initially in the codec context (and which happened to be
>  > correct).
>  >
>
>
> When were they initially set to the correct values?

stsd atom/box? i think

>  --Alex


-- 
Regards,

Jai



More information about the ffmpeg-devel mailing list