Neil Hopcroft

A digital misfit

Fixing of-video

The of-video project gives “warning: package video is empty”. This project also has a bootstrap script which creates a configure script which creates a Makefile. Running ./configure gives “error: Octave-Forge video package requires libavformat from FFmpeg”. A quick check shows that ffmpeg is generating only static linkage libraries, adding –enabled-shared to the ffmpeg build, adding a dependency from of-video upon ffmpeg then rebuilding ffmpeg.
However, ffmpeg now fails with “/usr/bin/ld: libavutil/color_utils.o: relocation R_X86_64_32S against `.rodata’ can not be used when making a shared object; recompile with -fPIC”. Checking the build configuration I notice that the ffmpeg build is not cleaned – cleaning the build resolves this problem, although it seems like a change to such an option should force all code to be recompiled?
Now of-video is looking in libavcodec for av_malloc, but it looks like it has been moved to libavutil, adding a patch to the configure script to pass ‘-lavutil’ to test program allows ./configure to run to completion.
Next the compilation fails:

AVHandler.cc:125:42: error: ‘av_set_parameters’ was not declared in this scope
if (av_set_parameters(av_output, NULL) < 0) { ^ AVHandler.cc:135:53: error: ‘URL_WRONLY’ was not declared in this scope if (avio_open(&av_output->pb, filename.c_str(), URL_WRONLY) < 0) { ^

These two are deprecated in ffmpeg.
I have added patches:

  • AVHandler.cc: remove call to av_set_parameters()
  • AVHandler.cc: update URL_WRONLY to AVIO_FLAG_WRITE
  • oct-avifile.h: remove DECLARE_OCTAVE_ALLOCATOR
  • oct-avifile.cc: remove DEFINE_OCTAVE_ALLOCATOR

Fixed in build 36.


Leave a Reply

Your email address will not be published.