Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 606511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:15:43+00:00 2026-05-13T17:15:43+00:00

I have to read a large file containing many animation frames from CD/DVDrom and

  • 0

I have to read a large file containing many animation frames from CD/DVDrom and display it into screen as an animation. When reading from hard disk, the strategy of reading a frame into memory, processing, displaying and then reading next frame works good, but when I read from optical device, access time kills the animation.

I use C and winapi OpenFile/ReadFile methods.

How should I read contents of a file stored on an optical device to achieve realtime speed of animation ( I have seen a program that does it even in double speed, for sure it does not buffer the whole file before animation start ) ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:15:44+00:00Added an answer on May 13, 2026 at 5:15 pm

    Two techniques:

    1. LARGE buffer or cache, as in multiple MB. CD/DVD has reasonable sequential I/O but very slow seek/access speeds (as you have noted), so it’s fast to refill the buffer. You just need the buffer to be large enough that it covers a few seconds to allow the disk to spin up if needed, and seek if already spun up.

    2. Multi-threading: keep one thread continuously reading and a separate thread decoding animation. Reader thread should block if it gets too far ahead of decoding.

    These techniques apply to any programming language, and can be combined for best effect. One reading buffer and one decoded frame buffer protects you twice as well against the decoding time and the access time.

    EDIT:
    These are the techniques MPlayer uses. In addition, you should consider your encoding format if you can — different formats can trade off CPU time on decoding for less data to read from disk. A couple pieces of info for estimating how much video should be compressed.

    • Read speed for 1x CD-ROM: 150 kiB/s (bare minimum speed)
    • Read speed 4x CD-ROM: 600 kiB/s (standard minimum drive)
    • Read speed 16x CD-ROM: 1600 kiB/s (maximum obtainable, usually only runs up to 8x)
    • Read speed 1x DVD Drive: ~1.3 MiB/s
    • Standard definition video compressed with MPEG2 at DVD-quality: ~600 kiB/s
    • Standard definition video compressed with MPEG4 at DVD quality: ~100 kiB/s
    • Uncompressed standard definition video: ~30 MB/s
    • Standard 1000×1000 (1 megapixel) image at 24 bit color: 3 MB
    • Standard 1 megapixel image at 8-bit color (grayscale): 1 MB

    Edit2: additional info

    • Note that DVDs commonly can be read at 8x or so if your drive supports it (most do now).
    • Animations start to appear smooth at 24+ frames/second. Below that they will appear jerky to a viewer.
    • Lossless compression is usually good for about a 50% reduction in size for photographic images. Your mileage may vary though.
    • Smooth playback of animations will be partly dependent on how you speak to the video hardware. Some methods will produce better results than others. I HIGHLY suggest you look at the code for MPlayer in this case.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very large codebase (read: thousands of modules) that has code shared
I have read (or perhaps heard from a colleague) that in .NET, TransactionScope can
Is it possible to read/write data from/to a file in a PL/SQL block without
I have some very large (>4 GB) files containing (millions of) fixed-length binary records.
I have read through several reviews on Amazon and some books seem outdated. I
I have read a lot that LISP can redefine syntax on the fly, presumably
I have read about partial methods in the latest C# language specification , so
I have read that using database keys in a URL is a bad thing
I have read this post about how to test private methods. I usually do
I have read on Stack Overflow some people that have converting to C#2.0 to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.