POV-Ray : Newsgroups : povray.off-topic : War of the codecs : War of the codecs Server Time
9 Oct 2024 20:52:42 EDT (-0400)
  War of the codecs  
From: Orchid XP v8
Date: 3 Nov 2008 16:44:35
Message: <490f70c3$1@news.povray.org>
OK, so my PC has spent the entire evening encoding and re-encoding the 
same AVI over and over again. And the results are in:

12-Flower3-v1-Part.avi

6,351 frames, 720x576 pixels, 24 bits/pixel, 25 frames/second.

Uncompressed:         7,901.797 MB,               14% CPU on playback.
FFDshow Huffyuv:        746.872 MB, 1:45 encode,  20% CPU on playback.
FFDshow FFV1:           547.746 MB, 5:09 encode, >50% CPU on playback 
(failed to play in realtime).
FFDshow MPEG1:           28.947 MB, 1:35 encode, Completely broken on 
playback.
FFDshow MPEG2:           28.947 MB, 1:35 encode, Playback refused.
FFDshow XviD:            28.782 MB, 1:39 encode,  13% CPU on playback.
FFDshow DivX:            28.952 MB, 1:45 encode,  13% CPU on playback.
FFDshow Theora:          28.298 MB, 2:19 encode,  16% CPU on playback.
FFDshow H.264:           29.061 MB, 3:50 encode,  21% CPU on playback.
FFDshow H.264 Lossless: 252.069 MB, 4:22 encode, Completely broken on 
playback.
TPMGEnc MPEG1 30Mbit:   148.213 MB, 1:47 encode,  17% CPU on playback.
TPMGEnc MPEG1 900Kbit:   27.168 MB, 1:43 encode,  17% CPU on playback.

As you can see, this conclusively proves... something.

Actually, you know what? My head hurts!

All of the ones that say "FFDshow" where encoded using Virtual Dub and 
the selected codec with all defaults. (Apparently that means 900 
Kbit/sec in one-pass average bitrate mode. I didn't even *look* at the 
defaults for the advanced settings...)

As far as lossless codecs go, only Huffyuv is actually usable. FFV1 
produces somewhat smaller files, but it's too slow for realtime 
playback. (As you can see, it locked up one core of my dual-core 
processor.) H.264 lossless was smaller still, but on playback the 
picture was spectacularly broken. Even in Virtual Dub, all the colours 
are mixed up and there are random lines everywhere and it basically 
looks like a bug in the codec. It is *not* lossless!

It also appears that putting an MPEG1/2 data stream into an AVI fail is 
a "bad" thing to do. Oh well!

As for the lossy codecs... well the numbers speak for themselves. 
Suffice it to say that most of the codecs are pretty similar in CPU 
requirements. (And obviously, at the same average bitrate, they produce 
similar files sizes!)

I am a little bit puzzled as to how some of the codecs manage to have 
slightly lower CPU load than completely uncompressed video. Obviously 
this is impossible - unless you're seriously telling me it takes 14% CPU 
to transfer 7.9 GB of data from HD to RAM?

In terms of visual quality, things are more complicated. Actually *all* 
of the codecs look quite good at 900 Kbit/sec with my test video - which 
probably means I've chosen a bad video for test purposes. The video in 
question is a POV-Ray animation. Most of the frame is jet-black. The 
parts that aren't black are all the same shade of green, varying in 
brightness only.

I should probably just start over with a better test video! Tomorrow 
I'll probably do that. (I think I have some fractal zooms kicking around 
somewhere. That should be a better test!)

 From what I've seen tonight, I can say this:
1. ALL of the codecs look pretty similar at 900 Kbit/sec.
2. MPEG1 does look very slightly worse.
3. Theora looks better than MPEG1, but slightly worse than everything else.
4. Beyond that, it's hard to say.

At lower bitrates, the ridiculously-named codec "H.264" seems to look 
slightly better than Xvid, which looks a bit better than DivX, which 
looks quite a bit better than MPEG1.

But anyway, the main result of tonights exploration is this: Last time I 
tried to use an MPEG-4 codec (I'm pretty sure it was DivX), the results 
were abomination. If you take a photo, save it as JPEG with quality=5, 
and then open it again, you'll get some idea of the level of quality I'm 
talking about. Large general features of the video were unrecognisible 
due to the extreme distortion. More importantly, no amount of increasing 
the quality settings had any effect on the garbage produced.

However, tonight I encoded a video with both DivX and XviD, and it came 
out looking... well, not that different, actually. They both look like 
codecs you could actually use, in the real world.

I am not, however, seeing the reputed "massive" difference in image 
quality. I think I need to pick a better video. A project for tomorrow, 
then.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.