Wrong Channel count value on mp4a sample entry

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Wrong Channel count value on mp4a sample entry

Yuntaek Lim
Hi,

I've created 5.1 channel aac-lc audio from  5.1 channel  ac-3 audio.
However, the sample entry of "mp4a" box show channel_count as "2", not "6".
Howerver, the  MPEG-4 elementary stream descriptor in "esds" box describes
channel count as 6.

Command
ffmpeg -loglevel debug  -i source.mp4 -filter_complex
"channelmap=map=FL-FL|FR-FR|FC-FC|LFE-LFE|SR-BR|SL-BL:channel_layout=5.1"
-c:v copy -c:a libfdk_aac -profile:a aac_he -f mp4 demo.mp4

I've checked the channel_cout using "
http://download.tsi.telecom-paristech.fr/gpac/mp4box.js/filereader.html".
I've checked the value of the "esds" box with shaka packager and ffrpobe.

Can you explain the reason why the values are different, please?

The source file "source.mp4"
https://drive.google.com/open?id=0B2CC25n6pcNwejM1T3ZQb25hOENJS0xBTlhZcU1nZHZBOUM0


The output file "demo.mp4"
https://drive.google.com/open?id=0B2CC25n6pcNwdnJNUmhQZU4wck1YRUhtVnRFekF1S2JnUU9z

Regards,
Yuntaek Lim
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Wrong Channel count value on mp4a sample entry

kumowoon1025
> On Feb 12, 2019, at 12:49 AM, Yuntaek Lim <[hidden email]> wrote:
>
> I've created 5.1 channel aac-lc audio from  5.1 channel  ac-3 audio.
> However, the sample entry of "mp4a" box show channel_count as "2", not "6".
> Howerver, the  MPEG-4 elementary stream descriptor in "esds" box describes
> channel count as 6.

It is an old container format with varied history. Many fields in iso container file boxes are just there to maintain compatibility, and ignored & set to default value. In this case, the channel count could only be 1 or 2, for mono and stereo. The default happens to be 2.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Wrong Channel count value on mp4a sample entry

Yuntaek Lim
Hi Ted,

Thank you for your replying.
I want to make clear your explain.

> It is an old container format with varied history.
Do you mean "audioSampleEntry version 0"  is old container?

> Many fields in iso container file boxes are just there to maintain
compatibility, and ignored & set to default value. In this case, the
channel count could only be 1 or 2, for mono and stereo. The default
happens to be 2.
I could not find any constraints about channel count, cannot describe greater
than 2, for audioSampleEntry from iso 14496-12:2015.
However, I've found "When values greater than 2 are used, the codec
configuration should identify the channel assignment."

I've found "Set to 1 for monaural sounds, 2 for stereo sounds. Higher
numbers of channels are not supported." from quick time format
specification. ("
https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-75770
")

It may seem that 'mp4'  can show channel count as 6, but 'mov' cannot be
described 6 channel count in the container. If it is right, I think,
"ffmpeg" describes channel_count in AudioSampleEntry as 6 for 5.1 channel.
Do you think my thought is right wrong?


2019년 2월 13일 (수) 오후 7:53에 Ted Park <[hidden email]>님이 작성:

> > On Feb 12, 2019, at 12:49 AM, Yuntaek Lim <[hidden email]> wrote:
> >
> > I've created 5.1 channel aac-lc audio from  5.1 channel  ac-3 audio.
> > However, the sample entry of "mp4a" box show channel_count as "2", not
> "6".
> > Howerver, the  MPEG-4 elementary stream descriptor in "esds" box
> describes
> > channel count as 6.
>
> It is an old container format with varied history. Many fields in iso
> container file boxes are just there to maintain compatibility, and ignored
> & set to default value. In this case, the channel count could only be 1 or
> 2, for mono and stereo. The default happens to be 2.
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Wrong Channel count value on mp4a sample entry

Gyan


On 14-02-2019 06:39 AM, Yuntaek Lim wrote:
>
> I could not find any constraints about channel count, cannot describe greater
> than 2, for audioSampleEntry from iso 14496-12:2015.
> However, I've found "When values greater than 2 are used, the codec
> configuration should identify the channel assignment."

The standard then goes on to say,

     "The audio output format (samplerate, samplesize and channelcount
fields) in the sample entry should be considered definitive only for
codecs that do not record their own output configuration. If the audio
codec has definitive information about the output format, it shall be
taken as definitive; in this case the samplerate, samplesize and
channelcount fields in the sample entry may be ignored, though sensible
values should be chosen (for example, the highest possible sampling rate)"

For AAC, ASC is added from codec extradata, and provides the definitive
info.

It may still be helpful to accurately record channel count for AAC, but
it's not required.

Gyan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Wrong Channel count value on mp4a sample entry

Yuntaek Lim
Thanks Gyan.

2019년 2월 14일 (목) 오후 3:45에 Gyan <[hidden email]>님이 작성:

>
>
> On 14-02-2019 06:39 AM, Yuntaek Lim wrote:
> >
> > I could not find any constraints about channel count, cannot describe
> greater
> > than 2, for audioSampleEntry from iso 14496-12:2015.
> > However, I've found "When values greater than 2 are used, the codec
> > configuration should identify the channel assignment."
>
> The standard then goes on to say,
>
>      "The audio output format (samplerate, samplesize and channelcount
> fields) in the sample entry should be considered definitive only for
> codecs that do not record their own output configuration. If the audio
> codec has definitive information about the output format, it shall be
> taken as definitive; in this case the samplerate, samplesize and
> channelcount fields in the sample entry may be ignored, though sensible
> values should be chosen (for example, the highest possible sampling rate)"
>
> For AAC, ASC is added from codec extradata, and provides the definitive
> info.
>
> It may still be helpful to accurately record channel count for AAC, but
> it's not required.
>
> Gyan
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".