Page 1 of 1

bare minimum installation mp3/ogg

Posted: Wed Sep 30, 2015 12:33 am
by chris_blues
Hi there!

First thanks a lot for your outstanding work! I just made a few tests and I am very impressed!

So, now I'd like to strip getID3 down to the bare minimum. Here are my thoughts:
  • delete all files from /getid3 except getid3.php getid3.lib.php and
    => mp3 and ogg reading is all I need.
Anything else I should keep? Or throw out?

I'm hoping to bring down processing times, so I wonder, are there any settings I should be aware of? Actually getID3 gives me much more information, than I need. Only the $getID3["tags"] section would be quite enough. You propably reckon, that I haven't sifted through the code yet, just looked into getid3.php and some demos, and couldn't get much out of it at a first glance. It takes a lot of time to understand it, looking at your modular approach... :)
So any hints are very appreciated!

And on a side-note, I plan to put this into my shop-system I wrote some time ago. Actually I came up with some ideas how to improve this system.
Do you have any objections, if I integrate this into a download/release of this shop software? It's all GPL and non-profit. I haven't begun work on the integration yet, I'm just planning to and thought it would be the polite thing to do - to ask you creator(s) if it's ok.

You can find my site in my profile. --------->

Thanks again!

Re: bare minimum installation mp3/ogg

Posted: Thu Oct 01, 2015 1:53 pm
by James Heinrich
You can delete any unused modules to save space, but they won't affect processing time either way. Modules are not loaded unless they're needed.
If you delete the module.tag.*.php files you will end up with no tag data at all, which is not what you're looking for I think.

getID3 provides for some speed improvement by not processing the tags (see public settings in getID3 object), but that sounds like the inverse of what you want to do.

You could potentially instantiate your own getid3_id3v2 object (and/or getid3_id3v1 and/or getid3_lyrics3) after analyzing the file to see what tags are in the file... but then you'd be more or less at what getID3 is doing. You could potentially save the analysis time of the audio portion of the file at the expense of writing a bunch of your own code.

getID3 does return a lot of information, but in many cases the information you don't want is a byproduct of the same work that would be required to find the information you do want. In MP3 files the tags are completely separate from the audio data, in Ogg files they're an integral part of the file.

getID3 is GPL so should be compatible with whatever GPL project you want to put it in.

Re: bare minimum installation mp3/ogg

Posted: Sat Oct 03, 2015 12:44 pm
by chris_blues
Thanks James!

I should have known, that if there is a modular system at work, then it might be modular! (In the sense, that the modules get loaded only when needed.) Sorry.

So, I'll go ahead and include this awesome piece of code into my application.

Thanks for your explanations!

Best regards!

Re: bare minimum installation mp3/ogg

Posted: Mon Oct 05, 2015 2:56 pm
by chris_blues
One more thing:

Is reading an mp3 faster than reading an ogg? Or the other way around?

Re: bare minimum installation mp3/ogg

Posted: Mon Oct 05, 2015 3:03 pm
by James Heinrich
That probably depends on the file.
A "clean" MP3 with no tags and a header frame (added by some encoders showing average bitrate and similar data) would probably parse faster than most Ogg files.
On the other hand, it's entirely possible to have large amounts of metadata in an ID3v2 tag, and an ID3v1 tag, and an APE tag, and a Lyrics3 tag, and have some corruption in the audio portion that getID3 has to work around, and parsing that would take longer than your average Ogg file.
Of course, in either case we're talking differences in the order 0.1s or so, but if you're scanning thousands of file I suppose it could make a difference.

Best answer: experiment and see using your hardware and selection of files.

Re: bare minimum installation mp3/ogg

Posted: Mon Oct 05, 2015 3:12 pm
by chris_blues
Ok, thanks, I'll do that! :)

Re: bare minimum installation mp3/ogg

Posted: Sun Oct 11, 2015 11:55 pm
by chris_blues
For your information:

I released a first alpha of my web-player, which includes getID3(). Take look at the player in action here:

The download is here:

...turns out, getID3() is the fastest component. (I left it as is.) The slowest is, of course is the net. Takes forever to load large amounts of data.
Just to let you know, where else your baby gets to work... :o)


Re: bare minimum installation mp3/ogg

Posted: Mon Oct 12, 2015 1:09 am
by James Heinrich
You can cross-post that in this forum if you like: