Movie from ram

I wrote a little script which plays copies movie into RAM and plays it from.
Requirements:
- packages:
       mplayer
       bar(optional, can be replaced by normal cp command, bar is used only to show progress of coping to RAMfs)
Preparation (replace "USER" with the username which will play the movie):
1. A line in fstab is needed:
none /mnt/ramfs ramfs noauto,user,maxsize=705000 0 0
(size of the ram filesystem is set in maxsize, it would be the maximum file size of a move which you can play)
2. Use visudo to add privilages for the user playing the move:
USER ALL=NOPASSWD:/usr/bin/sdparm --command=stop /dev/sda
USER ALL=NOPASSWD:/bin/chown USER /mnt/ramfs
3. Create a file and paste the source (for example to file mplayerRamFs).
4. Set runnable:
chmod +x mplayerRamFs
Some pros and cons of using this script:
5. Start your favourite terminal program and run:
./mplayerRamFs movieName
(You must specify only the name of the file without the file extension. Only .avi files are supported by this script, but it's not a big problem to change it. It's made so only to support copying subtitles.)
Pro:
+ saves your laptop battery (not yet tested how much saves, but a movie about 1,5h long takes 39% of my battery, using laptop-mode and cpufreqd, I'll write how much it saved after I watch a movie today :D )
Contra:
- needs at least 1GB of RAM
Source:
#!/bin/bash
#set -x
echo Preparin to play movie from RAMfs: $1
if [ "`free -m|awk '/Mem:/ {print $2}'`" -lt "999" ]; then
echo "Not enough RAM!"
echo "At least 1GB is needed!"
exit 1
fi
echo Mounting ramfs..
mount /mnt/ramfs || exit 1
echo Setting permissions...
sudo chown macieks /mnt/ramfs || exit 1
echo Copying movie to RAMfs...
bar -o /mnt/ramfs/"$1.avi" "$1.avi" || exit 1
# if you don't have bar, use cp instead:
#cp "$1.avi" /mnt/ramfs
cp "$1.txt" /mnt/ramfs 2> /dev/null
echo Running mplayer in background...
mplayer -fs -vo sdl "/mnt/ramfs/$1.avi" && umount /mnt/ramfs || umount /mnt/ramfs &
echo Waiting 30 secs to spin down the disk...
sleep 30
# Use here any other method you want (sdparm, hdparm)
sudo sdparm --command=stop /dev/sda
What do you think about this idea? Mayby someone has other better/simplier solution?
PS.
To reduce memory and disk usage, I run startx from console. In /etc/X11/xinit/xinitrc I only have twm started.
Also before starting the script it's good to stop all daemons from DAEMON list in rc.conf.
Ofcourse except acpid, cpufreqd, alsa, network, powersaved, laptop-mode (and similar).
Important is to stop syslog-ng, because it's often a reason to spin up the disk.
(I'm thinking of adding a function to stop all the daemons before playing the movie and starting them after that)
Last edited by MAC!EK (2007-07-10 11:22:05)

nikron wrote:Doesn't it use the same amount of power since you read the entire movie into ram anyway?   Or is reading it all at once better?
Well, that depends. Power efficiency with cdrom drives is in fact a little tricky to calculate. For one you have CBR modes/speed, which means the drive spins the disc at a rate that gives a constant performance and if that matches your movie bitrate, it depends on how much loss the motor etc. produces but generally you could say this is the optimum of efficiency when playing a movie directly from cd. If you can't match it perfectly because your drive doesn't support that particular speed in CBR it's probably a better idea to copy the movie first.
With DVDs though, this has changed a little. Basicly every drive can do DVD 1x where 1x is exactly the speed necessary to play a standard DVD. It's hard to beat the efficiency here. It's probably going to turn out just the same.
Last edited by kth5 (2007-07-17 05:17:08)

Similar Messages

  • I have a macbook pro 15" Retina Display with 2.6 ghz and 8gb of ram yet when i try to download a HD movie from itunes it says my computer doesn't support HD?

    i have a macbook pro 15" retina Display with 2.6 ghz and 8gb of ram when i try to download an HD movie from itunes it says my computer doesn't support HD? i went to the support on the apple website and looked at the specs that a computer has to meet in order to play HD movies and mine is well above them. Why can't i play the movies?

    That would at least partially explain it.
    These MacBook Pros drew more power than the power brick could readily supply, and so would only run at top speed when the power brick was supplemented by the battery.
    Though the applicable tech note has been removed, it stated:
    "If the battery is removed from a MacBook or MacBook Pro, the computer will automatically reduce the processor speed. This prevents the computer from shutting down if it demands more power than the A/C adapter alone can provide."

  • Problems with volume when streaming a Netflix movie from my Mac Book Pro (Mid 2009) to my flat screen TV?

    Hi!
    Does anyone know what I need to do in order to turn up the volume when I’m streaming a Netflix movie from my Mac Book Pro (Mid 2009) to my flat screen TV?
    I hooked up the HDMI adapter from my Mac to my TV and it is currently in Mirror Mode, but I can’t turn up the volume, the only audio I’m able to adjust is on my Mac.
    I’ve already tried: System Preference > Sound > Output > Internal Speakers Built in output.  That’s the only option my Mac gives me.
    Any suggestions?

    Hello jguti,
    Thanks for using Apple Support Communities.
    I understand that your external display connected via HDMI is not being detected by the computer.  At this point, the best bet for your next troubleshooting step would be to reset the system:
    Reset the system
    You can reset the Mac's parameter RAM and SMC.
    Reset the resolution
    Start by resetting the Mac's parameter RAM. If the display does not come up, was previously set to an unsupported resolution, and still results in no video:
    Start up in Safe Mode.
    From the Apple () menu, choose System Preferences.
    Choose Displays from the View menu to open the preferences pane.
    Select any resolution and refresh rate that your display supports.
    Restart your computer.
    Apple computers: Troubleshooting issues with video on internal or external displays
    http://support.apple.com/kb/HT1573
    Take care,
    Alex H.

  • Does it worth to move from macbook pro to macbook pro retina?

    Hey
    I have macbook pro with
    Processor  2.66 GHz Intel Core i7
    Memory  8 GB 1067 MHz DDR3
    Graphics  NVIDIA GeForce GT 330M 512 MB
    and its good but many people are saying macbook pro 2013 with retina display is the best laptop and has many features so do you advice me to move from macbook pro to macbook pro 2013 with retina display?
    thanka

    It's a very sweet machine, of course. Although the upgrade path is a bit dicey. Just my opinion, but unless you have very demanding graphics needs (in which case you probably should have a desktop system with a huge monitor), I don't see the point of spending all the money. Probably you would get more value if you take your current machine and max out the RAM and get an SSD.
    It's hard to advise anyone in such matters via the internet.
    Here are some good reviews:
    Apple MacBook Pro with Retina Display Review (2012)
    MacBook Pro with Retina display (15-inch) vs. MacBook...
    By the numbers: 13-inch Retina MacBook Pro vs. other MacBooks ...
    13-inch MacBook Pro w. Retina vs. old MacBook Pro vs. Sony Vaio ...

  • I'm going to get the I Mac and since the new I Mac doesn't have DVD drive on it I was thinking to get the Samsung SE-506AB Slim Portable Blu-ray Writer in order to burn movies from I movie do I need a special software for that since the SE-506ab comes onl

    I’m going to get the I Mac and since the new I Mac doesn’t have DVD drive on it I was thinking to get the Samsung SE-506AB Slim Portable Blu-ray Writer in order to burn movies from I movie do I need a special software for that since the SE-506ab comes only with windows software.. but I did check and it is compatible with apple. Can you please advise me and or let me know if I’m buying the right stuff or if there is any other blu ray that will work with the I mac as plug and play.
    Thank you
    Haim

    This freezing reminds me of really old Macs, long ago, in the days of the old-school peripherals like SCSI drives, terminators, scanners and the like. If you had a SCSI conflict, like the wrong device ID's or something, you'd freeze up like that. Back in those days you'd call 800-SOS-APPLE (AAPL?) and they'd run you through disconnecting all your extra hardware - Jaz and Zip drives, CD burners, scanners etc and then eliminate them one by one by adding them incrementally and testing for the freeze/bomb dialog.
    But, today we have Firewire and none of those ancient issues (no free lifetime tech support either). My iMac's ports are all full, and I only know which devices are connected when I have to remove something for another device. iSight, scanner, card reader, external hard drive, USB soundsticks, etc. You wouldn't happen to have any SCSI devices hooked up, would you?
    Out of curiosity, have you tried a different USB/Firewire port for the hard drive? Or run the hardware test DVD that comes with your computer? This weird freezing seems to suggest a problem with the computer, RAM or network more than a device. Bad devices, in my experience, cause kernel panics, not freezing.

  • Watch movies from HD connected to airport???

    Hello,
    I got a HD connected to my Airport Extreme and all my movies are on the HD. I watch them on my MacBook Pro (Unibody) wireless.
    The thing is, that after about 0-15 minutes the movies starts to stop for a few seconds and then start again and it keeps on going..
    Its funny because I had a older Macbook Pro before and there was never any problems.....
    Now I have the absolute top model 17" 2.66 GHz with 4 GB RAM and I can´t play movies wireless anymore....
    Hope somebody can help me..
    Sune, Denmark

    The bottleneck is the network connection; it's the slowest link between the movie and your laptop. For any recently made laptop, RAM and CPU speed should not matter. So here is the question: Can you monitor network activity to see if something is taking up all of the network bandwidth when your movies slow down?
    I also play back movies from a hard drive connected to a Time Capsule, and I know that if a Time Machine backup starts, it can strain the network enough to impact other data moving between the base station and the client, and video may play less smoothly when that happens.

  • Can I use Final Cut Express 4.0.1. to import movies from Panasonic VDR-D250?

    Can I use Final Cut Express 4.0.1. to import movies from Panasonic VDR-D250 via USB 2.0? How? (page in handbook?)
    Further specifications of this older camera:
    USB 2.0
    DVD-RAM (cannot be inserted in my MBP!)
    50-PAL (signal)
    MPEG2
    Dolby Digital
    I want to use FCE if possible but maybe could try to install the software of this camera on Windows virtual XP also on my MBP?

    I forward an answer of Panasonic (written in German):
    So Panasonic does not offer a software which is compatible with Apple!
    Bezug nehmend auf Ihre Anfrage teilen wir Ihnen mit, dass der Camcorder
    VDR-D250 die Videoaufnahmen nach dem DVD-Videostandard sowie nach dem
    DVD-VR-Standard aufnehmen kann. Wir können jedoch nicht beurteilen ob Ihre
    Software Final Cut Express 4.0.1 die Bearbeitung dieser Standards
    unterstützt. Seitens Panasonic wird weder eine Apple kompatible software
    noch Support für Apple Geräte angeboten. Wenden Sie sich diesbezüglich
    bitte an Ihren Apple Händler oder Ihren Computeradministrator. Die
    mitgelieferte Software des Camcorders ist ausschließlich für folgende
    Betriebssysteme vorgesehen:
    - Microsoft Windows 2000 Professional
    - Microsoft Windows XP Home Edition
    - Microsoft Windows XP Professional
    Ob diese Software in einer virtuellen Umgebung genutzt werden kann ist uns
    nicht bekannt. Um die mit dem Camcorder aufgenommenen DVDs an einem
    Computer-Laufwerk auslesen zu können müssen diese vorab mit dem Camcorder
    finalisiert werden. Ausnahme ist die Verwendung einer DVD-RAM.

  • Trying to put my movie from imovies onto itunes but it does the whole download then at the end comes up with error - 34 or error - 41

    trying to put my movie from imovies onto itunes but it does the whole download then at the end comes up with error - 34 or error - 41

    -34
    dskFulErr
    Disk full
    -41
    mFulErr
    Memory full (open) or file won't fit (load)
    Seems like it's having either a RAM or Hard Drive issue. What happens if you reboot the Mac, open iMovie and then try to Share to iTunes again?

  • I have been trying to create a movie from a project that is primarily stills and one video clip.  I cannot successfully create the movie without iMovie shutting down unexpectedly.  Any ideas for the cause of the problem?

    I am getting an unexpected shut down of iMovie when I try to share a movie from a project that is made up of still pictures, one video clip and music.  Have tried to create the movie several times with different formats and continue to get the message.  When I removed all music I was able to create the movie without a problem but when I added the music back, I was unable to create the movie.  I'm using iMoive 11' version 9.0.9
    Thanks.
    Bill

    I'm no expert in iMovie, but I've found that processing memory (as well as sheer hard disk space for the project to 'turn around in') can be a big issue with constructing, editing, and distilling projects in iMovie. I've improved the success by moving 2gb of image files off to an external drive, but only really got moving again on an hour-long project by doubling RAM and again freeing up h/d space.
    Some tunes are also an issue, but if you can see it in the iTunes list to place in your project, it should work okay... Does the project run with any other piece of music, or does just that one tune mess it up?
    Good luck,
    Laura

  • How do I move from 10.6.8 to 10.7

    how do I move from 10.6.8 to 10.7?

    First check that your Mac meets the System requirements for Lion...
    Lion Tech Specs  >  http://support.apple.com/kb/SP629
    To Contact Apple in your Country to Purchase a Lion Download code...
    http://support.apple.com/kb/HE57
    In the US...
    1-800-MY-APPLE or 1-800-676-2775
    Be sure to make a Backup of your Current System Before Upgrading...
    Also... Check here for compatibility of 3rd party Software you may be using...
    http://roaringapps.com/apps:table
    NOTE that Rosetta is no longer supported in Lion.
    You should also consider more RAM... Lion is a hungry beast...
    You can use these Links to check which RAM is suitable for your Mac...
    http://eshop.macsales.com/shop/apple/memory/
    If in the UK... Go to http://www.crucial.com
    It is Important to get the Correct and Matching RAM
    Those sites also have videos on how to Install RAM should you need it..

  • Putting Movies from DVDs onto iTunes

    is it possible to put movies from DVDs to iTunes?
    if so, how?
    and will it transfer to iPod like it normally does?
    tyvm
    iPod Video   Windows XP  

    Here's a guide.
    Hope this helps.
    M
    17' iMac fp 800 MHz 768 MB RAM   Mac OS X (10.4.6)   Several ext. HD (backup and data)

  • Extracting Quicktime movie from DVD that I made

    Maybe this question is more for the iLife forums, but I'll give it a shot with the eMac crowd first.
    I'm wondering if it's possible to extract or create a Quicktime file from a DVD with existing OS/iLife software, or do I have to use a third party. I created the video in iMovie soon after I bought my eMac in 2002, and burned the disk in iDVD. I've since deleted the Quicktime file thinking I'd never need it again since I have the DVD, but now I want to upload the video onto YouTube.
    Thanks for your help.
    eMac 800MHz, 1GB RAM, 60GB HD Mac OS X (10.4.5) 250GB OWC External Firewire HD, 20GB iPod G3
    eMac 800MHz, 1GB RAM, 60GB HD   Mac OS X (10.4.4)   250GB OWC External Firewire HD, 20GB iPod G3

    Jason,
    Head on over to the iDVD forum, where your question about how to "extract movie from iDVD" comes up regularly; e.g., here and also here

  • Download movies from Itune

    who can tell me what is wrong with itune, everytime I download movies from Itune, the movie is very dark, the last one can barely see. What can be done , thanks

    Good point - current requirements for iTunes 9.x are:
    Macintosh Hardware
    Mac computer with an Intel, PowerPC G5 or G4 processor
    Intel, PowerPC G5 or 1.0GHz PowerPC G4 or faster processor is required to play Standard Definition video from the iTunes Store
    2.0GHz Intel Core 2 Duo or faster processor is required to play HD video, an iTunes LP, or iTunes Extras from the iTunes Store
    512MB of RAM; 1GB is required to play HD video, an iTunes LP, or iTunes Extras
    Screen resolution of 1024x768 or greater; 1280x800 or greater is required to play an iTunes LP or iTunes Extras
    Playing videos also requires at least 16MB of video RAM
    Broadband Internet connection to use the iTunes Store
    Apple combo drive or SuperDrive to create audio, MP3, or back-up CDs; some non-Apple CD-RW recorders may also work.
    Apple SuperDrive to back up your library to DVDs; some non-Apple DVD-RW drives may also work.
    MJ

  • HT1657 I rented a movie from iTunes but it is not showing up in the Movies section. What do I do?

    I just rented and downloaded a movie from iTunes and now it will not show up in my iTunes library. What do I do?
    It DOES show up in iTunes on my iPhone. It DOES NOT show up on my desktop.
    Any thoughts? Ideas?
    I rented it for a flight I get on in 3 hours. Any quick help would be great.
    Thanks.

    If the computer iTunes is signed into the same account then contact iTunes:
    How to report/refund an issue with your iTunes Store, App Store, Mac App Store, or iBooks Store purchase

  • I bought a movie from iTunes on my Mac and it is not showing up on my AppleTV purchased movies.  Is there a way to get this to sync?

    I bought a movie from iTunes on my new macbook pro and it is not showing up on my AppleTV, any ideas?

    Sign out of the Apple ID on the ATV and sign back in.

Maybe you are looking for

  • How to return current value in iterator

    hi i have the following code when i iterator am always geting the same value,it display first value from the lov which is from the previous page.this is how am displaying the value i select value from lov and navigate to next page when am in the next

  • Is it possible to create a custom photo layout when creating a photo book in iphoto?

    Is it possible to create a custom photo layout when creating a photobook in iphoto? How about adding text boxes?

  • Problem with BAPI_PO_RELEASE in workflow

    Hi Experts, I have a backgrouond task for PO releases. in the method of the task , iam calling a BAPI, 'BAPI_PO_RELEASE' .when iam executing the workflow through SWUS the BAPI returnig parameters like new release code etc successfully but release str

  • MDS Customization Problem with multiple root components

    Hello, Oracle JDeveloper 11.1.1.5.0 and WebLogic Server Version: 10.3.5.0 I am using Oracle MDS Customization class with the following classes: oracle.adf.view.rich.change.MDSDocumentChangeManager org.apache.myfaces.trinidad.change.ChangeManager org.

  • E-mail configuration in C#

    I am not able to find the general Mail option(gtalk, yahoo, official mail) in the main menu of C3. When Mail is opened , Nokia mail opens and when Start  button is pressed,  chekcin for updates....... Later communication error. try later error comes.