I am working on some video gamma correction. And I used some sample avi uncompressed clips from online, everything works just fine. But once I try to use our own .avi video 1280x800 20 second about 400mb, Matlab can not read file through 'VideoReader'.
I'm really sure the problem is that my video is compressed avi. And I have tried the following to solve it:
1. some say in mac os, download gstreamer 0.10 may help. I did, but problem remained.
2. i tried to use ffmpeg to convert the compressed avi to uncompressed avi (i dont think i am supposed to do this tho). but the new uncompressed video became a mess.
So, I was thinking, when working on compressed avi file in MATLAB on mac, is there a good routine that people follow?
Thanks a lot.

댓글 수: 6

Tamir Suliman
Tamir Suliman 2016년 12월 3일
what is the error that matlab throwing when it cant read the file ?
JL peng
JL peng 2016년 12월 4일
Error using VideoReader/init (line 619) Failed to initialize internal resources.
Error in VideoReader (line 172) obj.init(fileName);
Thanks for replying. The uncompressed video is a 5.8mb file called 'suzie.avi' from online. Actually I also tried to cut my own video into smaller piece (~60mb) in case the workload is too large for my RAM(8GB), but it didn't work.
Tamir Suliman
Tamir Suliman 2016년 12월 4일
can you pelase post the code and share the video to test ?
JL peng
JL peng 2016년 12월 5일
Hi, I just simply used:
v = VideoReader('test.avi');
the uncompressed avi which works is from:
and the compressed avi which can not be processed is large, i found someplace with sample compressed avi as followed(I tried 'bird.avi' from this website to confirm it doesn't work):
thanks again.
Mat Lab
Mat Lab 2016년 12월 6일
forgot to mention, the codec for my avi is huffyuv
Mat Lab
Mat Lab 2016년 12월 6일
Solution found:
used :
ffmpeg -i test.avi -f image2 %04d.bmp
to extract all frame in bmp
then used:
ffmpeg -framerate 30 -pattern_type glob -i '*.bmp' -c:v rawvideo test_raw.avi
to generate the raw avi file. then video is nice and smooth, and can be read by Matlab's 'VideoReader' command.

댓글을 달려면 로그인하십시오.

답변 (1개)

AILEEN SENGUPTA
AILEEN SENGUPTA 2019년 4월 18일

0 개 추천

Hi,
I had two basic queries:
1. You have converted the compressed AVI into raw avi file to be read into matlab, so tis is not the same as uncompressed avi? why a raw format?
2. If we take a raw YUV video and convert it into a raw avi, does the video incur a loss? of course when we are reading the video sequence into matlab we will use the Y componen only: Strip to channel Y: frame1 = frame1(:,:,1); and then repeat it for all frames
Thanks,
Aileen

카테고리

질문:

2016년 12월 3일

답변:

2019년 4월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by