DLNA Linux

From OPPOwiki
Jump to: navigation, search
m (Protected "DLNA Linux": Excessive spamming ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite)))
Line 1: Line 1:
'''How-To configure a Linux machine with MiniDLNA to stream to the Oppo BDP-83'''
+
>'''How-To configure a Linux machine with MiniDLNA to stream to the Oppo BDP-83'''
  
 
Requirements:
 
Requirements:
Line 10: Line 10:
 
From a terminal window:
 
From a terminal window:
  
As root, move the source file into the '<code>/</code>' directory.
+
As root, move the source file into the '&lt;code&gt;/&lt;/code&gt;' directory.
  
<code><pre>`mv /home/myuser/path/to/minidlna_1.0.16.3_static.tar.gz /`</pre></code>
+
&lt;code&gt;&lt;pre&gt;`mv /home/myuser/path/to/minidlna_1.0.16.3_static.tar.gz /`&lt;/pre&gt;&lt;/code&gt;
  
 
Then, extract the files in the gzipped file:
 
Then, extract the files in the gzipped file:
  
<code><pre>`tar zxvf /minidlna_1.0.16.3_static.tar.gz`</pre></code>
+
&lt;code&gt;&lt;pre&gt;`tar zxvf /minidlna_1.0.16.3_static.tar.gz`&lt;/pre&gt;&lt;/code&gt;
  
 
There are two files that get installed in the following locations:
 
There are two files that get installed in the following locations:
  
<code><pre>
+
&lt;code&gt;&lt;pre&gt;
 
|__ etc
 
|__ etc
 
|  |__ minidlna.conf
 
|  |__ minidlna.conf
Line 27: Line 27:
 
     |__ sbin
 
     |__ sbin
 
         |__ minidlna
 
         |__ minidlna
</pre></code>
+
&lt;/pre&gt;&lt;/code&gt;
  
 
Change the ownership of the files to root:
 
Change the ownership of the files to root:
  
<code><pre>`chown root:root /etc/minidlna.conf /usr/sbin/minidlna`</pre></code>
+
&lt;code&gt;&lt;pre&gt;`chown root:root /etc/minidlna.conf /usr/sbin/minidlna`&lt;/pre&gt;&lt;/code&gt;
  
 
Almost done, next, we need to modify the minidlna.conf file.  Using nano, or gedit, open the /etc/minidlna.conf file:
 
Almost done, next, we need to modify the minidlna.conf file.  Using nano, or gedit, open the /etc/minidlna.conf file:
Line 37: Line 37:
  
 
First, we need to make sure the service is listening on the correct interface.
 
First, we need to make sure the service is listening on the correct interface.
<code><pre>
+
&lt;code&gt;&lt;pre&gt;
 
#network_interface=eth0
 
#network_interface=eth0
 
network_interface=wlan0
 
network_interface=wlan0
</pre></code>
+
&lt;/pre&gt;&lt;/code&gt;
  
 
Next, setup the directories you want to share.
 
Next, setup the directories you want to share.
<code><pre>
+
&lt;code&gt;&lt;pre&gt;
  
 
# set this to the directory you want scanned.
 
# set this to the directory you want scanned.
Line 49: Line 49:
 
# * if you want to restrict a media_dir to a specific content type, you
 
# * if you want to restrict a media_dir to a specific content type, you
 
#  can prepend the type, followed by a comma, to the directory:
 
#  can prepend the type, followed by a comma, to the directory:
#  + "A" for audio  (eg. media_dir=A,/home/jmaggard/Music)
+
#  + &quot;A&quot; for audio  (eg. media_dir=A,/home/jmaggard/Music)
#  + "V" for video  (eg. media_dir=V,/home/jmaggard/Videos)
+
#  + &quot;V&quot; for video  (eg. media_dir=V,/home/jmaggard/Videos)
#  + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)
+
#  + &quot;P&quot; for images (eg. media_dir=P,/home/jmaggard/Pictures)
 
media_dir=A,/home/myuser/mp3
 
media_dir=A,/home/myuser/mp3
 
media_dir=A,/path/to/big/usb_drive/music
 
media_dir=A,/path/to/big/usb_drive/music
 
media_dir=V,/path/to/big/NAS/video
 
media_dir=V,/path/to/big/NAS/video
 
media_dir=P,/path/to/Pictures
 
media_dir=P,/path/to/Pictures
</pre></code>
+
&lt;/pre&gt;&lt;/code&gt;
  
 
You should now be able to start minidlna with the following command:
 
You should now be able to start minidlna with the following command:
<code><pre>`/usr/sbin/minidlna`</pre></code>
+
&lt;code&gt;&lt;pre&gt;`/usr/sbin/minidlna`&lt;/pre&gt;&lt;/code&gt;
  
 
Here is an init.d script for Redhat/CentOS/Fedora based systems.  Put this in /etc/init.d,  name it minidlna, chmod it to 775 and add it to chkconfig.
 
Here is an init.d script for Redhat/CentOS/Fedora based systems.  Put this in /etc/init.d,  name it minidlna, chmod it to 775 and add it to chkconfig.
<code><pre>
+
&lt;code&gt;&lt;pre&gt;
 
#! /bin/sh
 
#! /bin/sh
  
Line 75: Line 75:
 
# settings, so you should treat this with care.
 
# settings, so you should treat this with care.
  
# Original author:  Perry Clark <omfgppc (at) gmail.com>
+
# Original author:  Perry Clark &lt;omfgppc (at) gmail.com&gt;
  
 
## EDIT FROM HERE
 
## EDIT FROM HERE
  
 
# Installation details
 
# Installation details
MINIDLNA="/usr/sbin/minidlna"
+
MINIDLNA=&quot;/usr/sbin/minidlna&quot;
ARGS="/etc/minidlna.conf"
+
ARGS=&quot;/etc/minidlna.conf&quot;
  
 
# Where to keep a log file
 
# Where to keep a log file
MINIDLNA_LOG="/var/log/minidlna.log"
+
MINIDLNA_LOG=&quot;/var/log/minidlna.log&quot;
  
 
# Where the PID lives
 
# Where the PID lives
PID_FILE="/var/run/minidlna.pid"
+
PID_FILE=&quot;/var/run/minidlna.pid&quot;
  
 
## STOP EDITING HERE
 
## STOP EDITING HERE
Line 102: Line 102:
 
case $1 in
 
case $1 in
 
   start)
 
   start)
echo -n "Starting MiniDLNA: "
+
echo -n &quot;Starting MiniDLNA: &quot;
$MINIDLNA -f $ARGS -P $PID_FILE  >> $MINIDLNA_LOG 2>&1
+
$MINIDLNA -f $ARGS -P $PID_FILE  &gt;&gt; $MINIDLNA_LOG 2&gt;&amp;1
echo "ok"
+
echo &quot;ok&quot;
 
;;
 
;;
 
   stop)
 
   stop)
  echo -n "Stopping MiniDLNA: "
+
  echo -n &quot;Stopping MiniDLNA: &quot;
  for pidf in `/bin/ls $PID_FILE 2>/dev/null`; do
+
  for pidf in `/bin/ls $PID_FILE 2&gt;/dev/null`; do
 
             if [ -s $pidf ]; then
 
             if [ -s $pidf ]; then
                 kill `cat $pidf` >/dev/null 2>&1
+
                 kill `cat $pidf` &gt;/dev/null 2&gt;&amp;1
 
             fi
 
             fi
 
rm -rf $PIF_FILE
 
rm -rf $PIF_FILE
 
  done
 
  done
echo "ok"
+
echo &quot;ok&quot;
 
;;
 
;;
 
   restart|reload|force-reload)
 
   restart|reload|force-reload)
echo "Restarting MiniDLNA: "
+
echo &quot;Restarting MiniDLNA: &quot;
 
 
 
     $0 stop
 
     $0 stop
Line 126: Line 126:
 
   *)
 
   *)
 
# Print help
 
# Print help
echo "Usage: /etc/init.d/minidlna {start|stop|restart|reload|force-reload}"
+
echo &quot;Usage: /etc/init.d/minidlna {start|stop|restart|reload|force-reload}&quot;
 
exit 1
 
exit 1
 
;;
 
;;
Line 132: Line 132:
  
 
exit 0
 
exit 0
</pre></code>
+
&lt;/pre&gt;&lt;/code&gt;
  
 
Pandora / other streaming media ideas:
 
Pandora / other streaming media ideas:
Line 155: Line 155:
  
 
Here's an example shell script, not for production usage :)
 
Here's an example shell script, not for production usage :)
<code><pre>
+
&lt;code&gt;&lt;pre&gt;
 
#!/bin/bash
 
#!/bin/bash
  
Line 162: Line 162:
  
 
#for file in `find $TMP -mmin 1 -name ${PREFIX}*`
 
#for file in `find $TMP -mmin 1 -name ${PREFIX}*`
for file in `find $TMP -name ${PREFIX}* 2>/dev/null`
+
for file in `find $TMP -name ${PREFIX}* 2&gt;/dev/null`
 
# for file in `ls $TMP/$PREFIX*`
 
# for file in `ls $TMP/$PREFIX*`
 
# file file in `lsof $TMP/$PREFIX*`
 
# file file in `lsof $TMP/$PREFIX*`
 
   do  
 
   do  
   CLEAN=`echo $file | cut -d "/" -f 3`
+
   CLEAN=`echo $file | cut -d &quot;/&quot; -f 3`
 
   #  echo `file $file`
 
   #  echo `file $file`
 
   # echo $CLEAN
 
   # echo $CLEAN
   VERSION=`file $file | cut -d " " -f 8`
+
   VERSION=`file $file | cut -d &quot; &quot; -f 8`
  
if [ ${VERSION} != "1" ]; then
+
if [ ${VERSION} != &quot;1&quot; ]; then
 
if [ -e $HOME/stream/music/${CLEAN}.mp3 ];  
 
if [ -e $HOME/stream/music/${CLEAN}.mp3 ];  
 
  then  
 
  then  
    echo -n "$HOME/stream/music/${CLEAN}.mp3 exists skipping..."
+
    echo -n &quot;$HOME/stream/music/${CLEAN}.mp3 exists skipping...&quot;
 
  else
 
  else
    # echo -n "linking $file to $HOME/stream/music/${CLEAN}.aac "
+
    # echo -n &quot;linking $file to $HOME/stream/music/${CLEAN}.aac &quot;
 
    # ln -s ${file} $HOME/stream/music/${CLEAN}.aac
 
    # ln -s ${file} $HOME/stream/music/${CLEAN}.aac
 
cp ${file} $HOME/stream/cache/${CLEAN}.aac
 
cp ${file} $HOME/stream/cache/${CLEAN}.aac
Line 186: Line 186:
 
     if [ -e $HOME/stream/video/${CLEAN}.mpg ];  
 
     if [ -e $HOME/stream/video/${CLEAN}.mpg ];  
 
  then  
 
  then  
    echo -n "$HOME/stream/video/${CLEAN}.mpg exists skipping..."
+
    echo -n &quot;$HOME/stream/video/${CLEAN}.mpg exists skipping...&quot;
 
  else
 
  else
    echo -n "linking $file to $HOME/stream/video/${CLEAN}.mpg "
+
    echo -n &quot;linking $file to $HOME/stream/video/${CLEAN}.mpg &quot;
 
    ln -s ${file} $HOME/stream/video/${CLEAN}.mpg
 
    ln -s ${file} $HOME/stream/video/${CLEAN}.mpg
 
cp ${file} $HOME/stream/cache/${CLEAN}.mpg  
 
cp ${file} $HOME/stream/cache/${CLEAN}.mpg  
Line 194: Line 194:
 
fi  
 
fi  
 
   done;
 
   done;
</pre></code>
+
&lt;/pre&gt;&lt;/code&gt;
 
[[Category:DLNA]]
 
[[Category:DLNA]]
 
[[Category:BDP-83]]
 
[[Category:BDP-83]]
 
[[Category:Linux]]
 
[[Category:Linux]]
 +
 +
----
 +
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 +
----
 +
=[http://adutaqaqoq.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
 +
----
 +
=[http://adutaqaqoq.co.cc CLICK HERE]=
 +
----
 +
</div>

Revision as of 23:05, 17 November 2010

Personal tools