[geeks] Scriptable Video Processing

Joshua Boyd jdboyd at jdboyd.net
Mon Aug 8 09:56:50 CDT 2005


On Mon, Aug 08, 2005 at 10:57:30AM -0400, Patrick Giagnocavo 717-201-3366 wrote:

> The MPEG encoder itself could tell you some of that, but probably
> there is no API for getting that info out of it (since it will try to
> determine when to use I/P/B frames and when not to). 

The I/P/B frame decision is usually preset by the GOP type used.  For
instance, HDV specifies a GOP of 6 or 15 frames long, and in that block,
there is a fixed sequence of I/P/B frames.  For instance:
I BB P BB P BB P BB P BB

Now, I believe that MPEG encoders typically use % difference for the
motion estimation.  The do a sum of the pixels in one macroblock, then
compare that over each same sized block in a certain "radius" to
estimate where the macroblock moved to.  Or at least that is the
primitive way to do it.  I keep seeing papers about potentially better
and/or faster ways to do it that might use more sophisticated
algorithms, or at least a faster search pattern.
 
> Assuming that you write out each frame to a separate JPEG, you can use
> ImageMagick's "compare" utility: 
> 
> http://imagemagick.org/script/compare.php  
> 
> Experimentation would be required, but with a little practice would
> probably work well. 

Now that is a place I didn't think to look, and is probably the best way
to accomplish the comparisons without writing code.

-- 
Joshua D. Boyd
jdboyd at jdboyd.net
http://www.jdboyd.net/
http://www.joshuaboyd.org/



More information about the geeks mailing list