--- category: '' date: 2006/05/12 12:17 description: '' link: '' priority: '' slug: '42' tags: CherryTV, programming, python, linux title: CherryTV type: text updated: 2006/05/12 12:17 url_type: '' --- I have had a Bt878-based TV tuner for quite a while. I have not made good use of it, though. While it works great both in Linux and Windows, I have some hardware issues... my only PC that can take a PCI card is my file server. Which is tucked away in a corner, and lacks any kind of monitor (or mouse. or keyboard). So, watching TV there was not possible. The obvious solution is a streaming video feed that could be accessed everywhere at home using my wireless network. But... what could I use? I decided that the simplest streaming server that could be accessed from windows and linux was VLC_. .. _VLC: http://www.videolan.org It is a bit tricky to get the right incantation, but here it is:: vlc -v --color v4l:/dev/video --sout \ '#transcode{vcodec=DIV3,vb=256,scale=1,acodec=mp3,\ ab=32,channels=2}:std{access=mmsh,mux=asfh,dst=:9998}' Then you can access it from windows using mms://192.168.1.2 and from Linux using mmsh://192.168.1.2 (if anyone knows why I have to use different URLs, I'd like to know). It doesn't work from mplayer, which is my default video app, but well.. it works. Then there is a snag... how can you change channels? Well, you can't, it seems. So, I wrote a throwaway CherryPy app in an hour or so, and I called it CherryTV. Here it is: .. image:: http://static.flickr.com/47/145091820_2454e4883f_m.jpg :target: http://www.flickr.com/photos/96455042@N00/145091820/ .. image:: http://static.flickr.com/48/145104266_a964136b5e_m.jpg :target: http://www.flickr.com/photos/96455042@N00/145104266/ How does it work (currently nerds-only)? * You use xawtv to build a list of your TV stations using the channel editor. * Copy your .xawtv file as xawtv in CherryTV´s folder (one example included) * Have v4lctl handy, and make sure it works like this:: v4lctl setstation someStationName * Start CherryTV * Start vlc streaming as mentioned above (change IP as needed) * Change stream URLs in cherryTV.py * Start cherryTV.py * Point your favourite browser to http://whatever:8080 * Choose whether your embedded video player works or not, and whether you use mms:// or mmsh:// URLs * Open your external viewer if needed. * Watch TV and be happy. I know it's quite simple to make this an actually usable app, which it currently isn't, but it is good enough for me. So, if anyone likes it the way it is, or intends to improve it... it's a measly 100 lines of python and it's here_ :-) .. _here: http://lateral.blogsite.org/static/cherryTV-0.1.tar.bz2