DBSTalk Forum banner
1 - 20 of 65 Posts

· Icon
Joined
·
908 Posts
Discussion Starter · #1 ·
It is confirmed :joy: Audio transcoding is possible from a NAS Box.

NAS: D-Link DNS-323 (500MHz ARM CPU, 64MB RAM) with two 1TB Seagate ST31000340AS SATA Drives
MediaTomb SVN-1895 Pre-0.12.0 code (compiled on the NAS)

I have been able to get music, video, and photos to stream to my HR20-700.

Music - MP3, Flac, Ogg, AAC, M4A, WMA Real Time Transcoded to WAV.
Video - MPEG2 (.mpg), TS Not Transcoded. VOB (Video Track & Audio Track 1) Transcoded (Muxed) from PS to TS
Photos - JPEG, Real Time Transcoded to strip metadata before sending to HR20.
Online Audio Streams: Will play MP3 and MMS streams in a playlist.

When transcoding Music, here are the CPU usage percentages:
MP3: 14%
AAC, M4A: 20%
Flac: 8%
Ogg Vorbis: 25%
WMA: 11%

These are a lot better than I anticipated and do not interfere with normal NAS file sharing.

Before you ask, it was a royal PITA to compile MediaTomb (and half of the dependencies) directly on the NAS. Please don't ask for a How-To on how I got this to compile. I probably couldn't reproduce it anyway ;) This is just a proof of concept that a NAS box is powerful enough to transcode audio. I was just impatient to see if this would work and couldn't wait for the official release when pre-compiled binaries would be available.

I will provide a How-To on how to setup this NAS (to get shell access) and how to install/setup MediaTomb with a pre-compiled install. Also, I have no idea when the 0.12.0 will be released. The MediaTomb developer has been tight lipped lately.

UPDATE: I have now packaged the software for installation on the DNS-323. Instructions and download links are here:
http://forum.dsmg600.info/t3098-[REL]-MediaTomb-0.12.0-1899.html
 

· Icon
Joined
·
908 Posts
Discussion Starter · #3 ·
RunnerFL said:
Care to share your config.xml? :)

I'm trying to get Mediatomb running on my FreeBSD machine. Finally got it to install and it's running but I have X's next to file names on my HR2X's.
This is the config.xml for the NAS Box. All of the transcoding applications are fixed point (integer math):

Code:
<?xml version="1.0" encoding="UTF-8"?>
<config version="1" xmlns="http://mediatomb.cc/config/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mediatomb.cc/config/1 http://mediatomb.cc/config/1.xsd">
  <server>
    <ui enabled="yes" show-tooltips="yes">
      <accounts enabled="no" session-timeout="30">
        <account user="mediatomb" password="mediatomb"/>
      </accounts>
    </ui>
    <name>MT NAS</name>
    <udn>uuid:30c0d5f5-abaf-458b-9235-d605b630f75f</udn>
    <home>/mnt/HD_a2/mt/config</home>
    <webroot>/mnt/HD_a2/mt/usr/share/mediatomb/web</webroot>
    <storage>
      <sqlite3 enabled="yes">
        <database-file>mediatomb.db</database-file>
      </sqlite3>
    </storage>
    <protocolInfo extend="no"/><!-- For PS3 support change to "yes" -->
    <!--
       Uncomment the lines below to get rid of jerky avi playback on the
       DSM320 or to enable subtitles support on the DSM units
    -->
    <!--
    <custom-http-headers>
      <add header="X-User-Agent: redsonic"/>
    </custom-http-headers>

    <manufacturerURL>redsonic.com</manufacturerURL>
    <modelNumber>105</modelNumber>
    -->
    <!-- Uncomment the line below if you have a Telegent TG100 -->
    <!--
       <upnp-string-limit>101</upnp-string-limit>
    -->
  </server>
  <import hidden-files="no">
    <scripting script-charset="UTF-8">      
    <common-script>/mnt/HD_a2/mt/usr/share/mediatomb/js/common.js</common-script>
    <playlist-script>/mnt/HD_a2/mt/usr/share/mediatomb/js/playlists.js</playlist-script>
      <virtual-layout type="js">
         <import-script>/mnt/HD_a2/mt/usr/share/mediatomb/js/import.js</import-script>
      </virtual-layout>
    </scripting>
    <mappings>
      <extension-mimetype ignore-unknown="no">
        <map from="mp3" to="audio/mpeg"/>
        <map from="ogg" to="application/ogg"/>
        <map from="aac" to="audio/x-aac"/>
        <map from="m4a" to="audio/mp4"/>
        <map from="flac" to="audio/x-flac"/>
        <map from="jpg" to="image/jpeg"/>
        <map from="JPG" to="image/jpeg"/>
        <map from="wav" to="audio/wav"/>
        <map from="vob" to="video/mpeg"/>
        <map from="ts" to="video/mpeg"/>
        <map from="mpg" to="video/mpeg"/>
        <map from="asf" to="video/x-ms-asf"/>
        <map from="asx" to="video/x-ms-asf"/>
        <map from="wma" to="audio/x-ms-wma"/>
        <map from="wax" to="audio/x-ms-wax"/>
        <map from="wmv" to="video/x-ms-wmv"/>
        <map from="wvx" to="video/x-ms-wvx"/>
        <map from="wm" to="video/x-ms-wm"/>
        <map from="wmx" to="video/x-ms-wmx"/>
        <map from="m3u" to="audio/x-mpegurl"/>
        <map from="pls" to="audio/x-scpls"/>
        <map from="flv" to="video/x-flv"/>
        <!-- Uncomment the line below for PS3 divx support -->
        <!-- <map from="avi" to="video/divx"/> -->
        <!-- Uncomment the line below for D-Link DSM / ZyXEL DMA-1000 -->
        <!-- <map from="avi" to="video/avi"/> -->
      </extension-mimetype>
      <mimetype-upnpclass>
        <map from="audio/*" to="object.item.audioItem.musicTrack"/>
        <map from="video/*" to="object.item.videoItem"/>
        <map from="image/*" to="object.item.imageItem"/>
      </mimetype-upnpclass>
      <mimetype-contenttype>
        <treat mimetype="audio/mpeg" as="mp3"/>
        <treat mimetype="application/ogg" as="ogg"/>
        <treat mimetype="audio/x-flac" as="flac"/>
        <treat mimetype="image/jpeg" as="jpg"/>
        <treat mimetype="image/jpeg" as="JPG"/>
        <treat mimetype="audio/x-mpegurl" as="playlist"/>
        <treat mimetype="audio/x-scpls" as="playlist"/>
        <treat mimetype="audio/x-wav" as="pcm"/>
        <treat mimetype="audio/L16" as="pcm"/>
        <treat mimetype="video/x-msvideo" as="avi"/>
        <treat mimetype="video/mp4" as="mp4"/>
        <treat mimetype="audio/mp4" as="mp4"/>
        <treat mimetype="audio/wav" as="wav"/>
        <treat mimetype="audio/x-aac" as="aac"/>
      </mimetype-contenttype>
    </mappings>
  </import>
  <transcoding enabled="yes">
    <mimetype-profile-mappings>
      <transcode mimetype="audio/mpeg" using="madwav"/>
      <transcode mimetype="application/ogg" using="oggwav"/>
      <transcode mimetype="audio/x-flac" using="flacwav"/>
      <transcode mimetype="audio/x-aac" using="faadwav"/>
      <transcode mimetype="audio/mp4" using="faadwav"/>
      <transcode mimetype="audio/x-ms-wma" using="wmawav"/>
      <transcode mimetype="image/jpeg" using="stripexif"/>  
    </mimetype-profile-mappings>
    <profiles>
      <profile name="madwav" enabled="yes" type="external">
        <mimetype>audio/wav</mimetype>
        <accept-url>no</accept-url>
        <first-resource>yes</first-resource>
        <accept-ogg-theora>no</accept-ogg-theora>
        <agent command="madplay" arguments="--output=wave:%out %in"/>
        <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
      </profile>
      <profile name="oggwav" enabled="yes" type="external">
        <mimetype>audio/wav</mimetype>
        <accept-url>no</accept-url>
        <first-resource>yes</first-resource>
        <accept-ogg-theora>no</accept-ogg-theora>
        <agent command="oggdec" arguments="-o %out %in"/>
        <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
      </profile>
      <profile name="flacwav" enabled="yes" type="external">
        <mimetype>audio/wav</mimetype>
        <accept-url>no</accept-url>
        <first-resource>yes</first-resource>
        <accept-ogg-theora>no</accept-ogg-theora>
        <agent command="flac" arguments="-d -f -o %out %in"/>
        <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
      </profile>
      <profile name="faadwav" enabled="yes" type="external">
        <mimetype>audio/wav</mimetype>
        <accept-url>no</accept-url>
        <first-resource>yes</first-resource>
        <accept-ogg-theora>no</accept-ogg-theora>
        <agent command="faad" arguments="-o %out %in"/>
        <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
      </profile>
      <profile name="wmawav" enabled="yes" type="external">
        <mimetype>audio/wav</mimetype>
        <accept-url>no</accept-url>
        <first-resource>yes</first-resource>
        <accept-ogg-theora>no</accept-ogg-theora>
        <agent command="wma2wav" arguments="%in %out"/>
        <buffer size="1048576" chunk-size="131072" fill-size="262144"/>
      </profile>
      <profile name="stripexif" enabled="yes" type="external">
        <mimetype>image/jpeg</mimetype>
        <accept-url>no</accept-url>
        <first-resource>yes</first-resource>
        <accept-ogg-theora>no</accept-ogg-theora>
        <agent command="jhead2" arguments="-purejpg -outfile %out %in"/>
        <buffer size="5000" chunk-size="100" fill-size="100"/>
      </profile>
    </profiles>
  </transcoding>
</config>
The config.xml and transcoding scripts for a more powerful machine (with floating point unit) are posted on the MediaTomb transcoding wiki:

http://mediatomb.cc/dokuwiki/transcoding:transcoding#directv_hr2x_transcoding
 

· Godfather
Joined
·
291 Posts
Awesome!
 

· Registered
Joined
·
16,423 Posts

· Icon
Joined
·
908 Posts
Discussion Starter · #10 ·
RunnerFL said:
I have mpeg video working now. :)

And I'm working my way thru the monster "Mediatomb is now working" thread hoping to get wmv and avi working as well. :lol:
Just curious...what kind of hardware are you running FreeBSD? As far as video transcoding goes, the ffmpegvideo script will transcode just about format :) You may have to compile a custom ffmpeg and you'll need to install mediainfo... Also, Greg Lee is working on a new script using VLC.
 

· Registered
Joined
·
16,423 Posts
boilerjt said:
Just curious...what kind of hardware are you running FreeBSD? As far as video transcoding goes, the ffmpegvideo script will transcode just about format :) You may have to compile a custom ffmpeg and you'll need to install mediainfo... Also, Greg Lee is working on a new script using VLC.
I'm running it on an i386 machine.

I have ffmpeg installed, from ports, but I get errors on avi and wmv formats.

When I try to play an avi or wmv file I get:

2008-09-28 20:57:58 INFO: Arguments: %in %out 5900k 256k
2008-09-28 20:57:58 ERROR: process terminated early
 

· Icon
Joined
·
908 Posts
Discussion Starter · #12 ·
RunnerFL said:
I'm running it on an i386 machine.

I have ffmpeg installed, from ports, but I get errors on avi and wmv formats.

When I try to play an avi or wmv file I get:

2008-09-28 20:57:58 INFO: Arguments: %in %out 5900k 256k
2008-09-28 20:57:58 ERROR: process terminated early
Do you have mediainfo installed? The first thing the script does is call mediainfo to get information about the video. Other things to check are that the ffmpegvideo +x bit is set (chmod +x) and whether the script actually runs without errors. I don't know if the script runs on FreeBSD the way it runs on Linux.

You can test the script by running it from the command line (ffmpegvideo inputfile.avi outputfile.ts 5900k 256k) and see if it transcodes and writes to the specified output file. If any errors occur, they should be sent to the console.
 

· Registered
Joined
·
16,423 Posts
boilerjt said:
Do you have mediainfo installed? The first thing the script does is call mediainfo to get information about the video. Other things to check are that the ffmpegvideo +x bit is set (chmod +x) and whether the script actually runs without errors. I don't know if the script runs on FreeBSD the way it runs on Linux.

You can test the script by running it from the command line (ffmpegvideo inputfile.avi outputfile.ts 5900k 256k) and see if it transcodes and writes to the specified output file. If any errors occur, they should be sent to the console.
Ok, this is odd... I'm getting "command not found" but I know ffmpegvideo is in /usr/local/bin and set executable.

Yes, mediainfo is installed and responding. And ffmpeg is installed and working as well.
 

· Icon
Joined
·
908 Posts
Discussion Starter · #14 ·
RunnerFL said:
Ok, this is odd... I'm getting "command not found" but I know ffmpegvideo is in /usr/local/bin and set executable.

Yes, mediainfo is installed and responding. And ffmpeg is installed and working as well.
Are you using a bash shell? The script calls /bin/bash and you should make sure this is correct.
 

· Icon
Joined
·
908 Posts
Discussion Starter · #19 ·
If there are any D-Link DNS-323 owners out there and would like to try the pre-0.12.0 MediaTomb code, please let me know. I was able to package the relevant files and I can email them to you. The package has been tested by another user and seems to be working :)
 

· Hall Of Fame
Joined
·
2,535 Posts
I got the 0.12.0 files from boilerjt, and while I've only tested photos thus far, this is some good stuff!

I've tried twonky, tversity, and WMP11 on various machines with not alot of luck.

I have about 15GB of photos (12K, roughly) and I've done a little messing with it in the last hour or so. I can view most of my photos - I'm guessing about 80%. The 20% that I can't view were taken on my Nikon D40 and are high resolution. The file size of these is roughly 2MB each. I've looked through a bunch of my photos, and I'm nearly 100% certain that the only photos I can see are those on the D40.

My assumption is that the fault lies on the HR2x, but I haven't done enough messing around to confirm whether or not that is, in fact, the case, but I'll work on it.

Either way, this is much, much more success than I had previously with any of my media servers. And even better, it's running on my NAS, which means no computers running 24/7 to have my photos accessible.

Now that I've made it this far, I'll track down my music & movies and start working on those.

All in all, I'm well on my way to becoming a very happy Mediatomb user! :D
 
1 - 20 of 65 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top