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

Some audio tracks cannot be selected #8347

Closed
montezumba opened this issue Dec 12, 2020 · 2 comments
Closed

Some audio tracks cannot be selected #8347

montezumba opened this issue Dec 12, 2020 · 2 comments
Assignees

Comments

@montezumba
Copy link

Hello,

In some cases not all audio tracks are visible or cannot be selected for some reason.
I sent a mail with an example that has 2 audio tracks (English, Russian) and 2 subtitles tracks (Hebrew, Russian). They are perfectly visible and selectable in VLC.

However, in ExoPlayer 2.12.2 I can only see 1 audio track (English) and 2 subtitle tracks (Hebrew and another one with unknown language)

Here is a log print:

 videoEnabled [eventTime=9.85, mediaPos=31.72, window=0, period=0]
 audioEnabled [eventTime=9.87, mediaPos=31.72, window=0, period=0]
 tracks [eventTime=9.87, mediaPos=31.72, window=0, period=0
   MediaCodecVideoRenderer [
     Group:0, adaptive_supported=N/A [
       [X] Track:0, id=0, mimeType=video/mpeg2, res=544x576, supported=NO_EXCEEDS_CAPABILITIES
     ]
   ]
   MediaCodecAudioRenderer [
     Group:0, adaptive_supported=N/A [
       [X] Track:0, id=1002/4, mimeType=audio/mpeg-L2, channels=2, sample_rate=48000, language=en, supported=YES
     ]
   ]
   FfmpegAudioRenderer []
   TextRenderer [
     Group:0, adaptive_supported=N/A [
       [ ] Track:0, id=1002/8194, mimeType=application/cea-608, supported=YES
     ]
     Group:1, adaptive_supported=N/A [
       [ ] Track:0, id=1002/89, mimeType=application/dvbsubs, language=he, supported=YES
     ]
   ]
   MetadataRenderer [
     Group:0, adaptive_supported=N/A [
       [X] Track:0, id=null, mimeType=application/id3, supported=YES
     ]
   ]
   CameraMotionRenderer []
 ]

  • ExoPlayer version number: 2.12.2
  • Android version: 7.1.1
  • Android device: BlueStacks N-64 emulator (but easily reproduced on any other device)

The original stream is an m3u8 stream, but when I tried to play the individual *.ts files within - the audio tracks are visible and selectable

Thanks!

@krocard
Copy link
Contributor

krocard commented Dec 15, 2020

I can reproduce. Playing the HLS playlist will only show one audio track and incorrectly detect one subtitle format:

      MediaCodecAudioRenderer [
        Group:0, adaptive_supported=N/A [
          [ ] Track:0, id=1002/4, mimeType=audio/mpeg-L2, channels=2, sample_rate=48000, language=en, supported=NO_UNSUPPORTED_TYPE
        ]
      ]
      TextRenderer [
        Group:0, adaptive_supported=N/A [
          [ ] Track:0, id=1002/8194, mimeType=application/cea-608, supported=YES
        ]
        Group:1, adaptive_supported=N/A [
          [ ] Track:0, id=1002/89, mimeType=application/dvbsubs, language=he, supported=YES
        ]
      ]

but playing directly the first item will show both audio tracks:

      MediaCodecAudioRenderer [
        Group:0, adaptive_supported=N/A [
          [ ] Track:0, id=1002/221, mimeType=audio/mpeg-L2, channels=2, sample_rate=48000, language=en, supported=NO_UNSUPPORTED_TYPE
        ]
        Group:1, adaptive_supported=N/A [
          [ ] Track:0, id=1002/222, mimeType=audio/mpeg-L2, channels=2, sample_rate=48000, language=ru, supported=NO_UNSUPPORTED_TYPE
        ]
      ]
      TextRenderer [
        Group:0, adaptive_supported=N/A [
          [ ] Track:0, id=1002/251, mimeType=application/dvbsubs, language=he, supported=YES
        ]
        Group:1, adaptive_supported=N/A [
          [ ] Track:0, id=1002/252, mimeType=application/dvbsubs, language=ru, supported=YES
        ]
      ]

@christosts or @AquilesCanta how are the tracks retrieved in HLS?

The playlist (full version in email):

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:22
#EXT-X-TARGETDURATION:12
#EXTINF:10.080000,
https://[RETRACTED].ts?dl=1
#EXTINF:10.360000,
https://[RETRACTED].ts?dl=1
#EXTINF:11.280000,
https://[RETRACTED].ts?dl=1
#EXTINF:10.200000,
https://[RETRACTED].ts?dl=1
#EXTINF:11.120000,
https://[RETRACTED].ts?dl=1
#EXTINF:10.320000,
https://[RETRACTED].ts?dl=1
Format of the first item
General
ID                                       : 10 (0xA)
Format                                   : MPEG-TS
File size                                : 2.55 MiB
Duration                                 : 10 s 40 ms
Start time                               : UTC 2020-11-21 01:05:40
End time                                 : UTC 2020-11-21 01:05:49
Overall bit rate mode                    : Variable
Overall bit rate                         : 2 123 kb/s
Country                                  : ISR
Timezone                                 : +02:00:00

Video
ID                                       : 211 (0xD3)
Menu ID                                  : 1002 (0x3EA)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@Main
Format settings                          : CustomMatrix / BVOP
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : Variable
Format settings, picture structure       : Frame
Codec ID                                 : 2
Duration                                 : 10 s 0 ms
Bit rate mode                            : Variable
Bit rate                                 : 1 759 kb/s
Maximum bit rate                         : 5 859 kb/s
Width                                    : 544 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 16:9
Active Format Description                : Full frame 16:9 image
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.225
Time code of first frame                 : 02:30:26:19
Time code source                         : Group of pictures header
GOP, Open/Closed                         : Open
Stream size                              : 2.10 MiB (82%)

Audio #1
ID                                       : 221 (0xDD)
Menu ID                                  : 1002 (0x3EA)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 4
Duration                                 : 10 s 80 ms
Bit rate mode                            : Constant
Bit rate                                 : 128 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -112 ms
Stream size                              : 158 KiB (6%)
Language                                 : English

Audio #2
ID                                       : 222 (0xDE)
Menu ID                                  : 1002 (0x3EA)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 4
Duration                                 : 10 s 80 ms
Bit rate mode                            : Constant
Bit rate                                 : 128 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -112 ms
Stream size                              : 158 KiB (6%)
Language                                 : Russian

Menu
ID                                       : 4095 (0xFFF)
Menu ID                                  : 1002 (0x3EA)
Duration                                 : 10 s 40 ms
List                                     : 211 (0xD3) (MPEG Video) / 221 (0xDD) (MPEG Audio, English) / 222 (0xDE) (MPEG Audio, Russian)
Language                                 :  / English / Russian
Service type                             : digital television

@krocard krocard assigned christosts and AquilesCanta and unassigned christosts Dec 15, 2020
@christosts
Copy link
Contributor

I believe this is happening due to #2014: audio tracks of the same type are multiplexed in the TS files and ExoPlayer does not support that. If you follow the comments thread on #2014 you'll see that the suggested way is to split the playlist the content in a master playlist with alternate audio renditions (eg here and here) or see customization efforts from other users reported on the same issue.

Aside: the audio tracks are encoded as mpeg-L2 which is not supported by the Android platform (maybe some devices support the codec but that is not the expected case). To play such audio with ExoPlayer on multiple devices, you need to use the ffmpeg extension. I see the extension is bundled in your app, judging by the the log output, so you may be aware of this. However, according to the log, the FfmpegAudioRenderer did not pick up the track and audio was played with MediaCodec. That probably means that ffmpeg was not built with mp3 support. In case you plan to use the ffmpeg extension for mpeg-L2, please ensure to include the mp3 decoder when building the extension (look for ENABLED_DECODERS in the extension's README on r2.12)

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

No branches or pull requests

4 participants