Hi,
You can refer to the following two MATLAB answers that discusses a similar issue that you are facing:
- https://www.mathworks.com/matlabcentral/answers/218237-unable-to-determine-the-codec-required
- https://www.mathworks.com/matlabcentral/answers/1902545-videoreader-reads-h264-video-compression-file-with-error-caught-unexpected-exception-of-unknown
I hope this helps.