[MPlayer-users] option to save cache in temporary directory instead of memory

houghi houghi at houghi.org
Sat Jan 26 11:42:15 CET 2013


On Sat, Jan 26, 2013 at 08:03:51AM -0200, Sezaru wrote:
> Hello guys,
> 
> I've using mplayer with the cache option to an absurd number (2000000
> to be exact), the reason is that I normally stream some videos and
> like to pause it in the middle, but if I do that when I resume it the
> server will timeout me and mplayer will be unable to continue the
> stream.

Is this from sites like Youtube and the like? What I have done might be
used as basis of something else.
What you could do is download the file and then have it played that file
via a pipe. That way you will not stop downloading when you stop.

What I do is download videos and then watch them later. I can download
several streams at the same time.

The basis for this is youtube-dl (works on different sites
http://rg3.github.com/youtube-dl/ for more info)

I have written a script around it called ytube. Basis is:
#!/bin/bash
DIR="/share/data_1/download/movies/youtube"
URL="$@"
#Get the file
cd $DIR
youtube-dl -o "%(stitle)s.%(ext)s" "${URL}"

Next I have added a bookmark in my bookmark bar that says as location:
javascript:void(location.href='http://local/tv/ytube.php?&u='+encodeURIComponent(location.href))

The page ytube.php contains the following code:
<?php
if (isset($_GET['u']))
{
	$URL=$_GET['u'];
	exec("/home/houghi/bin/ytube \"$URL\" &");
	echo $URL;
} else {
	echo "Nothing here";
}
?>

I also have a plugin that prevents autoplay in Firefox. So now I can
easily click on the bookmark and it starts downloading. I can download
several at a time, if I so desire and then look them in the way I want.

Perhaps not what you are looking for, but agian the idea would be do first
download, pipe that to play and then after you have played it, you delete
the file.

houghi
-- 
You can have peace. Or you can have freedom. 
Don't ever count on having both at once.
                       -- Robert A. Heinlein 


More information about the MPlayer-users mailing list