[vtkusers] compiling VTK with FFMPEG support on MacOSX 10.6

Alexandre GOUAILLARD agouaillard at gmail.com
Mon Feb 22 01:42:42 EST 2010


hi all,

I compiled FFMPEG with default configuration.
WHen trying to compile VTK with USE_FFMPEG flag ON, it did not find
some symbols.
Undefined symbols:
  "_BZ2_bzDecompressEnd", referenced from:
      _matroska_decode_buffer in libavformat.a(matroskadec.o)
  "_BZ2_bzDecompress", referenced from:
      _matroska_decode_buffer in libavformat.a(matroskadec.o)
  "_BZ2_bzDecompressInit", referenced from:
      _matroska_decode_buffer in libavformat.a(matroskadec.o)

adding bz2 to the list of libraries in /IO/CMakeLists.txt did the job.

Maybe there is something cleaner ( APPLE flags, checking if bz2
exists, ...) to do to make it work out of the box?

#-----------------------------------------------------------------------------
# FFMPEG
# If the ffmpeg library is available, compile vtkFFMPEGWriter.
IF (VTK_USE_FFMPEG_ENCODER)
  INCLUDE(${VTK_CMAKE_DIR}/vtkTestFFMPEG.cmake)

  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/vtkFFMPEGConfig.h.in
                 ${CMAKE_CURRENT_BINARY_DIR}/vtkFFMPEGConfig.h @ONLY)
  INCLUDE_DIRECTORIES(${VTK_BINARY_DIR}/IO)
  INSTALL(FILES vtkFFMPEGConfig.h
    DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}
    COMPONENT Development)

  INCLUDE_DIRECTORIES(${FFMPEG_INCLUDE_DIR})
  SET(Kit_SRCS ${Kit_SRCS} vtkFFMPEGWriter.cxx)
  SET(KIT_LIBS ${KIT_LIBS}
    ${FFMPEG_avformat_LIBRARY}
    ${FFMPEG_avcodec_LIBRARY}
    ${FFMPEG_avutil_LIBRARY}
    bz2)        ####### <<=== ######### MODIFIED ##################
  IF (NOT VTK_FFMPEG_HAS_IMG_CONVERT)
    SET(KIT_LIBS ${KIT_LIBS}
      ${FFMPEG_swscale_LIBRARY})
  ENDIF (NOT VTK_FFMPEG_HAS_IMG_CONVERT)
ENDIF (VTK_USE_FFMPEG_ENCODER)



More information about the vtkusers mailing list