filename = 'YourFile.avi';
[fid, msg] = fopen(filename, 'r');
if fid < 0
error('Failed to open file "%s" because "%s"', filename, msg);
end
bytes = fread(fid, [1 inf], '*uint8');
fclose(fid);
bitstream = reshape(logical(dec2bin(bytes, 8) - '0').', 1, []);
bytes is now a vector of uint8 containing the file -- the entire file, including all audio and video and EXIF and so on.
bitstream is now a vector of false (0) and true (1) values, giving the bytes in MSB-first order.
0 Comments
Sign in to comment.