MichaelMathieu / THFFmpeg

Torch bindings for FFmpeg (reading videos only)
26 stars 8 forks source link

Error loading module 'libthffmpeg' #2

Open WeimianLI opened 7 years ago

WeimianLI commented 7 years ago

After 'luarocks make', it looks like it had been installed: 'thffmpeg 1.0.alpha-0 is now built and installed in /home/lwm/torch/install/ (license: BSD)'. But I couldn't require it in torch : 'error loading module 'libthffmpeg' from file '/home/lwm/torch/install/lib/lua/5.1/libthffmpeg.so'.

How could I fix it? Thanks!

MichaelMathieu commented 7 years ago

Hi,

It looks like it is not installed properly. Can you remove the directory 'build' and run 'luarocks make' again, and paste the output here?

WeimianLI commented 7 years ago

That works! I remove the directory 'build' and run 'luarocks make' again, and now I can require it successfully. Thank you very much!

dezhili commented 7 years ago

I had the same problem. After 'luarocks make',it looks like it had been installed: 'thffmpeg 1.0.alpha-0 is now installed in /home/cxg/torch/install/ (license: BSD)'. Then 'th test/test.lua' ,I couldn't require it in torch : /home/cxg/torch/install/bin/luajit: /home/cxg/torch/install/share/lua/5.1/trepl/init.lua:384: /home/cxg/torch/install/share/lua/5.1/trepl/init.lua:384: /home/cxg/torch/install/share/lua/5.1/luarocks/loader.lua:118: error loading module 'libthffmpeg' from file '/home/cxg/torch/install/lib/lua/5.1/libthffmpeg.so': /home/cxg/torch/install/lib/lua/5.1/libthffmpeg.so: undefined symbol: av_frame_free stack traceback: [C]: in function 'error' /home/cxg/torch/install/share/lua/5.1/trepl/init.lua:384: in function 'require' test.lua:1: in main chunk [C]: in function 'dofile' .../cxg/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk [C]: at 0x00406620 Follwing the above ,I removed the the directory 'build' and ran 'luarocks make' again,but it didn't work. How could I fix it? Thanks!

MichaelMathieu commented 7 years ago

@WeimianLI great news!

Actually, I was asking for the log of the 'luarocks make' after deleting the 'build' folder. @dezhili , can you paste it? I can only assume somehow it's installed in the wrong path.

dezhili commented 7 years ago

cxg@Prof:~/torch/THFFmpeg$ rm -rf build cxg@Prof:~/torch/THFFmpeg$ luarocks make Warning: unmatched variable LUALIB cmake -E make_directory build && cd build && cmake .. -DLUALIB= -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/home/cxg/torch/install/bin/.." -DCMAKE_INSTALL_PREFIX="/home/cxg/torch/install/lib/luarocks/rocks/thffmpeg/1.0.alpha-0" && make

-- The C compiler identification is GNU 4.7.3 -- The CXX compiler identification is GNU 4.9.4 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Found Torch7 in /home/cxg/torch/install -- Found PkgConfig: /usr/bin/pkg-config (found version "0.26") -- checking for module 'libavcodec' -- found libavcodec, version 54.35.0 -- checking for module 'libavformat' -- found libavformat, version 54.20.4 -- checking for module 'libavutil' -- found libavutil, version 52.3.0 -- Found FFMPEG or Libav: /usr/lib/x86_64-linux-gnu/libavcodec.so;/usr/lib/x86_64-linux-gnu/libavformat.so;/usr/lib/x86_64-linux-gnu/libavutil.so, /usr/include -- Configuring done -- Generating done CMake Warning: Manually-specified variables were not used by the project:

LUALIB

-- Build files have been written to: /home/cxg/torch/THFFmpeg/build Scanning dependencies of target thffmpeg [100%] Building C object CMakeFiles/thffmpeg.dir/thffmpeg.c.o Linking C shared module libthffmpeg.so [100%] Built target thffmpeg cd build && make install [100%] Built target thffmpeg Install the project... -- Install configuration: "Release" -- Installing: /home/cxg/torch/install/lib/luarocks/rocks/thffmpeg/1.0.alpha-0/lib/libthffmpeg.so -- Set runtime path of "/home/cxg/torch/install/lib/luarocks/rocks/thffmpeg/1.0.alpha-0/lib/libthffmpeg.so" to "$ORIGIN/../lib:/home/cxg/torch/install/lib" -- Installing: /home/cxg/torch/install/lib/luarocks/rocks/thffmpeg/1.0.alpha-0/lua/thffmpeg/init.lua -- Installing: /home/cxg/torch/install/lib/luarocks/rocks/thffmpeg/1.0.alpha-0/lua/thffmpeg/test.lua -- Installing: /home/cxg/torch/install/lib/luarocks/rocks/thffmpeg/1.0.alpha-0/lua/thffmpeg/README.md thffmpeg 1.0.alpha-0 is now installed in /home/cxg/torch/install/ (license: BSD)

But i found that only 'doc','rock_manifest' and 'thffmpeg-1.0.alpha-0.rockspec' is in /home/cxg/torch/install/lib/luarocks/rocks/thffmpeg/1.0.alpha-0.

dezhili commented 7 years ago

I still cannot require 'libthffmpeg' correctly, were there any ways for fixing It ? Thanks!

lhao0301 commented 7 years ago

I meet the same problem in ubuntu 14.04 I solve it via specifying thoese *.so lib of ffmpeg during make.

masoudpz commented 7 years ago

ucf101FMeans.lua:1: loop or previous error loading module 'thffmpeg' stack traceback: [C]: in function 'require' ucf101FMeans.lua:1: in main chunk [C]: in function 'f' [string "local f = function() return dofile('ucf101FMe..."]:1: in main chunk [C]: in function 'xpcall' /home/yasin/torch/install/share/lua/5.1/itorch/main.lua:210: in function </home/yasin/torch/install/share/lua/5.1/itorch/main.lua:174> /home/yasin/torch/install/share/lua/5.1/lzmq/poller.lua:75: in function 'poll' /home/yasin/torch/install/share/lua/5.1/lzmq/impl/loop.lua:307: in function 'poll' /home/yasin/torch/install/share/lua/5.1/lzmq/impl/loop.lua:325: in function 'sleep_ex' /home/yasin/torch/install/share/lua/5.1/lzmq/impl/loop.lua:370: in function 'start' /home/yasin/torch/install/share/lua/5.1/itorch/main.lua:389: in main chunk [C]: in function 'require' (command line):1: in main chunk [C]: at 0x00406670 i take this error when make thggmpeg. how can i fix it? @MichaelMathieu

ArghyaPal commented 7 years ago

Hi @MichaelMathieu: I got the error; error loading module 'libthffmpeg' from file '/home/intern_vnb/torch/install/lib/lua/5.1/libthffmpeg.so'

I have changed the permission of: libthffmpeg.so at that location. Another thing: I can see libthffmpeg.so file at THFFmpeg/build location too

yanmengjia commented 7 years ago

@MichaelMathieu I have the same error like @dezhili, I install it on Ubuntu 14.04.

ArghyaPal commented 7 years ago

LD_PRELOAD=~/torch/install/lib/lua/5.1/libthffmpeg.so th

Solved my problem..

adityarp9 commented 6 years ago

Facing a similar error, please help:

/home/apatgao/torch/install/bin/luajit: /home/apatgao/torch/install/share/lua/5.1/trepl/init.lua:389: /home/apatgao/torch/install/share/lua/5.1/trepl/init.lua:389: .../apatgao/torch/install/share/lua/5.1/luarocks/loader.lua:117: error loading module 'libthffmpeg' from file '/home/apatgao/torch/install/lib/lua/5.1/libthffmpeg.so': /home/apatgao/torch/install/lib/lua/5.1/libthffmpeg.so: undefined symbol: av_frame_free stack traceback: [C]: in function 'error' /home/apatgao/torch/install/share/lua/5.1/trepl/init.lua:389: in function 'require' test/test.lua:1: in main chunk [C]: in function 'dofile' ...tgao/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: at 0x00406670