6 Mar 2010 yeupou   » (Master)

Watching Freebox’s TV stream on a Workstation in a software-independant way

There are plenty of ways to get TV broadcast on a workstation. You can browse TV show website that provides it. You can use software like VLC that will connect to whatever server (that may be an ISP router) that will serve such broadcast.

Freebox is somekind of ADSL modem/router modern enough even to carry an harddisk, provided by the French ISP Free.fr. Freebox provides several output plugs for video stream: HDMI, S-Video, numeric audio and one called “TV”.

Freebox available plugs

What is of interest to me is to make use of my Freebox stream with my workstation just as if it was a mere TV set. I do not want to use a specific software that will connect to whatever address, I do not want to use a specific video player. I just want to mimic the TV-set behavior. And so forth, it should run on whatever Operating System. Debian GNU/Linux, obviously, since that’s what I’m using, but any other else if wanted.

If I were using a real TV set, I would have two options: using the HDMI plug, if my TV-set supports it, to gain high-quality image ; using otherwise the SCART (called Péritel in France) cable with an adaptator in the “TV” plug.

The hardware is on one end the Freebox HD, as shipped by Free.fr.
On the other end, the workstation is recent enough, with modern video controller (ATI Radeon HD 4870) and “hybrid video recorder” (WinTV-HVR-1300, sold in Europe) which means in it’s producer marketting that it supports both analog and numeric streams. But actually, it does not, since all it’s video input plug are analogic (Composite video and S-Video).

Happauge PVR-1500

$ lspci | grep VGA
02:00.0 VGA compatible controller: ATI Technologies Inc RV770 [Radeon HD 4870]
$ lspci | grep video
01:08.0 Multimedia video controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder (rev 05)

Will also be necessary a S-Video cable, adaptator “TV” to SCART and a RCA stereo cable.

So, let get down to business:

1) Plug the S-Video from the Freebox to the WinTV-HVR-1300 (or any similar card that have a S-Video plug). Then you should be able to get video.

S-Video plugged in video recorder PCI card

2) Plug the adaptator “TV” to SCART in the “TV” Freebox plug, connect it with the RCA stereo to your tuner or workstation soundcard. This looks clumsy and surely could be improved. Nonetheless, then you should get audio.

RCA stereo plugged in Freebox TV plug via a SCART adaptator

3) Start a video player. For instance, you can use mplayer with the following script:

#!/bin/sh
# -ao not set as sound is going directly through the tuner
# -vo gl2 : slurp too much CPU, use xv instead, it is lighter
# we assume video recorder device is /dev/video0
# we use PAL-BG, assuming that's how the Freebox is configured
# (this is all one big line)
/usr/bin/mplayer -stop-xscreensaver -aspect 16:10 -ontop \
-dr -vo xv -ao null -framedrop \
-vf pp=fd \
-contrast 10 -brightness 5 -hue 5 -saturation 5 \
-tv mjpeg:norm=PAL-BG:noaudio:driver=v4l2:device=/dev/video0:input=2:width=768:height=576 \
-nocache -quiet 'tv://' -identify

Freebox stream through MPlayer, in KDE

For the sound, it depends whether you plugged the output in a classic tuner or in your workstation soundcard. But that should be easy-going.

Here it works with MPlayer, but could work with plenty other video player, dedicated to TV (like KDEtv) or not.
It is also easy to envision how to really record video with this setup (if you have the audio going through your workstation soundcard).
I’m sure there is room for improvement here. I’m not very fond of the idea of using through this SCART / RCA stereo cable. But it works.


Syndicated 2010-03-06 18:29:32 from # cd /scratch

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!