Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to watch a video in mplayer, however when I run the command:

mplayer video.flv

the terminal window remains open and another window for the video opens.

Is there a way I can run the video from the terminal but watch without the terminal window remaining open?

I've tried:

mplayer video.flv < /dev/null &

as suggested in their FAQ, however I get the process ID then a second or so later the output returns to the terminal before the video window opens. If I do then close the terminal window when the video window is open, the video window closes as well.

MPlayer version:

MPlayer svn r34540 (Ubuntu), built with gcc-4.7 (C) 2000-2012 MPlayer Team

Using gnome-terminal with i3.

share|improve this question
up vote 4 down vote accepted

Start it like this:

(nohup mplayer video.flv >/dev/null &) && exit

If mplayer starts successfully, the shell will exit and the terminal window close (unless you're running one shell in another, or something like that); if mplayer fails, the shell will remain open and you'll see the stderr output in it, so you can figure out what went wrong.

share|improve this answer
    
Brilliant- that does exactly what I wanted. Thanks! – Torvero Apr 17 '13 at 18:47
    
No problem! (And I'd be obliged if you'd click the green checkmark under the vote buttons on my answer... :) – Aaron Miller Apr 17 '13 at 18:50
    
Done! I was unable to because I needed to wait ten minutes before choosing an answer, then I got a bit distracted. – Torvero Apr 17 '13 at 19:01
    
Fair enough, and thanks again! – Aaron Miller Apr 17 '13 at 19:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .