Transcoding exotic formats (other than mp4a, mpeg, wav, etc)

FireFly Media Server Firefly Media Server Forums Firefly Media Server Setup Issues Transcoding exotic formats (other than mp4a, mpeg, wav, etc)

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1166
    Metalliferous
    Participant

    First of all I want to thank you all for the great work you’ve been doing. ๐Ÿ˜€
    I’ve got firefly svn-1498 running correctly and it works.

    While browsing around I discovered that you can transcode other formats to wave files so you can play them with Itunes etc.
    I want to transcode Adlib (OPL2) music to wav and play it in Itunes.

    I’ve followed instructions in the transcoding-HOWTO (http://wiki.mt-daapd.org/wiki/Transcoding_HOWTO)

    I wrote a working script, and Firefly indexes the files I need.
    The only problem is I can’t get firefly to transcode the files to .wav, they still show up as mp3 audio files in Itunes.

    Since there is no ssc_extension section anymore in the config file, I assume it has been replaced by ssc_codectypes. The problem is my format does not have a codectype related to it.

    Is there a way to include the codectypes, or am I doing something wrong?

    The important sections of my config file:
    mt-daapd.conf:

    extensions = .mp3,.m4a,.m4p,.dmo

    ssc_codectypes = dmo,.dmo

    ssc_prog = /usr/sbin/mtdaapd2adplay.sh

    (The .dmo extension is an adlib music file format adplay can play.)

    mtdaapd2adplay.sh:


    #!/bin/sh
    # Adplay transcoder for mt-daapd
    #
    # Plays file $1 and write it to stdout (--output=disk --device=-)
    # Then pipe it through wavstreamer with offset $2 and length $3
    adplay --quiet --output=disk --device=- "$1" | wavstreamer -o $2 -l $3

    P.S. My transcode script works and is playable when I write the output to a .wav file.

    #9484
    fizze
    Participant

    Yep, i thought about transcoding tracker formats (mod, s3m, far, 669, etc.) to play them on my SoundBridge…
    Guess the same problems would apply there.

    #9485
    rpedde
    Participant

    @Metalliferous wrote:

    First of all I want to thank you all for the great work you’ve been doing. ๐Ÿ˜€

    Thanks for saying.

    I wrote a working script, and Firefly indexes the files I need.
    The only problem is I can’t get firefly to transcode the files to .wav, they still show up as mp3 audio files in Itunes.

    Ah, yes. Unknown formats show up as codec type “unkn”. I intend to add scripted metadata scanners, so a script could dummy up the codec types to whatever they wanted. Not there yet.

    You should be able to modify shipped transcode script to transcode your files as well.

    — Ron

    #9486
    Metalliferous
    Participant

    @rpedde wrote:

    Ah, yes. Unknown formats show up as codec type “unkn”. I intend to add scripted metadata scanners, so a script could dummy up the codec types to whatever they wanted. Not there yet.

    You should be able to modify shipped transcode script to transcode your files as well.

    — Ron

    What you’re trying to say is that I should take an existing codectype, rename my files to that extension, so that firefly will start the transcoding process?

    I’ve been trying to get that idea to work but no luck so far. ๐Ÿ™

    If I try to ‘fake’ firefly to take one of the internal codectypes, and use the ssc_prog to transcode it, the scanners of those codectypes won’t allow my files to be added to the database.

    #9487
    rpedde
    Participant

    @Metalliferous wrote:

    What you’re trying to say is that I should take an existing codectype, rename my files to that extension, so that firefly will start the transcoding process?

    Ah, no sorry. I wasn’t verbose enough there. Sorry.

    As shipped, there is a conversion script (mt-daapd-ssc.sh) that transcodes alac, flac, and ogg. The relevant config entries look like:

    ssc_codecs=alac,flac,ogg
    ssc_script=/opt/bin/mt-daapd-ssc.sh

    Or something.

    Your custom files will be entered in the db with a codec type of “unkn”. So you’ll have to have a script for “unkn” types. You could do this:

    ssc_codecs=unkn
    ssc_script=/usr/local/bin/my-transcode-script.sh

    Except then, it won’t transcode ogg or flac or alac anymore. Also, it doesnt’ use wavstreamer which helps to set up the headers correctly in the generated .wav file. So I think the optimal solution is:

    ssc_codecs=alac,flac,ogg,unkn
    ssc_script=/opt/bin/mt-daapd-ssc.sh

    And then modify the mt-daapd-ssc.sh script such that it will transcode your file type. It should be reasonably easy to modify — take a look and use copy/paste methods to integrate your stuff in.

    That’s what I was getting at.

    — Ron

    #9488
    Metalliferous
    Participant

    Thanks for the extensive info :D, i’ll see if I can make it work.

    If it works out OK I will update the wiki with the things I learned.

    #9489
    Metalliferous
    Participant

    It still doesn’t work. ๐Ÿ™

    I tried to get ogg to decode, that worked. Then I discovered that even while I commented ogg support out of the transcode script, it still worked.
    This is because the ffplugin was still enabled (stupid me).

    I disabled the plugin, but now I can’t even decode ogg files. When I start the script with either an ogg or an dmo file, and write it to a wave file, it is playable.

    In Itunes, both ogg and dmo files now show up as MP3. It’s like firefly doesn’t know it needs to transcode those files.

    /etc/mt-daapd.conf:

    extensions = .mp3,.m4a,.m4p,.ogg,.flac,.mpc,.dmo
    ssc_codectypes = ogg, flac, alac, unkn
    ssc_prog = /usr/sbin/mt-daapd-ssc.sh

    In /usr/sbin/mt-daapd-ssc.sh I added the following:

    ADLIBDEC=adplay
    ....
    adlib_file() {
    $ADLIBDEC --quiet --output=disk --device=- "$FILE" | $WAVSTREAMER -o $OFFSET $FORGELEN

    }
    .....
    if ( echo $1 | grep -i ".dmo$" > /dev/null 2>&1 ); then
    adlib_file
    exit;
    fi

    P.S. I checked my song database with sqlite3, and the ogg file still shows up as ogg, my adlib files as unkn.

    #9490
    rpedde
    Participant

    @Metalliferous wrote:

    I disabled the plugin, but now I can’t even decode ogg files. When I start the script with either an ogg or an dmo file, and write it to a wave file, it is playable.

    The transcode files should show up as .wav. If not, then someting is quite wrong — the ssc-script plugin isn’t loading or something like that.

    extensions = .mp3,.m4a,.m4p,.ogg,.flac,.mpc,.dmo
    ssc_codectypes = ogg, flac, alac, unkn
    ssc_prog = /usr/sbin/mt-daapd-ssc.sh

    That looks right, so those files really should show up as “wav” files when getting file info from iTunes. If they don’t, then the rest is moot — the server has decided they don’t need to be transcoded.

    In /usr/sbin/mt-daapd-ssc.sh I added the following:

    ADLIBDEC=adplay
    ....
    adlib_file() {
    $ADLIBDEC --quiet --output=disk --device=- "$FILE" | $WAVSTREAMER -o $OFFSET $FORGELEN

    }
    .....
    if ( echo $1 | grep -i ".dmo$" > /dev/null 2>&1 ); then
    adlib_file
    exit;
    fi

    This looks good.

    You might want to full path to the executables:


    ADLIBDEC=/path/to/adplay

    and the same with oggdec, flac, wavstreamer, etc. Depending on your environment for daemons, /usr/bin or /usr/local/bin, or wherever these binaries are might not be on your path.

    P.S. I checked my song database with sqlite3, and the ogg file still shows up as ogg, my adlib files as unkn.

    That’s right.

    #9491
    Metalliferous
    Participant

    Ok, after some fidling with the config file I finally got it working. I will update the wiki with everything I learned.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Setup Issues’ is closed to new topics and replies.