Extract_outlier_frame function Error Message

When I attempted to use extract_outlier_frame function in ipython on high computing cluster, I have received this message. -----

Method jump found 91 putative outlier frames.
Do you want to proceed with extracting 2 of those?
If this list is very large, perhaps consider changing the parameters (start, stop, p_bound, comparisonbodyparts) or use a different method.
yes/noyes
Frames from video 17010 already extracted (more will be added)!
Loading video…

CalledProcessError Traceback (most recent call last)
in
----> 1 deeplabcut.extract_outlier_frames(config_path, [’/gpfs/scratch/doyjang/17010.avi’])

~/.local/lib/python3.7/site-packages/deeplabcut/refine_training_dataset/outlier_frames.py in extract_outlier_frames(config, videos, videotype, shuffle, trainingsetindex, outlieralgorithm, comparisonbodyparts, epsilon, p_bound, ARdegree, MAdegree, alpha, extractionalgorithm, automatic, cluster_resizewidth, cluster_color, opencv, savelabeled, destfolder, modelprefix, track_method)
268 cluster_resizewidth,
269 cluster_color,
–> 270 savelabeled,
271 )
272 else:

~/.local/lib/python3.7/site-packages/deeplabcut/refine_training_dataset/outlier_frames.py in ExtractFramesbasedonPreselection(Index, extractionalgorithm, Dataframe, dataname, video, cfg, config, opencv, cluster_resizewidth, cluster_color, savelabeled)
425 vid = VideoWriter(video)
426 fps = vid.fps
–> 427 duration = vid.calc_duration()
428 else:
429 from moviepy.editor import VideoFileClip

~/.local/lib/python3.7/site-packages/deeplabcut/utils/auxfun_videos.py in calc_duration(self, robust)
83 )
84 output = subprocess.check_output(
—> 85 command, shell=True, stderr=subprocess.STDOUT
86 )
87 return float(output)

/gpfs/software/Anaconda3/envs/DLC-GPU/lib/python3.7/subprocess.py in check_output(timeout, *popenargs, **kwargs)
409
410 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
–> 411 **kwargs).stdout
412
413

/gpfs/software/Anaconda3/envs/DLC-GPU/lib/python3.7/subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs)
510 if check and retcode:
511 raise CalledProcessError(retcode, process.args,
–> 512 output=stdout, stderr=stderr)
513 return CompletedProcess(process.args, retcode, stdout, stderr)
514

CalledProcessError: Command ‘ffprobe -i “/gpfs/scratch/doyjang/17010.avi” -show_entries format=duration -v quiet -of csv=“p=0”’ returned non-zero exit status 127.

I am not sure how to fix this error, but one thing I can think of is that the videos I used for labeling was ffmpeg with this code:
for f in *.avi ; do ffmpeg -i "$f" -vf scale=640:360 "/gpfs/scratch/doyjang/videoavi/s$f"; done

Hello @Jean11, it looks like there is something broken with the ffmpeg/ffprobe installation. Does conda install -c conda-forge ffmpeg help?

1 Like

Hello!,

I am having the same issue and I have tried installing ffmpeg again. I am still getting the error.
Do you want to proceed with extracting 40 of those?
If this list is very large, perhaps consider changing the parameters (start, stop, p_bound, comparisonbodyparts) or use a different method.
yes/noyes
Frames from video QZ_FBR030_C57BL6_eGFP-01042021101212-0000 already extracted (more will be added)!
Loading video…

CalledProcessError Traceback (most recent call last)
~\Anaconda3\envs\DLC-CPU\lib\site-packages\deeplabcut\gui\extract_outlier_frames.py in extract_outlier_frames(self, event)
213 trainingsetindex=self.trainingindex.GetValue(),
214 outlieralgorithm=self.algotype.GetValue(),
→ 215 track_method=tracker,
216 )
217

~\Anaconda3\envs\DLC-CPU\lib\site-packages\deeplabcut\refine_training_dataset\outlier_frames.py in extract_outlier_frames(config, videos, videotype, shuffle, trainingsetindex, outlieralgorithm, comparisonbodyparts, epsilon, p_bound, ARdegree, MAdegree, alpha, extractionalgorithm, automatic, cluster_resizewidth, cluster_color, opencv, savelabeled, destfolder, modelprefix, track_method)
268 cluster_resizewidth,
269 cluster_color,
→ 270 savelabeled,
271 )
272 else:

~\Anaconda3\envs\DLC-CPU\lib\site-packages\deeplabcut\refine_training_dataset\outlier_frames.py in ExtractFramesbasedonPreselection(Index, extractionalgorithm, Dataframe, dataname, video, cfg, config, opencv, cluster_resizewidth, cluster_color, savelabeled)
425 vid = VideoWriter(video)
426 fps = vid.fps
→ 427 duration = vid.calc_duration()
428 else:
429 from moviepy.editor import VideoFileClip

~\Anaconda3\envs\DLC-CPU\lib\site-packages\deeplabcut\utils\auxfun_videos.py in calc_duration(self, robust)
83 )
84 output = subprocess.check_output(
—> 85 command, shell=True, stderr=subprocess.STDOUT
86 )
87 return float(output)

~\Anaconda3\envs\DLC-CPU\lib\subprocess.py in check_output(timeout, *popenargs, **kwargs)
409
410 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
→ 411 **kwargs).stdout
412
413

~\Anaconda3\envs\DLC-CPU\lib\subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs)
510 if check and retcode:
511 raise CalledProcessError(retcode, process.args,
→ 512 output=stdout, stderr=stderr)
513 return CompletedProcess(process.args, retcode, stdout, stderr)
514

CalledProcessError: Command ‘ffprobe -i “E:\Shakhawat\QZ_FBR030\QZ_FBR030_C57BL6_eGFP-01042021101212-0000.avi” -show_entries format=duration -v quiet -of csv=“p=0”’ returned non-zero exit status 1.

I had the same error but ran this code and was able to successfully extract outlier frames!

Hi all,
Thank you so much for your replies! I was waiting for a response from a school cluster stuff to get a permission to install ffempeg to my environment. I apologized for the delay post…

When I used conda install -c conda-forge ffmpeg, the tensorflow and cuda setting was corrupted due to the downgrade, so I recreated a new environment and downloaded the library with this code:
conda install x264=='1!152.20180717' ffmpeg=4.0.2 -c conda-forge.
After the installation, everything works fine.

Thank you so much for everyone who commented on this question!