POV-Ray : Newsgroups : povray.animations : My quest for the holy grail of encoders. : Re: My quest for the holy grail of encoders. Server Time
6 Oct 2024 11:33:41 EDT (-0400)
  Re: My quest for the holy grail of encoders.  
From: Dick Balaska
Date: 14 Feb 2002 01:43:11
Message: <3C6B5C85.4F114E52@buckosoft.com>
Warp wrote:
> 
> Dick Balaska <dic### [at] buckosoftcom> wrote:
> : So i discovered VirtualDub.
> : I run my 3500 720x512 PNG frames through mpeg_encode at the highest
> : quality.
> : This yields a pretty unplayable, yet correct mpeg.
> : I then pass that through VirtualDub using the Microsoft MPEG-4 Video
> : Codec V2
> : which gives me decent avi file.  Actually, it looks like crap next to
> : the
> : aforementioned South Park DVD, but it is getting there. (slow movement
> : is bad
> : and gets that avi blocky look)
> 
> 
>   Eh, I think that you confuse a couple of things here.

No, not really. [1]

> 
>   Firstly, it's not VirtualDub which encodes the video/audio stream. VirtualDub
> just let's you choose a video/audio codec installed in your system and then
> let's that codec to do the job. VirtualDub is merely a user interface for
> using the installed codecs (VirtualDub doesn't actually care which codecs you
> have installed; it just looks at what you have and then lets you choose among
> them).

"I then pass that through VirtualDub using the Microsoft MPEG-4 Video Codec V2"

Maybe that sentence was unclear.  I did mean "through the VirtualDub stream filter
system".  To be combatant about it ;O it *is* VirtualDub which encodes the stream.
The codecs just supply a filter specific to a type of stream.

>   So if you have any concern about the quality of a video, don't blame
> VirtualDub, but blame the codec and settings you are using (it's not VirtualDub
> which generates the quality you are seeing, but the codec, which has nothing
> to do with it).
> 
>   Secondly, encoding frames first to MPEG-1 and then from that to MPEG-4 is
> a *REALLY BAD IDEA*.
>   When you encode to MPEG-1 you lose the most. After this what was lost, is
> lost; you can't get it back. Thus converting it to MPEG-4 can't give you any
> more quality. MPEG-1 does a really bad job in encoding, so don't use it.

Actually, as i said, i have a top quality MPEG-1.  It is unplayable because
the bitrate is way too high.  But i can look at individual frames and they
are pretty dang close to the original PNGs.  

In fact, if i select RGB uncompressed as the output of VirtualDub, i get a 
beautiful AVI file that weighs in at 3.5GB for 1:57 of video.  Also unplayable,
but again, the individual frames look mahvalous.

Here i think *you* are mistaken.  There is nothing in the MPEG-1 spec that
sez it has to look crappy.  If i encode a GOP of 1 (all I frames) with
ISCALE = 1, i am going to get pretty close to the source output.  Of course,
there is no M$ software that is going to deal with such a bitrate that this
MPEG would require. 
(Someday, i'd like to measure SCSI 160's actual transfer rate under Win2K.)

Is it not true that MPEG-2 is son of MPEG-1 with some new fangled compression
algorithms?  I believe it was one of the Berkeley boys that said something to 
the effect of "When we were researching codecs for the new HDTV format, we were 
surprised that MPEG-1 was designed robust enough that it just scaled up and 
thus it became the basis for the new MPEG-2 format".


>   What you should do is to convert your frames directly to an AVI with raw
> video (there are tools for that in the net; they just take the frames and
> put them in a raw format in the AVI and that's it). Then you can open this
> AVI in VirtualDub and encode it to another AVI using MPEG-4 (I suggest using
> the latest DivX codec as it has lots of quality fine-tuning options and
> optimizations; http://divx.com).

In my gropings, i found that MPEG-4 V2 actually gave me a better output than 
DIVX-4.1 .

And neither is as good as MPEG.  For example, here is a frame:
http://frank.buckosoft.com:2270/_frd?t=m&project=tteoac-512&Frame=2151
(from the 512x384 set).  The spotlight on the wall is the headlamp of the locomotive.
POV-Ray makes beautiful delicate shadows on the wall which MPEG-1 preserves
pretty well.  All of the AVI codecs i've tried turn that beige/white wall
and it's shadows into fractalized blocky things.

I was surfing through the porny groups (strictly as a research project)
and none of the DIVXs or MPEG-4s look as good as the few MPEG-2s that i found.
(Classic example: the "model" is being videoed and photoed at the same time.
The flash of the stills camera totally confuses the video codec into the
exact same fractal patterns that i am getting).

>   What a DVD uses is the MPEG-2 format. MPEG-4 can reach the same image
> quality with smaller file sizes.
I have a Sigma MPEG-2 encoder in my PC.  If i could find a way to feed it PNGs
at 30 fps, i'd be all set.  Um, no i wouldn't; it wants video in.  Maybe i could
print out my frames and hold them in front of a camera real fast.

> It's just a question of encoding it in
> the right way 

yes.

> (ie. *don't* use MPEG-1 as an intermediate format) and choosing
> the proper quality settings.

> 
> --
> #macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
> N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
> N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -

[1] Last year i wrote a WindRiver [2] (some embedded system) device driver for a
Sigma Designs MPEG-2 encoder and then multicasted that data.

[2] The same OS that's in the "we don't know where it went" Mars Lander.  I imagine it
is sitting on Mars with a hung TCP/IP stack, a nasty bug i fought many times
by stuffing too much MPEG-2 down it's throat.

dik


Post a reply to this message

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