// show QuickTime .mov file structure (C) 2001. by A'rpi/ESP-team #include #include unsigned int read_dword(FILE *f){ unsigned char atom_size_b[4]; if(fread(&atom_size_b,4,1,f)<=0) return -1; return (atom_size_b[0]<<24)|(atom_size_b[1]<<16)|(atom_size_b[2]<<8)|atom_size_b[3]; } void lschunks(FILE *f,int level,unsigned int endpos){ unsigned int atom_size; unsigned int atom_type; int pos; while(endpos==0 || ftell(f)S table size :%d\n",len); for(i=0;iC table size :%d\n",len); for(i=0;iChunk mapping table case 0x7A737473: // stsz Sample size table break; default: lschunks(f,level+1,pos+atom_size); } #else switch(atom_type){ case 0x766F6F6D: // moov case 0x61726D72: // rmra case 0x61646D72: // rmda lschunks(f,level+1,pos+atom_size); } #endif fseek(f,pos+atom_size,SEEK_SET); } } int main(int argc,char* argv[]){ int pos; FILE *f=fopen(argc>1?argv[1]:"Akira.mov","rb"); if(!f) return 1; lschunks(f,0,0); }