Why does the 'VideoReader' function read frames for MP4 files slower than AVI files in MATLAB R2023b?
5 views (last 30 days)
Show older comments
MathWorks Support Team
on 1 Feb 2024
Answered: MathWorks Support Team
on 20 Feb 2024
Reading frames using the 'VideoReader' function on MP4 files is significantly slower than when using it on an AVI file. Is this discrepancy in speed normal behavior and is there any way to resolve this issue so that MP4 files are able to be read in faster?
Accepted Answer
MathWorks Support Team
on 1 Feb 2024
The time-delay issue with the MP4 file is because of the codec used within the MP4 file and not MATLAB.
AVI is merely a container format, and different AVI files may utilize different codecs which could affect performance.
Some MP4 codecs, due to their complex compression algorithms, require more processing time to decode the data, which in turn affects the speed at which one can seek to a particular timestamp within the MP4 file. This delay is not exclusive to MATLAB and can be observed in other applications outside of MATLAB as well.
Therefore, changing the codec used on the MP4 file could result in improved performance when using the 'VideoReader' function. Codecs cannot be changed inside of MATLAB, however, there are many other tools online which can achieve this.
0 Comments
More Answers (0)
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!