how to read compressed avi

3 ビュー (過去 30 日間)
JL peng
JL peng 2016 年 12 月 3 日
回答済み: AILEEN SENGUPTA 2019 年 4 月 18 日
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 件のコメント
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 日
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

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by