VTK 请求的模块不可用 vtkIOFFMPEG

VTK Requested modules not available vtkIOFFMPEG

我尝试执行此 example from VTK, and to do that I most install ffmpeg from this url 并且一切正常,但是当我尝试构建项目时出现此错误:

/Downloads/VTK-8.2.0/CMake/vtkModuleAPI.cmake:140 (message):
Requested modules not available:

vtkIOFFMPEG

我在从 VTK 下载安装的 ffmpeg 压缩文件中执行所有步骤 url,如果在 VTK-build 目录上按 ccmake,我可以看到这些选项已启用

VTK_FFMPEG_INCLUDE_DIR /tmp/ffmpeg_inst/include
VTK_FFMPEG_avcodec_LIBRARY /tmp/ffmpeg_inst/lib/libavcodec.so
VTK_FFMPEG_avformat_LIBRARY /tmp/ffmpeg_inst/lib/libavformat.so
VTK_FFMPEG_avutil_LIBRARY /tmp/ffmpeg_inst/lib/libavutil.so VTK_USE_FFMPEG_ENCODER ON

找到所有 files/directory 并位于 /tmp/ffmpeg_inst 下, 此外,我 运行 在 VTK_USE_FFMPEG_ENCODER 设置为打开后生成 -j4。

为什么现在找不到 vtkIOFFMPEG 模块?配置是否有任何错误,或者在构建之前是否有针对 FFMPEG 示例的特定配置?谢谢。

补充说明:

  1. VTK 版本:8.2.0
  2. cmake 版本 3.13.2

我找到了这个问题的答案,只需转到 VTK-build 目录,然后设置 Module_vtkIOFFMPEG = ON,然后重建。

也在这个版本中你需要这样设置路径:

 FFMPEG_LIBAVCODEC_INCLUDE_DIRS   /ffmpeg_inst/include                                                                           
 FFMPEG_LIBAVCODEC_LIBRARIES      /ffmpeg_inst/lib/libavcodec.so                                                                 
 FFMPEG_LIBAVDEVICE_INCLUDE_DIR   /ffmpeg_inst/include                                                                           
 FFMPEG_LIBAVDEVICE_LIBRARIES     /ffmpeg_inst/lib/libavdevice.so                                                                
 FFMPEG_LIBAVFORMAT_INCLUDE_DIR   /ffmpeg_inst/include                                                                           
 FFMPEG_LIBAVFORMAT_LIBRARIES     /ffmpeg_inst/lib/libavformat.so                                                                
 FFMPEG_LIBAVUTIL_INCLUDE_DIRS    /ffmpeg_inst/include                                                                           
 FFMPEG_LIBAVUTIL_LIBRARIES       /ffmpeg_inst/lib/libavutil.so                                                                  
 FFMPEG_LIBSWRESAMPLE_INCLUDE_D   /ffmpeg_inst/include                                                                           
 FFMPEG_LIBSWRESAMPLE_LIBRARIES   /ffmpeg_inst/lib/libswresample.so                                                              
 FFMPEG_LIBSWSCALE_INCLUDE_DIRS   /ffmpeg_inst/include                                                                           
 FFMPEG_LIBSWSCALE_LIBRARIES      /ffmpeg_inst/lib/libswscale.so 

祝大家好运。