Error runing ffmpeg in Matlab function in linux

4 views (last 30 days)
I download exemplarsvm code, the problem: when I run : [tmp,lenstring] = unix('/usr/bin/ffmpeg -i "/home/ly/Documents/movie/AVSS_AB_Easy_Divx.avi" 2>&1 | grep Duration') the return value is tmp = 1 lenstring = '' , lenstring is Empty. And when I jues run: /usr/bin/ffmpeg -i "/home/ly/Documents/movie/AVSS_AB_Easy_Divx.avi" 2>&1 | grep Duration in terminal, the result is " Duration: 00:03:38.96, start: 0.000000, bitrate: 4005 kb/s".
So I think Matlab doesnot call ffmpeg right. and I just: unix('fmpeg') in matlab.result: ffmpeg: error while loading shared libraries: libraw1394.so.8: cannot open shared object file: No such file or directory
ans =
127
Wat does it mean? How can I fix it? Thank you for any help!

Answers (1)

Kaustubha Govind
Kaustubha Govind on 13 Mar 2012
What do you get when you just run:
>> [status,result] = unix('/usr/bin/ffmpeg -i "/home/ly/Documents/movie/AVSS_AB_Easy_Divx.avi" 2>&1')
It is possible that the system PATH and LD_LIBRARY_PATH are not set up correctly in the MATLAB session. Run the following commands in MATLAB and the system shell and compare the results:
In MATLAB:
>> getenv PATH
>> getenv LD_LIBRARY_PATH
In system shell:
$ printenv PATH
$ printenv LD_LIBRARY_PATH
  1 Comment
yan
yan on 14 Mar 2012
thank you! I have fixed it by:
ln -s /usr/lib/libraw1394.so.11.01 /usr/local/MATLAB/R2010b/sys/os/glnx86/libraw1394.so.8
Thank you for helping

Sign in to comment.

Categories

Find more on Install Products in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!