Reputation: 9
I have an old internet radio that does not support HLS streams. Therefore I cannot listen to my favourite radio at this url: https://streamcdnf31-4c4b867c89244861ac216426883d1ad0.msvdn.net/radiodeejay/radiodeejay/master_ma.m3u8
I found a solution using a paid software https://minimradio.com/ which is based on minimserver and minimstreamer.
This solution works if I install mininmserver and minimstreamer on a local computer and use the internet radio to point to the converter stream but I will have to pay if I want to use this.
Checking the documentation of minimradio and ministreamer I can see the following:
*Some internet radios can play the previous AAC ADTS streams but can't play these new HLS streams ...
If the network stream URL points to an HLS .m3u8 master playlist or media playlist file, MinimStreamer reads this file and uses the HLS protocol to read the stream audio data and send it to the music player as a conventional HTTP stream. This makes the stream playable on music players that don't support the HLS protocol. The audio data in the stream must be encoded in AAC format.* and not a single destination receiver I should use a streaming (broadcasting) server. What can I use to do that?
My question is the following: Is there a way to replicate what minimstreamer is doing using ffmpeg? I have tried this:
ffmpeg -re -i https://streamcdnf31-4c4b867c89244861ac216426883d1ad0.msvdn.net/radiodeejay/radiodeejay/master_ma.m3u8 -c copy -listen 1 -f mpegts http://192.168.1.9:10000
which is playing corrctly in local vlc on the same computer. But when I stop VLC is got this error in ffmpeg:
[https @ 00000291de047400] Cannot reuse HTTP connection for different host: StreamCdnG20-4c4b867c89244861ac216426883d1ad0.msvdn.net:-1 != 4c4b867c89244861ac216426883d1ad0.msvdn.net:-1
[hls @ 00000291dd96d140] keepalive request failed for 'https://4c4b867c89244861ac216426883d1ad0.msvdn.net/radiodeejay/radiodeejay/play1.m3u8' with error: 'Invalid argument' when parsing playlist
[hls @ 00000291dd96d140] Opening 'https://4c4b867c89244861ac216426883d1ad0.msvdn.net/radiodeejay/radiodeejay/play1.m3u8' for reading
[hls @ 00000291dd96d140] Skip ('#EXT-X-DISCONTINUITY-SEQUENCE:0')
[hls @ 00000291dd96d140] Skip ('#EXT-X-PROGRAM-DATE-TIME:2024-11-29T06:36:56.926Z')
[hls @ 00000291dd96d140] Skip ('#EXT-X-PROGRAM-DATE-TIME:2024-11-29T06:37:07.314Z')
[hls @ 00000291dd96d140] Skip ('#EXT-X-PROGRAM-DATE-TIME:2024-11-29T06:37:17.571Z')
[https @ 00000291de4e00c0] Opening 'https://StreamCdnG20-4c4b867c89244861ac216426883d1ad0.msvdn.net/radiodeejay/radiodeejay/20240722T095729_p1s_001086632.ts' for reading
[aost#0:0/copy @ 00000291de1c4f40] Error submitting a packet to the muxer: Error number -10054 occurred
Last message repeated 1 times
[out#0/mpegts @ 00000291deaa7e40] Error muxing a packet
[out#0/mpegts @ 00000291deaa7e40] Task finished with error code: -10054 (Error number -10054 occurred)
[out#0/mpegts @ 00000291deaa7e40] Terminating thread with return code -10054 (Error number -10054 occurred)
[out#0/mpegts @ 00000291deaa7e40] Error writing trailer: Error number -10054 occurred
[http @ 00000291de8870c0] URL read error: Error number -10054 occurred
[out#0/mpegts @ 00000291deaa7e40] Error closing file: Error number -10054 occurred
[out#0/mpegts @ 00000291deaa7e40] video:0KiB audio:797KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 21.849292%
size= 971KiB time=00:00:50.98 bitrate= 156.0kbits/s speed=1.01x
Conversion failed!
And if I try to connect from my internet radio I immediately got this error:
[aost#0:0/copy @ 0000027081584a40] Error submitting a packet to the muxer: Error number -10053 occurred
Last message repeated 1 times
[out#0/mpegts @ 0000027081e684c0] Error muxing a packet
[out#0/mpegts @ 0000027081e684c0] Task finished with error code: -10053 (Error number -10053 occurred)
[out#0/mpegts @ 0000027081e684c0] Terminating thread with return code -10053 (Error number -10053 occurred)
[out#0/mpegts @ 0000027081e684c0] Error writing trailer: Error number -10053 occurred
[http @ 0000027081c47680] URL read error: Error number -10053 occurred
[out#0/mpegts @ 0000027081e684c0] Error closing file: Error number -10053 occurred
[out#0/mpegts @ 0000027081e684c0] video:0KiB audio:46KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 13.917515%
size= 52KiB time=00:00:02.94 bitrate= 145.1kbits/s speed= 1.2x
Conversion failed!
What is the correct way to stream this one locally in order to be listened in my internet radio? Shall I use ffmpeg or can be done directly with ngnix? Or shall I use both?
Upvotes: -1
Views: 48
Reputation: 163478
I don't know why your FFmpeg command isn't working for you... it's working fine for me. However, I recommend dropping the -re
parameter. You don't want FFmpeg to re-clock the stream. You want to have it read in as quickly as the source does. For HLS, this is a pretty chunky buffer, but that's normal. That data will be flushed to the player which will buffer as it needs.
Another thing I should note is that you want to connect to FFmpeg immediately after it starts listening. Don't let it sit there and try to buffer indefinitely.
An alternative to this is to run Icecast as an internet radio server inbetween FFmpeg and your older radio.
Finally, what channel is this? I really like the music!
Upvotes: -1