[FFmpeg-devel] [PATCH] als in mp4

Alex Converse alex.converse
Mon Mar 23 06:26:04 CET 2009


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.

Also if you do end up trying to match AOT numbers please try to use
the enum from mpeg4audio.h. ALS's name in the enum is AOT_ALS.

>> ?Also why do we skip out on setting the sample_rate, is it wrong / inaccurate?
>
> Samplerate value is correct, just that i have never seen it differ
> from value stored in stsd :)
> But, you are correct, we should store samplerate value specified in
> the audio config object.
>
>> ?Otherwise good work,
>
> any ideas btw on how to do this cleanly. i'm assuming you have already
> looked into this at some point :)
>
>> ?Alex Converse
>
> --
> Regards,
>
> Jai
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>



More information about the ffmpeg-devel mailing list