I wanted to watch my movies remotely, so i used h264 for video and aac for audio, and built a vlc config to startup a daemonized RTSP server.I built a script to create the config file by scanning all my videos, and then start the vlc daemon :). Here it is:
#!/bin/ksh
ps -ef | grep -i vlc | grep -v grep |awk '{ print $2 }' |while read p;do
kill $p
done
(
x=0
find /disk2/VIDEO -type f | egrep -i 'avi|mpg' |while read v;do
#---- if not using x264
# echo "new $x vod enabled"
# echo -n "setup $x input \"file://$v\" output"
#---- if using x264
echo "new $x vod"
echo -n "setup $x input \"file://$v\" enabled output"
#---- low quality
#echo " #transcode{vcodec=mp4v,acodec=mp4a,width=640,height=480,fps=12,vb=128,ab=8}"
echo " #transcode{vcodec=h264,acodec=mp4a,width=640,height=480,vb=100,ab=4}"
#---- mid quality
#echo " #transcode{vcodec=mp4v,acodec=mp4a,scale=.5,fps=10,vb=256,ab=64}"
#echo " #transcode{vcodec=h264,acodec=mp4a,scale=.5,fps=12,vb=256,ab=64}"
#---- high quality
#echo " #transcode{vcodec=mp4v,acodec=mp4a,scale=.5,fps=10,vb=512,ab=64}"
#echo " #transcode{vcodec=h264,acodec=mp4a,scale=.5,fps=12,vb=512,ab=128}"
echo " "
x=$(($x+1))
done
) > /etc/v.config
nohup cvlc --vlm-conf /etc/v.config -I telnet --telnet-password vl --rtsp-host 0.0.0.0:564 &
Try it, and enjoy :)
View as PDF: This entry | This month | Full blog


0 Trackbacks