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일

0 개 추천

'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개)

질문:

2020년 7월 6일

댓글:

2020년 7월 13일

Community Treasure Hunt

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

Start Hunting!