Click to See Complete Forum and Search --> : What I want to do with mplayer


blackbelt_jones
11-27-2005, 01:06 PM
I've been looking over the man page for mplayer, and if what I need is there, I haven't been able to find it. I also listed all the options, but I didn't find that helpful either.

I'm looking for a command line option for mplayer that will allow me to play determined number of files at random and then stop. When I go to bed, I like to watch a couple of sitcom episodes, fall asleep tp an old movie, and then play a loop of ocean sounds that has subliminal messages that teach me not to procrastinate. (Hey, it may be a placebo, but placebos work too!)

The compound command I use looks like this:

#mplayer -fs sitcom.avi sitcom.avi movie.mpg ; mplayer -loop 0 ocean.ogg

At bedtime going through my files and picking what I want to watch always takes about twenty minutes. I want to be able to enter a command that will pick something at random, play it, and move on to the next part of the compund command.

cybertron
11-27-2005, 02:14 PM
I suppose you could do something like that with a playlist. Just do "find /path/to/files -printf "%h%f\n" > playlist" and then do "mplayer -playlist playlist -shuffle". That would play forever, but you might be able to add -frames to make it stop after a certain amount of time (~30fps x 60 minutes or whatever). Either that or you can use "at" to kill the first mplayer after some amount of time.

Probably not quite as simple as you'd like, but if you just drop those commands into a 4 or 5 line script it shouldn't be too bad.