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

Implement MP3 audio support for HLS #71

Closed
andudo opened this issue Oct 6, 2014 · 13 comments
Closed

Implement MP3 audio support for HLS #71

andudo opened this issue Oct 6, 2014 · 13 comments

Comments

@andudo
Copy link
Contributor

andudo commented Oct 6, 2014

Not a priority for us at the moment. But we might focus on it later.

@tresvecesseis
Copy link
Contributor

I have posted a mostly working patch #229 tor MPEG 1/2 Layer I/II/III support

@biddster
Copy link

biddster commented Apr 1, 2015

+1 for this. I'm trying to play back a demuxed video over HLS. The mp3 audio is in one playlist and the h264 video in another. The video plays find as you'd expect, but the audio stream gives an error.

04-01 16:02:50.824    5947-6586/com.example.droid.app E/LoadTask﹕ Unexpected error loading stream
    java.lang.IllegalArgumentException
            at com.google.android.exoplayer.util.Assertions.checkArgument(Assertions.java:39)
            at com.google.android.exoplayer.util.ParsableByteArray.setPosition(ParsableByteArray.java:110)
            at com.google.android.exoplayer.util.ParsableByteArray.skip(ParsableByteArray.java:123)
            at com.google.android.exoplayer.hls.parser.TsExtractor.read(TsExtractor.java:179)
            at com.google.android.exoplayer.hls.TsChunk.load(TsChunk.java:123)
            at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:206)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)

@ojw28
Copy link
Contributor

ojw28 commented May 29, 2015

@tresvecesseis - Did you ever get this fully working? It should be much easier to finish now, since the extractor re-factoring that we've done more recently. We also have an Mp3Extractor, which is probably useful to copy code from.

@tresvecesseis
Copy link
Contributor

yes, we are using this patch #325 for four moths in our player without problems and we will like to know if you have any problem with the pull request.

The only problem we have is with the unsupported codecs in android, as mpeg L1 and L2 (our audio is mpeg 1 layer II) are not officially supported in android and there is not a clear naming convention with these codecs, each vendor use a different mime type for these and other vendors use the same mime type as the mp3 codec (audio/mpeg) so it´s very difficult to detect codec support. For example in google nexus player there is not support for mpeg L1 or L2 but mp3 is supported with a codec that announces audio/mpeg support, in a humax box mpeg L2 support is supported with a codec with mime type audio/mpeg2, other white box use audio/mpeg-L2 and a third box uses audio/mpeg for mpeg L3 and mpeg L2 so we dont have a way to detect accurately mpeg L2 support based on the mime type.

@ojw28
Copy link
Contributor

ojw28 commented May 29, 2015

Ah, sorry, that kinda passed me by. We'd like to pull something here, I think! I tried patching it in, and it seems like it produces a native crash on my devices for the test stream in #501, which contains a TS_STREAM_TYPE_MPA_LSF stream. Any idea about that?

@tresvecesseis
Copy link
Contributor

I think the problems is the codec support in your box, as per the last explanation I don´t have a way to identify what codec support mpeg audio so i use the generic audio/mpeg mime type to request a codec, but depending on the mpeg layer you could need to specify other mime type to select the right codec.

I did my test mainly with mpeg 1 L2 audios but i tested with some mpeg 1 L3, unfortunately i don´t streams with mpeg 2 audio tracks

@tresvecesseis
Copy link
Contributor

the audio in the playlist is:

Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Audio
Format version                           : Version 2.5
Format profile                           : Layer 3
Mode                                     : Joint stereo
Mode extension                           : Intensity Stereo + MS Stereo
Codec ID                                 : 4
Duration                                 : 11s 442ms
Bit rate mode                            : Constant
Bit rate                                 : 24.0 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 11.025 KHz
Compression mode                         : Lossy
Delay relative to video                  : 2ms
Stream size                              : 33.5 KiB (16%)

unfortunately mpeg 2.5 is a non standard format and I don´t have specs.

@ojw28
Copy link
Contributor

ojw28 commented May 29, 2015

Ok. Do you have some standard HLS+MP3 example streams to test with?

@tresvecesseis
Copy link
Contributor

no, all the links that I can provide you (privately) are progressive HTTP (or HLS) with MP2 audio

@ojw28
Copy link
Contributor

ojw28 commented May 29, 2015

Ok. I think we need some samples (that we can use for ongoing testing) before we can sanely merge this. I'll have a hunt around for some. If you happen to find any, let me know.

@tresvecesseis
Copy link
Contributor

@tresvecesseis
Copy link
Contributor

i have tested several MPA and MPA_LSF layer III streams without problems:

movistar_fubol_hd_13.1Mbps.mp1l3.ts:

MacBook-Pro:MP3 tests sergio$ mediainfo movistar_fubol_hd_13.1Mbps.mp1l3.ts
...
Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Mode                                     : Joint stereo
Mode extension                           : MS Stereo
Codec ID                                 : 3
Duration                                 : 16s 704ms
Bit rate mode                            : Constant
Bit rate                                 : 192 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Delay relative to video                  : -804ms
Stream size                              : 392 KiB (1%)
Writing library                          : LAME3.99.5
...

movistar_fubol_hd_13.1Mbps.mp2l3.ts:

MacBook-Pro:MP3 tests sergio$ mediainfo movistar_fubol_hd_13.1Mbps.mp2l3.ts
...
Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Audio
Format version                           : Version 2
Format profile                           : Layer 3
Mode                                     : Joint stereo
Mode extension                           : MS Stereo
Codec ID                                 : 3
Duration                                 : 16s 728ms
Bit rate mode                            : Constant
Bit rate                                 : 160 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 24.0 KHz
Compression mode                         : Lossy
Delay relative to video                  : -827ms
Stream size                              : 327 KiB (1%)
Writing library                          : LAME3.99.5
...

you can get the test streams from:

https://drive.google.com/folderview?id=0Bzu4Z1WNC2reaUlPTl8xQ3lqSzg&usp=sharing

@ojw28 ojw28 mentioned this issue Jun 25, 2015
@ojw28
Copy link
Contributor

ojw28 commented Jun 26, 2015

This is now supported on the dev branch.

@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

4 participants