CDDA vs XviD: why so much burden for the CPU, and so much RAM?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
CDDA vs XviD: why so much burden for the CPU, and so much RAM?
Hi:
Let's take a multimedia player. Say MPlayer. Two cases:
(a) I play a file of this type: 640 x 272, 25.00 fps, video: XviD, audio: MPEG-1 Layer 3 (stereo, 48000 Hz).
(b) I play a CDDA.
In case (a), my machine is fast enough so that I can watch and listen perfectly well. In case (b), it seems my machine lacks speed or memory, for the sound is heard as if each second mplayer had to load some buffer and must stop playback for a few milliseconds. "Each second" actually means "at random intervals nearly one second long.
Because the movie (case a) is a compressed format, the actual amount of information is low. But we are speaking about video here (I'm beginning to feel the impression that I'm speaking about what I do not know). Plus, the CPU has the extra work of decoding.
On the other hand in case b, no decoding needed.
So, in view of mplayer's performance in each of those cases, 640 x 272, 25.00 fps is less info than Stereo, 44100 Hz? What is the explanation for this phenomenon: A motion picture less work for the machine than a CDDA?
If by CDDA you mean playing an audio CD directly, there are other factors at work too. You have the speed and ability of the drive to read the disk (including the condition of the disk itself), the size of the drive's cache, possible driver bugs, and the speed and quality of the bus connection.
I'd be willing to bet that one or more of these are actually causing your slow-down, since CD audio is simple uncompressed PCM and would need much less processing than the compressed xvid/mp3 streams.
Try ripping the audio to an uncompressed .wav file and see if it still causes playback problems.
Thanks. Yes, I mean Red Book. I hope you did not bet. KsCD has no problem playing the CD (same machine, same drive, same disk). Where as any audio CD will beat the monster program called mplayer.
However, your idea about transferring to a WAV file could perhaps give a clue. Regards.
EDIT
I ripped a CD to WAV, played the WAV. Result: no problem. I played the CD and the result was the same as before. Always speaking about mplayer.
When I compiled the source from the official site the result, in regard to this behaviour, was the same as now, when I am using a slackbuilds.
These settings seem to work fine for my machine (thanks for the link) although what I'd actually like to know is the reason behind it:
640 x 272 pixels= 174080 bits= 21760 bytes
21760 bytes * 25 frame/s = 544000 byte/s
plus decoding.
2 bytes * 44100 Hz * 2 = 176400 byte/s
I do not understand. Perhaps, for movies, mplayer by default uses a large cache. IDK. But I can use mplayer to play CDs for the first time. Thanks a lot.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.