Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] nvidia tv-out script : mplayot
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message

Joined: 20 Nov 2002
Posts: 9
Location: Netherlands

PostPosted: Fri Dec 28, 2007 1:17 pm    Post subject: [HOWTO] nvidia tv-out script : mplayot Reply with quote

There are a lot of ways to play movies on your television, through your tv-out output on a nvidia card. My way is a simple, but complete, script which does some useful things besides starting the movie.

First you need to check whether you installed all useful packages.

# emerge -uav mplayer nvtv smixer audacious

The first is a movie player. The second a daemon that makes it possible to use your tv-out without restarting X. The last two are optional.

I compiled xorg-server with VIDEO_CARDS="nv". The proprietary nvidia driver also works a bit, but is instable on my system and gives me headaches.

Put the below script, named mplayot, somewhere in your PATH. The commands should be self-explanatory or read the man page like "man smixer".


# mplayer-on-tv (mplayot) v0.3.5 - by Marco van Hulten
# You may modify and distribute the code, according to GPLv3 and higher versions
# Script for viewing movies with mplayer, through a nvidia card, on the telly
# - xorg started with preferably the nv driver
# - nvtvd started
# - nvtv in path
# - mplayer in path
# - audtool
# - smixer
# - dcop
# - xscreensaver
# - xcompmgr

echo mplayer-on-tv v0.3.4

if [ -e `which audacious` ]; then
  if [ `audtool --playback-status` = "playing" ]; then
      audacious -t
      sleep .5

nvtv -r 800,600 -s Large -t -C CONVERT &&\

if ! [ `ps -C dcop | wc -l` = 1 ]; then
        dcop kdesktop KScreensaverIface enable false > /dev/null &

if ! [ `ps -C xscreensaver | wc -l` = 1 ]; then
        killall xscreensaver

if ! [ `ps -C xcompmgr | wc -l` = 1 ]; then
        killall xcompmgr

# Note: old versions of smixer use the -s option for stdin
if [ -e /usr/bin/smixer ]; then
        echo vol Vol + | smixer
        echo vol Vol + | smixer

mplayer -fs -osdlevel 1 -font /usr/share/mplayer/fonts/font-arial-28-iso-8859-1/font.desc -vo xv -spuaa 4 -screenw 800 -screenh 600 -ao alsa "$@" &&\

if [ $PLAYED = "YES" ]; then
        audacious -t

if [ -e /usr/bin/smixer ]; then
        echo vol Vol - | smixer
        echo vol Vol - | smixer

nvtv -m

if [ $XCOMP = "YES" ]; then
        xcompmgr -cCfF -r7 -o.65 -l -10 -t -8 -D7

if [ $KSCRSAV = "YES" ]; then
        dcop kdesktop KScreensaverIface enable true > /dev/null

if [ $XSCRSAV = "YES" ]; then
        xscreensaver &

Of course, you should change it for your needs, but it should work out-of-the-box. Besides on my Gentoo instable (and previously Gentoo stable) box, it works fine on Debian (I believe it was a Debian 3.1 stable computer) and Ubuntu 7.x or so.

A few explanatory notes:
  • The sleep .5 can be useful when you use a fade-out in audacious and don't want an increase in volume during the current song.
  • nvtv gives me a magenta stripe at the left of my TV. You can fix it by shifting the picture via the GUI of nvtv (nvtv -g), but when I do this, the picture gets wiggly, possibly because I go outside the PAL standard. Therefore I learned to live with the stripe (and because nvtv has no command line option for it). Does anyone have a solution for this problem?
  • xcompmgr is possibly deprecated by now. I used this part of the script, because mplayer had problems with this composite manager.
  • vol Vol + | smixer increases the master volume by 5%. I increase the volume by 10%, trying to fix the fact that most of the times one has to increase the volume of a video.
  • By means of shell variables program states are (as good as) restored after playing the video.

This was originally posted a while ago on
If anyone whishes to look at old versions or would like a translation of this or whatever, let me know.

edit: I found a way to remove the magenta stripe. I patched the code according to and then added --set TVPositionX:-3,0 to the first nvtv line in mplayot.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum