Feb 17
Linux

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 :)

Posted by rdircio

| Top Exits (0)
Vote for articles fresher than 7 days!
Current karma: none, 0 vote(s) 738 hits

View as PDF: This entry | This month | Full blog

0 Trackbacks

  1. No Trackbacks

0 Comments

Display comments as(Linear | Threaded)
  1. No comments

Add Comment


Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA