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

3 visualizzazioni (ultimi 30 giorni)

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?

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 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. 

Più risposte (0)

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by