Difference of frame size and cv::Mat size [closed]

asked 2014-05-23 11:20:05 -0500

Tariq gravatar image

updated 2014-05-24 01:25:33 -0500

berak gravatar image

Dear all,

I am extracting frames from a video stream of approximately 2 minutes at 25fps. Total size of the video is 4.4MB. I calculate size of individual frame as follows:

I convert the file size into KBytes(4.41024) and calculate size of individual frame in KBytes. (4.41024) / (120*25) = 1.5 KBytes (size of one frame)

In OpenCV, I get the following frame data: Rows: 288 Cols: 352 Channels: 3 Size: [352 x 288] step: 1056 (# of bytes occupied by each row)

If I calculate size of one frame in Bytes: 1056*288 =304128 Bytes = 297KB

Could you please comments on this size calculation and explain the difference of size?


edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-10-06 07:56:45.101764



Maybe the video is compressed?

isarandi gravatar imageisarandi ( 2014-05-23 11:51:00 -0500 )edit

you can't guess anything about the frame-size from the on-disk size of a video.

apart from the ompression, there might be additional audio tracks or subtitles in japanese.

berak gravatar imageberak ( 2014-05-24 01:24:21 -0500 )edit

@isarandi, Video is recorded as MP4.

@berak, Video is recorded as MP4 and there are no audio/subtitles in the video.

Tariq gravatar imageTariq ( 2014-05-31 07:40:55 -0500 )edit