Click here to Skip to main content
15,888,816 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I really don't know who to read the header of .mov video file .
So,can anybody can help regarding this

What I have tried:

I just know the research of the .MOV video file but don't know the Backend coding
Posted
Updated 11-Apr-17 21:27pm

1 solution

At first you need the file format specification. See QuickTime File Format - Wikipedia[^] for an overview and history and the QuickTime File Format Specification[^] for the reference.

According to the reference, QuickTime files use "atoms" to specify data blocks. Each atom begins with a 4 byte size field followed by a type field. So you can step through the file reading the size and type, optionally process the following data and resume at the next atom by adding the size to the file position.

To read the file use any C/C++ file library functions that support seeking (e.g. fopen(), fread(), fseek(), fclose()).

If you need further processing of QuickTime files I suggest to use a library rather than doing it yourself. Examples may be GStreamer[^] and FFmpeg[^].
 
Share this answer
 
Comments
CPallini 12-Apr-17 3:32am    
5.
Member 13119910 12-Apr-17 23:02pm    
I already read this but i don't know how to code i this format and how to read the bytes in the video file header.
So,help me with this
Jochen Arndt 13-Apr-17 2:52am    
You don't know how to read binary data from a file?
uint32_t atom_size;
// Field has 4 characters. Use 5 byte NULL terminated buffer here
//  to allow using strcmp().
char atom_type[5] = "xxxx";
FILE *f = fopen(fileName, "rb");
fread(&atom_size, sizeof(atom_size), 1, f);
fread(atom_type, 4, 1, f);
// Seek to next atom or read atom into allocated buffer
fseek(f, atom_size, SEEK_CUR);

I'm actually not sure if the size field includes the size and type fields. If so, subtract those sizes (8 bytes) from atom_size when seeking or reading.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900