Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th September 2013, 08:25   #1  |  Link
karasu
Registered User
 
karasu's Avatar
 
Join Date: Jun 2006
Posts: 111
How to tell if a mp4 file has metadata at the begining or not?

As I'm working with files for the web, I sometimes need to know if the mp4 files I recieve have their metadata at the begining. Mediainfo does not seems to provide such informations.
What tool can I use to check that? (Linux or OSX)

Thank you.
karasu is offline   Reply With Quote
Old 5th September 2013, 08:50   #2  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
With the l-smash boxdumper you could look whether the Media Data Box is at the end or not.
sneaker_ger is offline   Reply With Quote
Old 5th September 2013, 18:08   #3  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Parsing MP4 files is not that complicated. You always have "boxes" (aka "atoms"), each of which starts with an 8 Byte header (4 Byte size field + 4 Byte name in ASCII).

Boxes may also contain other boxes, but you don't need to care here. Just do the following in a loop: Read the 8 Byte header, then check the name and finally skip over exactly size-8 Bytes to the next box.

Either you will encounter the "moov" box before the "mdat" box - or the other way around. All the meta-data and all the fancy tables are stored within the "moov" box.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 5th September 2013 at 18:45.
LoRd_MuldeR is offline   Reply With Quote
Old 5th September 2013, 19:02   #4  |  Link
ganymede
Registered User
 
Join Date: Aug 2010
Location: Paris
Posts: 52
Quote:
Originally Posted by karasu View Post
What tool can I use to check that? (Linux or OSX)
MP4Box from the gpac package can do that.
Code:
MP4Box -info -v file.mp4
If you only need to check that moov is before mdat, -v (verbose) is not even necessary : MP4Box -info will display "File suitable for progressive download (moov before mdat)".
ganymede is offline   Reply With Quote
Old 7th September 2013, 15:46   #5  |  Link
karasu
Registered User
 
karasu's Avatar
 
Join Date: Jun 2006
Posts: 111
Thank you, MP4Box is exactly the tool I need.
karasu is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:00.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.