how to read compressed avi
이전 댓글 표시
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
2016년 12월 3일
what is the error that matlab throwing when it cant read the file ?
JL peng
2016년 12월 4일
Tamir Suliman
2016년 12월 4일
can you pelase post the code and share the video to test ?
JL peng
2016년 12월 5일
Mat Lab
2016년 12월 6일
forgot to mention, the codec for my avi is huffyuv
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
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
카테고리
도움말 센터 및 File Exchange에서 Audio and Video Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!