How can I read a video with frame width and height as 6*8? Cannot read a single frame by using read() function

I am reading the attached video with Matlab R2021a, but I get an empty matrix result. However, this video can be played with PotPlayer or read by python code.
Matlab code:
file = VideoReader('tmpGetStiTimeFromFrametest.mov');
frm = read(file);

Answers (1)

Hi,
I tried to read the frames from the provided video but it seems there is some issue with the videofile itself. I also tried to open that in my Desktop but the video was not playing. You can try checking the videofile again and use the read().
At my end I used an example ".mov" videofile and it was working fine, attaching that here for your reference.
v = VideoReader("example.mov");
frm = read(v);

4 Comments

Hello, great thanks for your answer. I wonder how my attached video perform in your desktop. I find that it is working fine in my desktop with Potplayer or some other video players except windows media player. I think it is windows media player that matters. Maybe because that the video frame is so small (6*8)?
By the way, my attached video is generated with ffmpeg cut from the one captured with a usb camera by
system(strcat('ffmpeg -i',32,myfile_name,32,'-vf crop=','8:6:1077:273',32,'-threads 5 -preset ultrafast -strict -2 ',32,output_file))
, but I don't think this can be the issue. If the result video frame size is set a bit larger(about 42*32), matlab can read it successfully.
On Mac, QuickTime Player does not complain about the file, but it only shows blanks.
VLC shows some actual content. It looks to me as if it is interpolating a lot on the display though.
@Walter Roberson The video is just a fre pixels cropped from a 720p, 120 frameRate video by ffmpeg. There is no interpolation.
VLC is displaying at a lot larger than 6 x 8, and VLC is interpolating somehow.
That is, VLC knows the proper size of the video, but when it displays it in a larger window, it is not just replicating pixels; it is interpolating to a larger size when it displays. This is an issue with VLC.

Sign in to comment.

Asked:

on 18 Sep 2021

Commented:

on 22 Sep 2021

Community Treasure Hunt

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

Start Hunting!