Frame not found when extracting frames

Hi everyone !

I am using DLC on rather small videos (i.e. 5 to 8 sec at 50fps).

I have edited the config file in order to pick 80 frames to label and changed the labels of the body parts.

When I run the extraction of the frames, here’s what I got :

Config file read successfully.
Extracting frames based on kmeans …
Kmeans-quantization based extracting of frames from 0.0 seconds to 9.67 seconds.
Extracting and downsampling… 483 frames from the video.
483it [00:08, 55.38it/s]
Kmeans clustering … (this might take a while)
Frame 445 not found!

And then nothing happens…
I have already used DLC on the same computer and everything goes perfectly well.
I tried to run it without modifying the config file and it worked (with the default body parts and 20 frames to pick). So I guess this is where my problem is but I can’t see why…
So if anyone have a solution or an idea to solve this problem, it would be greatly appreciated !

Thanks !

I think it suggests that this frames is corrupt? – does this video otherwise play well?

Thank you very much for your reply !

Yes, the video plays well and I tried on several videos and the result is still the same…

Did you try to manually extract the exact frame that gives the error? Curious what happens then

Thank you for this idea, I am going to try that !
The problem is that it is never the same frame that is not found… :confused: Very odd…

I understood where the problem is :
The video have for example 340 frames but when loaded in DLC it appears that DLC is considering that there is 380 frames. So obviously it can’t find the 40 frames missing…

Do you know what I can do to solve this ?

Can you check video metadata to see how many frames it shows? You can use exiftool for easy access to metadata (download exiftool and drop video file on exiftool icon). Seems weird that DLC would see more frames than there actually is, I’d assume that opencv reads metadata to check framerate and # of frames. What happens if you set opencv to False when extracting (this will use moviepy)?