How can i read mjpeg video?

10 ビュー (過去 30 日間)
Siwoo Lee
Siwoo Lee 2020 年 7 月 6 日
コメント済み: Siwoo Lee 2020 年 7 月 13 日
Hello, I'm struggling with reading mp4 files.
I firstly had an error using VideoReader to read my video file(.mp4). After i downloaded Windows Media Codec, I don't get the error message. But the Numframe is empty.
Filename = 'world.mp4';
vid = VideoReader(Filename)
vid =
VideoReader - 속성 있음:
일반 속성(general):
Name: 'world.mp4'
Path: 'C:\Users\Lee\Desktop\Content\VD\code'
Duration: 180.3010
CurrentTime: 180.3010
NumFrames: <계산 중(calculating)...> 자세히 알아보기
비디오 속성(video):
Width: 1280
Height: 720
FrameRate: 59.9402
BitsPerPixel: 24
VideoFormat: 'RGB24'
So I used
info = mmfileinfo('world.mp4')
and it says that the video format is 'mp4v' and i haven't heared of this.(I guess that this video is Motion JPEG, but i am not sure)
Which code should i use to decode mjpeg video? ( or if i have to use ffmpeg, can you please tell me what should i do?)

採用された回答

Chidvi Modala
Chidvi Modala 2020 年 7 月 13 日
'updateTimestamp' is not triggered in Linux which is why isNumFramesAvailable is 0. And that is the reason why NumFrames is always showing 'calculating'
On Linux, computation of timestamps results in frame decoding which might lead to performance regression in few cases. Computation is deferred until timestamps are needed. On Windows and Mac, timestamp generation does not affect performance as no frame decoding is done. Based on platform, appropriate value is passed to VideoReader.
  1 件のコメント
Siwoo Lee
Siwoo Lee 2020 年 7 月 13 日
thanks for replying. I solved this problem using python :D thank you

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!