mimetype
mimetype copied to clipboard
File type is mismatched from audio/mp4 to video/mp4.
Expected mime type audio/mp4
Returned mime type video/mp4
Version of the library you are using 1.1
Output of go version
go version go1.14 darwin/amd64
Additional context The code assumes that the header is at a fixed byte. That doesn't seem to be the case. The file above contains some header info that Android wrote into the file thus the ftyp=m4a is offset from where you expect it.
func (fSig ftypSig) detect(in []byte) bool {
return len(in) > 12 &&
bytes.Equal(in[4:8], []byte("ftyp")) &&
bytes.Equal(in[8:12], fSig)
}
Sorry for the late response. I will have a look at this, but can you please upload the sample file again. If you want, you can also describe how you generated the troublesome file so I can do it myself.
The file was generated on Android. I can't easily get you the code... but apparently there can be meta information in the file and thus shifting the position of the ftyp header.
Alright, then just reupload it. I won't miss it this time.