Deeplabcut: Error in Colab when analyzing video deeplabcut==2.2.b.5 (ffprobe)

Created on 28 May 2020  路  12Comments  路  Source: DeepLabCut/DeepLabCut

maDeepLabcCut, using deeplabcut==2.2.b.5, the project was created and labeled in windows 10, DLC-CPU, then copied to google drive.

Using Colab, creating a training data set and training works fine, but when tried to analyze a video I get:

CalledProcessError                        Traceback (most recent call last)
<ipython-input-26-221bf1d55f94> in <module>()
----> 1 deeplabcut.analyze_videos(path_config_file,'/content/drive/My Drive/MVI_0466.MP4', videotype='mp4')

4 frames
/usr/lib/python3.6/subprocess.py in run(input, timeout, check, *popenargs, **kwargs)
    436         if check and retcode:
    437             raise CalledProcessError(retcode, process.args,
--> 438                                      output=stdout, stderr=stderr)
    439     return CompletedProcess(process.args, retcode, stdout, stderr)
    440 

CalledProcessError: Command 'ffprobe -i /content/drive/My Drive/MVI_0466.MP4 -show_entries format=duration -v quiet -of csv="p=0"' returned non-zero exit status 1.

Thanks.

All 12 comments

deeplabcut.analyze_videos(path_config_file,['/content/drive/My Drive/MVI_0466.MP4'], videotype='mp4')

thanks for the quick answer, still the same:

Loading  /content/drive/My Drive/MVI_0466.MP4
---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
<ipython-input-31-ceaaaba29cbf> in <module>()
----> 1 deeplabcut.analyze_videos(path_config_file,['/content/drive/My Drive/MVI_0466.MP4'], videotype='mp4')

4 frames
/usr/lib/python3.6/subprocess.py in run(input, timeout, check, *popenargs, **kwargs)
    436         if check and retcode:
    437             raise CalledProcessError(retcode, process.args,
--> 438                                      output=stdout, stderr=stderr)
    439     return CompletedProcess(process.args, retcode, stdout, stderr)
    440 

CalledProcessError: Command 'ffprobe -i /content/drive/My Drive/MVI_0466.MP4 -show_entries format=duration -v quiet -of csv="p=0"' returned non-zero exit status 1.

for sure this notebook works (well as least of ~8 hours ago: https://github.com/DeepLabCut/DeepLabCut/blob/master/examples/COLAB_maDLC_TrainNetwork_VideoAnalysis.ipynb)

@cgutierrez-Ibanez - if there is an encode issue perhaps with the video, you can try out the new loader by passing robust_nframes=True to read the video

https://github.com/DeepLabCut/DeepLabCut/blob/8a499514dbaf71118adcd11b15500e16055924d7/deeplabcut/pose_estimation_tensorflow/predict_multianimal.py#L21

PS - "star" of DLC is super appreciated, if you find it useful for your research :)

I had the same issue on Colab while analyzing .avi videos, I had to change the code of deeplabcut.utils.auxfun_videos.get_duration() to make it work, however I haven't identified the cause of the problem yet.

@hugofluhr - robust_nframes did not work for you?

@MMathisLab No it dit not, same error

just not clarify, I was not using that notebook, it was using an older, one animal one, which I just changed the pip install line. will try the ma notebook later.

Not sure what's happening but I found a fix in deeplabcut.utils.auxfun_videos.get_duration()
replace :
https://github.com/DeepLabCut/DeepLabCut/blob/8a499514dbaf71118adcd11b15500e16055924d7/deeplabcut/utils/auxfun_videos.py#L286

with
cmd = f'ffprobe -i "{videofile}" -show_entries format=duration -v quiet -of csv="p=0"'

There seems to be a problem with the "My Drive" in the file path (videofile), really strange that it's working in some notebooks and not others though

Great catch @hugofluhr, white spaces were indeed the issue! I've just added it to get_nframes_robust() as well :) https://github.com/DeepLabCut/DeepLabCut/commit/1baf6c23fd1302b23e2e741178053ff530f2df07

@jeylau - perhaps a blackify issue? but to be clear, the pypi and the current code is working for me on colab, and macOS (pre-this change...)

That's odd. I ran the subprocess command alone in COLAB, and couldn't make it run unless the apostrophes were added :/

I just ran into this problem and was also able to fix it by removing white space from my folder path :)

Was this page helpful?
0 / 5 - 0 ratings