Reading info from MPG (xxxxx.mpg) video files

Started by Archive, May 12, 2010, 08:53:54 AM

Previous topic - Next topic

Archive

[Originally posted by motley on 2006-05-10 14:30:35-07]

Hi there! ExifTool is MIGHTY impressive, so super thank you for that.
I'm just wondering, how come reading info from mpg files doesn't seem to be supported?

At the moment it's the only thing I'm lacking of. I'm bulding a little media databsae for myself that reads info of every uploaded file and mpg is such a semi-famous format, so support for it would be really nice to get.

Any chances for that in near future?
Thanx again for the program!

/Tony

Archive

[Originally posted by exiftool on 2006-05-10 17:30:08-07]

Hi Tony, thanks for the compliment.

MPG is at the top of the list of file formats that I would like to add to the ExifTool arsenal.  I have done a LOT of surfing for a free MPG specification, but unfortunately haven't found one yet.  The official MPG specification is controlled by the ISO, and as such costs money (I estimate of the order $100US).  If anyone knows where I can get a free MPG file format specification, let me know.  If I could get this it should only take me a few days to add MPG support.  (Note that ExifTool does support MP3 and MP4 though, since these specifications were obtainable.)

It is for reasons like this that the ISO takes a lot of criticism (and rightly so).

- Phil

Archive

[Originally posted by motley on 2006-05-10 21:15:53-07]

Hi Phil.

I found a ID tag reader made for PHP4 with support for MPEG-1 MPEG-2 and many other formats.

It has full source code for each media type written in PHP with comments.

http://getid3.sourceforge.net/

I would love it if you could add support for:

- MPEG-1 / MPEG-2

- APE (Monkeys Audio)

- FLAC

- Ogg Vorbis

- RealAudio/Real video

- SWF (flash)

My Media Database project is coded in Adobe's ColdFusion, so I'm gonna use your EXIF reader through Perl and another audio info reader through Java to work with it Smiley

Archive

[Originally posted by motley on 2006-05-10 21:21:11-07]

Comment about the GetID() php scripts.

I found on their forum page that there are certain issues with some of the formats

in his script.

http://www.getid3.org/phpBB2/viewtopic.php?t=25

One of the issues seems to be that he is unable to read playtime duration of a MPG file.

At least it's a good start.

Archive

[Originally posted by exiftool on 2006-05-11 11:44:49-07]

Very interesting that the person who posted that list of getID3() issues is from Kingston Ontario Canada (that's where I am!).  What are the odds?

Thanks for the information.  I'll look into it.  They provide a link to the MPEG-1/2 header structure which is useful.  Other than that, extracting format information from source code is a pain, but  I'll see what I can do.

-Phil

Archive

[Originally posted by exiftool on 2006-05-15 14:22:13-07]

I have just released version 6.18 from the ExifTool home page.

This version adds read support for MPEG audio/video files.  I decode most of the tags of the getID3() code, but the one thing I don't do is calculate a play duration like they do.  (ThE calculation isn't exact and seems a bit fiddly to me with a number of a empirical constants used in the approximation.)

Thanks for pointing out this source of information.  It is good to finally add MPEG suppport.  Let me know if you have any problems.  Next on the list is SWF...

- Phil

Archive

[Originally posted by motley on 2006-05-15 16:31:42-07]

Yippieee!! =)

I'm going to download it now and test it, I'm still labbing with the previous version.

I just did a test with a Quicktime movie (.mov) and I wasn't able to extract Duration out of it.
(version 6.17)

Is this something you forgot to add in or lack of information from Apple?

I'm trying to find more info about mpg duration things for you if possible.

Anyways, Thanks for the great work!

I'm off to test the new version now!

Archive

[Originally posted by motley on 2006-05-15 16:41:38-07]

I did some typo's in my last message.

What I meant to say was that I couldn't read the Frame Rate of a Quicktime file.

And that is from the version 6.16 also same with 6.18 (just tried it).

/Tony

Archive

[Originally posted by exiftool on 2006-05-15 16:50:51-07]

All of my QuickTime sample movies contain duration information.  However, some streaming audio/video formats don't include this information (like MPEG I believe), and in this case the duration must be determined by scanning the whole stream, and this is something I don't want to do because it is complicated and slow.

Archive

[Originally posted by exiftool on 2006-05-15 17:12:13-07]

A bit of a cross post there.

You're right.  FrameRate is not reported for QT movies.  I quickly scanned the QT docs again, but didn't find a simple way to determine the frame rate.

- Phil

Archive

[Originally posted by motley on 2006-05-15 17:28:18-07]

I think I might have found the ISO MPEG documents that they charge for.

http://neuron2.net/library/library.html

Scroll down to Encoding/Decoding MPEG2, all the filenames that start with ISO(if you look the link).

Some reason he only seems to have 4 of the 5 files (if I understood it correctly) and 3 of them are in some old WORD doc format and one in PDF.

There seems to be plenty of other info docs as well (MPEG-1) there as well.

If that will help you to squeeze out the duration time of mpg files Smiley

A good tip, if you sometimes try to get to a webpage that has been removed for various reasons, then a good tip is to go to http://www.archive.org and paste your desired url(even with with .html in the path) to the WAYBACKMACHINE field.

It's awesome!!

/Tony

Archive

[Originally posted by exiftool on 2006-05-15 18:02:04-07]

Hi Tony,

Thanks for the links to these ISO drafts.  In the past I have sometimes been able to use old ISO drafts to get useful information, but one should be aware that these drafts may be different than the final specification.  However, many applications have been developed using old drafts like this as references.

I just found the wayback machine myself about a month ago.  Very cool...  Spent an afternoon surfing web sites that I maintained back in the mid 90's.  I haven't used it to look up any old documentation from dead links yet though, but that is a good idea.

Archive

[Originally posted by exiftool on 2006-05-16 18:39:40-07]

ExifTool 6.19 (just released) reads information from SWF files.

- Phil

Archive

[Originally posted by exiftool on 2006-11-15 18:34:53-08]

There you go.  I have just released ExifTool 6.56 which adds support
for a number of new audio formats.  ExifTool now supports all
of the file formats you requested:

- MPEG-1 / MPEG-2

- APE (Monkeys Audio) [new]

- FLAC [new]

- Ogg Vorbis [new]

- RealAudio/Real video

- SWF (flash)