View previous topic :: View next topic |
Author |
Message |
D-brane n00b
Joined: 20 Nov 2002 Posts: 9 Location: Netherlands
|
Posted: Fri Dec 28, 2007 1:17 pm Post subject: [HOWTO] nvidia tv-out script : mplayot |
|
|
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.
Code: |
# 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".
Code: |
#!/bin/sh
# 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
#
# NEEDED:
# - xorg started with preferably the nv driver
# - nvtvd started
# - nvtv in path
# - mplayer in path
#
# USED WHEN FOUND:
# - audtool
# - smixer
# - dcop
# - xscreensaver
# - xcompmgr
echo mplayer-on-tv v0.3.4
PLAYED=NO
if [ -e `which audacious` ]; then
if [ `audtool --playback-status` = "playing" ]; then
audacious -t
sleep .5
PLAYED=YES
fi
fi
nvtv -r 800,600 -s Large -t -C CONVERT &&\
KSCRSAV=NO
if ! [ `ps -C dcop | wc -l` = 1 ]; then
dcop kdesktop KScreensaverIface enable false > /dev/null &
KSCRSAV=YES
fi
XSCRSAV=NO
if ! [ `ps -C xscreensaver | wc -l` = 1 ]; then
killall xscreensaver
XSCRSAV=YES
fi
XCOMP=NO
if ! [ `ps -C xcompmgr | wc -l` = 1 ]; then
killall xcompmgr
XCOMP=YES
fi
# 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
fi
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
fi
if [ -e /usr/bin/smixer ]; then
echo vol Vol - | smixer
echo vol Vol - | smixer
fi
nvtv -m
if [ $XCOMP = "YES" ]; then
xcompmgr -cCfF -r7 -o.65 -l -10 -t -8 -D7
fi
if [ $KSCRSAV = "YES" ]; then
dcop kdesktop KScreensaverIface enable true > /dev/null
fi
if [ $XSCRSAV = "YES" ]; then
xscreensaver &
fi
|
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 http://www.uithofnet.nl/forum/viewtopic.php?p=25311&highlight=mplayot#25311.
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 http://mail-index.netbsd.org/pkgsrc-bugs/2006/07/18/0010.html and then added --set TVPositionX:-3,0 to the first nvtv line in mplayot. |
|
Back to top |
|
|
|
|
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
|
|