videosegmentation / video_segment

Main repository for The Video Segmentation Project
Other
167 stars 80 forks source link

Compilation error on video_framework library #14

Open tanismar opened 9 years ago

tanismar commented 9 years ago

Hi guys,

First of all, thanks for the great job and for sharing the code, I am really excited about using it for my project. However, after successfully installing (not without pain) all the dependencies, when I tried to compile seg_tree_sample in the way indicated on the RADME, I got the following error from the video_framework library:

video_framework/libvideo_framework.a(video_writer_unit.cpp.o): In function video_framework::VideoWriterUnit::OpenStreams(std::vector<std::shared_ptr<video_framework::DataStream>, std::allocator<std::shared_ptr<video_framework::DataStream> > >*)': video_writer_unit.cpp:(.text+0x474): undefined reference toavformat_alloc_output_context2' collect2: error: ld returned 1 exit status CMakeFiles/seg_tree_sample.dir/build.make:115: recipe for target 'seg_tree_sample' failed make[2]: * [seg_tree_sample] Error 1 CMakeFiles/Makefile2:68: recipe for target 'CMakeFiles/seg_tree_sample.dir/all' failed make[1]: * [CMakeFiles/seg_tree_sample.dir/all] Error 2 Makefile:75: recipe for target 'all' failed make: *\ [all] Error 2

It might be some dependency error, but it seems more like a small bug on the library. Is there any way to fix it? Thanks in advance! Tanis

dcastro9 commented 9 years ago

Hey Tanis,

This seems to be an issue with how you installed ffmpeg.

See https://github.com/ZoneMinder/ZoneMinder/issues/249 for a similar issue.

Try to uninstall it and compile it from source, also make sure you uninstall any old headers from past installations.

Let me know how that goes.

tanismar commented 9 years ago

Tried removing ffmpeg (and as I learned libav-tools too, to avoid incompatibilities), and installed everything from source using the following guide ( I am working on Ubuntu 14.10: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu.

Now I get the following errors... Building CXX object video_framework/CMakeFiles/video_framework.dir/video_capture_unit.cpp.o /home/icub/icubTanis/video_segment/video_framework/video_writer_unit.cpp: In member function ‘virtual bool video_framework::VideoWriterUnit::OpenStreams(videoframework::StreamSet)’: /home/icub/icubTanis/video_segment/video_framework/video_writer_unit.cpp:127:53: error: ‘avformat_alloc_output_context2’ was not declared in this scope videofile.c_str()); ^ /home/icub/icubTanis/video_segment/video_framework/video_writer_unit.cpp:144:32: error: ‘CODEC_ID_H264’ was not declared in this scope codeccontext->codec_id = CODEC_ID_H264; ^ /home/icub/icubTanis/video_segment/video_framework/video_writer_unit.cpp:163:35: error: ‘CODEC_ID_MPEG2VIDEO’ was not declared in this scope if (codeccontext->codec_id == CODEC_ID_MPEG2VIDEO) { ^ /home/icub/icubTanis/video_segment/video_framework/video_writer_unit.cpp:167:35: error: ‘CODEC_ID_MPEG1VIDEO’ was not declared in this scope if (codeccontext->codec_id == CODEC_ID_MPEG1VIDEO) { ^ /home/icub/icubTanis/video_segment/video_framework/video_writer_unit.cpp:171:35: error: ‘CODEC_ID_H264’ was not declared in this scope if (codeccontext->codec_id == CODEC_ID_H264) { ^ /home/icub/icubTanis/video_segment/video_framework/video_reader_unit.cpp: In member function ‘videoframework::VideoFrame video_framework::VideoReaderUnit::ReadNextFrameImpl(const AVPacket&)’: /home/icub/icubTanis/video_segment/video_framework/video_reader_unit.cpp:380:72: error: ‘av_rescale_q’ was not declared in this scope formatcontext->streams[video_streamidx]->time_base); ^ /home/icub/icubTanis/video_segment/video_framework/video_reader_unit.cpp: In member function ‘virtual bool video_framework::VideoReaderUnit::SeekImpl(int64_t)’: /home/icub/icubTanis/video_segment/video_framework/video_reader_unit.cpp:411:33: error: ‘av_rescale_q’ was not declared in this scope source_timebase); ^ video_framework/CMakeFiles/video_framework.dir/build.make:126: recipe for target 'video_framework/CMakeFiles/video_framework.dir/video_writer_unit.cpp.o' failed make[2]: * [video_framework/CMakeFiles/video_framework.dir/video_writer_unit.cpp.o] Error 1 make[2]: * Waiting for unfinished jobs.... video_framework/CMakeFiles/video_framework.dir/build.make:103: recipe for target 'video_framework/CMakeFiles/video_framework.dir/video_reader_unit.cpp.o' failed make[2]: * [video_framework/CMakeFiles/video_framework.dir/video_reader_unit.cpp.o] Error 1 CMakeFiles/Makefile2:268: recipe for target 'video_framework/CMakeFiles/video_framework.dir/all' failed make[1]: * [video_framework/CMakeFiles/video_framework.dir/all] Error 2

I tried removing ffmpeg again and installing from PPA (http://www.noobslab.com/2014/12/ffmpeg-returns-to-ubuntu-1410.html), but I still get the same errors.

I assume this is an error with the FFMPEG installation too, but I cant tell where it went wrong :(