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

No sound in certain HLS stream but VideoView has sound #501

Closed
andhie opened this issue May 28, 2015 · 7 comments
Closed

No sound in certain HLS stream but VideoView has sound #501

andhie opened this issue May 28, 2015 · 7 comments

Comments

@andhie
Copy link

andhie commented May 28, 2015

When using ExoPlayer to play some HLS stream, there is video but no sound. However, playing the same stream in VideoView, there is video and sound.
ExoPlayer does throw an exception when it fails to play video, but there is no way to know if video is ok and audio fails. If there is such indicators, at least i could still fallback to VideoView.
VLC Player indicates the audio codec used is MPEG Audio Layer 1/2 (mpga).

http://198.50.176.179:1935/live/ktvlive.sdp/playlist.m3u8

@ojw28
Copy link
Contributor

ojw28 commented May 29, 2015

This is because we don't handle the following stream types:

0x03 ISO/IEC 11172-3 Audio
0x04 ISO/IEC 13818-3 Audio

We currently handle 0x0F (AAC) for audio.

@andhie
Copy link
Author

andhie commented May 29, 2015

Is there a way for me to know if audio failed to play so I can switch over to VideoView?

@ojw28
Copy link
Contributor

ojw28 commented May 29, 2015

No massively easy way. Internally in MediaCodecTrackRenderer, the audio renderer will transition to the STATE_IGNORE state after doPrepare. So one option as a temporary solution would be for you to expose that and query it.

Things this issue now tracks:

  1. Provide an API to allow easy querying of whether a renderer is in STATE_IGNORE.
  2. Supporting MPEG-1/MPEG-2 audio in HLS. Since it appears VideoView supports it, I guess we should too.

@andhie
Copy link
Author

andhie commented May 29, 2015

I also wonder how did you get the 0x03 ISO/IEC 11172-3 Audio, 0x04 ISO/IEC 13818-3 Audio?
Based on the HLS draft, they are mention to support these codecs

https://tools.ietf.org/html/draft-pantos-http-live-streaming-16#page-5

Each Media Segment MUST be formatted as an MPEG-2 Transport Stream [ISO_13818], a WebVTT [WebVTT] file, or a Packed Audio file, which is a file containing packed encoded audio samples and ID3 tags, such as AAC with ADTS framing [ISO_13818_7], MP3 [ISO_13818_3] or AC-3 [AC_3]. Transport of other media file formats is not defined.

@ojw28
Copy link
Contributor

ojw28 commented May 29, 2015

Yup, thanks. Updated the comment above. We should aim to provide support (not a huge priority for us though).

@ghost
Copy link

ghost commented Jun 12, 2015

@andhie can you please post a snippet of your solution based on @ojw28 's suggestion to expose MediaCodecTrackRenderer's state transition?

I need the exact same mechanism, but for when there is only audio and no video

Thanks!

@ojw28
Copy link
Contributor

ojw28 commented Jun 26, 2015

MP3 support has been added to HLS in the dev branch. The stream linked in this bug is dead, so I don't know whether it works, but closing anyway. Please file a new issue with a working stream if you find any problems.

@ojw28 ojw28 closed this as completed Jun 26, 2015
@google google locked and limited conversation to collaborators Jun 28, 2017
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

2 participants