Kodi crashes when I play a video from my USB

Hi, would appreciate help on this.

I’ve got Kodi 17.1 set up on my raspberry pi and use it as a media player, copying videos on to a USB to play videos from.

However, about 70% of videos I play seem to crash and kick me out of Kodi altogether. Originally the error was something along the lines of “Error creating demuxer”. After updating Kodi to its current version, I can see the below error, which seems to end abruptly

16:32:54.986 T:1731482544 ERROR: GetDirectory – Error getting
16:35:02.635 T:1945830048 ERROR: Previous line repeats 6 times.
16:35:02.635 T:1945830048 NOTICE: VideoPlayer: Opening: /media/usb0/Family Guy – S13E17 – Fighting Irish.mkv
16:35:02.635 T:1945830048 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
16:35:02.636 T:1731482544 NOTICE: Creating InputStream
16:35:02.644 T:1731482544 NOTICE: Creating Demuxer

Interesting thing is that other videos of the same filetype may not have the same problem.

Can someone recommend what else to update or how to increase logging to resolve this problem please?

Thanks