[GRASS-dev] OSX FFMPEG build instructions available

Bob Covill bcovill at tekmap.ns.ca
Sat Dec 1 11:48:26 EST 2007


On Sat, 2007-12-01 at 18:00 +1300, Hamish wrote:
> Bob Covill wrote:
> > On Mon, 2007-10-22, Glynn Clements wrote: 
> > > William Kyngesburye wrote:
> > > 
> > > > I finally got back to FFMPEG on OSX.  It went fairly smooth this  
> > > > time.  I added build instructions to the GRASS OSX readme.  My
> > > > future OSX builds will now have ffmpeg support, yay!
> > > > 
> > > > Question: what is the minimum needed in the ffmpeg libraries for  
> > > > GRASS?  I'm thinking of disabling codecs and formats that GRASS
> > > > can't use to reduce the library size (a basic universal build
> > > > without debug symbols added ~6.5MB to libgrass_ogsf!).  Or can
> > > > GRASS use any codec available in ffmpeg?
> > > 
> > > It only uses MPEG-1. There's a compile-time option to use XviD, but
> > > that gives you a "raw" XviD stream (no AVI etc container), which isn't
> > > much use.
> > > 
> > 
> > I have attached a patch for gsd_img_mpeg.c (ogsf) which is based on the
> > later releases of ffmpeg (output_example.c). This uses a function
> > guess_format to guess the format based upon the file extension given. If
> > the format is unknown it reverts to mpeg1. With this patch you can save
> > to any (almost) format supported by ffmpeg. For example you can save to
> > asf, avi, flv, swf, etc. To use this with nviz the auto name extension
> > in panel_kanimator.tcl will have to be commented out ...
> > 
> > #       if { [string compare $fnameExt ".mpg"] != 0  &&
> > #               [string compare $fnameExt ".mpeg"] != 0 } then {
> > #           append keyanimBaseName ".mpg"
> > #       }
> > 
> > The patch needs testing, etc. 
> > 
> > Let me know if you have any questions.
> > 
> > --
> > Bob
> 
> 
> Hi,
> 
> I have applied this patch now in 6.3-cvs. I also reinserted the
>  USE_XVID code to force the encoder to use the Xvid codec, but I
>  haven't tested that.

You probably do not need this. The video format written will be
determined by the file extension passed from the GUI. The default
fall-back is the generic MPEG1 if it cannot figure out the format from
the extension. You should get an mp4 if you use "movie.mp4" as the
output name? The library still needs options to allow quality variables
supplied by the user (eg. qscale, bit rate, etc). 

Note that with this change it is ALMOST possible to write an animated
GIF. If you supply the filename as "movie.gif" it will fail because the
pixel format is not compatible with the GIF output. It should be
possible to tweak the library to handle this and output an animated GIF
if requested. 

> 
> In other NVIZ news for Max res PPM output I have changed the rendering
>  logic in 6.3.0 release branch to use the safe methods by default and
>  only use pixmaps/pbuffers if asked for with the GRASS_GLX_PIXMAPS or
>  GRASS_GLX_PBUFFERS enviro vars.
> 
> 
> For me, to get it to export the image correctly in 6.3-cvs I need to do:
>  export GRASS_NO_GLX_PIXMAPS=TRUE
> ( unset GRASS_NO_GLX_PBUFFERS )
> 
> otherwise NVIZ exits with an error:
> 
> G63.cvs> nviz elevation.dem
> Loading Data
> Update elev null mask
> Loading Data
> translating colors
> recalculating normals...
> Create PixMap Using GLX 1.1
> X Error of failed request:  GLXBadContext
>   Major opcode of failed request:  143 (GLX)
>   Minor opcode of failed request:  5 (X_GLXMakeCurrent)
>   Serial number of failed request:  5281
>   Current serial number in output stream:  5281
> 
> 
> Hamish

--
Bob



More information about the grass-dev mailing list