Beginning with MATLAB R2020b, the MATLAB Support Package for IP Cameras supports H.264 RTSP streams.
You can download the latest version of the MATLAB Support Package for IP Cameras from the following link:https://www.mathworks.com/matlabcentral/fileexchange/49824-matlab-support-package-for-ip-cameras
You can also download and install the MATLAB Support Package for IP Cameras directly from within MATLAB by going to the MATLAB Home tab, in the Environment section, click Add-Ons > Get Hardware Support Packages.
Start using the IP Camera Support Package following our documentation: https://www.mathworks.com/help/supportpkg/ipcamera/index.html