Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We're using the file utility on linux to determine the file MIME type (and this information we subsequently use), which seems to be failing on some m4v files, but not on others.

Running                                     Shows
/usr/bin/file sample_iPod.m4v               sample_iPod.m4v: ISO Media
/usr/bin/file -i -b sample_iPod.m4v         (NOTHING)

This particular file was from Apple's site: http://support.apple.com/kb/HT1425

The ones for which it does work shows:

/usr/bin/file agsample.m4v                  agsample.m4v: ISO Media, MPEG v4 system, version 2
/usr/bin/file -i -b agsample.m4v            video/mp4

It appears that the ones where it works are actually MPEG 4 encoded files renamed as m4v, but how can I determine file type otherwise if not through /usr/bin/file?

share|improve this question
add comment

1 Answer

Look at apple`s donwload page closely: H.264 is the file-type for sample_iPod.

The file command propably does not know about that file-type, but you can add that type to the file command if you can describe the format with a proper regex. Read The Fine Manual: man magic.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.