Preload movie on RAM
Pre-loading a movie to memory probably only matters for network streams or if you don't want your disk respinning.
In any case you can try increasing cache size in your media player. With mplayer
it can be achieved with following command.
mplayer -cache <HUGE_NUMBER_IN_KILOBYTES> <VIDEO_FILE>
Usually the problem with slow/choppy video is in graphics card or libraries and drivers around it. You can try other media player (vlc
, xbmc
) and try playing with its configuration. Again with mplayer
you can try setting different video output driver using the following.
mplayer -vo <DRIVER> <VIDEO_FILE>
The argument here can be vdpau
(for nVidia cards), vaapi
(for Intel) etc. (check mplayer -vo help
to list supported drivers).
Yes it is possible. You can first mount a tmpfs
partition and then play your video file from there.
I mount my /tmp
partition in RAM since the contents do not need to be preserved between reboots and there are definite speed benefits. Here is my entry in my /etc/fstab
which creates it on each boot:
tmpfs /tmp tmpfs defaults,rw,mode=1777,size=3G 0 0
You can do something similar using the mount command as root.
A simple cat movie.mkv >/dev/null
should do the trick. The reason is that the file is entirely read and files recently read are kept in the file cache by the operating system, which happens to be in RAM. However, you have no guarantee how long the file remains in memory, that depends on several factors:
- movie size
- memory size
- available memory