Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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! –  Nysepho 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. –  Nysepho Apr 17 '13 at 19:01
    
Fair enough, and thanks again! –  Aaron Miller Apr 17 '13 at 19:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.