Rebuilding VideoLan Client with PVR Support

I’m assuming all went well in the previous section we are now ready to rebuild and install VLC. I like to work with RPMs when I can so I would head to Freshrpms.net and grab the source rpm for VLC. You will also need rpmbuild installed. You can do that with yum if you don’t have it. Remember even though the executable is rpmbuild the package is called rpm-build. I don’t know what that is all about. Once you get that source rpm installed you can try using my modified spec file.

If that doesn’t work, then you just need to add ‘–enable-pvr’ to the configure section for VLC in the spec. (Be careful, because there are two configure sections. It is the second one.) Most likely you don’t have all the dependencies to build the package so you will need to install those with yum. Here is what my yum command looks like:

yum –enablerepo=dries install gcc-c++ \
XFree86-devel \
libpng-devel \
libxml2-devel \
libgcrypt-devel \
gnutls-devel \
libdvdread-devel \
libdvdnav-devel \
libdvbpsi-devel \
libogg-devel \
libebml-devel \
libmatroska-devel \
libmodplug-devel \
libmad-devel \
libid3tag-devel \
lame-devel \
faac-devel \
faad2-devel \
a52dec-devel \
flac-devel \
mpeg2dec-devel \
libvorbis-devel \
speex-devel \
libtheora-devel \
SDL-devel \
fribidi-devel \
aalib-devel \
libcaca-devel \
esound-devel \
arts-devel \
alsa-lib-devel \
wxGTK-devel \
xosd-devel \
lirc-devel \
libcdio-devel

That might get them all. Once you get vlc built then you can install the package that is built (usually in /usr/src/redhat/RPMS/i386/) using the really nifty:

yum localinstall

That command should pull in all the packages needed to install your new vlc package.
Using VLC as a streamer

Before you can really get to working with VLC you need to setup your PVR cards to the inputs and channels that you need. To this kind of changing there are a couple programs that you want to use. The first is “ivtvctl”, using this you can control pretty much all aspects of the card.

I would actually say that it has too much power. In the cases where you don’t want to have that much power there are two programs called, “ptune.pl” and “ptune-ui.pl”. These programs aren’t located in your path so you have to put the full path to them. They are located in “/usr/lib/ivtv/”. To change the input that is on the card, the best way is to use:

ivtvctl -d /dev/video0 -p 0

This will set the tuner located at video0 to the S-Video port. If you want to use the composite then set it to 2 and if you want to use the coax set it to 6. If you want to see what all the options are, then replace the -p with a -n and it will show you. There are a lot of other options that you can muck with, but I didn’t have to. If you are using anything but the coax tuner then you should be done. If you are using the coax the most likely you will need to set the channel you want to stream. The easiest way to do that in my opinion is using the “ptune.pl” interface:

/usr/lib/ivtv/ptune.pl –channel 6 –input /dev/video0

Obviously change the channel number to the one that you want. “ptune.pl” has a lot of options that you might want to monkey with, but I didn’t have to. If you want to change settings on the card on the you can use the GUI version of ptune.pl called ptune-ui.pl

Now you should be able to run vlc from the command line and get a nice GUI. Click on the file option and select “Open Capture Device”. You should see a PVR tab. This is where you want to work now. Most likely you want to work with /dev/video0 and then you are going to want to click the stream option and muck with the settings there for what you want to get done. When you are done messing with your encoding options and variables, note the top of the dialog which shows you the options. You will need these if you plan to build a command line that will run VLC without the GUI. My command line looks like this:

vlc -I http –http-host 10.76.80.61:8075 \
pvr:/dev/video0:norm=ntsc:size=720×480:bitrate=3000000:maxbitrate=4000000 –cr-average 1000 \
–sout ‘#transcode{vcodec=mp4v,vb=2048,scale=0.5}:\
duplicate{dst=std{access=http,mux=ts,url=10.76.80.61:8080}}’ &

Yes that is a pretty big mess, but once you start to learn how it works, it isn’t too bad. The “-I” option with http after it tells vlc not to use the gui but instead starts a webserver and hosts it on 10.76.80.61 port 8075. The rest of it is a mess that passes all the options to the encoder and everything. For more info about it hit the VLC documentation pages.
Finishing Up

So once every thing is lined out, if you want the box to do this at boot up, then you need to put this stuff into the start up. I just make a script and called it from /etc/rc.local
Mainly, my script just calls “modprobe ivtv” then the commands to get the cards on the correct inputs and channels, and last I call vlc with the options that I want it to have. Make sure to put the ‘&’ at the end so that each command will pass control back so that the machine will continue to boot correctly.

http://www.brentnorris.net

Popular Tags for the article:

??????

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • BlinkList
  • blogmarks
  • Blogosphere News
  • connotea
  • LinkaGoGo
  • LinkedIn
  • Live
  • MyShare
  • MySpace
  • RSS
  • StumbleUpon
  • Technorati
  • Webnews.de
  • Yahoo! Bookmarks
  • Yahoo! Buzz

Related posts:

  1. FTP Client for Linux Ubuntu
  2. How to Make Windows XP running in Ubuntu
  3. How to Install and Use the WHFC Client in Windows XP
  4. Download and Install Driver Canon Pixma IP1980
  5. Tips Using Zenmap on Ubuntu

Leave a Reply