Change mp3 bitrate
  • Hi, how can change the mp3 bitrate, from 128 to 64 or 96 on airtime 1.70 o 1.6.1?

    Very Happy

    I tried to change the file ls_script.liq on airtime 1.6.1 with this new line

    ""
    if output_icecast_mp3 then
    out_mp3 = output.icecast(%mp3,
    host = icecast_host, port = icecast_port,
    password = icecast_pass, mount = mount_point_mp3,
    fallible = true,
    bitrate = 96,
    restart = true,
    restart_delay = 5,
    url = icecast_url,
    description = icecast_description,
    genre = icecast_genre,


    but the output was always at 128 Sad

    how can I do? thanks and sorry for the trouble!
  • 18 Comments sorted by
  • Vote Up0Vote Down Paul BaranowskiPaul Baranowski
    Posts: 389Member, Administrator, Sourcefabric Team
    Your best bet is to look into the liquidsoap documentation to figure that one out...and if you do find out, please let us know!
  • Hi Fabio,
    You're almost there.. once you edit that file, you need to copy it to /opt/pypo/bin/scripts and restart liquidsoap.

    Airtime Pro Hosting: http://airtime.pro
  • Or you could just edit /opt/pypo/bin/scripts/ls_script.liq directly.
    Airtime Pro Hosting: http://airtime.pro
  • thanks Very Happy
  • Fabio Da Ronta писал(а) Ср., 13 Апрель 2011 00:40
    bitrate = 96,

    This doesn't work with Liquidsoap 1.0.0-beta+svn (default@e712df4d96c0:20110501:162642), after adding the "bitrate" parameter, I get the following error in liquidsoap --check:
    At line 140, char 23-24: cannot apply that parameter because
    the function (at line 136, char 29) has no argument labeled "bitrate"!
    Same for "quality" setting for the OGG stream.

  • try putting it like this:

    if output_icecast_mp3 then
        out_mp3 = output.icecast(%mp3(bitrate=96),
            host = icecast_host, port = icecast_port,
            password = icecast_pass, mount = mount_point_mp3,
            fallible = true,
            restart = true,
            restart_delay = 5,
            url = icecast_url,
            description = icecast_description,
            genre = icecast_genre,
            s)
  • James Dunn писал(а) Пт., 15 Июль 2011 21:50
        out_mp3 = output.icecast(%mp3(bitrate=96),


    Thank you James, I appreciate! It works.
  • How do with OGG quality ??
  • Vote Up0Vote Down Paul BaranowskiPaul Baranowski
    Posts: 389Member, Administrator, Sourcefabric Team
    Same thing, except change the line that says output.icecast(%vorbis)
    instead.


    On Sun, Aug 7, 2011 at 7:16 PM, krzakx <
    airtime-support@lists.sourcefabric.org> wrote:

    > **
    > How do with OGG quality ??
    >

  • But this hang up me AirTime.

    I done ii in this way:
        out_ogg = output.icecast(%ogg(quality=-1.0),
    


    What's wrong?
  • Vote Up0Vote Down Paul BaranowskiPaul Baranowski
    Posts: 389Member, Administrator, Sourcefabric Team
    Try this way:

    out_ogg = output.icecast(%ogg(bitrate=64),

  • No it still not working

    %include "library/pervasives.liq"
    %include "/etc/airtime/liquidsoap.cfg"
    
    set("log.file.path", log_file)
    set("log.stdout", true)
    set("server.telnet", true)
    set("server.telnet.port", 1234)
    
    queue = request.queue(id="queue", length=0.5)
    queue = audio_to_stereo(queue)
    
    pypo_data = ref '0'
    web_stream_enabled = ref false
    stream_metadata_type = ref 0
    station_name = ref ''
    show_name = ref ''
    
    %include "ls_lib.liq"
    
    server.register(namespace="vars", "pypo_data", fun (s) -> begin pypo_data := s "Done" end)
    server.register(namespace="vars", "web_stream_enabled", fun (s) -> begin web_stream_enabled := (s == "true") string_of(!web_stream_enabled) end)
    server.register(namespace="vars", "stream_metadata_type", fun (s) -> begin stream_metadata_type := int_of_string(s) s end)
    server.register(namespace="vars", "show_name", fun (s) -> begin show_name := s s end)
    server.register(namespace="vars", "station_name", fun (s) -> begin station_name := s s end)
    
    
    default = amplify(0.00001, noise())
    default = rewrite_metadata([("artist","Airtime"), ("title", "offline")],default)
    
    s = fallback(track_sensitive=false, [queue, default])
    
    s = on_metadata(notify, s)
    s = crossfade(s)
    # Attach a skip command to the source s:
    
    #web_stream_source = input.http(id="web_stream", autostart = false, buffer=0.5, max=20., "")
    
    #once the stream is started, give it a sink so that liquidsoap doesn't
    #create buffer overflow warnings in the log file.
    #output.dummy(fallible=true, web_stream_source)
    
    #s = switch(track_sensitive = false,
    #    transitions=[to_live,to_live],
    #    [
    #      ({ !web_stream_enabled }, web_stream_source),
    #      ({ true }, s)
    #    ]
    #)
    
    add_skip_command(s)
    s = map_metadata(append_title, s)
    
    
    if output_sound_device then
        out_device = out(s)
    end
    
    if output_icecast_mp3 then
        out_mp3 = output.icecast(%mp3(bitrate=128),
                host = icecast_host, port = icecast_port,
                password = icecast_pass, mount = mount_point_mp3,
                fallible = true,
                restart = true,
                restart_delay = 5,
                url = icecast_url,
                description = icecast_description,
                genre = icecast_genre,
                s)
    end
    
    if output_icecast_vorbis then
        
        if output_icecast_vorbis_metadata then
            out_vorbis = output.icecast(%vorbis(bitrate=64),
                    host = icecast_host, port = icecast_port,
                    password = icecast_pass, mount = mount_point_vorbis,
                    fallible = true,
                    restart = true,
                    restart_delay = 5,
                    url = icecast_url,
                    description = icecast_description,
                    genre = icecast_genre,
                    s)
    
        else
            #remove metadata from ogg source and merge tracks to fix bug
            #with vlc and mplayer disconnecting at the end of every track
            s = add(normalize=false, [amplify(0.00001, noise()),s])
            out_vorbis = output.icecast(%vorbis(bitrate=64),
                    host = icecast_host, port = icecast_port,
                    password = icecast_pass, mount = mount_point_vorbis,
                    fallible = true,
                    restart = true,
                    restart_delay = 5,
                    url = icecast_url,
                    description = icecast_description,
                    genre = icecast_genre,
                    s)    
        end
        
    
    end


    krzakx@krzakx:~$ sudo /usr/lib/airtime/pypo/bin/liquidsoap/liquidsoap --check /usr/lib/airtime/pypo/bin/scripts/ls_script.liq
    Error in encoding format at line 74, char 53-54:
      unknown parameter name or invalid parameter value.
    


  • What is on line 74 in ls_script.liq?
  • I attached above all ls_script.liq file.
    Here you have something more comfortable check this http://wklej.org/id/585194/
  • Hi,

    I haven't tested this, but try replacing "%vorbis" with "%vorbis.cbr" on line 74.

    http://savonet.sourceforge.net/doc-svn/encoding_formats.html
    Airtime Pro Hosting: http://airtime.pro
  • It is works! Thanks you.

    But there are no meta tags Sad

    http://play.bieszczady.fm:8000/

    I don't know if the problem is standing on Icecast side (it looks like) or in client player side (I am using VLC, audacious)
  • ogg metadata is turned off as it causes disconnects in some players.

    What's that language? - some words seem familiar : )
    Encoding of the title is screwed, looks like this now:
    Bézèd'h - Les filles sont volages
  • Language - Polish.

    You said that ogg metadata is turned off.
    But I have in ls_script.liq this:

    if output_icecast_vorbis then
        
        if output_icecast_vorbis_metadata then
            out_vorbis = output.icecast(%vorbis,
                    host = icecast_host, port = icecast_port,
                    password = icecast_pass, mount = mount_point_vorbis,
                    fallible = true,
                    restart = true,
                    restart_delay = 5,
                    url = icecast_url,
                    description = icecast_description,
                    genre = icecast_genre,
                    s)
    
        else
            #remove metadata from ogg source and merge tracks to fix bug
            #with vlc and mplayer disconnecting at the end of every track
            s = add(normalize=false, [amplify(0.00001, noise()),s])
            out_vorbis = output.icecast(%vorbis,
                    host = icecast_host, port = icecast_port,
                    password = icecast_pass, mount = mount_point_vorbis,
                    fallible = true,
                    restart = true,
                    restart_delay = 5,
                    url = icecast_url,
                    description = icecast_description,
                    genre = icecast_genre,
                    s)    
        end


    PS. I don't know how fix encoding.