TV-Out, KDE and Xine
If, like me, you happen to be using an NVidia based graphics adapter with TV-Out, you might find useful the following instructions to configure it, adding a KDE service menu to watch your movies on the TV with a single click.
Three steps are necessary:
- Configure your X server, creating a TV dedicated layout. We’ll later start X using this setup.
- Create a script to start X, running xine with the file we want.
- Create a
.desktopfile which inokes this script for the MIME typesvideo/*.
1. First we must have NVidia’s driver installed and running. This has already been discused elsewhere, so there is no need to elaborate. Once it is done (I recommend applying NVidia’s patches, which are posted on the forums), append the following to your /etc/X11/xorg.conf file:
#### Configuración para la salida de TV de NVidia <nonick AT 8027 DOT org>## ATENCIÓN: aquí se hace referencia a las secciones "Mouse[2]" y "Keyboard[0]"# Deberás sustituir estos identificadores por los tuyos.#Section "Monitor"HorizSync 30-50VertRefresh 60Identifier "tv"EndSectionSection "Screen"Identifier "Screen_tv"Device "Card_tv"Monitor "tv"DefaultDepth 24EndSectionSection "Device"Identifier "Card_tv"Driver "nvidia"BusID "1:0:0" # May differ (not needed unless you have two or more cards)Option "TVOutFormat" "COMPOSITE" # or "SVIDEO" ?Option "TVStandard" "PAL-B"Option "ConnectedMonitor" "TV"EndSectionSection "ServerLayout"Identifier "tv"Screen 0 "Screen_tv" 0 0InputDevice "Mouse[2]" "CorePointer"InputDevice "Keyboard[0]" "CoreKeyboard"EndSection- Download this code: xorg.tvout.conf
2. Now you need the script to start the X server using the new tv layout. You can use the following if you like it; just save it somewhere and set it executable with chmod +x /path/to/your/file/tvout.sh:
#!/bin/bash## v0.1 [ Thu May 19 09:23:04 CET 2005 <nonick AT 8027 DOT org> ]# v0.2 [ Fri Feb 24 03:52:39 CET 2006 <nonick AT 8027 DOT org> ]# v0.3 [ Mon Jul 10 12:02:50 CEST 2006 <nonick AT 8027 DOT org> ]xineexec="/usr/bin/xine"fileexec="/usr/bin/file"wmanager="/usr/X11R6/bin/twm"tvlayout="tv"if [ ! -z "$1" ]thenrun="$xineexec -f -g"arg=$1# Se trata de una imagen ISO?if expr match "$arg" '.*\(\.iso\)'then# Es una imagen válida? Sólo lo comprobamos si existe $fileexecif [ -x "$fileexec" ] && file=$(file --brief "$arg") && \! expr match "$file" '\(ISO 9660\)'thenkdialog --error "'$arg' no es una imagen ISO válida.\n$fileexec dijo: $file"exit 1fimsg="¿Quieres ver la imagen ISO '$arg' en la TV mediante xine?"arg="dvd://$arg"# Es un fichero normal:elsemsg="¿Quieres ver '$arg' en la TV mediante xine?"fielserun=$wmanagerarg=""msg="¿Quieres activar la salida de televisión?"fikdialog --warningyesno "$msg"if (( $? == 0 ))then# Comprobamos que se puede verif [ ! -z "$arg" ] && [ -d "$arg" ] && [ ! -f "$arg" ] && [ -z "${arg#dvd:}" ]thenkdialog --error "'$arg' no es un directorio o fichero válido."exit 1fiexec /usr/X11R6/bin/xinit $run "$arg" -- /usr/X11R6/bin/X :9 -layout $tvlayoutfi- Download this code: tvout.sh
3. Finally, we add the konqueror context menu entry which will show when clicking thr right mouse button over a video file. Save the following file in .kde/share/apps/konqueror/servicemenus, just changing the path to your script:
## View file via TV out## v0.1 [ Fri Feb 24 09:26:15 CET 2006 <nonick AT 8027 DOT org> ]# v0.2 [ Mon Jul 10 11:42:50 CEST 2006 <nonick AT 8027 DOT org> ][Desktop Entry]Encoding=UTF-8ServiceTypes=video/*,application/x-isoTryExec=tvout.shIcon=tvActions=ViewOnTV[Desktop Action ViewOnTV]Name=View on TVName[fr]=Voir à la téléName[es]=Ver por la TVIcon=tvExec=tvout.sh "%U"- Download this code: file_tvout.desktop
4. Have fun!


July 10th, 200612:45 pm at
UPDATE: I just added the ability to view DVD ISO 9660 images. The context menu will appear when right-clicking one of those and xine will try to open it as a dvd. The script tries to check for file validity but cannot go as far as checking whether it actually is a movie or not.