Author Topic: Stream Server randomly reports streaming at higher bitrates  (Read 472 times)

Chris Oakley

  • Posts: 107
Has anyone ever seen an instance where an IceCast or Shoutcast server turns off a stream and reports that the software being used to stream exceeds the allowed bitrate?

Our app using Bass and Bass.Net is doing this, although everything is correct in terms of streaming. We're using lame.exe for the encoder.

This would create the encoder:

Code: [Select]
Com = "lame.exe -r -s 44.1 --cbr --flush -h -b 128 --resample 44.1 - -"
Encoder = BassEnc.BASS_Encode_Start(CastingMixer, Com, BASSEncode.BASS_ENCODE_NOHEAD Or BASSEncode.BASS_ENCODE_FP_16BIT, _myEndProc, IntPtr.Zero)

And then this would start the casting:

Code: [Select]
nRet = BassEnc.BASS_Encode_CastInit(Encoder, StreamURL.Trim, IIf(Username.Trim = "", Password.Trim, Username.Trim & ":" & Password.Trim), Content, Name, WebURL, Genre, Description, Nothing, Bitrate, IsPublic)

It's pretty standard stuff to make it encode and cast, but why from time to time the server knocks it back saying it's exceeding the allowed bitrate is beyond me.

Ian @ un4seen

  • Administrator
  • Posts: 22829
Is the CastingMixer's sample rate always 44100 Hz? If not, that could explain the higher data rate, because the encoder is told to expect 44100 Hz ("-r -s 44.1"). Note the "--resample 44.1" option isn't actually doing anything because of that (the rate is already 44100 Hz as far as LAME is concerned).

Chris Oakley

  • Posts: 107
Thanks Ian, I switched out the variables with the 44.1 so you could see what was what. It could be that it would be a different value depending on the user config.

The CastingMixer sample rate could be different. Should I set it to be 44100?

Ian @ un4seen

  • Administrator
  • Posts: 22829
The CastingMixer's sample rate can be different but the "-s" option in the LAME command line will need to match it.

If the problem still happens then, is it early on or after some time? If the latter, I suppose another possibility is that the network stalled briefly and there was a burst of data afterwards that exceeded some threshold in the server. I haven't heard of this happening before, so I'm not really sure.

Chris Oakley

  • Posts: 107
Thanks again Ian. I checked again and I misread my code. The sample rate in the -s option in the encoder always matches the sample rate of the CastingMixer as they use the same variable.

I don't understand streaming servers enough to even theorise what this issue could be. I'll have to keep digging I suppose. I like your theory on the data burst.