I am trying to stream two MP3 files to Icecast using Ezstream and the stream should run in web browsers. The files I am testing with were downloaded as webm and converted to MP3 using ffmpeg. They have the same channels count, same bitrate and same sample rate but different duration.
My setup: the Ezstream xml configuration file is set to stream MP3 and a program playlist is used to identify what is the next file to be streamed, and no encoders or decoders are used. When I start streaming I save the process ID of the Ezstream process (using the -p argument), and then I use the command kill -10 $(cat currentpid) with currentpid as the file containing the process ID so Ezstream executes the playlist program to get the next file name and skips the current file to play the next one. Basically I am just switching between 1.mp3 and 2.mp3.
The problem is that on Chrome web browser, when I switch between the two files the player (default HTML5 player) will suddenly stop (sometimes I can switch multiple times before it happens and sometimes it happens quickly) and the error PIPELINE_ERROR_DECODE is what I find when I access player.error in JavaScript. Although Firefox handles the change and continues the stream normally, I am convinced that Firefox here is the exception, that it is not a bug in Chrome (in my case), and that there is something wrong with my setup that needs to be fixed to support other browsers.
Doing the same using mpv player, I get the following errors but the audio keeps streaming normally (sometimes it takes multiple switches before it happens just like in Chrome):
[ffmpeg/audio] mp3float: big_values too big
[ffmpeg/audio] mp3float: Error while decoding MPEG audio frame.
Error decoding audio.
I tried using MP3 encoder and decoder I copied from the Ezstream example files (lame and madplay) but the problem still existed.
I am not sure if the problem is basic and I cannot see it or it is more complicated. Also I do not have a problem if I need to use other format than MP3 to fix that issue, as long as that format is supported by Ezstream and Icecast.
Thanks.