• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Cinepak vs. Motion-JPEG

JWG Design

Active member
A discussion about converting an MPEG-4 video to 4-bit Cinepak Quicktime spawned some discussion about quality of different codecs.

> http://68kmla.org/forums/viewtopic.php?t=960

I thought I would start a new thread to discuss the topic of Cinepak vs. Motion-JPEG as it seems interesting to more than a few people.

The claim was that MotionJPEG produced better results than Cinepak at any given data rate. My own tests on a high-motion video clip (28 seconds long) produced similar results.

How can this be?

I'll do some more tests and post the results soon.

 

tomlee59

Well-known member
My limited experimentation seems to be consistent with what others have noticed -- exactly as bobw stated, MJPEG generally produces better looking output for comparable file sizes, and also encodes faster. But, this comes at the cost of considerably more complex decode. Since (M)JPEG is DCT-based, decode requires performing inverse DCTs, which is computationally expensive. Vector quantization basically requires just a lookup table to do the decode (but a massive search operation to generate the lookup table during encode, hence the slowness). Cinepak evolved with the specific purpose of easy decode, so they apparently made concessions to allow older CPUs to keep up.

I'd be very interested in the results of any experiments you run. In particular, if there's a way to make Cinepak perform better, that would be terrific. In the meantime, I'm going to take the clips I've transcoded and see how well they'll play on some of my older macs, to get calibrated on what can play what.

 

tomlee59

Well-known member
So, bobw -- did your conversion ever finish? How long did it take? And how well does the result play on your mac?

 

bestobothworlds

Well-known member
So, bobw -- did your conversion ever finish? How long did it take? And how well does the result play on your mac?
It never did. I gave up trying to convert to Cinepak from the LC, so I tried to make a 16 color and a 256 color uncompressed file. Both attempts to convert the file ended up in the computer crashing, so I just used a Windows box at the library to do the conversion and then made the resulting file into a MOV with Movieplayer 2.5 on the G4. Still, I plan to do my next conversion on the LC itself. I think the reason why the Cinepak conversion didn't finish was because I didn't have Virtual Memory turned on. Silly me. :I
 

tomlee59

Well-known member
Still, I plan to do my next conversion on the LC itself. I think the reason why the Cinepak conversion didn't finish was because I didn't have Virtual Memory turned on. Silly me. :I
Ah, yes. You will definitely need a *ton* of memory to do the conversion, so VM has to be enabled if the LC is to have any hope of doing the job. :)

When you did the conversion on the G4, what codec did you use? Still Cinepak?

For fun, I encoded Galaxy Quest completely in 10fps MJPEG at Medium quality, just to see what would happen. With an MP2 soundtrack, the whole thing fits in 780MB, and is amazingly watchable. Starting from an XVCD that I had created from the original DVD, the entire conversion took 4-5 hours on a 300MHz G3 beige tower. That was a lot faster than I'd expected.

I may try Cinepak again, although I only have patience enough to do a part of the movie. I'm curious to see if an LCIII can play it, even if only at 160x120 frame size. I'll have to do something awful to the audio track, too, to make it playable as well. Maybe 8-bit 22kHz mono...

 

bestobothworlds

Well-known member
For fun, I encoded Galaxy Quest completely in 10fps MJPEG at Medium quality, just to see what would happen. With an MP2 soundtrack, the whole thing fits in 780MB, and is amazingly watchable.
What was the screen resolution and sound quality for the converted file?
 

tomlee59

Well-known member
The frame size as reported by QT is 320x240 (but I am suspicious, as the source is 352x240; QT's reports are sometimes a bit off). I didn't bother to re-encode the audio -- I just stripped it off of the XVCD, which was stereo, 128kb/s total, at 44.1kHz sampling rate. Sounded just fine, but it's MP2, which has fairly heavy decode requirements (not as tough as MP3, but similar). To enable playback on machines that can barely keep up with Cinepak, the audio will have to be re-encoded to something a lot less complex (but it will either have to sound worse or have larger file sizes, or both).

 

tomlee59

Well-known member
That's a very good question. The documentation that came with my card only talks about its mpeg1 playback ability, which doesn't tell us anything about whether it also handles other formats, or defers support of those other formats to software. I guess that adds one more experiment to do on a rainy day, someday...

 
Top