missing frames in mp4

1 回表示 (過去 30 日間)
Stefan Monstein
Stefan Monstein 2018 年 10 月 31 日
The attached movie-file has about 38 frames. I can see them with VLC and with MPC-HC. Frames are 20ms appart as seen in the timestamps at the bottom of each image. Matlab however, only shows half of these frames every 40ms. How can I get all frames?

回答 (1 件)

YT
YT 2018 年 10 月 31 日
From the documentation on VideoReader
v = VideoReader('stefan.mp4');
currAxes = axes;
while hasFrame(v)
vidFrame = readFrame(v);
image(vidFrame, 'Parent', currAxes);
currAxes.Visible = 'off';
pause(1/v.FrameRate);
end
More info on VideoReader can be found here
  7 件のコメント
Hugo Lehoux
Hugo Lehoux 2021 年 3 月 12 日
I have done some research, it appears one codec that is problematic is the Motion JPEG (MJPG or MJPEG). I have not tested all of them of course, and it seems I cannot get information on the file you provided on Matlab for some reason, so I don't know if it is encoded in MJPEG, but if that is the case, then that could explain why Matlab only reads half the frames. I have checked again and VLC does correctly read the interlaced frames on this file.
Constantino Carlos Reyes-Aldasoro
Constantino Carlos Reyes-Aldasoro 2023 年 2 月 9 日
I had a similar problem, I changed from mp4 to AVI and now I can see all my frames. The size of the video tripled, but I have all the frames.

サインインしてコメントする。

製品


リリース

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by