-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
Feature request: Example for how create a HLS stream m3u8 player #911
Comments
BBC decided to provide the audio as m4a. Unfortunatly I do not have any codec which would support this and information how to parse this is really hard to find. Any help is appreciated... |
Hi Phil, Frank Boesing AudioLibrary on a Teensy looks promising: https://github.com/FrankBoesing/Arduino-Teensy-Codec-lib And Yokohama-Miyazawa on a M5 Stack has and M5HLSPlayer: https://github.com/Yokohama-Miyazawa/M5HLSPlayer Kind Regards |
3 attempts at any help: Espressif provides an aac decoder with their ADF: https://github.com/espressif/esp-adf-libs/blob/master/esp_codec/include/codec/aac_decoder.h m4a is just an envelope for a codec, usually aac. Have not checked for what bbc actually uses. faad is one open source project that can decode m4a and aac, so probably contains code to study the difference. |
Yes, I also found franks approach most promising, but I am not sure how reliable it will be. A test file that I donwloaded did not seem to have the same atoms that he was relying on. He also has an easier problem to solve because he can rely on the file API when doing the parsing. I would expect that the helix aac decoder that I am normally using in my examples works as well. Currently I am in the hospital,, so do not expect to see any quick progress. |
Things are not working yet, but to keep things simple, I decided on the following design:
A draft implementation of these classes have been committed. #include "AudioTools.h"
#include "AudioCodecs/CodecMTS.h"
#include "AudioCodecs/CodecAACHelix.h"
I2SStream out; // final output of decoded stream
HLSStream hls_stream("SSID", "password");
MTSDecoder mts;
AACDecoderHelix aac;
EncodedAudioStream aac_stream(&out, &aac);
EncodedAudioStream mts_stream(&aac_stream, &mts);
StreamCopy copier(mts_stream, hls_stream);
// Arduino Setup
void setup(void) {
Serial.begin(115200);
AudioLogger::instance().begin(Serial, AudioLogger::Info);
out.begin(TX_MODE);
mts_stream.begin();
aac_stream.begin();
hls_stream.begin("http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/nonuk/sbr_vlow/ak/bbc_world_service.m3u8");
}
// Arduino loop
void loop() {
copier.copy();
} |
I just made a test by sending the data directly to FAAD: it can't handle it! I am getting a Decoding error: Channel coupling not yet implemented. So there seems to be no direct path w/o mpeg-ts. ps. |
Today I spent some time to investigate why the MTSDecoder above is not working: I am stunned - the same code with the same data on the desktop is working, but on the ESP32 it's not. This will be difficult to find... |
@pschatzmann Thank you. Thank you. |
The MTSDecoder is working now, but the HLSStream seems to need some rework, to get faster. |
Hi Phil, I'm not sure which example file this is, is it this one and is it working enough to be useful? arduino-audio-tools/examples/examples-stream/streams-url_mts-hex/streams-url_mts-hex.ino Line 12 in ae72af6
Thank you |
No hls does not work properly yet |
Phil, my favorite radio use this kind of stream and after many research this is the only solution i've found. |
HLS is not working (reliably) yet. |
I see the example running and receiving TS file without any sound. |
The example sends the output to the display! So there can not be any sound... |
The example sends the output to the display! So there can not be any sound... I see your point regarding portability. |
Did you try this code: |
I am also very interested in HLS streams (mainly because BBC discontinued their Icecast MP3 streams). A quick note: Aside from issues of portability, the M5HLSPlayer repo also seems quite broken and hasn't had any commits in a year. HLS is a tough one! |
Hi Phil,
Thank you for all the work you have put into making this amazing library, and thank you for generously sharing it.
It is amazing.
I have been using it to make my main kitchen radio, but last month BBC have changed how they stream their internet radio, so mp3 streams are no longer available, only m3u8 like this one:
"http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_6music.m3u8"
I can see that you have created a HLS player in experiments, which looks like it will solve this problem, but I can't quite work out how to use it.
Would you please share an example that shows how to use this to create a simple streaming music player. Something like the URL player example for playing a m3u8 live stream.
Many thanks
Drew
The text was updated successfully, but these errors were encountered: