Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Transcoding FLAC to WAV for PS3

Help
2009-04-13
2013-05-30
  • quietdragon
    quietdragon
    2009-04-13

    It is possible to transcode flac to raw pcm for streaming to the PS3 using the following:

         <mimetype-profile-mappings>
            <transcode mimetype="audio/x-flac" using="audio-flac"/>
         </mimetype-profile-mappings>

          <profile name="audio-flac" enabled="yes" type="external">
            <mimetype>audio/L16</mimetype>
            <accept-url>no</accept-url>
            <first-resource>yes</first-resource>
            <hide-original-resource>yes</hide-original-resource>
            <accept-ogg-theora>no</accept-ogg-theora>
            <sample-frequency>44100</sample-frequency>
            <audio-channels>2</audio-channels>
            <agent command="flac" arguments="-dfs --force-raw-format --endian=big --sign=signed -o %out %in"/>
            <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
          </profile>

    I notice that the PS3 will also fetch and play .WAV files if I place .WAV files on the file system and have MediaTomb them served up to the PS3.

    So, is it possible to transcode from FLAC to WAV and avoid going to raw pcm ?

    I tried:

         <mimetype-profile-mappings>
            <transcode mimetype="audio/x-flac" using="audio-flac-wav"/>
         </mimetype-profile-mappings>

          <profile name="audio-flac-wav" enabled="yes" type="external">
            <mimetype>audio/x-wav</mimetype>
            <accept-url>no</accept-url>
            <first-resource>yes</first-resource>
            <hide-original-resource>yes</hide-original-resource>
            <accept-ogg-theora>no</accept-ogg-theora>
            <agent command="flac" arguments="-dfs -o %out %in"/>
            <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
          </profile>

    With this, the PS3 shows FLAC files as icons as "Unsupported Data".

    The WAV file shows up ok, and still plays.

    What's missing here?

    Any suggestions as to how to debug this?

     
    • Scott Meacham
      Scott Meacham
      2009-04-14

      I use "audio/L16; rate=44100; channels=2" for mimetype.  You probably only need to add the channels info, but I'm not sure.  I include the rate as well since that is the rate of all my FLAC's.

       
      • Scott Meacham
        Scott Meacham
        2009-04-15

        Oops. Sorry quietdragon, my brain was not fully engaged due to sleep deprivation. I thought you were having difficulty with PCM (even though the thread title should have set me straight).

        No, transcoding to WAV never worked for me, but I've been very pleased with the PCM capability so don't really care.  It's the same thing without a header and big instead of little endian byte order.

         
    • BT
      BT
      2009-04-15

      quietdragon,

      It is not possible to transcode to WAV as the PS3 will only accept transcoded audio as raw PCM.

       
    • quietdragon
      quietdragon
      2009-04-17

      Thanks for the response guys.

      Ok, is there a way I can deal with streaming/transcoding 96kHz/24bit flac files to the PS3?

       
      • Scott Meacham
        Scott Meacham
        2009-04-20

        Have you tried transcoding to raw format and specifying bps and sample rate?  The max sample rate you can use for L16 is 48000 which would at least be an even divide by 2.

        Try transcoding with:

        flac -dfs --force-raw-format --endian=big --sign=signed --bps=16 --sample-rate=48000 <output_file>

        I'm not sure if the <sample-frequency> tag sets up http header info that the PS3 reads or if you would need the rate in the mime type:

        "audio/L16; rate=48000"

        I don't know how you would deal with multiple rates unless you use different file extensions for flac files (.flac,.flacHD) or transcode all to one rate.  I think it would be better to not do rate conversion unless you have to.  You could rate convert everything to CD rates if you mostly have CD rips.

         
  • Almost good, the arguments -bps and -sample-rate are not accepted by flac when decoding. For me setting the mime type did the trick.
    Thanx!

    Btw. I'm using debian lenny

     

  • Anonymous
    2012-04-10

    I'd like to be able to do this as well.  No luck yet.

    Testing on Samsung LED TV 6500 and iPhone app "Media Link Player Lite" - they just don't like audio/wav .

     
  • Pascal Pochol
    Pascal Pochol
    2012-05-05

    http://mediatomb.cc/dokuwiki/transcoding:transcoding might help.

    here's what I have to transcode flac to my PS3
       <mimetype-contenttype>
             <treat mimetype="audio/x-flac" as="flac"/>
        …
        <transcoding enabled="yes">
           <mimetype-profile-mappings>
               <transcode mimetype="application/ogg" using="oggflac2raw"/>
               <transcode mimetype="audio/x-flac" using="oggflac2raw"/>
               …
        <profiles>
          <profile name="oggflac2raw" enabled="yes" type="external">
            <mimetype>audio/L16</mimetype>
            <accept-url>no</accept-url>
            <first-resource>yes</first-resource>
            <accept-ogg-theora>yes</accept-ogg-theora>
            <sample-frequency>44100</sample-frequency>
            <audio-channels>2</audio-channels>
            <hide-original-resource>yes</hide-original-resource>
            <agent command="/usr/bin/ffmpeg" arguments="-i %in -ac 2 -ar 44100 -y -f s16be %out"/>
            <buffer size="1048576" chunk-size="4096" fill-size="1024"/>
          </profile>