Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format.langauge for Arabic tracks return arb instead of ar #10255

Closed
LuGO0 opened this issue May 12, 2022 · 4 comments
Closed

Format.langauge for Arabic tracks return arb instead of ar #10255

LuGO0 opened this issue May 12, 2022 · 4 comments
Assignees
Labels

Comments

@LuGO0
Copy link
Contributor

LuGO0 commented May 12, 2022

When filing a question:

This is a sample manifest adaptation set that I am testing, for the English audio adaptation set I get the correct isoCode which is the 2 letters en I expected the same for the Arabic track as well, but it returned 3 letter iso code arb.
Is this expected for the Arabic language? is it IETF BCP 47 conformant or is it a bug?
I am using 2.16.1 as the exoplayer version.

<AdaptationSet mimeType="audio/mp4" startWithSAP="1" segmentAlignment="true" lang="eng" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
    <!-- MPEG Common Encryption -->
    <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="39aa2d7b-212e-c6e4-dd26-b6d3deec92a2" />
    <!-- Widevine -->
    <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed">
        <cenc:pssh>AAAALnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAA4IARABGgNoZXMiA2hlcw==</cenc:pssh>
    </ContentProtection>
    <Representation id="audio_aac_1649092788119-en-mp4a-1" codecs="mp4a.40.2" bandwidth="56706" audioSamplingRate="48000">
        <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
        <BaseURL>seg-audio_aac_1649092788119-en-mp4a-1.mp4</BaseURL>
        <SegmentBase indexRange="793-5012">
            <Initialization range="0-792" />
        </SegmentBase>
    </Representation>
    <Representation id="audio_aac_1649092788119-en-mp4a-2" codecs="mp4a.40.2" bandwidth="73134" audioSamplingRate="48000">
        <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
        <BaseURL>seg-audio_aac_1649092788119-en-mp4a-2.mp4</BaseURL>
        <SegmentBase indexRange="793-5012">
            <Initialization range="0-792" />
        </SegmentBase>
    </Representation>
    <Representation id="audio_aac_1649092788119-en-mp4a-3" codecs="mp4a.40.2" bandwidth="137166" audioSamplingRate="48000">
        <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
        <BaseURL>seg-audio_aac_1649092788119-en-mp4a-3.mp4</BaseURL>
        <SegmentBase indexRange="793-5012">
            <Initialization range="0-792" />
        </SegmentBase>
    </Representation>
</AdaptationSet>
<AdaptationSet mimeType="audio/mp4" startWithSAP="1" segmentAlignment="true" lang="arb" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
    <!-- MPEG Common Encryption -->
    <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="39aa2d7b-212e-c6e4-dd26-b6d3deec92a2" />
    <!-- Widevine -->
    <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed">
        <cenc:pssh>AAAALnBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAA4IARABGgNoZXMiA2hlcw==</cenc:pssh>
    </ContentProtection>
    <Representation id="audio_aac_1649755297605-ar-mp4a-1" codecs="mp4a.40.2" bandwidth="57007" audioSamplingRate="48000">
        <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
        <BaseURL>seg-audio_aac_1649755297605-ar-mp4a-1.mp4</BaseURL>
        <SegmentBase indexRange="793-5012">
            <Initialization range="0-792" />
        </SegmentBase>
    </Representation>
    <Representation id="audio_aac_1649755297605-ar-mp4a-2" codecs="mp4a.40.2" bandwidth="74232" audioSamplingRate="48000">
        <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
        <BaseURL>seg-audio_aac_1649755297605-ar-mp4a-2.mp4</BaseURL>
        <SegmentBase indexRange="793-5012">
            <Initialization range="0-792" />
        </SegmentBase>
    </Representation>
    <Representation id="audio_aac_1649755297605-ar-mp4a-3" codecs="mp4a.40.2" bandwidth="140960" audioSamplingRate="48000">
        <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
        <BaseURL>seg-audio_aac_1649755297605-ar-mp4a-3.mp4</BaseURL>
        <SegmentBase indexRange="793-5012">
            <Initialization range="0-792" />
        </SegmentBase>
    </Representation>
</AdaptationSet>

cc @SaurabhOfficial @vinodkputta

@tonihei
Copy link
Collaborator

tonihei commented May 13, 2022

ExoPlayer doesn't parse the arb language code because it's an individual sublanguage ("Standard Arabic") of the Arabic macrolanguage (which is represented by ar (ISO 639-1) or ara (ISO 639-2)). See https://iso639-3.sil.org/code/ara.

For other macrolanguages, we have a special mapping list to detect individual languages and map them back to their standardized macrolanguage so that they are compatible (e.g. Indonesian, in is mapped to ms-ind as an individual language of the Malay macrolanguage). I guess it makes sense to do the same here and map arb to ar-arb to indicate that we have an Arabic language as the main language and "Standard Arabic" as the individual sublanguage.

If you wonder why we haven't done that already and just map every existing individual code to its macrolanguage - the reason is simply that the list is too long and most of the codes are unlikely to ever appear in a media streaming service (see https://en.wikipedia.org/wiki/ISO_639_macrolanguage for a full list)

@tonihei tonihei self-assigned this May 13, 2022
@SaurabhOfficial
Copy link

Got it @tonihei answers my question. Thanks ✌️

icbaker pushed a commit to androidx/media that referenced this issue May 24, 2022
This is an individual language (ISO 639-3) part of the Arabic
macrolanguage ("ar" in ISO 639-1). Add this mapping to our
existing list similar to other individual to macrolanguage
mappings we have already.

Issue: Issue: google/ExoPlayer#10255
PiperOrigin-RevId: 448911950
icbaker pushed a commit that referenced this issue May 24, 2022
This is an individual language (ISO 639-3) part of the Arabic
macrolanguage ("ar" in ISO 639-1). Add this mapping to our
existing list similar to other individual to macrolanguage
mappings we have already.

Issue: Issue: #10255
PiperOrigin-RevId: 448911950
@tonihei
Copy link
Collaborator

tonihei commented Jun 9, 2022

This is fixed by the commit above.

@tonihei tonihei closed this as completed Jun 9, 2022
@SaurabhOfficial
Copy link

Thank you !

@google google locked and limited conversation to collaborators Aug 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants