2

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.

1 Answer 1

3

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.

3
  • Brilliant- that does exactly what I wanted. Thanks!
    – user183714
    Apr 17, 2013 at 18:47
  • No problem! (And I'd be obliged if you'd click the green checkmark under the vote buttons on my answer... :) Apr 17, 2013 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.
    – user183714
    Apr 17, 2013 at 19:01

You must log in to answer this question.