stupid way to make mplayer repeatly play
November 3rd, 2007 mysurface Posted in Bash, for, mplayer, sleep | Hits: 99081 | 19 Comments »
I am so desperately wanna make mplayer repeat a song, somehow I obtain a song in flv format. I fail to figure out how to make mplayer repeat, so here make a stupid workaround with bash for.
for (( ; ; )); do mplayer nicesong.flv; sleep 0.1; done
Kill it by hitting ctrl+c two times very fast!
heh! Why I need sleep after mplayer? If you don’t put sleep, you won’t be able to kill it by hitting ctrl+c no matter how many times.
November 3rd, 2007 at 2:35 am
“mplayer -loop 0 foo” would repeat foo indefinitely. A single ‘q’ or ctrl-c would stop it.
November 3rd, 2007 at 3:57 am
Ramprasad: Thanks. Somehow -loop doesn’t work for my particular song.flv, but it works for .mp3, .wav and video .flv from youtube.
November 3rd, 2007 at 8:01 pm
I don’t know anything about .flv, but -loop alone doesn’t complete the option. It’s -loop 2 for 2 repeats, -loop 3 for 3 repeats, etc, including -loop 0 for endless repeats.
November 3rd, 2007 at 8:02 pm
PS Great idea for a blog, btw
November 3rd, 2007 at 10:44 pm
blackbelt_jones: Yup. Obviously, Ramprasad had mention that :)
November 3rd, 2007 at 11:31 pm
I like the following loop structure:
while $(sleep 2); do date; done
Substitute whatever for the ‘date’ command.
November 3rd, 2007 at 11:45 pm
dan: That is neat! thanks.
November 13th, 2007 at 8:13 pm
I like audacious to play a song.
February 10th, 2008 at 5:44 pm
You don’t need sleep.
You can stop it by hitting ctrl+c, many many times. button mash it like crazy. I tried it with date, instead of mplayer …, and was able to get it terminated in a faster time. You just need to hit that c over and over fast.
February 10th, 2008 at 11:46 pm
tony1grendel: Yeah! But I precious my keyboard :P
April 10th, 2008 at 7:22 am
good idea dute ! -loop 0 thanks !
June 18th, 2008 at 12:08 am
mplayer -loop 0 endless
mplayer -loop n times
;)
October 8th, 2008 at 6:07 am
Put ‘-loop 0’ option AFTER the filename. It sounds silly, but it makes a difference. For example, “mplayer foo -loop 0”. In this case mplayer will reuse the current window. If you put -loop option before the filename then mplayer will close the window and open a new one. In Gnome Nautilus you can set “Open With” to use a custom command. I use this setting:
mplayer %f -loop 0
—
Noah
March 16th, 2009 at 5:41 pm
I did this with a while loop at first:
while echo “running…”; do mplayer foo; done;
But `-loop` is what I wanted! I had checked the man page, but I searched for “repeat”, so didn’t see it…
BTW: I just discovered that command-line completion also works for options! Nice e.g. Press TAB after the following:
mplayer foo -l
May 7th, 2011 at 3:33 am
I like your blog, but I find your blog there is a serious waste!!! use on your blog, you can earn a lot of dollars, but you did not find. Now unlike all the scammers and guru’s out there I’m going to tell you straight… Making Money Online From Blogs Is Easy. http://bit.ly/mj5cB6 Best regards, Money Making Blog 2011
October 9th, 2011 at 12:57 am
I have a good way to do this. Although it can’t be better than -loop 0 , it is also nice. It seems like this:
yes file_name|xargs -d \\n -n 1 mplayer
you can terminate it easily.
October 19th, 2014 at 3:31 am
When some one searches for his required thing, thus he/she desires to be
available that in detail, therefore that thing is maintained over here.
August 18th, 2016 at 1:27 am
You have probably the greatest internet websites
madden nfl 17 http://www.adsagar.com/item/6100
August 18th, 2016 at 1:28 am
Amazing Site, Maintain the fantastic job. Thank you so much!.
nhl 17 http://www.golfcave.co.uk/forum/forum/main-forum/107-fifa-17-coins-depends-substantially