VideoReader can't read "mp4" files?

95 views (last 30 days)
When I read an MP4 video file, the following error appears, how do I solve it, my computer configuration:
win10,x64
matlab2020b
video = VideoReader('D:/test_video/hkvideo/test.mp4');
-------------------------------------------------------------------------------------------------
Error using VideoReader/initReader (line 734)
Could not read file due to an unexpected error. Reason: Error Creating Source Reader
Reason: IDispatch error #64
Error in audiovideo.internal.IVideoReader (line 136)
initReader(obj, fileName, currentTime);
Error in VideoReader (line 104)
obj@audiovideo.internal.IVideoReader(varargin{:});
Error in mycluster (line 24)
Reference:
  2 Comments
Walter Roberson
Walter Roberson on 26 Jan 2021
I am not at all certain, but to the extent that I can find error lists, that one might possibly be "bad file name"
cui,xingxing
cui,xingxing on 26 Jan 2021
Edited: cui,xingxing on 26 Jan 2021
I think it shouldn’t be the reason for the "bad file name". I also make errors when loading other mp4 videos in the videolabeler app. The content is as follows:
--------------------------------------------------------------------------------------------------
Error using vision.labeler.loading.VideoSource/loadSource (line 113)
Could not read file due to an unexpected error. Reason: Error Creating Source Reader
Reason: IDispatch error #64
Warning: Error occurred while evaluating listener callback.
Both win10 local player and opencv can successfully open MP4 video files!

Sign in to comment.

Accepted Answer

cui,xingxing
cui,xingxing on 26 Jan 2021
Edited: cui,xingxing on 18 Feb 2023
A solution to the problem has been found. This is because the current video file does not have a corresponding decoding driver under the current system. You need to download and install the decoding driver.
Reference:
-------2023.2.18 update---------
A more efficient alternative is to use the ffmpeg tool to convert the video format, which corresponds to most avi format videos and is supported by matlab! See my answer below for details!
  1 Comment
Stefan Oline
Stefan Oline on 8 Nov 2022
The software in this link installed 4 malware programs onto my computer in addition to the codec pack, and turned off my antivirus. Users beware!

Sign in to comment.

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!