transcode flac to mp3

Help
billjen
2009-10-06
2013-05-30
  • billjen

    billjen - 2009-10-06

    Can anybody tell me how to setup the config.xml to transcode flac to mp3?

     
  • James Wyper

    James Wyper - 2009-10-30

    I have the following in the transcoding section of my config.xml

          <transcoding enabled="yes">
            <mimetype-profile-mappings>
              <transcode mimetype="audio/x-flac" using="hqmp3"/> 
            </mimetype-profile-mappings>
            <profiles>
              <profile name="hqmp3" enabled="yes" type="external">
                <mimetype>audio/mpeg</mimetype>
                <accept-url>no</accept-url>
                <use-chunked-encoding>no</use-chunked-encoding>
                <first-resource>yes</first-resource>
                <accept-ogg-theora>no</accept-ogg-theora>
                <agent command="/home/james/.mediatomb/flac2mp3" arguments="%in %out"/>
                <buffer size="800000" chunk-size="100000" fill-size="100000"/>
              </profile>
              </transcoding>

    ..and this script in /home/james/.mediatomb/flac2mp3 (but it can go anywhere so long as the "agent" tag above refers to the correct location).

        #!/bin/bash
        flac -d -c "$1" | lame -id3v1-only -t -preset fast extreme - - > "$2"

    You'll need flac and lame installed on your system.

    Hope this helps

    James.

     
  • griz

    griz - 2012-09-13

    To save anyone else the hassle I've find-and-replaced all the html characters back to how they should be.
    This is untested. I'll post again if it works.

     <transcoding enabled="yes">
     <mimetype-profile-mappings>
     <transcode mimetype="audio/x-flac" using="hqmp3"/>
     </mimetype-profile-mappings>
     <profiles>
     <profile name="hqmp3" enabled="yes" type="external">
     <mimetype>audio/mpeg</mimetype>
     <accept-url>no</accept-url>
     <use-chunked-encoding>no</use-chunked-encoding>
     <first-resource>yes</first-resource>
     <accept-ogg-theora>no</accept-ogg-theora>
     <agent command="/home/james/.mediatomb/flac2mp3" arguments="%in %out"/>
     <buffer size="800000" chunk-size="100000" fill-size="100000"/>
     </profile> </transcoding>
    
     ..and this script in /home/james/.mediatomb/flac2mp3 (but it can go anywhere so long as the "agent" tag above refers to the correct location).
    
     #!/bin/bash
     flac -d -c "$1" | lame --id3v1-only -t --preset fast extreme - - > "$2"
    
     
  • griz

    griz - 2012-09-13

    It works for me, but apparently the buffer, chunk and fill need tweeking for my sheevaplug so that it can keep up.

     
  • griz

    griz - 2012-09-13

    Or swap to a less extreme encoding preset >.<

     
  • griz

    griz - 2012-09-13

    Oh, and ONE MORE THING. There is a tag missing: </profiles>

     
  • griz

    griz - 2012-09-13

    Transcoding from flac to mp3 on a sheevaplug was a terrible idea.

    The first reply to this post is awesome - plays flac files on my android phone (that struggles with flac) as pcm with Bubble Upnp. Now I can listen at full quality via fubar 2000 and on my phone, which is why I've just spent about twelve hours trawling through different dodgy transcoding setups.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks