videosegmentation / video_segment

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

Code is not running #9

Closed mgarbade closed 9 years ago

mgarbade commented 9 years ago

Hi Unfortunately I cannot run the toy example: ./seg_tree_sample --input_file=INPUT.mp4 --logging --write-to-file

The error message is: ERROR: something wrong with flag 'flagfile' in file '/home/myusername/Progs/VideoSegmentation/gflags-master/src/gflags.cc'. One possibility: file '/home/myusername/Progs/VideoSegmentation/gflags-master/src/gflags.cc' is being linked both statically and dynami

I don't know how to fix this issue. I had already problems installing glog along gflags. I would be really thankful if you could help me. I already spent many hours on this :/

dcastro9 commented 9 years ago

Hey Martin,

It seems you have not correctly installed glog, I would remove any trace of glog and attempt to reinstall it.

mgarbade commented 9 years ago

Thanks for your answer. Unfortunately installing glog only succeeded when I installed gflag before with the options export CXXFLAGS="-fPIC" cmake .. -DGFLAGS_NAMESPACE=google

Removing every trace of glog and gflag and trying to install it again didn't help. In the meantime I tried to compile the video segmentation program under Ubuntu 14.04.1 LTS in my virtual machine. While glog and gflag install without problems now, I still get one compilation error when compiling the segmentation program: [ 96%] Built target segmentation Scanning dependencies of target seg_tree_sample [100%] Building CXX object CMakeFiles/seg_tree_sample.dir/seg_tree.cpp.o Linking CXX executable seg_tree_sample /usr/bin/ld: /usr/local/lib/libavcodec.a(tiff.o): undefined reference to symbol 'lzma_code@@XZ_5.0

libavcodec is installed normally. Do I need to adapt the cmake configuration? Maybe it cannot find the libavcodec

mgarbade commented 9 years ago

This is my output of ccmake for the video_segmentation program:

BOOST_THREAD_LIBRARY /usr/lib/x86_64-linux-gnu/libpthread.so
CMAKE_BUILD_TYPE
CMAKE_INSTALL_PREFIX /usr/local
FFMPEG_LIBAVCODEC_INCLUDE_DIRS /usr/local/include
FFMPEG_LIBAVCODEC_LIBRARIES /usr/local/lib/libavcodec.a
FFMPEG_LIBAVDEVICE_INCLUDE_DIR /usr/local/include
FFMPEG_LIBAVDEVICE_LIBRARIES /usr/local/lib/libavdevice.a
FFMPEG_LIBAVFORMAT_INCLUDE_DIR /usr/local/include
FFMPEG_LIBAVFORMAT_LIBRARIES /usr/local/lib/libavformat.a
FFMPEG_LIBAVUTIL_INCLUDE_DIRS /usr/local/include
FFMPEG_LIBAVUTIL_LIBRARIES /usr/local/lib/libavutil.a
FFMPEG_LIBSWRESAMPLE_INCLUDE_D /usr/local/include
FFMPEG_LIBSWRESAMPLE_LIBRARIES /usr/local/lib/libswresample.a
FFMPEG_LIBSWSCALE_INCLUDE_DIRS /usr/local/include
FFMPEG_LIBSWSCALE_LIBRARIES /usr/local/lib/libswscale.a
FFMPEG_ROOT
GFLAGS_INCLUDE_DIR /usr/local/include
GFLAGS_LIBRARY /usr/local/lib/libgflags.a
GFLAGS_ROOT_DIR
NO_X_SUPPORT OFF
OPENCV_calib3d_INC_DIR /usr/include
OPENCV_calib3d_LIB /usr/lib/x86_64-linux-gnu/libopencv_calib3d.so
OPENCV_contrib_INC_DIR /usr/include
OPENCV_contrib_LIB /usr/lib/x86_64-linux-gnu/libopencv_contrib.so
OPENCV_core_INC_DIR /usr/include
OPENCV_core_LIB /usr/lib/x86_64-linux-gnu/libopencv_core.so
OPENCV_features2d_INC_DIR /usr/include
OPENCV_features2d_LIB /usr/lib/x86_64-linux-gnu/libopencv_features2d.so
OPENCV_flann_INC_DIR /usr/include
OPENCV_flann_LIB /usr/lib/x86_64-linux-gnu/libopencv_flann.so
OPENCV_gpu_INC_DIR /usr/include
OPENCV_gpu_LIB /usr/lib/x86_64-linux-gnu/libopencv_gpu.so
OPENCV_highgui_INC_DIR /usr/include
OPENCV_highgui_LIB /usr/lib/x86_64-linux-gnu/libopencv_highgui.so
OPENCV_imgproc_INC_DIR /usr/include
OPENCV_imgproc_LIB /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so
OPENCV_legacy_INC_DIR /usr/include
OPENCV_legacy_LIB /usr/lib/x86_64-linux-gnu/libopencv_legacy.so
OPENCV_ml_INC_DIR /usr/include
OPENCV_ml_LIB /usr/lib/x86_64-linux-gnu/libopencv_ml.so
OPENCV_objdetect_INC_DIR /usr/include
OPENCV_objdetect_LIB /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so
OPENCV_video_INC_DIR /usr/include
OPENCV_video_LIB /usr/lib/x86_64-linux-gnu/libopencv_video.so
OpenCV_ROOT_DIR /usr
WITH_QT OFF

davidstutz commented 9 years ago

I cannot directly help you, however, I also had trouble installing the project correctly. I use 64bit Ubuntu 14.04 and the following approach worked for me:

Install libx264 using sudo apt-get install libx264-dev. Download FFMPEG 2.2.3 (as in the google doc) and configure as follows:

./configure --enable-nonfree --enable-gpl --enable-pic --enable-shared --enable-libx264 --disable-vaapi

Important is --enable-pic and --enable-shared; --disable-vaapi may not be necessary, but I have not tested it. Then, download and install OpenCV 2.4.10. Check that CMake recognizes the correct FFMPEG installation, in particular the below versions for codec, format, etc. If OpenCV does not recognize the below versions, you might have installed another version of FFMPEG (try removing it with sudo apt-get remove ffmpeg in case it was installed e.g. for using some video player):

FFMPEG:                      YES
  codec:                         YES (ver 55.52.102)
  format:                        YES (ver 55.33.100)
  util:                              YES (ver 52.66.100)
  swscale:                      YES (ver 2.5.102)
  gentoo-style:               YES
mgarbade commented 9 years ago

Thanks for your help so far. So I finally had the time to retry the installation on a fresh Ubuntu 14.04 machine. I followed the tip of davidstutz and could compile the videosegmentation src code normally. However when I try to segment an example video I get an error:

$~/libs/videosegmentation/video_segment/release$ ./seg_tree_sample --input_file=~/Desktop/testvid.mp4 --logging --write_to_file I0325 20:50:50.382592 32656 seg_tree.cpp:305] Writing result to file ~/Desktop/testvid.mp4.pb I0325 20:50:50.382675 32656 seg_tree.cpp:327] Tree layout: I0325 20:50:50.382724 32656 video_unit.cpp:486] Tree layout: video_framework::VideoReaderUnit video_framework::VideoPipelineSink video_framework::VideoPipelineSource video_framework::LuminanceUnit video_framework::DenseFlowUnit video_framework::VideoPipelineSink video_framework::VideoPipelineSource segmentation::DenseSegmentationUnit video_framework::VideoPipelineSink video_framework::VideoPipelineSource segmentation::RegionSegmentationUnit video_framework::VideoPipelineSink video_framework::VideoPipelineSource segmentation::SegmentationWriterUnit E0325 20:50:50.383116 32656 video_reader_unit.cpp:93] Could not open file: ~/Desktop/testvid.mp4 E0325 20:50:50.383132 32656 seg_tree.cpp:337] Setup failed. Segmentation fault (core dumped)

I tried it with a .avi and a .mp4 video. In both cases i get the same error. Since I can segment these files using the webpage "www.videosegmenation.com" I don't think that it's an issue with the codec.

When i ran "ccmake ../seg_tree_sample" I had to specify the path to OpenCV_ROOT_DIR manually (By default it chose /usr/). Since I have a local installation of opencv 2.4.10 (and ffmpeg 2.2.3) I changed that variable to the path where my locally installed "opencv" "opencv2" folders are located. I'm not sure if this is producing the error. Maybe the "./seg_tree_sample" binary still doesn't see the locally installed opencv but the global one?

grundman commented 9 years ago

Bash expansion does not work for command line arguments without spaces. Use absolute paths.

(810) 643-1383 www.mgrundmann.com

On Wed, Mar 25, 2015 at 1:01 PM, Martin Garbade notifications@github.com wrote:

Thanks for your help so far. So I finally had the time to retry the installation on a fresh Ubuntu 14.04 machine. I followed the tip of davidstutz and could compile the videosegmentation src code normally. However when I try to segment an example video I get an error:

$~/libs/videosegmentation/video_segment/release$ ./seg_tree_sample --input_file=~/Desktop/testvid.mp4 --logging --write_to_file I0325 20:50:50.382592 32656 seg_tree.cpp:305] Writing result to file ~/Desktop/testvid.mp4.pb I0325 20:50:50.382675 32656 seg_tree.cpp:327] Tree layout: I0325 20:50:50.382724 32656 video_unit.cpp:486] Tree layout: video_framework::VideoReaderUnit video_framework::VideoPipelineSink video_framework::VideoPipelineSource video_framework::LuminanceUnit video_framework::DenseFlowUnit video_framework::VideoPipelineSink video_framework::VideoPipelineSource segmentation::DenseSegmentationUnit video_framework::VideoPipelineSink video_framework::VideoPipelineSource segmentation::RegionSegmentationUnit video_framework::VideoPipelineSink video_framework::VideoPipelineSource segmentation::SegmentationWriterUnit E0325 20:50:50.383116 32656 video_reader_unit.cpp:93] Could not open file: ~/Desktop/testvid.mp4 E0325 20:50:50.383132 32656 seg_tree.cpp:337] Setup failed. Segmentation fault (core dumped)

I tried it with a .avi and a .mp4 video. In both cases i get the same error. Since I can segment these files using the webpage " www.videosegmenation.com" I don't think that it's an issue with the codec.

When i ran "ccmake ../seg_tree_sample" I had to specify the path to OpenCV_ROOT_DIR manually (By default it chose /usr/). Since I have a local installation of opencv 2.4.10 (and ffmpeg 2.2.3) I changed that variable to the path where my locally installed "opencv" "opencv2" folders are located. I'm not sure if this is producing the error. Maybe the "./seg_tree_sample" binary still doesn't see the locally installed opencv but the global one?

Reply to this email directly or view it on GitHub https://github.com/videosegmentation/video_segment/issues/9#issuecomment-86196371 .

mgarbade commented 9 years ago

Thanks that was the trick :). Now everything seems to be working fine.

MRCoderMan commented 9 years ago

@mgarbade Recently I happened to the same problem like you,but the difference is that I don't want to reinstall a new Ubuntu for solving the problem-----I have little time for that.I have followed this way in https://github.com/BVLC/caffe/issues/2263,but failed.I also tried to delete gflags and reinstalled it and that seems no effection.So,please tell me except reinstalling,do you have any idea to solve this problem?