How can I get the information from a .dat file in order to create a new video file in .avi file format
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I've actually tried to read my .dat file which is a binary file of a video, and after that tried to write as a .avi video file. The code that I wrote here is at the below of the post. Yet, when I was trying to play as a video by using vision.VideoFileReader method, I see a black screen and actually the video window itself is a black line vertically aligned in the screen.
v = VideoWriter('newfile.avi','Grayscale AVI');
open(v);
ffid=fopen('depth.dat');
A = fread(ffid);
writeVideo(v,A/255);
fclose(ffid);
close(v);
0 comentarios
Respuestas (1)
Walter Roberson
el 22 de Feb. de 2016
fread() by default returns a column vector of uint8 values. You would need to reshape() that to a 2 dimensional or possibly 3 dimensional array. Depending on the order the values were written, you might also need to exchange rows and columns with transpose() or permute()
0 comentarios
Ver también
Categorías
Más información sobre Audio and Video Data en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!