Why do I get an error when I specify certain range of frames in the function READ while reading WMV video files in MATLAB 7.14 (R2012a)?

3 views (last 30 days)
I am trying to read a WMV video file attached with the solution by the following MATLAB code,
Obj = VideoReader('ESPN_vid1.wmv');
Video1 = read(Obj, [1 10]);
Video2 = read(Obj, [100 150]);
Video3 = read(Obj, [300 350]);
Video4 = read(Obj, [312 376]);
The code works fine for the above ranges of frames.
But when I execute the following code,
Obj = VideoReader('ESPN_vid1.wmv');
Video1 = read(Obj, [35 50]);
Video2 = read(Obj, [2 50]);
I get the following error report for the above ranges,
Error using VideoReader/read (line 86)
The frame range requested is beyond the end of the file.
Error in Read_Video (line 2)
Video1 = read(Obj, [35 50]);

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 14 Sep 2012
This is a bug in MATLAB 7.14(R2012a) wherein the READ function does not read the WMV video files for certain ranges of frames.
As a workaround you can do the following,
1) Always start reading the WMV file from frame 1
2) Convert the WMV file to another format using a third party tool.

More Answers (0)

Products


Release

R2012a

Community Treasure Hunt

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

Start Hunting!