首次知道可以使用DLNA,還是在網易雲音樂的設定選項裡面發現的,之前家裡有電視盒子,可以直接用,但是每次都要按開關感覺有點麻煩,正好有樹莓派,在網上查了一下,基本上都是DLNA伺服器端的安裝,少有幾個用戶端配置的,結合了兩個部落格的内容糅合出這篇文章,修複了一些有問題的指令:
dir=`mktemp -d`
cd $dir
wget wget http://www.chiark.greenend.org.uk/~christi/debian/[email protected]
apt-key add [email protected]
touch /etc/apt/sources.list.d/upnprender.list
echo "deb http://www.chiark.greenend.org.uk/~christi/debian/ wheezy main" > /etc/apt/sources.list.d/upnprender.list
apt-get install libupnp-dev libgstreamer1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-alsa -y
git clone https://github.com/hzeller/gmrender-resurrect.git
cd gmrender-resurrect
apt-get install autoconf -y
./autogen.sh
./configure
make install
echo "gmediarender -I \`ifconfig wlan0 | grep -P 'inet\s' | awk '{print \$2}'\` -f \"RaspberryPI\" &" > /etc/rc.local
#gmediarender -I `ifconfig wlan0 | grep -P 'inet\s' | awk '{print $2}'` -f "RaspberryPI"
cd /tmp
rm -rf $dir
注意:我的環境,是Pi使用wifi接入我的網絡的,是以倒數第三行,取的是無線網卡的位址。