NeilBetham / livewire-streamer

Stream a Livewire multicast stream to Icecast
MIT License
15 stars 6 forks source link

Output formatting #2

Closed AliceRossa closed 9 years ago

AliceRossa commented 9 years ago

Hello,

Thank you for your sharing.

I will wish to broadcast to an Icecast server with two different rates:

MP3 ice-samplerate = 44100; ice-bitrate = 128; ice-channels = 2 AAC ice-samplerate = 44100; ice-bitrate = 64; ice-channels = 2

I can convert the stream into 128kbps but not 44k, how do I do?

dumprtp 239.192.0.1 5004 | \
avconv -f s24be -ar 48k -ac 2 -i - -f mp3 -b:a 128K - | \
ezstream -c /etc/ezstream.xml

Input #0, s24be, from 'pipe:': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0.0: Audio: pcm_s24be, 48000 Hz, stereo, s32, 2304 kb/s Output #0, mp3, to 'pipe:': Metadata: TSSE : Lavf54.20.4 Stream #0.0: Audio: libmp3lame, 48000 Hz, stereo, s32p, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (pcm_s24be -> libmp3lame)

Isn't it better to convert directly into the ezstream.xml file like this?

<ezstream>
    <url>http://ICECAST.ADDRESS.GOES.HERE:8000/stream</url>
    <sourcepassword>hackme</sourcepassword>
    <format>MP3</format>
    <filename>stdin</filename>
    <stream_once>1</stream_once>

    <svrinfoname>Awesome Stream Name</svrinfoname>
    <svrinfourl>http://awesomestream.org</svrinfourl>
    <svrinfogenre>All</svrinfogenre>
    <svrinfodescription>This is my amazing web stream!</svrinfodescription>

   <reencode>
      <enable>1</enable>
      <encdec>
         <format>MP3</format>
         <match>.mp3</match>
         <decode> DECODE LIVEWIRE CHANNEL </decode>
         <encode>ffmpeg -f s16le -ar 44.1k -ac 2 -i - -b:a 32k -ar 44.1k -f adts -</encode>
      </encdec>
   </reencode>
</ezstream>

Thank you very much for your help!

NeilBetham commented 9 years ago

Hi,

Sorry for the late response. I would recommend just adding a -ar 44.1k after the 128k bit rate but before the last - in the first example you gave. I would recommend that over doing the second conversion in ezstream, doing that just introduces extra overhead that you don't need to add.

AliceRossa commented 9 years ago

Hi, Thank you for your answer, your solution works perfectly! I now broadcasts in 128kbps 44.1k but the sound is attenuated. How can I set the level of the encoder to be 0dB ? Thank you for your help.

NeilBetham commented 9 years ago

Try adding -af "volume=5dB" after -i - in the first example. This will boost the volume by 5dB, however I'm not sure of all the gains in your system so you will probably just have to play around with the level to find how much gain you need