kristinbranson / APT

Animal Part Tracker
GNU General Public License v3.0
71 stars 16 forks source link

Create from DeepLabCut not working properly #326

Closed 2909ft closed 4 years ago

2909ft commented 4 years ago

Hello everybody!

There seems to be a bug on the createFromDeeplabcut file. Whenever I try to run it, I get this error message, any idea on how to fix it?

APT.setpath;createFromDeeplabcut('/home/alvaro/Desktop/CollectedData_Filipa.csv')

Loading Java Customizations in UIExtrasTable.jar Labeler GUI created. Error using get_readframe_fcn (line 387) Could not open file /home/alvaro/Desktop/test_mov/m2sensoryD1top0.avi with VideoReader: Error using VideoReader/init (line 601) Could not read file due to an unexpected error. Reason: Unable to initialize the video properties

Error in VideoReader (line 171) obj.init(fileName);

Error in get_readframe_fcn (line 330) readerobj = VideoReader(filename);

Error in MovieReader/open (line 124) get_readframe_fcn(obj.filename,'preload',obj.preload);%,'neednframes',obj.neednframes);

Error in Labeler/movieAdd (line 3532) mr.open(movfilefull);

Error in createFromDeeplabcut (line 92) lObj.movieAdd(umovies(ndx));

Error in MovieReader/open (line 124) get_readframe_fcn(obj.filename,'preload',obj.preload);%,'neednframes',obj.neednframes);

Error in Labeler/movieAdd (line 3532) mr.open(movfilefull);

Error in createFromDeeplabcut (line 92) lObj.movieAdd(umovies(ndx));

allenleetc commented 4 years ago

This looks like a video decoding problem. Is it possible that one or more movies referenced in this project cannot be opened within MATLAB on your computer? For instance, in MATLAB can you try this line:

vr = VideoReader('/home/alvaro/Desktop/test_mov/m2sensoryD1top0.avi');

If this errors, then MATLAB is having trouble opening this movie and this will subsequently cause trouble for APT.

2909ft commented 4 years ago

Indeed, I am having some issues with getting matlab to open videos on ubuntu 18.04. Thanks for the help!

allenleetc commented 4 years ago

Yes we have also encountered this on occasion. This can depend on how the video was encoded, the machine, and in some cases even the MATLAB version. MATLAB relies on libraries like gstreamer to read/decode videos. Googling around may provide some hints, eg https://www.mathworks.com/matlabcentral/answers/377803-how-to-get-videoreader-working-on-ubuntu-17-04; also Mathworks support may be able to help. Another idea would be to re-encode the videos with another codec that plays better on your system. Hope this helps!