VideoReader provide wrong number of frames
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to extract frames from a .mpg video file, and I use VideoReader to read the video file. But the number of frames obtained using this way seems not correct. As shown in the figure, the frame rate and duration of the video are 29.9 FPS and 606s, respective. But the number of frames is 1211, which is obviously not correct. I also tried another .mp4 file, this problem is solved. Does this problem arise from .mpg format? If so, could anyone please tell me how to obtain the correct information from .mpg files?

4 commentaires
Jan
le 9 Juil 2022
Many programs import files even if they contain errors in the header by replacing them with feasable values. So maybe use another software to read the header and compare it with the real number of frames.
Walter Roberson
le 9 Juil 2022
mpg files can be variable frame rate. 29.97 would be the nominal frame rate.
Réponses (0)
Voir également
Catégories
En savoir plus sur Audio and Video Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!