Menu

#18 QTVR detection expects moov top-level atom

open
nobody
None
5
2008-04-09
2008-04-09
No

[Transferring this from bug #1935911]

The QTVR problem was that a QuickTime file can start with various atoms other than 'moov':

http://wiki.multimedia.cx/index.php?title=QuickTime_container#Known_Top-Level_Atoms

In particular, pano2qtvr creates QTVRs that start with an 'ftyp' atom. I'm sure there is a better solution, but this works for me with these particular files:

Index: src/libfreepv/Utils/signatures.cpp

--- src/libfreepv/Utils/signatures.cpp (revision 142)
+++ src/libfreepv/Utils/signatures.cpp (working copy)
@@ -43,11 +43,14 @@
//DCR Signature
char dcr_size=2;
short dcr_sig[]={0x4658, 0x5249};
+ //ftyp (not moov) Signature
+ char ftyp_size=4;
+ short ftyp_sig[]={0x0000, 0x0000, 0x7466, 0x7079};

//Signatures to check
- char sig_types_num=5;
- short* signature[]={jpg_sig,png_sig,mov_sig,xml_sig,dcr_sig};
- char sig_sizes[]={jpg_size,png_size,mov_size,xml_size,dcr_size};
+ char sig_types_num=6;
+ short* signature[]={jpg_sig,png_sig,mov_sig,xml_sig,dcr_sig,ftyp_sig};
+ char
sig_sizes[]={jpg_size,png_size,mov_size,xml_size,dcr_size,ftyp_size};

const char* CheckMagicBytes(const char* filename)
{
@@ -72,6 +75,7 @@
//by asigning the first 4 read bytes
//to the MOV signature
if(type==2&&i<2) mov_sig[i]=number;
+ if(type==5&&i<2) ftyp_sig[i]=number;

//The comparation is made by using a bit XOR operator
//we look for the double implication <->, so the result
@@ -106,6 +110,8 @@
return("XML");
if(type==4)
return("DCR");
+ if(type==5)
+ return("QTVR");

//In other case return Unknown
return("Unknown");

Discussion

MongoDB Logo MongoDB