Why does the 'VideoReader' function read frames for MP4 files slower than AVI files in MATLAB R2023b?

조회 수: 6 (최근 30일)

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?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2024년 2월 1일
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개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by