Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36

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

  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

  2. #2
    Join Date
    Jun 2005
    Location
    France
    Beans
    7,100
    Distro
    Ubuntu 10.04 Lucid Lynx

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

    What you don't like with displayconfig-gtk ?
    https://wiki.ubuntu.com/DisplayConfigGTK

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

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

    Quote Originally Posted by frodon View Post
    What you don't like with displayconfig-gtk ?
    https://wiki.ubuntu.com/DisplayConfigGTK
    It won't let me set the TV as a secondary screen. The only options availiable are "default screen" and "disabled." Also my video card's max texture size is 2048x2048, so if I wanted the screens to display side by side, I'd have to disable Compiz.

  4. #4
    Join Date
    Nov 2006
    Beans
    Hidden!

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

    I have same problem as CarpKing. I can't change values in displayconfig-gtk to others than "default screen" and "disabled". Even if I try connect sencondary monitor.
    Is there any way to solve this problem?

  5. #5
    Join Date
    May 2005
    Beans
    366

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

    Quote Originally Posted by frodon View Post
    What you don't like with displayconfig-gtk ?
    https://wiki.ubuntu.com/DisplayConfigGTK
    DisplayConfigGTK doesn't support xrandr. It's a very poor tool to use for multiple monitors with the intel or radeon driver.

    https://bugs.launchpad.net/ubuntu/+s...tk/+bug/144641
    Last edited by sciurus; December 4th, 2007 at 05:02 AM.

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

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

    First post updated with a simpler method and (hopefully) better organization.

  7. #7
    Join Date
    Mar 2008
    Beans
    10

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

    If i were wanting to use my RCA out on my card how would i change the code?

  8. #8
    Join Date
    Sep 2007
    Location
    Lyon
    Beans
    59
    Distro
    Ubuntu 8.04 Hardy Heron

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

    Hello,

    Thank you for this thread, I am now able to have a desktop on two screens and it's very useful.

    I have almost reached the result i am looking for :

    I have a Dell laptop which i put on a work station linked to a dell screen or which i directly connect to a TV. I don't want to have one big desktop on my two screens. I'd rather have two separate desktops, one on each screen. Is this possible with xrandr ? If not, what would be the best solution ?

    Thank you in advance

    PC
    Every morning when I wake up, I ask myself: "What would I do if I wasn't so dumb ?" !

    ...and then, one morning () ... I dumped Windows ! =D>

  9. #9
    Join Date
    Oct 2007
    Location
    Cornfields, PA
    Beans
    2

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

    When I entered

    Code:
    xrandr --addmode S-video 800x600
    I got:

    Code:
    xrandr: cannot find output "S-video"
    I'm using xrandr 1.2.2, with an ATI Radeon Xpress 200M using the open-source "ati" driver, on Gutsy. Display on the TV through the S-video cable works okay, except I am not able to watch video on the TV, only the monitor. Additonally, entering

    Code:
    xvattr -a XV_CRTC -v 1
    returns this:

    Code:
    Found Xv 2.2
    X Error of failed request:  BadMatch (invalid parameter attributes)
      Major opcode of failed request:  140 (XVideo)
      Minor opcode of failed request:  13 ()
      Serial number of failed request:  11
      Current serial number in output stream:  12
    xrandr by itself returns:

    Code:
    Screen 0: minimum 320 x 200, current 1280 x 800, maximum 1280 x 800
    default connected 1280x800+0+0 0mm x 0mm
       1280x800       60.0* 
       1024x768       60.0  
       1024x480       60.0  
       848x480        60.0  
       800x600        60.0  
       720x576        60.0  
       720x480        60.0  
       640x480        60.0  
       640x400        60.0  
       640x350        60.0  
       512x384        60.0  
       400x300        60.0  
       320x240        60.0  
       320x200        60.0
    Last edited by zuzoa; March 20th, 2008 at 08:29 PM.

  10. #10
    Join Date
    Mar 2008
    Beans
    22
    Distro
    Hardy Heron (Ubuntu Development)

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

    Hey yeah, that's cool
    The problem is I want to watch a movie on the TV AND still be able to work on the monitor. When I do full screen in the VLC or SMPlayer the first screen goes black... hmm.
    In XP I can start a movie and it goes full screen on the TV, the monitor is all mine.

Page 1 of 4 123 ... LastLast

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
  •