VTK fails to compile with FFmpeg 3.0
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
ffmpeg 3.0 has recently been released. I am trying to compile VTK 7 and it fails. Here is compilation error:
[10043/22348] Building CXX object IO/FFMPEG/CMakeFiles/vtkIOFFMPEG.dir/vtkFFMPEGWriter.cxx.o [10044/22348] Tcl Wrapping - generating vtkOggTheoraWriterTcl.cxx [10045/22348] Building CXX object IO/Movie/CMakeFiles/vtkIOMovieTCL.dir/vtkIOMovieTCLInit.cxx.o FAILED: /usr/bin/c++ -DVTK_IN_VTK -DvtkIOFFMPEG_EXPORTS -D__STDC_CONSTANT_MACROS -IIO/Movie -I/build/vtk/src/VTK-7.0.0/IO/Movie -ICommon/DataModel -I/build/vtk/src/VTK-7.0.0/Common/DataModel -ICommon/Math -I/build/vtk/src/VTK-7.0.0/Common/Math -ICommon/Core -I/build/vtk/src/VTK-7.0.0/Common/Core -IUtilities/KWSys -I/build/vtk/src/VTK-7.0.0/Utilities/KWSys -ICommon/Misc -I/build/vtk/src/VTK-7.0.0/Common/Misc -ICommon/System -I/build/vtk/src/VTK-7.0.0/Common/System -ICommon/Transforms -I/build/vtk/src/VTK-7.0.0/Common/Transforms -ICommon/ExecutionModel -I/build/vtk/src/VTK-7.0.0/Common/ExecutionModel -IIO/Core -I/build/vtk/src/VTK-7.0.0/IO/Core -IThirdParty/zlib -I/build/vtk/src/VTK-7.0.0/ThirdParty/zlib -IThirdParty/oggtheora -I/build/vtk/src/VTK-7.0.0/ThirdParty/oggtheora -IIO/FFMPEG -I/build/vtk/src/VTK-7.0.0/IO/FFMPEG -D__STDC_CONSTANT_MACROS -O3 -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MMD -MT IO/FFMPEG/CMakeFiles/vtkIOFFMPEG.dir/vtkFFMPEGWriter.cxx.o -MF IO/FFMPEG/CMakeFiles/vtkIOFFMPEG.dir/vtkFFMPEGWriter.cxx.o.d -o IO/FFMPEG/CMakeFiles/vtkIOFFMPEG.dir/vtkFFMPEGWriter.cxx.o -c /build/vtk/src/VTK-7.0.0/IO/FFMPEG/vtkFFMPEGWriter.cxx /build/vtk/src/VTK-7.0.0/IO/FFMPEG/vtkFFMPEGWriter.cxx: In member function 'int vtkFFMPEGWriterInternal::Start()': /build/vtk/src/VTK-7.0.0/IO/FFMPEG/vtkFFMPEGWriter.cxx:194:18: error: 'PIX_FMT_YUVJ422P' was not declared in this scope c->pix_fmt = PIX_FMT_YUVJ422P; ^ /build/vtk/src/VTK-7.0.0/IO/FFMPEG/vtkFFMPEGWriter.cxx:198:18: error: 'PIX_FMT_BGR24' was not declared in this scope c->pix_fmt = PIX_FMT_BGR24; ^ /build/vtk/src/VTK-7.0.0/IO/FFMPEG/vtkFFMPEGWriter.cxx:277:40: error: 'avcodec_alloc_frame' was not declared in this scope this->rgbInput = avcodec_alloc_frame(); ^ /build/vtk/src/VTK-7.0.0/IO/FFMPEG/vtkFFMPEGWriter.cxx:283:36: error: 'PIX_FMT_RGB24' was not declared in this scope int RGBsize = avpicture_get_size(PIX_FMT_RGB24, c->width, c->height); ^ /build/vtk/src/VTK-7.0.0/IO/FFMPEG/vtkFFMPEGWriter.cxx: In member function 'int vtkFFMPEGWriterInternal::Write(vtkImageData*)': /build/vtk/src/VTK-7.0.0/IO/FFMPEG/vtkFFMPEGWriter.cxx:357:28: error: 'PIX_FMT_RGB24' was not declared in this scope cc->width, cc->height, PIX_FMT_RGB24, ^ /build/vtk/src/VTK-7.0.0/IO/FFMPEG/vtkFFMPEGWriter.cxx: In member function 'int vtkFFMPEGWriterInternal::Start()': /build/vtk/src/VTK-7.0.0/IO/FFMPEG/vtkFFMPEGWriter.cxx:326:53: warning: ignoring return value of 'int avformat_write_header(AVFormatContext*, AVDictionary**)', declared with attribute warn_unused_result [-Wunused-result] avformat_write_header(this->avFormatContext, NULL); ^ ninja: build stopped: subcommand failed.