How to visualize or process video data with .raw extension in matlab ?

17 views (last 30 days)
I have downloaded video file from PREVENTION DATASET, which was captured by Grasshopper3 camera. It has .raw as extnestion, kindly help me in visualizing or processing the video data that has .raw extension using MATLAB or Python

Answers (1)

Monisha Nalluru
Monisha Nalluru on 29 Oct 2020
The video with .raw format is not supported by MATLAB
Refer the documentation link below to understand the Supported Video Formats:
But, there are File Exchanges while helps in converting the other formats to .mp4 format:
After converting the video into supported format, Use VideoReader to point object to video file and perform required process
  1 Comment
Sudheer Dunna
Sudheer Dunna on 30 Oct 2020
Hello Monisha,
Thankyou for your responce. I tried using above mentioned file exchanges but was not able to convert the (.raw) to any regualr video mormat(.mp4).
Actually using VideoReader() or imread() for file with (.raw) extension matlab is throwing an error. Above mentioned links using videoReader() and imread() only.
I have a video ('videoCamera1.raw'), author has mentioned that it was captured using grasshopper3 camera, each frame resolution is 1920*600. Using fread() and the reshaping the read data with provided resolution information [1920*600], i was able to see the first frame (imshow()).
My concern is to get the information of total number of frames and to access the data frame by frame. Kindly help me in this regard.
Using below mentioned code i was able to visualize the first frame.
fop=fopen('video_camera1.raw','r');
row=1920;
col=1200;
fr=fread(fop,row*col,"uint8=>uint8")
z=reshape(fr,row,col)
z=z'
imshow(z)

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!