Results 1 to 10 of 36

Thread: HOWTO: Watch videos with TV-Out from Xrandr

Threaded View

  1. #1
    Join Date
    May 2006
    Location
    Nebraska
    Beans
    480
    Distro
    Ubuntu 10.10 Maverick Meerkat

    HOWTO: Watch videos with TV-Out from Xrandr

    Updated 10/22/2009

    Warning: I've had X freeze on me a couple times with this (and Xrandr in general). Use at your own risk, and make sure you don't have important unsaved files open while using it. I've never had it freeze with Compiz turned off, but that doesn't mean it never will.

    Edit: It seems that I was making this harder than it had to be by using VLC. MPlayer and SMPlayer behave almost perfectly in this setup. Instructions altered to encourage simplicity.

    This will allow you to watch videos on a TV connected through an S-video cable. It requires that your video drivers be Xrandr-capable. At the moment this includes (AFAIK) the open-source ATI and Intel drivers included with Ubuntu (and maybe the open-source nVidia ones as well). If you figure out ways for this to work with additional players, post it in this thread and I'll add it to this post. Special thanks to this post: http://ubuntuforums.org/showthread.p...87#post3467287

    Step 1

    First, make sure the TV is connected.

    Then, install xvattr by entering the following in a terminal:

    Code:
    sudo apt-get install xvattr
    A similar command would install VLC, MPlayer, or SMPlayer if they are not installed already.

    Step 2a: For MPlayer/SMPlayer

    Mplayer should require no configuration.

    In SMPlayer, go to Options -> Preferences -> Advanced and check the "Run MPlayer in its own window" option. Then click "Apply" and "OK."

    Next, use Xrandr to enable the TV:

    Code:
    xrandr --addmode S-video 800x600
    xrandr --output S-video --mode 800x600 --crtc 1
    This will display an 800x600 area of your desktop with its top left corner aligned with the top left corner of your screen. When you play a video, the fullscreen should fill up this area but not the rest of your monitor. Continue to step three.

    Step 2b: For VLC

    Open up VLC and go to Settings->Preferences. Click on the check box at the bottom to show "Advanced options." Click the item on the left labeled "Video." Enter 800 in "Video Width," 600 in "Video Height," and 200 in both "Video X coordinate" and "Video y coordinate." Uncheck "Window decoration." Now click on the left to Interfaces-> Main Interfaces-> wxWidgets and uncheck "Embed video in interface." This will make the video appear in a separate window without decoration occupying the space that is displayed on the TV. Save your settings. You may have to restart the program for this to take effect.

    Next, use Xrandr to enable the TV:

    Code:
    xrandr --addmode S-video 800x600
    xrandr --output S-video --mode 800x600 --pos 200x200 --crtc 1
    This will display an 800x600 area of your desktop with its top left corner 200 pixels to the right and 200 pixels down from the top left corner of your screen. If you don't have a top panel, you can omit the parts about the video coordinates and the --pos 200x200. In either case, do not set the video to fullscreen.

    Step 3

    Now set the Xv overlay to appear on the TV:

    Code:
    xvattr -a XV_CRTC -v 1
    If some white areas get full of noise (a known problem which should be fixed in the drivers soon), try:

    Code:
    xvattr -a XV_BRIGHTNESS -v -30
    And you should be good to go!

    When you want to return to normal, simply enter the following:

    Code:
    xvattr -a XV_CRTC -v 0
    xrandr --output S-video --off
    For a script to switch between the two states, see this post.
    Last edited by CarpKing; October 22nd, 2009 at 10:22 AM. Reason: fixed xrandr syntax for newer versions

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •